Reading a Namespace
Function
This API is used to read the details about a specified namespace.
URI
GET /api/v1/namespaces/{name}
|
Parameter |
Description |
|---|---|
|
name |
Name of the Namespace. |
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
pretty |
No |
If 'true', then the output is pretty printed. |
|
exact |
No |
Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. |
|
export |
No |
Should this value be exported. Export strips fields that a user cannot specify. |
Request
N/A
Response
Response parameters
For the description about response parameters, see Table 2. Table 3 provides the description about metadata.annotations.
|
Parameter |
Type |
Description |
|---|---|---|
|
pv.kubernetes.io/enable-dynamic-provisioning |
String |
Indicates whether to support dynamic storage creation. |
|
tenant.kubernetes.io/domain-id |
String |
Account ID. |
|
tenant.kubernetes.io/domain-name |
String |
Account name. |
|
tenant.kubernetes.io/project-id |
String |
Project ID. |
|
tenant.kubernetes.io/project-name |
String |
Project name. |
Example response
{
"metadata": {
"name": "namespace-test",
"selfLink": "/api/v1/namespaces/namespace-test",
"uid": "68a68c5a-af6b-11e8-8f17-c81fbe371a17",
"resourceVersion": "5016746",
"creationTimestamp": "2018-09-03T11:20:48Z",
"annotations": {
"namespace.kubernetes.io/flavor": "gpu-accelerated",
"pv.kubernetes.io/enable-dynamic-provisioning": "true",
"tenant.kubernetes.io/domain-id": "aadb43c0b14c4cafbccfff483d075987",
"tenant.kubernetes.io/domain-name": "cci",
"tenant.kubernetes.io/project-id": "51bf52609f2a49c68bfda3398817b376",
"tenant.kubernetes.io/project-name": "southchina"
},
"enable": true
},
"spec": {
"finalizers": [
"kubernetes"
]
},
"status": {
"phase": "Active"
}
}
Status Code
Table 4 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a Namespace resource object is returned. |
For more status codes, see Status Codes.
Last Article: Creating a Namespace
Next Article: Listing Namespaces
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.