• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. Kubernetes API
  5. Namespace
  6. Updating a Specified Namespace

Updating a Specified Namespace

Function

This API is used to update some information about a specified Namespace.

The following fields can be updated:

  • metadata.selfLink
  • metadata.resourceVersion
  • metadata.generation
  • metadata.creationTimestamp
  • metadata.deletionTimestamp
  • metadata.labels
  • metadata.generateName
  • metadata.annotations

URI

PATCH /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

Yes

Name of the Namespace.

Request

Request parameters:

For the description about the Content-Type message header, see section Patch Request Method Operation Description.

Example request:

Content-Type: application/json-patch+json
[ 
 { 
     "op": "add", 
     "path": "/spec/finalizers/0", 
     "value": "kubernetes" 
 } 
 ]

Response

Response parameters:

For the description about response parameters, see Request

Example response:

{ 
   "kind": "Namespace", 
   "apiVersion": "v1", 
   "metadata": { 
     "name": "helloworld", 
     "selfLink": "/api/v1/namespaces/helloworld", 
     "uid": "1298d13a-5d34-11e6-aeb9-286ed488fafe", 
     "resourceVersion": "3043", 
     "creationTimestamp": "2016-08-08T06:48:11Z" 
   }, 
   "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.