*View the list of namespaces under the specified cluster
Requests
HTTP request
GET /auth/v1/projects/{name}/clusters/{cluster-name}/namespaces
List namespaces in specified project within specified cluster
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | True | Name of project to query |
| cluster-name | string | True | Name of the cluster to query |
Responses
Content-Type
application/json
Status code: 200
OK
Sample response
NamespaceList is a list of Namespaces.
{
"apiVersion": "v1",
"items": [
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"annotations": {
"cpaas.io/creator": "admin@cpaas.io",
"cpaas.io/display-name": "",
"cpaas.io/updated-at": "2021-06-17T10:13:47Z"
},
"creationTimestamp": "2021-06-17T10:13:47Z",
"labels": {
"cpaas.io/cluster": "devops",
"cpaas.io/project": "demo",
"olm.operatorgroup.uid/32915967-ae16-4fdc-9a4f-6dd92e32a688": "",
"openshift.io/cluster-monitoring": "true"
},
"name": "demo-devops",
"resourceVersion": "16935795",
"selfLink": "/api/v1/namespaces/demo-devops",
"uid": "262e1ea1-7dd0-46c5-befd-c7dfd63404e9"
},
"spec": {
"finalizers": [
"kubernetes"
]
},
"status": {
"phase": "Active"
}
}
],
"kind": "NamespaceList",
"metadata": {
"resourceVersion": "23878595",
"selfLink": "/api/v1/namespaces"
}
}Parameters
| Name | Type | Description |
|---|---|---|
| apiVersion | string | See common parameters |
| items | array |
Items is the list of Namespace objects in the list. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Path: items |
| items[] | object |
Namespace provides a scope for Names. Use of multiple namespaces is optional.
Path: items[] |
| items[].apiVersion | string | See common parameters |
| items[].kind | string | See common parameters |
| items[].metadata | object | See common parameters |
| items[].spec | object |
NamespaceSpec describes the attributes on a Namespace.
Path: items[].spec |
| spec.finalizers | array |
Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
Path: items[].spec.finalizers |
| items[].status | object |
NamespaceStatus is information about the current status of a Namespace.
Path: items[].status |
| status.phase | string |
Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
Path: items[].status.phase |
| kind | string | See common parameters |
| metadata | object | See common parameters |