功能介绍
该API用于创建一个Namespace。
请求消息
请求参数:
请求参数如表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 |
- |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
finalizers |
No |
Array of strings |
Finalizers is an opaque list of values that must be empty to permanently remove object from storage. |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
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" } }