Listing All PersistentVolumes
Function
This API is used to list all PersistentVolumes.
URI
GET /api/v1/persistentvolumes
Table 1 describes the parameters of this API.
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
pretty |
No |
If 'true', then the output is pretty printed. |
|
fieldSelector |
No |
A selector to restrict the list of returned objects by their fields. Defaults to everything. |
|
labelSelector |
No |
A selector to restrict the list of returned objects by their labels. Defaults to everything. |
|
includeUninitialized |
No |
If true, partially initialized resources are included in the response. |
|
resourceVersion |
No |
When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. |
|
timeoutSeconds |
No |
Timeout for the list/watch call. |
|
watch |
No |
Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
Request
N/A
Response
Response parameters:
|
Parameter |
Type |
Description |
|---|---|---|
|
apiVersion |
String |
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. |
|
items |
Object |
List of persistent volumes. For details, see Table 2. |
|
kind |
String |
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. |
|
metadata |
ListMeta object |
Standard list metadata. |
|
Parameter |
Type |
Description |
|---|---|---|
|
resourceVersion |
String |
String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. |
|
selfLink |
String |
SelfLink is a URL representing this object. Populated by the system. Read-only. |
Example response:
{
"kind": "PersistentVolumeList",
"apiVersion": "v1",
"metadata": {
"selfLink": "/api/v1/persistentvolumes",
"resourceVersion": "5672912"
},
"items": [
{
"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 4 describes the status code of this API.
|
Status Code |
Description |
|---|---|
|
200 |
This operation succeeds, and a group of PersistentVolume resource objects is returned. |
For the description about error status codes, see Status Code.
Last Article: Replacing the Status of a Specified PersistentVolume
Next Article: Updating a Specified PersistentVolume
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.