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.
|
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
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.
For the description about error status codes, see Status Code.
Last Article: Deleting RoleBindings in Batches
Next Article: Obtaining the RoleBinding List in a Specified Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.