Reading a Specified PersistentVolume
Function
This API is used to read a specified PersistentVolume.
URI
GET /api/v1/persistentvolumes/{name}
Table 1 describes the parameters of this API.
|
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 response parameters, see Table 2.
Example response:
{
"kind": "PersistentVolume",
"apiVersion": "v1",
"metadata": {
"name": "pv-test-02",
"namespace": "default",
"selfLink": "/api/v1/namespaces/default/persistentvolumes/pv-test-02",
"uid": "98efd6aa-920a-11e8-81cc-fa163e49263c",
"resourceVersion": "5672676",
"creationTimestamp": "2018-07-28T02:04:44Z",
"labels": {
"failure-domain.beta.kubernetes.io/region": "cn-north-4",
"failure-domain.beta.kubernetes.io/zone": "cn-north-4a",
"name": "pv-test-02"
},
"annotations": {
"volume.beta.kubernetes.io/storage-class": "sata",
"volume.beta.kubernetes.io/storage-provisioner": "flexvolume-huawei.com/fuxivol"
}
},
"spec": {
"capacity": {
"storage": "10Gi"
},
"hostPath": {
"path": "/home",
"type": ""
},
"accessModes": [
"ReadWriteMany"
],
"persistentVolumeReclaimPolicy": "Delete"
},
"status": {
"phase": "Available"
}
}
Status Code
Table 2 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a PersistentVolume resource object is returned. |
For the description about error status codes, see Status Code.
Last Article: Deleting All PersistentVolumes
Next Article: Replacing a Specified PersistentVolume
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.