---
title: "Get all PersistentVolumes in the cluster"
method: GET
path: "/kubernetes/{id}/persistent_volumes"
tags: ["kubernetes"]
---

# Get all PersistentVolumes in the cluster

`GET /kubernetes/{id}/persistent_volumes`

Get a list of all PersistentVolumes in the given environment.
**Access policy**: Authenticated user.

## Path parameters

- `id` integer, required

## Response `200`

Success

- KubernetesK8sPersistentVolume[]
  - `accessModes` string[]
  - `annotations` object
  - `capacity` V1ResourceList
  - `claimRef` K8sIoApiCoreV1ObjectReference
    - `apiVersion` string — API version of the referent. +optional
    - `fieldPath` string — If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future. +optional
    - `kind` string — Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds +optional
    - `name` string — Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names +optional
    - `namespace` string — Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +optional
    - `resourceVersion` string — Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency +optional
    - `uid` string — UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids +optional
  - `creationDate` string
  - `csi` V1CSIPersistentVolumeSource
    - `controllerExpandSecretRef` V1SecretReference
      - `name` string — name is unique within a namespace to reference a secret resource. +optional
      - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
    - `controllerPublishSecretRef` V1SecretReference
      - `name` string — name is unique within a namespace to reference a secret resource. +optional
      - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
    - `driver` string — driver is the name of the driver to use for this volume. Required.
    - `fsType` string — fsType to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs". +optional
    - `nodeExpandSecretRef` V1SecretReference
      - `name` string — name is unique within a namespace to reference a secret resource. +optional
      - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
    - `nodePublishSecretRef` V1SecretReference
      - `name` string — name is unique within a namespace to reference a secret resource. +optional
      - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
    - `nodeStageSecretRef` V1SecretReference
      - `name` string — name is unique within a namespace to reference a secret resource. +optional
      - `namespace` string — namespace defines the space within which the secret name must be unique. +optional
    - `readOnly` boolean — readOnly value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write). +optional
    - `volumeAttributes` object — volumeAttributes of the volume to publish. +optional
    - `volumeHandle` string — volumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.
  - `humanReadableAccessModes` V1PersistentVolumeAccessMode[]
  - `labels` object
  - `name` string
  - `persistentVolumeReclaimPolicy` 'Recycle' | 'Delete' | 'Retain'
  - `status` 'Pending' | 'Available' | 'Bound' | 'Released' | 'Failed'
  - `storageClassName` string
  - `volumeMode` 'Block' | 'Filesystem'

## Other responses

- `400` — Invalid request payload, such as missing required fields or fields not meeting validation criteria.
- `403` — Unauthorized access or operation not allowed.
- `500` — Server error occurred while attempting to retrieve persistent volumes.

---

[API](https://skmtc.net/portainer/apis/portainerce-api.md) · [All operations](https://skmtc.net/portainer/apis/portainerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portainer/portainerce-api/versions/c0b0975cd11b/schema)
