Reading a Specified ClusterRole
Function
This API is used to read a specified ClusterRole.
URL
GET /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
Table 1 describes the parameters of this API.
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
name |
Yes |
Name of the ClusterRole. |
|
pretty |
No |
If 'true', then the output is pretty printed. |
Request
N/A
Example response:
{
"kind" : "ClusterRole",
"apiVersion" : "rbac.authorization.k8s.io/v1",
"metadata" : {
"name" : "secret-reader",
"selfLink" : "/apis/rbac.authorization.k8s.io/v1/clusterroles/secret-reader",
"uid" : "f2cf199e-f1f0-11e8-b449-fa163ec24e06",
"resourceVersion" : "13211",
"creationTimestamp" : "2018-11-27T03:03:00Z"
},
"rules" : [ {
"verbs" : [ "get", "watch", "list" ],
"apiGroups" : [ "" ],
"resources" : [ "secrets" ]
} ]
}
Status Code
Table 2 describes the status code of this API.
For the description about error status codes, see Status Code.
Last Article: Deleting ClusterRoles in Batches
Next Article: Reading the List of ClusterRoles
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.