当前位置:主页 > 查看内容

创建Namespace_云容器引擎 CCE_API参考_Kubernetes API_Namespac

发布时间:2021-09-24 00:00| 位朋友查看

简介:功能介绍 该API用于创建一个Namespace。 URI POST /api/v1/namespaces 表1 描述该API的参数。 表1 参数描述 参数 是否必选 描述 pretty No If 'true', then the output is pretty printed. 请求消息 请求参数: 请求参数如 表2 所示。 表2 参数描述 参数 是……

功能介绍

该API用于创建一个Namespace。

URI

POST /api/v1/namespaces

表1 描述该API的参数。

表1 参数描述

参数

是否必选

描述

pretty

No

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

请求消息

请求参数:

请求参数如表2所示。

表2 参数描述

参数

是否必选

参数类型

描述

kind

Yes

String

Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase.

The value of this parameter is Namespace.

apiVersion

Yes

String

APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.

The value of this parameter is v1.

metadata

Yes

metadata object

-

spec

No

spec object

-

status

No

status object

-

表3 spec字段数据结构说明

参数

是否必选

参数类型

描述

finalizers

No

Array of strings

Finalizers is an opaque list of values that must be empty to permanently remove object from storage.

表4 status字段数据结构说明

参数

是否必选

参数类型

描述

phase

No

String

Phase is the current lifecycle phase of the namespace.

请求示例:

{ 
   "apiVersion":"v1", 
   "kind": "Namespace", 
   "metadata": { 
     "name": "development", 
     "labels": { 
       "name": "development" 
     } 
   }, 
   "spec": { 
     "finalizers": ["kubernetes"] 
   }, 
   "status": { 
     "phase": "Active" 
   } 
 }

响应消息

响应参数:

响应参数的详细描述请参见请求消息

响应示例:

{ 
   "kind": "Namespace", 
   "apiVersion": "v1", 
   "metadata": { 
     "name": "development", 
     "selfLink": "/api/v1/namespaces/development", 
     "uid": "c98a9a98-595c-11e6-b444-286ed488fafe", 
     "resourceVersion": "16578", 
   "creationTimestamp": "2016-08-03T09:29:33Z", 
     "labels": { 
       "name": "development" 
     } 
   }, 
   "spec": { 
     "finalizers": [ 
       "kubernetes" 
     ] 
   }, 
   "status": { 
     "phase": "Active" 
   } 
 }

状态码

表5描述API的状态码。

表5 状态码

状态码

描述

201

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

异常状态码请参见状态码


本站部分内容转载于网络,版权归原作者所有,转载之目的在于传播更多优秀技术内容,如有侵权请联系QQ/微信:153890879删除,谢谢!
上一篇:2020 年 4 个非常值得推荐的 VS Code 插件 下一篇:没有了

推荐图文

  • 周排行
  • 月排行
  • 总排行

随机推荐