[zh-cn] sync1.25 /authorization-resources/role-v1.md

pull/36300/head
Michael 2022-08-26 07:12:59 +08:00
parent e2ad935ef9
commit f05ab10895
1 changed files with 96 additions and 67 deletions

View File

@ -7,10 +7,8 @@ content_type: "api_reference"
description: "Role 是一个按命名空间划分的 PolicyRule 逻辑分组,可以被 RoleBinding 作为一个单元引用。"
title: "Role"
weight: 7
auto_generated: false
---
<!--
---
api_metadata:
apiVersion: "rbac.authorization.k8s.io/v1"
import: "k8s.io/api/rbac/v1"
@ -20,7 +18,6 @@ description: "Role is a namespaced, logical grouping of PolicyRules that can be
title: "Role"
weight: 7
auto_generated: true
---
-->
`apiVersion: rbac.authorization.k8s.io/v1`
@ -28,6 +25,7 @@ auto_generated: true
`import "k8s.io/api/rbac/v1"`
## Role {#Role}
<!--
Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.
-->
@ -40,6 +38,7 @@ Role 是一个按命名空间划分的 PolicyRule 逻辑分组,可以被 RoleB
- **kind**: Role
- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)
<!--
Standard object's metadata.
@ -50,7 +49,7 @@ Standard object's metadata.
*PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.*
- **rules.apiGroups** ([]string)
APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.
APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups.
- **rules.resources** ([]string)
Resources is a list of resources this rule applies to. '*' represents all resources.
@ -61,18 +60,20 @@ Standard object's metadata.
rules 包含了这个 Role 的所有 PolicyRule。
<a name="PolicyRule"></a>
<a name="PolicyRule"></a>
**PolicyRule 包含描述一个策略规则的信息,但不包含该规则适用于哪个主体或适用于哪个命名空间的信息。**
- **rules.apiGroups** ([]string)
apiGroups 是包含资源的 apiGroup 的名称。
如果指定了多个 API 组,则允许对任何 API 组中的其中一个枚举资源来请求任何操作。
"" 表示核心 API 组,“*” 表示所有 API 组。
- **rules.resources** ([]string)
resources 是此规则所适用的资源的列表。
“*” 表示所有资源。
<!--
- **rules.verbs** ([]string), required
Verbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.
@ -103,6 +104,7 @@ Standard object's metadata.
但不能同时应用于两者。
## RoleList {#RoleList}
<!--
RoleList is a collection of Roles
-->
@ -114,19 +116,23 @@ RoleList 是 Role 的集合。
- **kind**: RoleList
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
<!--
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
Standard object's metadata.
- **items** ([]<a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>), required
Items is a list of Roles
-->
-->
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
标准的对象元数据。
- **items** ([]<a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>),必需
items 是 Role 的列表。
<!--
## Operations {#Operations}
<hr>
@ -142,6 +148,7 @@ RoleList 是 Role 的集合。
#### HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
<!--
#### Parameters
- **name** (*in path*): string, required
@ -155,17 +162,18 @@ GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
-->
#### 参数
- **name** (**路径参数**): string必需
- **name****路径参数**string必需
Role 的名称
- **namespace** (**路径参数**): string必需
- **namespace****路径参数**string必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
@ -174,6 +182,7 @@ GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
200 (<a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>): OK
401: Unauthorized
<!--
### `list` list or watch objects of kind Role
#### HTTP Request
@ -183,6 +192,7 @@ GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
#### HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
<!--
#### Parameters
- **namespace** (*in path*): string, required
@ -210,49 +220,50 @@ GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
-->
#### 参数
- **namespace** (**路径参数**): string必需
- **namespace****路径参数**string必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **allowWatchBookmarks** (**查询参数**): boolean
- **allowWatchBookmarks****查询参数**boolean
<a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks</a>
- **continue** (**查询参数**): string
- **continue****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>
- **fieldSelector** (**查询参数**): string
- **fieldSelector****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>
- **labelSelector** (**查询参数**): string
- **labelSelector****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>
- **limit** (**查询参数**): integer
- **limit****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
- **resourceVersion** (**查询参数**): string
- **resourceVersion****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>
- **resourceVersionMatch** (**查询参数**): string
- **resourceVersionMatch****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
- **timeoutSeconds** (**查询参数**): integer
- **timeoutSeconds****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
- **watch** (**查询参数**): boolean
- **watch****查询参数**boolean
<a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch</a>
<!--
#### Response
-->
@ -261,6 +272,7 @@ GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
200 (<a href="{{< ref "../authorization-resources/role-v1#RoleList" >}}">RoleList</a>): OK
401: Unauthorized
<!--
### `list` list or watch objects of kind Role
#### HTTP Request
@ -270,6 +282,7 @@ GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
#### HTTP 请求
GET /apis/rbac.authorization.k8s.io/v1/roles
<!--
#### Parameters
- **allowWatchBookmarks** (*in query*): boolean
@ -295,45 +308,46 @@ GET /apis/rbac.authorization.k8s.io/v1/roles
-->
#### 参数
- **allowWatchBookmarks** (**查询参数**): boolean
- **allowWatchBookmarks****查询参数**boolean
<a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks</a>
- **continue** (**查询参数**): string
- **continue****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>
- **fieldSelector** (**查询参数**): string
- **fieldSelector****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>
- **labelSelector** (**查询参数**): string
- **labelSelector****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>
- **limit** (**查询参数**): integer
- **limit****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
- **resourceVersion** (**查询参数**): string
- **resourceVersion****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>
- **resourceVersionMatch** (**查询参数**): string
- **resourceVersionMatch****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
- **timeoutSeconds** (**查询参数**): integer
- **timeoutSeconds****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
- **watch** (**查询参数**): boolean
- **watch****查询参数**boolean
<a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch</a>
<!--
#### Response
-->
@ -342,6 +356,7 @@ GET /apis/rbac.authorization.k8s.io/v1/roles
200 (<a href="{{< ref "../authorization-resources/role-v1#RoleList" >}}">RoleList</a>): OK
401: Unauthorized
<!--
### `create` create a Role
#### HTTP Request
@ -351,6 +366,7 @@ GET /apis/rbac.authorization.k8s.io/v1/roles
#### HTTP 请求
POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
<!--
#### Parameters
- **namespace** (*in path*): string, required
@ -367,27 +383,28 @@ POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
-->
#### 参数
- **namespace** (**路径参数**): string必需
- **namespace****路径参数**string必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>,必需
- **dryRun** (**查询参数**): string
- **dryRun****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
- **fieldManager** (**查询参数**): string
- **fieldManager****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>
- **fieldValidation** (**查询参数**): string
- **fieldValidation****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
@ -400,6 +417,7 @@ POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
202 (<a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>): Accepted
401: Unauthorized
<!--
### `update` replace the specified Role
#### HTTP Request
@ -409,6 +427,7 @@ POST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
#### HTTP 请求
PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
<!--
#### Parameters
- **name** (*in path*): string, required
@ -427,31 +446,32 @@ PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
-->
#### 参数
- **name** (**路径参数**): string必需
- **name****路径参数**string必需
Role 的名称
- **namespace** (**路径参数**): string必需
- **namespace****路径参数**string必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>,必需
- **dryRun** (**查询参数**): string
- **dryRun****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
- **fieldManager** (**查询参数**): string
- **fieldManager****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>
- **fieldValidation** (**查询参数**): string
- **fieldValidation****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
@ -462,6 +482,7 @@ PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
201 (<a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>): Created
401: Unauthorized
<!--
### `patch` partially update the specified Role
#### HTTP Request
@ -471,6 +492,7 @@ PUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
#### HTTP 请求
PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
<!--
#### Parameters
- **name** (*in path*): string, required
@ -491,35 +513,36 @@ PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
-->
#### 参数
- **name** (**路径参数**): string必需
- **name****路径参数**string必需
Role 的名称
- **namespace** (**路径参数**): string必需
- **namespace****路径参数**string必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch</a>,必需
- **dryRun** (**查询参数**): string
- **dryRun****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
- **fieldManager** (**查询参数**): string
- **fieldManager****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>
- **fieldValidation** (**查询参数**): string
- **fieldValidation****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>
- **force** (**查询参数**): boolean
- **force****查询参数**boolean
<a href="{{< ref "../common-parameters/common-parameters#force" >}}">force</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
@ -530,6 +553,7 @@ PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
201 (<a href="{{< ref "../authorization-resources/role-v1#Role" >}}">Role</a>): Created
401: Unauthorized
<!--
### `delete` delete a Role
#### HTTP Request
@ -539,6 +563,7 @@ PATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
#### HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
<!--
#### Parameters
- **name** (*in path*): string, required
@ -557,31 +582,32 @@ DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
-->
#### 参数
- **name** (**路径参数**): string必需
- **name****路径参数**string必需
Role 的名称
- **namespace** (**路径参数**): string必需
- **namespace****路径参数**string必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions</a>
- **dryRun** (**查询参数**): string
- **dryRun****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
- **gracePeriodSeconds** (**查询参数**): integer
- **gracePeriodSeconds****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
- **propagationPolicy** (**查询参数**): string
- **propagationPolicy****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy</a>
<!--
#### Response
-->
@ -592,6 +618,7 @@ DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
202 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): Accepted
401: Unauthorized
<!--
### `deletecollection` delete collection of Role
#### HTTP Request
@ -601,6 +628,7 @@ DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
#### HTTP 请求
DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
<!--
#### Parameters
- **namespace** (*in path*): string, required
@ -631,55 +659,56 @@ DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
-->
#### 参数
- **namespace** (**路径参数**): string必需
- **namespace****路径参数**string必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions</a>
- **continue** (**查询参数**): string
- **continue****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>
- **dryRun** (**查询参数**): string
- **dryRun****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
- **fieldSelector** (**查询参数**): string
- **fieldSelector****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>
- **gracePeriodSeconds** (**查询参数**): integer
- **gracePeriodSeconds****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds</a>
- **labelSelector** (**查询参数**): string
- **labelSelector****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>
- **limit** (**查询参数**): integer
- **limit****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>
- **pretty** (**查询参数**): string
- **pretty****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
- **propagationPolicy** (**查询参数**): string
- **propagationPolicy****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy</a>
- **resourceVersion** (**查询参数**): string
- **resourceVersion****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>
- **resourceVersionMatch** (**查询参数**): string
- **resourceVersionMatch****查询参数**string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
- **timeoutSeconds** (**查询参数**): integer
- **timeoutSeconds****查询参数**integer
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
<!--
#### Response
-->