# Storage reference

Look up every origin storage CLI command and every GraphQL query and mutation in the pvs namespace for volumes, snapshots, and storage classes.

The storage reference covers the `origin storage` CLI commands and the `pvs` (Persistent Volume Storage) namespace of the GraphQL API. For concepts and procedures, see [Volumes](/docs/storage/volumes) and [Snapshots](/docs/storage/snapshots).

## CLI [#cli]

[`origin storage` commands](/docs/storage/reference/cli) lists every command with its options. Attaching and detaching volumes are `origin compute` commands; see [`attach-volume`](/docs/compute/reference/cli#attach-volume) and [`detach-volume`](/docs/compute/reference/cli#detach-volume).

## GraphQL queries [#graphql-queries]

Queries live under `query { pvs { … } }`.

| Query | Returns | Permission |
| --- | --- | --- |
| `volumes(input: { projectUrn })` | The project’s volumes, without deleted ones. | `pvs.volume.list` |
| `volume(volumeUrn)` | One volume, including a deleted one. | `pvs.volume.get` |
| `snapshots(input: { projectUrn })` | The project’s snapshots, without deleted ones. | `pvs.snapshot.list` |
| `snapshot(snapshotUrn)` | One snapshot, including a deleted one. | `pvs.snapshot.get` |
| `storageClasses` | Every published storage class with its `available` flag. | None |

To find the instance an `INUSE` volume is attached to, use the `compute.volumeAttachments` query. See [Find the instance a volume is attached to](/docs/storage/volumes/find-instance).

## GraphQL mutations [#graphql-mutations]

Mutations live under `mutation { pvs { … } }`. Mutations that return `CommandRequestStatus` report only that the request was accepted; read the resource to see the result.

| Mutation | Effect | Returns | Permission |
| --- | --- | --- | --- |
| `createVolume` | Creates a volume, empty or from a snapshot. See [Create a volume](/docs/storage/volumes/create). | `PvsVolume` | `pvs.volume.create` |
| `importVolume` | Creates a volume from a disk image at a URL. See [Import a disk image as a volume](/docs/storage/volumes/import). | `PvsVolume` | `pvs.volume.create` |
| `resizeVolume` | Grows a volume. See [Resize a volume](/docs/storage/volumes/resize). | `CommandRequestStatus` | `pvs.volume.update` |
| `deleteVolume` | Deletes a volume. See [Delete a volume](/docs/storage/volumes/delete). | `CommandRequestStatus` | `pvs.volume.delete` |
| `createSnapshot` | Takes a snapshot of a volume. See [Create and protect a snapshot](/docs/storage/snapshots/create-and-protect). | `PvsSnapshot` | `pvs.snapshot.create` |
| `protectSnapshot` | Protects a snapshot so it can be a clone source. | `CommandRequestStatus` | `pvs.snapshot.protect` |
| `unprotectSnapshot` | Lifts a snapshot’s protection. | `CommandRequestStatus` | `pvs.snapshot.unprotect` |
| `deleteSnapshot` | Deletes an unprotected snapshot. See [Delete a snapshot](/docs/storage/snapshots/delete). | `CommandRequestStatus` | `pvs.snapshot.delete` |

## Status values [#status-values]

The `status`, `modificationStatus`, and `protectionStatus` fields are strings. Their values are listed in [Volume states](/docs/storage/volumes/volume-states) and [Snapshot states](/docs/storage/snapshots/snapshot-states).

## Errors and limits [#errors-and-limits]

- [Error codes](/docs/platform/reference/errors)
- [Storage limits](/docs/platform/reference/limits#storage)

