View DependentAPIs¶
Table of Contents¶
What is a DependentAPI?¶
A DependentAPI is a child Custom Resource created by the Component Operator when it decomposes a Component. For every entry in spec.coreFunction.dependentAPIs[], spec.managementFunction.dependentAPIs[], or spec.securityFunction.dependentAPIs[], the Component Operator creates a DependentAPI resource.
The Dependency Operator watches these DependentAPI resources and:
Searches the cluster for ExposedAPIs that match the dependency (by API name, type, and optional selector filters)
When a match is found, writes the resolved URL into
.status.depapiStatus.urlSets
.status.implementation.readytotrue
This is how the ODA Canvas enables automatic cross-component API wiring — a component declares what APIs it needs, and the Dependency Operator discovers them at runtime.
To explore the DependentAPI CRD schema:
kubectl explain dependentapi.spec
kubectl explain dependentapi.spec.selector
The CRD definition is in charts/oda-crds/templates/oda-dependentapi-crd.yaml (v1 schema starts around line 176).
An example of a component declaring dependent APIs is in:
feature-definition-and-test-kit/testData/productordercaptureandvalidation-v1/templates/component-productordercaptureandvalidation.yaml
Focus¶
DependentAPIs represent API dependencies that a component needs from other components. The key concern is whether dependencies are resolved.
Important: DependentAPIs only exist when a component declares them. For example, the productcatalog chart requires --set component.dependentAPIs.enabled=true at install time. If no DependentAPIs are found, inform the user that either no component has declared dependencies, or the feature was not enabled during deployment.
Handling Empty Results¶
If kubectl get dependentapis -n components returns “No resources found”, check whether any components are deployed:
kubectl get components -n components
No components deployed¶
Report: “No DependentAPIs found — no components are deployed yet.” Suggest deploying a component first (action 5).
One or more components deployed, but no DependentAPIs¶
Report: “No DependentAPIs are currently declared in the components namespace.”
Then check whether any deployed component is a productcatalog. If so, propose the Federated Catalog scenario:
Try a Federated Catalog: Deploy a second Product Catalog instance with dependent APIs enabled. The second instance declares a dependency on the downstream Product Catalog Management API exposed by the first instance. The Canvas dependency operator will automatically discover and resolve this dependency, demonstrating cross-component API wiring.
Important: Use a short release name (max 5 characters, e.g.,
pc2). Kubernetes port names must be 15 characters or fewer, and ODA component charts derive port names by combining the release name with internal suffixes. Long names likeprodcat2orprodinvcause deployment failures.helm install pc2 oda-components/productcatalog -n components \ --set component.dependentAPIs.enabled=trueOnce deployed, repeat this action to see the DependentAPIs and their resolution status.
If the deployed component is not a productcatalog, suggest the general approach:
Upgrade the existing release with
--set component.dependentAPIs.enabled=trueOr deploy a second component that declares dependencies
Commands¶
# Summary table
kubectl get dependentapis -n components
# Full YAML for detailed inspection
kubectl get dependentapis -n components -o yaml
# Detail for a specific DependentAPI
kubectl describe dependentapi <name> -n components
Key Fields¶
Field |
YAML Path |
Description |
|---|---|---|
Name |
|
DependentAPI resource name |
Namespace |
|
Namespace |
Parent Component |
|
Owning Component |
API Name |
|
Name of the API dependency |
API Type |
|
e.g., |
Version |
|
Required API version |
Ready |
|
Boolean, is the dependency resolved |
Resolved URL |
|
URL of the resolved upstream API |
Presentation¶
Present DependentAPIs grouped by resolution status:
Resolved (ready=true): Show name, resolved URL, parent component
Unresolved (ready=false or no status): Highlight these prominently — they indicate missing upstream components
Offer to show full spec and status for any specific DependentAPI.
After showing results, explain the resolution:
A resolved DependentAPI means the Dependency Operator found an ExposedAPI in the cluster whose name and type match the dependency. The resolved URL is the gateway endpoint of that upstream API.
An unresolved DependentAPI means no matching ExposedAPI was found. This happens when the upstream component hasn’t been deployed, hasn’t reached
Completestatus yet, or theselectorconstraints (zone, releaseName, namespace) filter out all matches.
Understanding the CRD Schema¶
Offer to explore the DependentAPI schema:
Live cluster exploration:
kubectl explain dependentapi.spec
kubectl explain dependentapi.spec.selector
Key v1 schema properties (from charts/oda-crds/templates/oda-dependentapi-crd.yaml):
Field |
Type |
Description |
|---|---|---|
|
string |
Name of the API dependency (required) |
|
enum: openapi |
Type of API expected (required) |
|
array of {url, version} |
Links to the expected API specification |
|
object |
Filters which ExposedAPIs can satisfy this dependency |
|
string |
Cluster/canvas/gateway-id or |
|
string |
Restrict to a specific Helm release |
|
string |
Restrict to a specific namespace |
|
array |
Optional resource descriptors |
|
boolean |
Whether this dependency is mandatory |
|
enum: coreFunction, managementFunction, securityFunction |
Which component section it came from |
Status fields (populated by the Dependency Operator):
.status.implementation.ready— boolean, whether a match was found.status.depapiStatus.url— the resolved API URL.status.depapiStatus.svcInvID— service inventory ID (if registered)
Federated Catalog Example¶
When two productcatalog instances are deployed (e.g., prodcat and pc2) and the second has component.dependentAPIs.enabled=true, the DependentAPI output will show:
productcatalogmanagement dependency (openapi, v4) — resolved against the first instance’s ExposedAPI URL
This demonstrates the Canvas dependency operator automatically discovering and linking a downstream Product Catalog Management API. Highlight the resolved URL and explain that the second catalog can now federate queries to the first.
If the dependency shows as unresolved, suggest:
Check that the first component is fully deployed (
Completestatus)Verify the ExposedAPI exists:
kubectl get exposedapis -n componentsCheck dependency operator logs:
kubectl logs -l app=oda-controller-dependentapi -n canvas --tail=50
Contextual Next Steps¶
Present these options using ask_questions:
# |
Next Step |
|---|---|
1 |
Deploy a component with dependencies — Install a second instance with |
2 |
View ExposedAPIs — See what APIs are available for dependencies to resolve against |
3 |
View deployed components — Check overall component status and readiness |
4 |
Return to main menu |