Replacing a Specified Role
Function
This API is used to replace a specified Role.
URL
PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
Table 1 describes the parameters of this API.
Request
Request parameters:
For the description about request parameters, see Table 2.
For the description about the Content-Type field, see Patch Request Method Operation Description.
Example request:
{
"metadata": {
"name": "pod-reader",
"namespace": "default",
"selfLink": "/apis/rbac.authorization.k8s.io/v1/namespaces/default/roles/secret-reader",
"uid": "6320bedb-f220-11e8-b449-fa163ec24e06",
"resourceVersion": "56532",
"creationTimestamp": "2018-11-27T08:42:35Z"
},
"rules": [{
"verbs": ["get","watch"],
"apiGroups": [""],
"resources": ["pods"]
}]
}
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": "6320bedb-f220-11e8-b449-fa163ec24e06",
"resourceVersion": "56532",
"creationTimestamp": "2018-11-27T08:42:35Z"
},
"rules": [{
"verbs": ["get","watch"],
"apiGroups": [""],
"resources": ["pods"]
}]
}
Status Code
Table 2 describes the status codes of this API.
Last Article: Updating a Specified Role
Next Article: Deleting a Specified Role
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.