文档首页 > > API参考> Kubernetes API> RBAC> RoleBinding> 替换指定的RoleBinding

替换指定的RoleBinding

分享
更新时间:2020/05/26 GMT+08:00

功能介绍

This API is used to replace the specified RoleBinding

URL

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

参数解释描述该API的参数。

表1 参数解释

参数

是否必选

描述

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

-

请求消息

请求参数:

请求参数的详细描述请参见请求参数

“Content-Type”的详细描述请参见 PATCH请求方法操作说明

请求示例:

{
	"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"
	}
}

响应消息

响应参数:

响应参数的详细描述请参见请求参数

响应示例:

{
	"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"
	}
}

状态码

状态码描述API的状态码。

表2 状态码

状态码

描述

200

OK

201

Created

分享:

    相关文档

    相关产品

文档是否有解决您的问题?

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

反馈提交失败,请稍后再试!

*必选

请至少选择或填写一项反馈信息

字符长度不能超过200

提交反馈 取消

如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨

智能客服提问云社区提问