Updating a Specified Role
Function
This API is used to partially update a specified Role.
URL
PATCH /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. |
|
body |
Yes |
- |
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","list"],
"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","list"],
"apiGroups": [""],
"resources": ["pods"]
}]
}
Status Code
Table 2 describes the status code of this API.
Last Article: Creating a Role
Next Article: Replacing a Specified Role
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.