查询Namepsace
更新时间:2020-01-03
接口描述
查询Namespace的详细信息。 |
请求结构
GET /api/v1/namespaces/{name} HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
表1 Path参数描述
参数 | 类型 | 参数位置 | 描述 | 是否必须 |
---|---|---|---|---|
name | String | URI参数 | 要查询的namespace名称 | 必须 |
表2 Query参数描述
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
pretty | String | If 'true', then the output is pretty printed. | 非必须 |
exact | String | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. | 非必须 |
export | String | Should this value be exported. Export strips fields that a user cannot specify. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
表3 Namespace v1数据结构说明
参数 | 类型 | 描述 |
---|---|---|
kind | 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 | 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 | Object | Standard object metadata. 详情请参见 表XX |
spec | Object | Spec defines the behavior of the Namespace. 详情请参见 表XX |
status | Object | Status describes the current status of a Namespace. 详情请参见 表3 |
表4 namespace status字段数据结构说明
参数 | 类型 | 描述 |
---|---|---|
phase | String | Phase is the current lifecycle phase of the namespace. Namespace的状态有2个: - Active: means the namespace is available for use in the system - Terminating: means the namespace is undergoing graceful termination |
错误码
请参照前文的网关错误码和平台错误码。
请求示例
GET /api/v1/namespaces/test-namespace HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"annotations": null,
"clusterName": null,
"creationTimestamp": 1568204139000,
"deletionGracePeriodSeconds": null,
"deletionTimestamp": null,
"finalizers": null,
"generateName": null,
"generation": null,
"initializers": null,
"labels": null,
"name": "test-namespace",
"namespace": null,
"ownerReferences": null,
"resourceVersion": "4908345",
"selfLink": "/api/v1/namespaces/test-namespace",
"uid": "de4fd416-d48d-11e9-aa29-rebw4e9ea903"
},
"spec": {
"finalizers": [
"kubernetes"
]
},
"status": {
"phase": "Active"
}
}