Cluster discovery API (certificate-based) (deprecated)
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
This feature was deprecated in GitLab 14.5.
Retrieve certificate-based clusters
Retrieve certificate-based clusters that are registered to a group, subgroup, or project. Disabled and enabled clusters are also returned.
GET /discover-cert-based-clustersParameters:
| Attribute | Type | Required | Description |
|---|---|---|---|
group_id | integer or string | yes | The ID of the group |
Example request:
curl --request GET \
--header "PRIVATE-TOKEN: <your_access_token>" \
--url "https://gitlab.example.com/api/v4/discover-cert-based-clusters?group_id=1"Example response:
{
"groups": {
"my-clusters-group": [
{
"id": 2,
"name": "group-cluster-1"
}
],
"my-clusters-group/subgroup1/subsubgroup1": [
{
"id": 4,
"name": "subsubgroup-cluster"
}
]
},
"projects": {
"my-clusters-group/subgroup1/subsubgroup1/subsubgroup-project-with-cluster": [
{
"id": 3,
"name": "subsubgroup-project-cluster"
}
],
"my-clusters-group/project1-with-cluster": [
{
"id": 1,
"name": "test"
}
]
}
}Delete certificate-based clusters
You can delete a certificate-based cluster you found with the discovery API by using the group or project clusters API.
Prerequisites:
- Maintainer or Owner role for the group or project.
To delete a cluster:
- From the discovery API response, get the cluster
idand the group or project path. The path is the key the cluster is listed under, for example,my-clusters-group/project1-with-cluster. - Call the API for your cluster type, using the cluster
idas thecluster_idattribute and the URL-encoded path as theidattribute:- For clusters in groups, use the group clusters API.
- For clusters in projects, use the project clusters API.
To remove a cluster in the UI, or to remove an instance cluster, see remove a cluster.
Was this page helpful?