• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. Namespace (Native Kubernetes APIs)
  5. Reading a Specified Namespace

Reading a Specified Namespace

Function

This API is used to read the details about a specified Namespace.

URI

GET /api/v1/namespaces/{name}

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

pretty

No

If 'true', then the output is pretty printed.

name

No

Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated.

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 Request.

Example response:

{
    "kind": "Namespace",
    "apiVersion": "v1",
    "metadata": {
        "name": "ns-test",
        "selfLink": "/api/v1/namespaces/ns-test",
        "uid": "00468bb2-fcef-11e7-9193-fa163ecdc4fd",
        "resourceVersion": "95092",
        "creationTimestamp": "2018-01-19T08:01:49Z",
        "labels": {
            "name": "ns-test"
        },
        "enable": true
    },
    "spec": {
        "finalizers": [
            "kubernetes"
        ]
    },
    "status": {
        "phase": "Active"
    }
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

This operation succeeds, and a Namespace resource object is returned.

For the description about status codes, see section Status Codes.