• Cloud Container Engine

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

Replacing the Status of a Specified Namespace

Function

This API is used to replace the status of a specified Namespace, that is, to modify the value of the status field of the Namespace.

When the namespace.deletionTimestamp is set to null, the phase can be set to Active only.

When the namespace.deletionTimestamp is not set to null, the phase can be set to Terminating only.

URI

PUT /api/v1/namespaces/{name}/status

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

Yes

Name of the Namespace.

Request

Request parameters:

For the description about request parameters, see Table 2.

Example request:

{ 
   "apiVersion": "v1", 
     "kind": "Namespace", 
     "metadata": { 
         "name": "ns-test", 
         "labels": { 
             "name": "ns-test" 
         } 
     }, 
     "spec": { 
         "finalizers": [ 
             "openshift.com/origin", 
             "kubernetes" 
         ] 
     }, 
     "status": { 
         "phase": "Active" 
     } 
 }

Response

Response parameters:

For the description about response parameters, see the parameter description in Request.

Example response:

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

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.