# Storage Classes

storage class related operations

## Get all storageClasses from a cluster.

> this API is used by cluster versions < 2.20

```json
{"openapi":"3.0.3","info":{"title":"Runai API","version":"2.20"},"tags":[{"name":"Storage Classes","description":"storage class related operations"}],"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":"Runai API","version":"2.20"},"tags":[{"name":"Storage Classes","description":"storage class related operations"}],"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 to be able to create PVCs without a storage class","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"}}}}}}
```
