Deleting a PV (Discarded)
Function
This API is used to delete a PV from a specified namespace. Using this API, you can determine whether to retain the cloud storage associated with the PV. This API has been discarded. Use the corresponding Kubernetes PV API instead.
The URL for storage management is in the format of https://{clusterid}.Endpoint/uri. In the URL, {clusterid} indicates a cluster ID, and uri indicates the resource path, that is, the path for API access. If https://Endpoint/uri is used, the X-Cluster-ID parameter must be specified in the request header.
Calling Method
For details, see Calling APIs.
Authorization
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see the required permissions in Permissions Policies and Supported Actions.
- If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.
URI
DELETE /api/v1/cloudpersistentvolumes/{name}
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Name of the PV to be deleted. Name format: Volume name[?deleteVolume=BOOLEAN&storageType=Cloud storage volume type]. The content in square brackets can be omitted. Examples:
In the first example: deleteVolume: Whether to delete associated backend cloud storage after the PV is deleted. The value can be true or false and defaults to false. If it is set to true, it indicates that the associated backend cloud storage is deleted along with the PV. If it is set to false, it indicates that the associated backend cloud storage is not deleted along with the PV.
NOTE:
If the storage volume type is efs, this parameter must be set to false. storageType: Cloud storage volume type. This parameter is used together with deleteVolume. This means that deleteVolume and storageType must be configured simultaneously.
NOTE:
|
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
Content-Type |
Yes |
String |
The request body type or format Possible values:
|
|
X-Auth-Token |
Yes |
String |
Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details about how to obtain a token, see Authentication. Maximum length: 16,384 characters |
|
X-Cluster-ID |
No |
String |
Cluster ID. This parameter is mandatory when the URL format https://Endpoint/uri is used. For details about how to obtain the value, see How to Obtain Parameters in the API URI. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
apiVersion |
String |
API version. The value is fixed at v1. Default value: v1 |
|
kind |
String |
API type. The value is fixed at PersistentVolume. Default value: PersistentVolume |
|
metadata |
PersistentVolumeMetadata object |
PV metadata information. |
|
spec |
PersistentVolumeSpec object |
PV specifications. |
|
status |
PersistentVolumeStatus object |
PV status information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
PV name. Enter 1 to 253 characters that start and end with a letter or digit. Only lowercase letters, digits, hyphens (-), and periods (.) are allowed. PV names must be unique in a namespace. |
|
labels |
Map<String,String> |
PV labels, in the format of key-value pairs.
Example label: "foo": "bar" |
|
Parameter |
Type |
Description |
|---|---|---|
|
flexVolume |
FlexVolume object |
FlexVolume storage plug-in of Kubernetes. |
|
persistentVolumeReclaimPolicy |
String |
PV reclaim policy. Possible values:
|
|
accessModes |
Array of strings |
Access mode of the PV.
|
|
Parameter |
Type |
Description |
|---|---|---|
|
driver |
String |
Name of the FlexVolume storage plug-in. Set this parameter based on the storage volume type.
|
|
fsType |
String |
File system type. Set this parameter based on the storage volume type.
|
|
options |
Options object |
FlexVolume configuration items. |
|
Parameter |
Type |
Description |
|---|---|---|
|
fsType |
String |
File system type. Set this parameter based on the storage volume type.
|
|
region |
String |
Region where the cloud storage is located. |
|
volumeID |
String |
UUID of the cloud storage. If the cloud storage is an OBS bucket, set this parameter to the bucket name. |
|
storageType |
String |
Cloud storage volume type.
|
|
Parameter |
Type |
Description |
|---|---|---|
|
accessModes |
Array of strings |
Access mode of a PV |
|
phase |
String |
PV status. Possible values:
|
Example Requests
None
Example Responses
Status code: 200
The job for deleting a PV has been delivered.
{
"kind" : "PersistentVolume",
"apiVersion" : "v1",
"metadata" : {
"name" : "pv-test",
"selfLink" : "/api/v1/persistentvolumes/pv-test",
"uid" : "0d93181d-3628-11e7-9093-fa163e8c373b",
"resourceVersion" : "180886",
"creationTimestamp" : "2017-05-11T08:58:51Z",
"labels" : {
"app" : "test"
}
},
"spec" : {
"flexVolume" : {
"driver" : "huawei.com/fuxivol",
"fsType" : "ext4",
"options" : {
"fsType" : "ext4",
"kubernetes.io/namespace" : "default",
"volumeID" : "0781b22f-4d89-4e9c-b026-80e545cea16c"
}
},
"capacity" : {
"storage" : "1Gi"
},
"accessModes" : [ "ReadWriteMany" ],
"persistentVolumeReclaimPolicy" : "Delete"
},
"status" : {
"phase" : "Available"
}
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
The job for deleting a PV has been delivered. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot