Updating a Specified RoleBinding

Function

This API is used to partially update a specified RoleBinding.

URL

PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}

Table 1 describes the parameters of this API.

Table 1 Parameter description

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:

{
	"subjects": [{
		"kind": "User",
		"apiGroup": "rbac.authorization.k8s.io",
		"name": "hecapi"
	}],
	"roleRef": {
		"apiGroup": "rbac.authorization.k8s.io",
		"kind": "Role",
		"name": "pod-reader"
	}
}

Response

Response parameters:

For the description about response parameters, see Table 2.

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": "06cc94b7-f2bb-11e8-b449-fa163ec24e06",
		"resourceVersion": "200072",
		"creationTimestamp": "2018-11-28T03:09:32Z"
	},
	"subjects": [{
		"kind": "User",
		"apiGroup": "rbac.authorization.k8s.io",
		"name": "hecapi"
	}],
	"roleRef": {
		"apiGroup": "rbac.authorization.k8s.io",
		"kind": "Role",
		"name": "pod-reader"
	}
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status Code

Status Code

Description

200

OK