Reading a Specified Role
Function
This API is used to read a specified Role.
URL
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
Table 1 describes the parameters of this API.
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
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. |
Request
N/A
Example response:
{
"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" ]
} ]
}
Status Code
Table 2 describes the status code of this API.
For the description about error status codes, see Status Code.
Last Article: Deleting Roles in Batches
Next Article: Obtaining the Role List in a Specified Namespace
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.