• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. Kubernetes API
  5. PersistentVolume
  6. Reading a Specified PersistentVolume

Reading a Specified PersistentVolume

Function

This API is used to read a specified PersistentVolume object.

URI

GET /api/v1/persistentvolumes/{name}

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

name

Yes

Name of the PersistentVolume.

pretty

No

If 'true', then the output is pretty printed.

exact

No

Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.

export

No

Should this value be exported. Export strips fields that a user cannot specify.

Request

N/A

Response

Response parameters:

For the description about request parameters, see the parameter description in Table 2.

Example response:

{
    "kind": "PersistentVolume",
    "apiVersion": "v1",
    "metadata": {
        "name": "pv-test",
        "selfLink": "/api/v1/persistentvolumes/pv-test",
        "uid": "007c8f1c-2363-11e7-9c83-fa163ec08232",
        "resourceVersion": "1736298",
        "creationTimestamp": "2017-04-17T11:42:57Z",
        "labels": {
            "app": "test"
        }
    },
    "spec": {
        "capacity": {
            "storage": "1Gi"
        },
        "hostPath": {
            "path": "/home"
        },
        "accessModes": [
            "ReadWriteMany"
        ],
        "persistentVolumeReclaimPolicy": "Recycle"
    },
    "status": {
        "phase": "Available"
    }
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

This operation succeeds, and a PersistentVolume resource object is returned.

For the description about status codes, see Status Codes.