Reading a PersistentVolumeClaim
Function
This API is used to read a specified PersistentVolumeClaim.
URI
GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
| Parameter | Description |
|---|---|
| namespace | Object name and auth scope, such as for teams and projects. |
| name | Name of the PersistentVolumeClaim. |
| Parameter | Mandatory | Description |
|---|---|---|
| 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 92.
Example response
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "pvc-test",
"namespace": "test-namespace",
"selfLink": "/api/v1/namespaces/namespace-test/persistentvolumeclaims/pvc-test",
"uid": "19a355cc-b26e-11e8-b205-c88d83be759f",
"resourceVersion": "5915795",
"creationTimestamp": "2018-09-07T07:17:38Z",
"annotations": {
"pv.kubernetes.io/bound-by-controller": "yes",
"volume.beta.kubernetes.io/storage-class": "sata",
"volume.beta.kubernetes.io/storage-provisioner": "flexvolume-huawei.com/fuxivol",
"pv.kubernetes.io/bind-completed": "yes"
},
"finalizers": [
"kubernetes.io/pvc-protection"
],
"enable": true
},
"spec": {
"accessModes": [
"ReadWriteMany"
],
"resources": {
"requests": {
"storage": "10Gi"
}
},
"volumeName": "pvc-19a355cc-b26e-11e8-b205-c88d83be759f"
},
"status": {
"phase": "Bound",
"accessModes": [
"ReadWriteMany"
],
"capacity": {
"storage": "10Gi"
}
}
} Status Code
Table 3 describes the status code of this API.
| Status Code | Description |
|---|---|
| 200 | This operation succeeds, and a PersistentVolumeClaim resource object is returned. |
For more status codes, see Status Codes.
Last Article: Creating a PersistentVolumeClaim
Next Article: Listing PersistentVolumeClaims
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.