Replacing a Specified RoleBinding
Function
This API is used to replace a specified RoleBinding.
URL
PUT /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. |
|
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:
{
"kind": "RoleBinding",
"apiVersion": "rbac.authorization.k8s.io/v1",
"metadata": {
"name": "read-pods",
"namespace": "default",
"selfLink": "/apis/rbac.authorization.k8s.io/v1/namespaces/default/rolebindings/read-pods",
"uid": "301398f6-f2b9-11e8-b449-fa163ec24e06",
"resourceVersion": "198279",
"creationTimestamp": "2018-11-28T02:56:22Z"
},
"subjects": [{
"kind": "User",
"apiGroup": "rbac.authorization.k8s.io",
"name": "cce20"
}],
"roleRef": {
"kind": "Role",
"name": "pod-reader",
"apiGroup": "rbac.authorization.k8s.io"
}
}
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/read-pods",
"uid": "301398f6-f2b9-11e8-b449-fa163ec24e06",
"resourceVersion": "198279",
"creationTimestamp": "2018-11-28T02:56:22Z"
},
"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 codes of this API.
Last Article: Updating a Specified RoleBinding
Next Article: Deleting a Specified RoleBinding
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.