文档首页 > > API参考> Kubernetes API> Namespace>

获取指定的Namespace

获取指定的Namespace

分享
更新时间:2020/12/16 GMT+08:00

功能介绍

该API用于获取指定的Namespace的详细信息。

URI

GET /api/v1/namespaces/{name}

表1 描述该API的参数。

表1 参数描述

参数

是否必选

描述

pretty

No

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

name

No

Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated.

exact

No

Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.

export

No

Should this value be exported. Export strips fields that a user can not specify.

请求消息

N/A

响应消息

响应参数:

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

响应示例:

{
    "kind": "Namespace",
    "apiVersion": "v1",
    "metadata": {
        "name": "test",
        "selfLink": "/api/v1/namespaces/test",
        "uid": "00468bb2-fcef-11e7-9193-fa163ecdc4fd",
        "resourceVersion": "95092",
        "creationTimestamp": "2018-01-19T08:01:49Z",
        "labels": {
            "name": "test"
        },
        "enable": true
    },
    "spec": {
        "finalizers": [
            "kubernetes"
        ]
    },
    "status": {
        "phase": "Active"
    }
}

状态码

表2描述API的状态码。

表2 状态码

状态码

描述

200

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

异常状态码请参见状态码

分享:

    相关文档

    相关产品