# Storage Classes

## Get all storageClasses from a cluster.

> this API is used by cluster versions < 2.20

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Storage Classes"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"responses":{"V1StorageClassNames":{"description":"Expected response to a valid request","content":{"application/json":{"schema":{"type":"object","properties":{"storageClasses":{"type":"array","items":{"type":"string"}}}}}}},"V1Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1Error"}}}},"V1NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1Error"}}}}},"schemas":{"V1Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}}},"paths":{"/v1/k8s/clusters/{uuid}/storage-classes":{"get":{"summary":"Get all storageClasses from a cluster.","description":"this API is used by cluster versions < 2.20","deprecated":true,"operationId":"V1GetStorageClasses","tags":["Storage Classes"],"parameters":[{"name":"includeNone","in":"query","description":"Include runai-none storage class to be able to create PVCs without a storage class","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"$ref":"#/components/responses/V1StorageClassNames"},"401":{"$ref":"#/components/responses/V1Unauthorized"},"404":{"$ref":"#/components/responses/V1NotFound"},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/V1Error"}}}}}}}}}
```

## GET /api/v1/storage-classes

> get a Storage Class/Classes for a given cluster

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Storage Classes"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ClusterIdRequired":{"name":"clusterId","in":"query","description":"The id of the cluster","required":true,"schema":{"type":"string","format":"uuid"}},"nameFilter":{"name":"name","in":"query","description":"filter by name","schema":{"type":"string"},"required":false}},"schemas":{"StorageClasses1":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StorageClass1"}}}},"StorageClass1":{"type":"object","required":["storage_class_name"],"properties":{"cluster_id":{"type":"string","format":"uuid","description":"Cluster ID which has sent the resource info"},"storage_class_name":{"type":"string","description":"Storage class name"},"Spec":{"type":"object","required":["is_default"],"properties":{"provisioner":{"type":"string","description":"The provisioner type (unique name)"},"allow_volume_expansion":{"type":"boolean","description":"Indicates whether the storage class allows volume expansion"},"is_default":{"type":"boolean","description":"Indicates whether the storage class is the default one"}}}}},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/storage-classes":{"get":{"summary":"get a Storage Class/Classes for a given cluster","operationId":"getStorageClasses","tags":["Storage Classes"],"parameters":[{"$ref":"#/components/parameters/ClusterIdRequired"},{"$ref":"#/components/parameters/nameFilter"},{"name":"includeNone","in":"query","description":"Include runai-none storage class, which is used for static provisioning of PVC. In static provisioning storage is omitted.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageClasses1"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```

## GET /api/v2/storage-classes

> get a Storage Class/Classes for a given cluster

```json
{"openapi":"3.0.3","info":{"title":"NVIDIA Run:ai","version":"2.24"},"tags":[{"name":"Storage Classes"}],"servers":[{"url":"https://app.run.ai"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer authentication"}},"parameters":{"ClusterIdRequired":{"name":"clusterId","in":"query","description":"The id of the cluster","required":true,"schema":{"type":"string","format":"uuid"}},"nameFilter":{"name":"name","in":"query","description":"filter by name","schema":{"type":"string"},"required":false}},"schemas":{"StorageClassesV2":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/StorageClassV2"}}}},"StorageClassV2":{"type":"object","required":["clusterId","storageClassName","spec"],"properties":{"clusterId":{"type":"string","format":"uuid","description":"Cluster ID which has sent the resource info"},"storageClassName":{"type":"string","description":"Storage class name"},"spec":{"$ref":"#/components/schemas/StorageClassSpec"},"permissions":{"$ref":"#/components/schemas/StorageClassPermissions"},"customization":{"$ref":"#/components/schemas/StorageClassCustomization"}}},"StorageClassSpec":{"type":"object","required":["isDefault"],"properties":{"provisioner":{"type":"string","description":"The provisioner type (unique name)"},"allowVolumeExpansion":{"type":"boolean","description":"Indicates whether the storage class allows volume expansion"},"isDefault":{"type":"boolean","description":"Indicates whether the storage class is the default one"}}},"StorageClassPermissions":{"type":"object","nullable":true,"description":"Defines the access permissions and behavioral rules for this storage class.","properties":{"allowedForAssets":{"$ref":"#/components/schemas/AllowedForAssets"},"allowedForWorkloads":{"$ref":"#/components/schemas/AllowedForWorkloads"},"allowedForEphemeralVolumes":{"$ref":"#/components/schemas/AllowedForEphemeralVolumes"},"allowedForPersistentVolumes":{"$ref":"#/components/schemas/AllowedForPersistentVolumes"},"allowDataSharing":{"$ref":"#/components/schemas/AllowDataSharing"}}},"AllowedForAssets":{"type":"boolean","nullable":true,"description":"Determines whether PVC assets can be created using this storage class."},"AllowedForWorkloads":{"type":"boolean","nullable":true,"description":"Allows workloads to include PVCs that use this storage class. When disabled, users cannot (a) include non-existing PVC assets created with this class in asset-based submissions, or (b) attach PVCs with existing=false to workloads using this class."},"AllowedForEphemeralVolumes":{"type":"boolean","nullable":true,"description":"Allows workloads to create ephemeral volumes using this storage class. When disabled, users cannot (a) create PVC assets with autoDelete=true and ephemeral=true, or (b) include PVC instances with isEphemeral=false that use this storage class."},"AllowedForPersistentVolumes":{"type":"boolean","nullable":true,"description":"Allows workloads to create persistent volumes using this storage class. When disabled, users cannot (a) create PVC assets with autoDelete=true and ephemeral=true, or (b) include PVC instances with isEphemeral=false that use this storage class."},"AllowDataSharing":{"type":"boolean","nullable":true,"description":"Allows creation of PVCs using a shared volume."},"StorageClassCustomization":{"description":"Optional UI/policy controls that define defaults and requirements when creating PVCs with this storage class.","properties":{"accessMode":{"$ref":"#/components/schemas/AccessModeCustomization"},"volumeMode":{"$ref":"#/components/schemas/VolumeModeCustomization"},"claimSize":{"$ref":"#/components/schemas/ClaimSizeCustomization"},"attributes":{"$ref":"#/components/schemas/AttributesCustomization"}},"type":"object","nullable":true},"AccessModeCustomization":{"description":"Controls whether PVC access modes are required and what defaults to apply.","properties":{"required":{"type":"boolean","description":"If true, the accessMode field is mandatory when creating a PVC that uses this storage class.","nullable":true},"default":{"$ref":"#/components/schemas/PvcAccessModes"},"supportedValues":{"$ref":"#/components/schemas/PvcSupportedAccessModes"}},"type":"object","nullable":true},"PvcAccessModes":{"description":"Default access mode(s) applied to newly created PVCs unless explicitly overridden.","properties":{"readWriteOnce":{"description":"Mount the volume as read/write by a single node.","type":"boolean","default":true,"nullable":true},"readOnlyMany":{"description":"Mount the volume as read-only by many nodes.","type":"boolean","default":false,"nullable":true},"readWriteMany":{"description":"Mount the volume as read/write by many nodes.","type":"boolean","default":false,"nullable":true}},"nullable":true,"type":"object"},"PvcSupportedAccessModes":{"description":"Defines the access modes supported by the given storage class. These values indicate which access configurations can be used when creating PVCs with this class.","properties":{"readWriteOnce":{"description":"Indicates whether the readWriteOnce access mode is supported. This mode allows a volume to be mounted as read/write by a single node.","type":"boolean","default":true,"nullable":true},"readOnlyMany":{"description":"Indicates whether the readOnlyMany access mode is supported. This mode allows a volume to be mounted as read-only by many nodes.","type":"boolean","default":true,"nullable":true},"readWriteMany":{"description":"Indicates whether the readWriteMany access mode is supported. This mode allows a volume to be mounted as read/write by many nodes.","type":"boolean","default":true,"nullable":true}},"nullable":true,"type":"object"},"VolumeModeCustomization":{"description":"Defines whether the volumeMode field is required when creating PVCs and specifies default and supported modes for the storage class.","properties":{"required":{"type":"boolean","description":"Indicates whether the volumeMode field is mandatory when creating a PVC.","nullable":true},"default":{"$ref":"#/components/schemas/PvcVolumeMode"},"supportedValues":{"description":"Lists which volume modes are supported for this storage class.","type":"object","nullable":true,"properties":{"filesystem":{"type":"boolean","description":"Indicates whether filesystem mode is supported. Filesystem allows the volume to be mounted as a filesystem, enabling the usage of directories and files.","default":true,"nullable":true},"block":{"type":"boolean","description":"Indicates whether block mode is supported. Exposes the volume as a block storage, which can be formatted or used by applications directly without a filesystem.","default":true,"nullable":true}}}},"type":"object","nullable":true},"PvcVolumeMode":{"description":"Default volume mode for the PVC. Choose between Filesystem (default) or Block.","type":"string","enum":["Filesystem","Block"],"nullable":true},"ClaimSizeCustomization":{"description":"Defines the default, supported units, and range constraints for PVC claim sizes. These settings control the requested storage capacity when creating a PVC using this storage class.","properties":{"default":{"$ref":"#/components/schemas/PvcClaimSize"},"supportedUnits":{"description":"Units supported for specifying PVC sizes. Valid values: \"MB\", \"MiB\", \"GB\", \"GiB\", \"TB\", \"TiB\".","type":"array","items":{"type":"string","enum":["MB","MiB","GB","GiB","TB","TiB"]}},"min":{"$ref":"#/components/schemas/PvcClaimMinSize"},"max":{"$ref":"#/components/schemas/PvcClaimMaxSize"},"step":{"$ref":"#/components/schemas/PvcClaimStepSize"}},"type":"object","nullable":true},"PvcClaimSize":{"description":"Requested size for the PVC. Mandatory when existingPvc is false. Recommended sizes: TB/GB/MB/TIB/GIB/MIB","type":"string","pattern":"^([+]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$","maxLength":63,"nullable":true},"PvcClaimMinSize":{"description":"Minimum claim size allowed for PVCs created with this storage class. Mandatory when existingPvc = false. Recommended values: TB, GB, MB, TIB, GIB, MIB.","type":"string","pattern":"^([+]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$","nullable":true},"PvcClaimMaxSize":{"description":"Maximum claim size allowed for PVCs created with this storage class. Mandatory when existingPvc = false. Recommended values: TB, GB, MB, TIB, GIB, MIB.","type":"string","pattern":"^([+]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$","nullable":true},"PvcClaimStepSize":{"description":"Defines the incremental step between allowed numeric values (for example, 1, 0.1).","type":"string","pattern":"^([+]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$","nullable":true},"AttributesCustomization":{"description":"Defines additional annotation attributes to be applied to PVCs created under this storage class. Each attribute describes an annotation key and its expected value format, display name, and purpose.","type":"array","items":{"$ref":"#/components/schemas/PvcAddedAttribute"}},"PvcAddedAttribute":{"description":"Attribute that is added to any PVC of a given storage class.","required":["key"],"properties":{"key":{"type":"string","minLength":1,"description":"The annotation key for the PVC. Must comply with Kubernetes naming rules: ≤63 characters, beginning and ending with an alphanumeric character ([A-Za-z0-9]), and may include dashes (-), underscores (_), or dots (.).","maxLength":63,"pattern":"^([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$"},"format":{"description":"Defines the data type the attribute can accept. Enum: \"text\" \"number\" \"boolean\"","$ref":"#/components/schemas/PvcAddedAttributeFormat"},"display":{"type":"string","minLength":1,"description":"User-friendly display name for the attribute, shown in the UI.","nullable":true},"description":{"type":"string","minLength":1,"description":"A description of the attribute's purpose or expected values.","nullable":true},"placeholder":{"type":"string","minLength":1,"description":"Example or hint text for the attribute's value, displayed as a watermark or help message in the UI.","nullable":true},"required":{"description":"Indicates whether this attribute is mandatory.","type":"boolean","nullable":true},"defaultValue":{"description":"Default value assigned to the attribute when not explicitly provided.","type":"string","minLength":1,"nullable":true},"validationRegexp":{"description":"Regular expression used to validate user input for text attributes.","type":"string","minLength":1,"nullable":true},"minValue":{"description":"Minimum allowed value for attributes of type number.","type":"number","minLength":1,"nullable":true},"maxValue":{"description":"Maximum allowed value for attributes of type number.","type":"number","minLength":1,"nullable":true},"step":{"description":"Defines the incremental step between allowed numeric values (for example, 1, 0.1).","type":"number","minLength":1,"nullable":true},"validationError":{"description":"Custom validation error message shown if input fails validation. If omitted, a default error message is generated automatically.","type":"string","minLength":1,"nullable":true}},"nullable":true,"type":"object"},"PvcAddedAttributeFormat":{"type":"string","description":"Defines the data type the attribute can accept. Enum: \"text\" \"number\" \"boolean\"","enum":["text","number","boolean"],"nullable":true},"Error":{"required":["code","message"],"properties":{"code":{"type":"integer","minimum":100,"maximum":599},"message":{"type":"string"},"details":{"type":"string"}}}},"responses":{"401Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500InternalServerError":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503ServiceUnavailable":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v2/storage-classes":{"get":{"summary":"get a Storage Class/Classes for a given cluster","operationId":"getStorageClassesV2","tags":["Storage Classes"],"parameters":[{"$ref":"#/components/parameters/ClusterIdRequired"},{"$ref":"#/components/parameters/nameFilter"},{"name":"includeNone","in":"query","description":"Include runai-none storage class, which is used for static provisioning of PVC. In static provisioning storage is omitted.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Executed successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageClassesV2"}}}},"401":{"$ref":"#/components/responses/401Unauthorized"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerError"},"503":{"$ref":"#/components/responses/503ServiceUnavailable"}}}}}}
```
