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": "clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50",
"namespace": "rbac-test",
"selfLink": "/apis/rbac.authorization.k8s.io/v1/namespaces/rbac-test/rolebindings/clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50",
"uid": "6163c216-78a9-11ea-bcc5-340a9837e2a7",
"resourceVersion": "230608015",
"creationTimestamp": "2020-04-07T08:25:46Z"
},
"subjects": [{
"kind": "User",
"apiGroup": "rbac.authorization.k8s.io",
"name": "07b82a44a680d5661f01c00b448f8f50"
}],
"roleRef": {
"apiGroup": "rbac.authorization.k8s.io",
"kind": "ClusterRole",
"name": "view"
}
}
Example response
{
"kind": "RoleBinding",
"apiVersion": "rbac.authorization.k8s.io/v1",
"metadata": {
"name": "clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50",
"namespace": "rbac-test",
"selfLink": "/apis/rbac.authorization.k8s.io/v1/namespaces/rbac-test/rolebindings/clusterrole_view_User_07b82a44a680d5661f01c00b448f8f50",
"uid": "6163c216-78a9-11ea-bcc5-340a9837e2a7",
"resourceVersion": "230609819",
"creationTimestamp": "2020-04-07T08:25:46Z"
},
"subjects": [
{
"kind": "User",
"apiGroup": "rbac.authorization.k8s.io",
"name": "07b82a44a680d5661f01c00b448f8f50"
}
],
"roleRef": {
"apiGroup": "rbac.authorization.k8s.io",
"kind": "ClusterRole",
"name": "view"
}
}
Status Code
Table 2 describes the status codes of this API.
For more status codes, see Status Codes.
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.