Reading a Specified RoleBinding

Function

This API is used to read a specified RoleBinding.

URL

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

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

name

Yes

Name of the RoleBinding.

namespace

Yes

Object name and auth scope, such as for teams and projects.

pretty

No

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

Request

N/A

Response

Response parameters:

For the description about response parameters, see Table 2.

Example response:

{
    "kind" : "RoleBinding",
    "apiVersion" : "rbac.authorization.k8s.io/v1",
    "metadata" : {
        "name" : "read-pods",
        "namespace" : "default",
        "selfLink" : "/apis/rbac.authorization.k8s.io/v1/namespaces/default/rolebindings/secret-reader",
        "uid" : "b3d1a49a-f1f4-11e8-b449-fa163ec24e06",
        "resourceVersion" : "16611",
        "creationTimestamp" : "2018-11-27T03:29:52Z"
    },
    "subjects" : [ {
        "kind" : "User",
        "apiGroup" : "rbac.authorization.k8s.io",
        "name" : "jane"
    } ],
    "roleRef" : {
        "apiGroup" : "rbac.authorization.k8s.io",
        "kind" : "Role",
        "name" : "pod-reader"
    }
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

OK

For the description about error status codes, see Status Code.