• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference
  4. PersistentVolume (Native Kubernetes APIs)
  5. Replacing the Status of a Specified PersistentVolume

Replacing the Status of a Specified PersistentVolume

Function

This API is used to replace the status of a specified PersistentVolume object.

The following fields can be updated:

  • status.phase

URI

PUT /api/v1/persistentvolumes/{name}/status

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.

Request

Request parameters:

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

Example request:

{
    "kind": "PersistentVolume",
    "apiVersion": "v1",
    "metadata": {
        "name": "pv-test",
        "selfLink": "/api/v1/persistentvolumes/pv-test",
        "uid": "e0b9c5e3-fcfc-11e7-9c3c-fa163eb8ad1a",
        "resourceVersion": "189565",
        "creationTimestamp": "2018-01-19T09:41:09Z",
        "labels": {
            "app": "test"
        }
    },
    "spec": {
        "capacity": {
            "storage": "1Gi"
        },
        "hostPath": {
            "path": "/home"
        },
        "accessModes": [
            "ReadWriteOnce"
        ],
        "persistentVolumeReclaimPolicy": "Recycle"
    },
    "status": {
        "phase": "Bound"
    }
}

Response

Response parameters:

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

Example response:

{
    "kind": "PersistentVolume",
    "apiVersion": "v1",
    "metadata": {
        "name": "pv-test",
        "namespace": "default",
        "selfLink": "/api/v1/namespaces/default/persistentvolumes/pv-test",
        "uid": "e0b9c5e3-fcfc-11e7-9c3c-fa163eb8ad1a",
        "resourceVersion": "599899",
        "creationTimestamp": "2018-01-19T09:41:09Z",
        "labels": {
            "name": "pv-test"
        },
        "enable": true
    },
    "spec": {
        "capacity": {
            "storage": "1Gi"
        },
        "hostPath": {
            "path": "/home"
        },
        "accessModes": [
            "ReadWriteOnce"
        ],
        "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.