更新时间:2022-05-10 GMT+08:00
分享

获取指定的Role

功能介绍

This API is used to read the specified Role.

URL

GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}

参数解释描述该API的参数。

表1 参数解释

参数

是否必选

描述

name

Yes

name of the Role.

namespace

Yes

object name and auth scope, such as for teams and projects

pretty

No

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

请求消息

N/A

响应消息

响应参数:

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

响应示例:

{
    "kind" : "Role",
    "apiVersion" : "rbac.authorization.k8s.io/v1",
    "metadata" : {
        "name" : "pod-reader",
        "namespace" : "default",
        "selfLink" : "/apis/rbac.authorization.k8s.io/v1/namespaces/default/roles/secret-reader",
        "uid" : "f379007e-f1f0-11e8-b449-fa163ec24e06",
        "resourceVersion" : "13218",
        "creationTimestamp" : "2018-11-27T03:03:01Z"
    },
    "rules" : [ {
        "verbs" : [ "get", "watch", "list" ],
        "apiGroups" : [ "" ],
        "resources" : [ "pods" ]
    } ]
}

状态码

状态码描述API的状态码。

表2 状态码

状态码

描述

200

OK

异常状态码请参见状态码

分享:

    相关文档

    相关产品

close