---
title: "获取PV列表"
method: GET
path: "/k8s/cluster/{id}/pvs"
tags: ["K8s存储管理-PV"]
---

# 获取PV列表

`GET /k8s/cluster/{id}/pvs`

获取集群中的PV列表

## Path parameters

- `id` integer, required

## Headers

- `Authorization` string, required

## Response `200`

OK

- object
  - `code` integer — 状态码
  - `data` object — 返回的数据
    - `pvs` ModelK8sPersistentVolume[]
      - `accessModes` string[] — 访问模式
      - `capacity` string — 总量
      - `claimRef` ModelPVClaimRef
        - `apiVersion` string — API版本
        - `kind` string — 类型
        - `name` string — 名称
        - `namespace` string — 命名空间
        - `uid` string — UID
      - `createdAt` string — 创建时间
      - `labels` object — 标签
      - `mountOptions` string[] — 挂载选项
      - `name` string — PV名称
      - `nodeAffinity` ModelPVNodeAffinity
        - `required` ModelPVNodeSelector
          - `nodeSelectorTerms` ModelPVNodeSelectorTerm[] — 节点选择器条件
            - `matchExpressions` ModelPVNodeSelectorRequirement[] — 匹配表达式
              - …
            - `matchFields` ModelPVNodeSelectorRequirement[] — 匹配字段
              - …
      - `persistentVolumeSource` ModelPVSource
        - `awsElasticBlockStore` ModelPVAWSElasticBlockStoreVolumeSource
          - `fsType` string — 文件系统类型
          - `partition` integer — 分区
          - `readOnly` boolean — 只读
          - `volumeID` string — 卷ID
        - `csi` ModelPVCSIVolumeSource
          - `driver` string — 驱动名称
          - `fsType` string — 文件系统类型
          - `readOnly` boolean — 只读
          - `volumeAttributes` object — 卷属性
          - `volumeHandle` string — 卷句柄
        - `hostPath` ModelPVHostPathVolumeSource
          - `path` string — 主机路径
          - `type` string — 类型
        - `iscsi` ModelPVISCSIVolumeSource
          - `fsType` string — 文件系统类型
          - `iqn` string — IQN
          - `iscsiInterface` string — iSCSI接口
          - `lun` integer — LUN
          - `portals` string[] — 门户列表
          - `readOnly` boolean — 只读
          - `targetPortal` string — 目标门户
        - `local` ModelPVLocalVolumeSource
          - `fsType` string — 文件系统类型
          - `path` string — 本地路径
        - `nfs` ModelPVNFSVolumeSource
          - `path` string — NFS路径
          - `readOnly` boolean — 只读
          - `server` string — NFS服务器
      - `reclaimPolicy` string — 回收策略 Retain/Delete/Recycle
      - `status` string — 状态 Available/Bound/Released/Failed
      - `storageClass` string — 存储类型
      - `volumeMode` string — 卷模式
    - `total` integer
  - `message` string — 提示信息

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.net/opsre/apis/devops.md) · [All operations](https://skmtc.net/opsre/apis/devops/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opsre/devops/revisions/25cac8835c4c/schema)
