文档首页> 云容器引擎 CCE> API参考> Kubernetes API> PersistentVolume> 替换指定的PersistentVolume的状态
更新时间:2022-04-18 GMT+08:00
分享

替换指定的PersistentVolume的状态

功能介绍

该API用于替换指定的PersistentVolume对象的状态。

其中以下字段支持更新:

  • status.phase

URI

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

表1 描述该API的参数。

表1 参数描述

参数

是否必选

描述

name

Yes

Name of the PersistentVolume.

pretty

No

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

请求消息

请求参数:

请求参数的详细描述请参见表2

请求示例:

{
    "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": [
            "ReadWriteMany"
        ],
        "persistentVolumeReclaimPolicy": "Delete"
    },
    "status": {
        "phase": "Bound"
    }
}

响应消息

响应参数:

响应参数的详细描述请参见表2.

响应示例:

{
    "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": [
            "ReadWriteMany"
        ],
        "persistentVolumeReclaimPolicy": "Delete"
    },
    "status": {
        "phase": "Available"
    }
}

状态码

表2描述API的状态码。

表2 状态码

状态码

描述

200

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

异常状态码请参见状态码

分享:

    相关文档

    相关产品

close