Updating a Specified ClusterRoleBinding

Function

This API is used to partially update a specified ClusterRoleBinding.

URL

PATCH /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

name

Yes

Name of the ClusterRoleBinding.

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": "Group",
		"apiGroup": "rbac.authorization.k8s.io",
		"name": "pro-manager"
	}],
	"roleRef": {
		"apiGroup": "rbac.authorization.k8s.io",
		"kind": "ClusterRole",
		"name": "secret-reader"
	}
}

Response

Response parameters:

For the description about response parameters, see Table 2.

Example response:

{
	"kind": "ClusterRoleBinding",
	"apiVersion": "rbac.authorization.k8s.io/v1",
	"metadata": {
		"name": "read-secrets-global",
		"selfLink": "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/read-secrets-global",
		"uid": "c384b02f-f2d7-11e8-b449-fa163ec24e06",
		"resourceVersion": "226911",
		"creationTimestamp": "2018-11-28T06:35:14Z"
	},
	"subjects": [{
		"kind": "Group",
		"apiGroup": "rbac.authorization.k8s.io",
		"name": "pro-manager"
	}],
	"roleRef": {
		"apiGroup": "rbac.authorization.k8s.io",
		"kind": "ClusterRole",
		"name": "secret-reader"
	}
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status Code

Status Code

Description

200

OK