--- api_metadata: apiVersion: "storage.k8s.io/v1beta1" import: "k8s.io/api/storage/v1beta1" kind: "VolumeAttributesClass" content_type: "api_reference" description: "VolumeAttributesClass 表示由 CSI 驱动所定义的可变更卷属性的规约。" title: "VolumeAttributesClass v1beta1" weight: 12 --- `apiVersion: storage.k8s.io/v1beta1` `import "k8s.io/api/storage/v1beta1"` ## VolumeAttributesClass {#VolumeAttributesClass} VolumeAttributesClass 表示由 CSI 驱动所定义的可变更卷属性的规约。 此类可以在动态制备 PersistentVolumeClaim 期间被指定, 并且可以在制备之后在 PersistentVolumeClaim 规约中更改。
- **apiVersion**: storage.k8s.io/v1beta1 - **kind**: VolumeAttributesClass - **metadata** (}}">ObjectMeta) 标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - **driverName** (string),必需 CSI 驱动的名称。此字段是不可变更的。 - **parameters** (map[string]string) parameters 保存由 CSI 驱动所定义的卷属性。这些值对 Kubernetes 是不透明的,被直接传递给 CSI 驱动。 下层存储驱动支持更改现有卷的这些属性,但 parameters 字段本身是不可变更的。 要触发一次卷更新,应该使用新的参数创建新的 VolumeAttributesClass, 并且应更新 PersistentVolumeClaim,使之引用新的 VolumeAttributesClass。 此字段是必需的,必须至少包含一个键/值对。键不能为空,参数最多 512 个,累计最大尺寸为 256K。 如果 CSI 驱动拒绝无效参数,则目标 PersistentVolumeClaim 的状态中 modifyVolumeStatus 字段将被设置为 “Infeasible”。 ## VolumeAttributesClassList {#VolumeAttributesClassList} VolumeAttributesClassList 是 VolumeAttributesClass 对象的集合。
- **apiVersion**: storage.k8s.io/v1beta1 - **kind**: VolumeAttributesClassList - **metadata** (}}">ListMeta) 标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - **items** ([]}}">VolumeAttributesClass),必需 items 是 VolumeAttributesClass 对象的列表。 ## 操作 {#Operations}
### `get` 读取指定的 VolumeAttributesClass #### HTTP 请求 GET /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} #### 参数 - **name** (**路径参数**): string,必需 VolumeAttributesClass 的名称。 - **pretty** (**查询参数**): string }}">pretty #### 响应 200 (}}">VolumeAttributesClass): OK 401: Unauthorized ### `list` 列举或监视类别为 VolumeAttributesClass 的对象 #### HTTP 请求 GET /apis/storage.k8s.io/v1beta1/volumeattributesclasses #### 参数 - **allowWatchBookmarks** (**查询参数**): boolean }}">allowWatchBookmarks - **continue** (**查询参数**): string }}">continue - **fieldSelector** (**查询参数**): string }}">fieldSelector - **labelSelector** (**查询参数**): string }}">labelSelector - **limit** (**查询参数**): integer }}">limit - **pretty** (**查询参数**): string }}">pretty - **resourceVersion** (**查询参数**): string }}">resourceVersion - **resourceVersionMatch** (**查询参数**): string }}">resourceVersionMatch - **sendInitialEvents** (**查询参数**): boolean }}">sendInitialEvents - **timeoutSeconds** (**查询参数**): integer }}">timeoutSeconds - **watch** (**查询参数**): boolean }}">watch #### 响应 200 (}}">VolumeAttributesClassList): OK 401: Unauthorized ### `create` 创建 VolumeAttributesClass #### HTTP 请求 POST /apis/storage.k8s.io/v1beta1/volumeattributesclasses #### 参数 - **body**: }}">VolumeAttributesClass,必需 - **dryRun** (**查询参数**): string }}">dryRun - **fieldManager** (**查询参数**): string }}">fieldManager - **fieldValidation** (**查询参数**): string }}">fieldValidation - **pretty** (**查询参数**): string }}">pretty #### 响应 200 (}}">VolumeAttributesClass): OK 201 (}}">VolumeAttributesClass): Created 202 (}}">VolumeAttributesClass): Accepted 401: Unauthorized ### `update` 替换指定的 VolumeAttributesClass #### HTTP 请求 PUT /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} #### 参数 - **name** (**路径参数**): string,必需 VolumeAttributesClass 的名称。 - **body**: }}">VolumeAttributesClass,必需 - **dryRun** (**查询参数**): string }}">dryRun - **fieldManager** (**查询参数**): string }}">fieldManager - **fieldValidation** (**查询参数**): string }}">fieldValidation - **pretty** (**查询参数**): string }}">pretty #### 响应 200 (}}">VolumeAttributesClass): OK 201 (}}">VolumeAttributesClass): Created 401: Unauthorized ### `patch` 部分更新指定的 VolumeAttributesClass #### HTTP 请求 PATCH /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} #### 参数 - **name** (**路径参数**): string,必需 VolumeAttributesClass 的名称。 - **body**: }}">Patch,必需 - **dryRun** (**查询参数**): string }}">dryRun - **fieldManager** (**查询参数**): string }}">fieldManager - **fieldValidation** (**查询参数**): string }}">fieldValidation - **force** (**查询参数**): boolean }}">force - **pretty** (**查询参数**): string }}">pretty #### 响应 200 (}}">VolumeAttributesClass): OK 201 (}}">VolumeAttributesClass): Created 401: Unauthorized ### `delete` 删除 VolumeAttributesClass #### HTTP 请求 DELETE /apis/storage.k8s.io/v1beta1/volumeattributesclasses/{name} #### 参数 - **name** (**路径参数**): string,必需 VolumeAttributesClass 的名称。 - **body**: }}">DeleteOptions - **dryRun** (**查询参数**): string }}">dryRun - **gracePeriodSeconds** (**查询参数**): integer }}">gracePeriodSeconds - **pretty** (**查询参数**): string }}">pretty - **propagationPolicy** (**查询参数**): string }}">propagationPolicy #### 响应 200 (}}">VolumeAttributesClass): OK 202 (}}">VolumeAttributesClass): Accepted 401: Unauthorized ### `deletecollection` 删除 VolumeAttributesClass 的集合 #### HTTP 请求 DELETE /apis/storage.k8s.io/v1beta1/volumeattributesclasses #### 参数 - **body**: }}">DeleteOptions - **continue** (**查询参数**): string }}">continue - **dryRun** (**查询参数**): string }}">dryRun - **fieldSelector** (**查询参数**): string }}">fieldSelector - **gracePeriodSeconds** (**查询参数**): integer }}">gracePeriodSeconds - **labelSelector** (**查询参数**): string }}">labelSelector - **limit** (**查询参数**): integer }}">limit - **pretty** (**查询参数**): string }}">pretty - **propagationPolicy** (**查询参数**): string }}">propagationPolicy - **resourceVersion** (**查询参数**): string }}">resourceVersion - **resourceVersionMatch** (**查询参数**): string }}">resourceVersionMatch - **sendInitialEvents** (**查询参数**): boolean }}">sendInitialEvents - **timeoutSeconds** (**查询参数**): integer }}">timeoutSeconds #### 响应 200 (}}">Status): OK 401: Unauthorized