• Cloud Container Engine

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

Replacing the Status of a Specified PersistentVolumeClaim

Function

This API is used to replace the status of a specified PersistentVolumeClaim object under a specified Namespace.

The following fields can be updated:

  • status.phase

URI

PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status

Table 1 describes the parameters of this API.

Table 1 Parameter description

Parameter

Mandatory

Description

name

Yes

Name of the PersistentVolumeClaim.

namespace

Yes

Object name and auth scope, such as for teams and projects.

pretty

No

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

Request

Request parameters:

For the description about request parameters, see Table 2.

Example request:

{
    "apiVersion": "v1",
    "kind": "PersistentVolumeClaim",
    "metadata": {
        "labels": {
            "app": "mysql"
        },
        "name": "db-mysql-0",
        "namespace": "default"
    },
    "spec": {
        "accessModes": [
            "ReadWriteOnce"
        ],
        "volumeName": "pv-test2",
        "resources": {
            "requests": {
                "storage": "1Gi"
            }
        }
    },
    "status": {
        "phase": "Pending"
    }
}

Response

Response parameters:

For the description about response parameters, see 14.2-Table2 Request parameters.

Example response:

{
  "kind": "PersistentVolumeClaim",
  "apiVersion": "v1",
  "metadata": {
    "name": "db-mysql-0",
    "namespace": "default",
    "selfLink": "/api/v1/namespaces/default/persistentvolumeclaims/db-mysql-0/status",
    "uid": "85c56d5c-24e6-11e7-9c83-fa163ec08232",
    "resourceVersion": "1920383",
    "creationTimestamp": "2017-04-19T09:56:56Z",
    "labels": {
      "app": "mysql"
    }
  },
  "spec": {
    "accessModes": [
      "ReadWriteOnce"
    ],
    "resources": {
      "requests": {
        "storage": "1Gi"
      }
    },
    "volumeName": "pv-test2"
  },
  "status": {
    "phase": "Pending"
  }
}

Status Code

Table 2 describes the status code of this API.

Table 2 Status code

Status Code

Description

200

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

For the description about status codes, see Status Codes.