IDC

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

作者:admin 2021-09-24 我要评论

功能介绍 该API用于创建一个Namespace。 URI POST /api/v1/namespaces 表1 描述该API的参数。 表1 参数描述 参数 是否必选 描述 pretty No If 'true', then the ...

在说正事之前,我要推荐一个福利:你还在原价购买阿里云、腾讯云、华为云服务器吗?那太亏啦!来这里,新购、升级、续费都打折,能够为您省60%的钱呢!2核4G企业级云服务器低至69元/年,点击进去看看吧>>>)

功能介绍

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

异常状态码请参见状态码

版权声明:本文转载自网络,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。本站转载出于传播更多优秀技术知识之目的,如有侵权请联系QQ/微信:153890879删除

相关文章
腾讯云代理商
精彩导读
海外云服务器
热门资讯
腾讯云代理商