The Cluster API provides information about managed clusters (node clusters), their resource composition (cluster resources), and alarm definitions. Cluster data is collected by watching ACM ManagedCluster resources and assisted-service Agent resources on the hub cluster.
For authentication and common query parameters (filtering, field selection), see API Overview.
All cluster API endpoints use the base path
/o2ims-infrastructureCluster/v1.
- Node Clusters
- Node Cluster Types
- Cluster Resources
- Cluster Resource Types
- Subscriptions
- Alarm Dictionaries
A node cluster represents a managed OpenShift cluster registered with ACM. Each ManagedCluster on the hub corresponds to a node cluster in the API.
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/nodeClusters" | jqExample response:
[
{
"nodeClusterId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"nodeClusterTypeId": "d1eabf91-f0e6-5170-97dc-797d35146dad",
"name": "my-sno-cluster",
"description": "SNO RAN DU cluster",
"extensions": {
"clusterID": "c5e3f8a2-1b4d-4e6f-8a9b-0c1d2e3f4a5b",
"platform": "BareMetal",
"openshiftVersion": "4.20.4"
},
"clusterResourceIds": []
}
]curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/nodeClusters/{nodeClusterId}" | jq# Find clusters by name
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/nodeClusters?filter=(eq,name,my-sno-cluster)" | jq
# Exclude the local hub cluster
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/nodeClusters?filter=(neq,name,local-cluster)" | jqNode cluster types categorize managed clusters. Each unique cluster configuration (platform, version) corresponds to a node cluster type.
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/nodeClusterTypes" | jqcurl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/nodeClusterTypes/{nodeClusterTypeId}" | jqEach node cluster type has an associated alarm dictionary that defines the alerts that can be raised for clusters of that type:
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/nodeClusterTypes/{nodeClusterTypeId}/alarmDictionary" | jqCluster resources represent individual nodes within a managed cluster. The data is collected from assisted-service Agent CRs on the hub.
Note
Cluster resources are only populated for clusters provisioned via the assisted-installer flow. IBI-provisioned clusters do not create Agent CRs, so their cluster resources will be empty. See OCPBUGS-83739.
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/clusterResources" | jqcurl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/clusterResources/{clusterResourceId}" | jqCluster resource types categorize the nodes within managed clusters.
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/clusterResourceTypes" | jqcurl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/clusterResourceTypes/{clusterResourceTypeId}" | jqSubscriptions allow an SMO to receive notifications when cluster resources change. When a subscription is created, the O-Cloud Manager sends HTTP callbacks to the specified URL whenever matching resources are created, modified, or deleted.
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/subscriptions" | jqcurl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/subscriptions/{subscriptionId}" | jqcurl -ks -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${MY_TOKEN}" \
-d '{
"consumerSubscriptionId": "69253c4b-8398-4602-855d-783865f5f25c",
"filter": "",
"callback": "https://smo.example.com/v1/o2ims_cluster_observer"
}' \
"https://${API_URI}/o2ims-infrastructureCluster/v1/subscriptions" | jqcurl -ks -X DELETE \
-H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/subscriptions/{subscriptionId}" | jqAlarm dictionaries define the set of alarms that can be raised for managed clusters. They are derived from Prometheus alerting rules on the spoke clusters.
curl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/alarmDictionaries" | jqcurl -ks -H "Authorization: Bearer ${MY_TOKEN}" \
"https://${API_URI}/o2ims-infrastructureCluster/v1/alarmDictionaries/{alarmDictionaryId}" | jq