API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a...

108
Volume Backup Service API Reference Issue 11 Date 2018-05-15 HUAWEI TECHNOLOGIES CO., LTD.

Transcript of API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a...

Page 1: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Volume Backup Service

API Reference

Issue 11

Date 2018-05-15

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Copyright © Huawei Technologies Co., Ltd. 2018. All rights reserved.No part of this document may be reproduced or transmitted in any form or by any means without prior writtenconsent of Huawei Technologies Co., Ltd. Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei and thecustomer. All or part of the products, services and features described in this document may not be within thepurchase scope or the usage scope. Unless otherwise specified in the contract, all statements, information,and recommendations in this document are provided "AS IS" without warranties, guarantees orrepresentations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

Bantian, LonggangShenzhen 518129People's Republic of China

Website: http://www.huawei.com

Email: [email protected]

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

i

Page 3: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Contents

1 API Calling..................................................................................................................................... 11.1 Service Usage................................................................................................................................................................. 11.2 Request Methods............................................................................................................................................................ 21.3 Request Authentication Methods....................................................................................................................................21.4 Token Authentication......................................................................................................................................................21.5 AK/SK Authentication................................................................................................................................................... 31.5.1 AK and SK Generation................................................................................................................................................31.5.2 Request Signing Procedure..........................................................................................................................................41.5.3 Sample Code................................................................................................................................................................41.6 Obtaining a Project ID..................................................................................................................................................12

2 Common Message Headers....................................................................................................... 132.1 Common Request Headers........................................................................................................................................... 132.2 Common Response Headers.........................................................................................................................................15

3 Volume Backup Service............................................................................................................. 163.1 Creating a VBS Backup................................................................................................................................................163.2 Deleting a VBS Backup (Deprecated)..........................................................................................................................193.3 Restoring a Disk Using a VBS Backup........................................................................................................................ 213.4 Creating a VBS Backup (Native OpenStack API)....................................................................................................... 233.5 Querying Summary Information About VBS Backups (Native OpenStack API)........................................................263.6 Querying Details About VBS Backups (Native OpenStack API)................................................................................293.7 Querying Details About a VBS Backup (Native OpenStack API)...............................................................................343.8 Querying the Job Status................................................................................................................................................373.9 Deleting a VBS Backup (Native OpenStack API)....................................................................................................... 393.10 Restoring a Disk Using a VBS Backup (Native OpenStack API)..............................................................................413.11 Creating a Backup Share.............................................................................................................................................433.12 Deleting a Backup Share............................................................................................................................................ 463.13 Querying Backup Shares............................................................................................................................................ 473.14 Counting Backup Shares............................................................................................................................................ 523.15 Querying Details About a Backup Share....................................................................................................................54

4 Backup Policy............................................................................................................................... 584.1 Creating a Backup Policy............................................................................................................................................. 584.2 Querying Backup Policies............................................................................................................................................ 62

Volume Backup ServiceAPI Reference Contents

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

ii

Page 4: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

4.3 Modifying a Backup Policy..........................................................................................................................................654.4 Deleting a Backup Policy............................................................................................................................................. 684.5 Associating Resources with a Backup Policy...............................................................................................................704.6 Disassociating Resources from a Backup Policy......................................................................................................... 734.7 Executing a Backup Policy At Once............................................................................................................................ 754.8 Enabling or Disabling a Backup Policy........................................................................................................................774.9 Querying Backup Jobs Triggered by a Backup Policy................................................................................................. 774.10 Adding a Tag for a Backup Policy..............................................................................................................................814.11 Deleting a Tag of a Backup Policy............................................................................................................................. 834.12 Querying All Backup Policy Tags.............................................................................................................................. 854.13 Querying the Tags of a Backup Policy....................................................................................................................... 874.14 Batch Updating or Deleting Tags of a Backup Policy................................................................................................894.15 Querying a Backup Policy Using Tags.......................................................................................................................92

A Appendix......................................................................................................................................96A.1 Error Codes..................................................................................................................................................................96

B Change History..........................................................................................................................102

Volume Backup ServiceAPI Reference Contents

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

iii

Page 5: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

1 API Calling

Application programming interface (API) requests sent by third-party applications to publiccloud services must be authenticated using signatures.

This chapter describes the signature usage procedure, provides sample code to illustrate howto use the default signer to sign requests and how to use the HTTP client to send requests.

1.1 Service Usage

1.2 Request Methods

1.3 Request Authentication Methods

1.4 Token Authentication

1.5 AK/SK Authentication

1.6 Obtaining a Project ID

1.1 Service UsagePublic cloud services provide RESTful APIs.

Representational State Transfer (REST) allocates Uniform Resource Identifiers (URIs) todispersed resources so that resources can be located. Applications on clients use UniformResource Locators (URLs) to obtain resources.

The URL is in the following format: https://Endpoint/uri

Table 1-1 describes the parameters in a URL.

Table 1-1 Parameter description

Parameter Description

Endpoint Specifies the URL that is the entry point for a web service. Obtainthe value from Regions and Endpoints.

URI Specifies the API access path for performing a specified operation.Obtain the value from the URI of the API, for example, v3/auth/tokens.

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

1

Page 6: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

1.2 Request MethodsThe HTTP protocol defines request methods, such as GET, PUT, POST, DELETE, andPATCH, to indicate the desired action to be performed on the identified resource. Thefollowing table describes the HTTP methods supported by the RESTful APIs.

Table 1-2 HTTPS methods

Method Description

GET The GET method requests a representation of the specified resource.

PUT The PUT method requests that the enclosed entity be stored under thesupplied URI.

POST The POST method requests that the server accept the entity enclosed in therequest as a new subordinate of the web resource identified by the URI.

DELETE The DELETE method deletes the specified resource, for example, anobject.

PATCH The PATCH method applies partial modifications to a resource.If the resource does not exist, the PATCH method creates a resource.

1.3 Request Authentication MethodsYou can use either of the following two authentication methods to call APIs:

l Token authentication: Requests are authenticated using Tokens.l AK/SK authentication: Requests are encrypted using the access key (AK) and secret key

(SK) to provide higher security.

1.4 Token Authentication

Scenarios

If you use a token for authentication, you must obtain the user's token and add X-Auth-Tokento the request message header of the service API when making an API call.

This section describes how to make an API call for token authentication.

Make an API Call1. Send POST https://Endpoint of IAM/v3/auth/tokens to obtain the endpoint of IAM and

the region name in the message body.See Regions and Endpoints.If the service region name is ALL, replace Endpoint of IAM with the endpoint of CNNorth-Beijing1.

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

2

Page 7: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

An example request message is as follows:

NOTE

Replace the items in italic in the following example with actual ones. For details, see the Identityand Access Management API Reference.

{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "password", "domain": { "name": "domainname" } } } }, "scope": { "project": { "id": "0215ef11e49d4743be23dd97a1561e91" //This ID is used as an example. } } }}

2. Obtain the token. For details, see section "Obtaining the User Token" in the Identity andAccess Management API Reference.

3. Make a call to a service API, add X-Auth-Token to the message header, and set thevalue of X-Auth-Token to the token obtained in step 2.

1.5 AK/SK AuthenticationWhen you use API Gateway to send requests to underlying services, the requests are signedusing the AK and SK.

NOTE

AK: indicates the ID of the access key. AK is used together with SK to obtain an encrypted signature fora request.

SK: indicates the secret access key together used with the access key ID to sign requests. AK and SKcan be used together to identify a request sender to prevent the request from being modified.

When the AK/SK of a user under a domain is used, add X-Domain-Id to the header and set itto the user's domain ID.

1.5.1 AK and SK Generation1. Log in to the management console.2. Hover the mouse over the username and select Basic Information from the drop-down

list.3. On the Account Info page, click Manage after Security Credentials.

4. On the My Credential page, click Access Keys.5. Click Add Access Key.

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

3

Page 8: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

6. Enter the current login password.7. Enter the authentication code received in the email or mobile phone.

NOTE

For users created in Identity and Access Management (IAM), if no email address or mobile phoneis filled during the user creation, you only need to authenticate the login password.

8. Click OK to download the access key.

NOTE

To prevent the access key from being leaked, keep it secure.

1.5.2 Request Signing Procedure

Preparations1. Download the API Gateway signature tool.

Download path: http://esdk.huawei.com/ilink/esdk/download/HW_4567062. Extract the package.3. Create a Java project, and reference the extracted JAR to the dependency path.

Sign a Request1. Create a request com.cloud.sdk.DefaultRequest (JAVA) used for signing.2. Set the target API URL, HTTPS method, and content of request

com.cloud.sdk.DefaultRequest (JAVA).3. Sign request com.cloud.sdk.DefaultRequest (JAVA).

a. Call SignerFactory.getSigner(String serviceName, String regionName) to obtaina signing tool.

b. Call Signer.sign(Request<?> request, Credentials credentials) to sign the requestcreated in step 1.The following code shows the details://Select an algorithm for request signing.Signer signer = SignerFactory.getSigner(serviceName, region);//Sign the request. The request will change after the signing.signer.sign(request, new BasicCredentials(this.ak, this.sk));

4. Convert the request signed in the previous step to a new request that can be used to makean API call and copy the header of the signed request to the new request.For example, if Apache HttpClient is used, convert DefaultRequest to HttpRequestBaseand copy the header of the signed DefaultRequest to HttpRequestBase.For details, see descriptions of AccessServiceImpl.java in section 1.5.3 Sample Code.

1.5.3 Sample CodeThe following three types of code show how to sign a request and how to use an HTTP clientto send an HTTPS request:

AccessService: indicates the abstract class that converts the GET, POST, PUT, and DELETEmethods in to the access method.

Demo: indicates the execution entry used to simulate GET, POST, PUT, and DELETE requestsending.

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

4

Page 9: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

AccessServiceImpl: indicates the implementation of the access method. Code required forAPI gateway communication is in the access method.

For details about region and serviceName in the following code, see Regions andEndpoints.

AccessService.java:

package com.cloud.apigateway.sdk.demo;

import java.io.InputStream;import java.net.URL;import java.util.Map;

import org.apache.http.HttpResponse;

import com.cloud.sdk.http.HttpMethodName;

public abstract class AccessService { protected String serviceName = null; protected String region = null; protected String ak = null; protected String sk = null; public AccessService(String serviceName, String region, String ak, String sk) { this.region = region; this.serviceName = serviceName; this.ak = ak; this.sk = sk; } public abstract HttpResponse access(URL url, Map<String, String> header, InputStream content, Long contentLength, HttpMethodName httpMethod) throws Exception; public HttpResponse access(URL url, Map<String, String> header, HttpMethodName httpMethod) throws Exception { return this.access(url, header, null, 0l, httpMethod); } public HttpResponse access(URL url, InputStream content, Long contentLength, HttpMethodName httpMethod) throws Exception { return this.access(url, null, content, contentLength, httpMethod); } public HttpResponse access(URL url, HttpMethodName httpMethod) throws Exception { return this.access(url, null, null, 0l, httpMethod); } public abstract void close(); public String getServiceName() { return serviceName; } public void setServiceName(String serviceName) { this.serviceName = serviceName; } public String getRegion() { return region; }

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

5

Page 10: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

public void setRegion(String region) { this.region = region; } public String getAk() { return ak; } public void setAk(String ak) { this.ak = ak; } public String getSk() { return sk; } public void setSk(String sk) { this.sk = sk; } }

AccessServiceImpl.java:

package com.cloud.apigateway.sdk.demo;

import java.io.IOException;import java.io.InputStream;import java.net.URISyntaxException;import java.net.URL;import java.util.HashMap;import java.util.Map;

import javax.net.ssl.SSLContext;

import org.apache.http.Header;import org.apache.http.HttpHeaders;import org.apache.http.HttpResponse;import org.apache.http.client.methods.HttpDelete;import org.apache.http.client.methods.HttpGet;import org.apache.http.client.methods.HttpHead;import org.apache.http.client.methods.HttpPatch;import org.apache.http.client.methods.HttpPost;import org.apache.http.client.methods.HttpPut;import org.apache.http.client.methods.HttpRequestBase;import org.apache.http.conn.ssl.AllowAllHostnameVerifier;import org.apache.http.conn.ssl.SSLConnectionSocketFactory;import org.apache.http.conn.ssl.SSLContexts;import org.apache.http.conn.ssl.TrustSelfSignedStrategy;import org.apache.http.entity.InputStreamEntity;import org.apache.http.impl.client.CloseableHttpClient;import org.apache.http.impl.client.HttpClients;

import com.cloud.sdk.DefaultRequest;import com.cloud.sdk.Request;import com.cloud.sdk.auth.credentials.BasicCredentials;import com.cloud.sdk.auth.signer.Signer;import com.cloud.sdk.auth.signer.SignerFactory;import com.cloud.sdk.http.HttpMethodName;

public class AccessServiceImpl extends AccessService {

private CloseableHttpClient client = null;

public AccessServiceImpl(String serviceName, String region, String ak, String sk) { super(serviceName, region, ak, sk); }

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

6

Page 11: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

/** {@inheritDoc} */

public HttpResponse access(URL url, Map<String, String> headers, InputStream content, Long contentLength, HttpMethodName httpMethod) throws Exception {

// Make a request for signing. Request request = new DefaultRequest(this.serviceName); try { // Set the request address. request.setEndpoint(url.toURI());

String urlString = url.toString();

String parameters = null;

if (urlString.contains("?")) { parameters = urlString.substring(urlString.indexOf("?") + 1); Map parametersmap = new HashMap<String, String>(); if (null != parameters && !"".equals(parameters)) { String[] parameterarray = parameters.split("&"); for (String p : parameterarray) { String key = p.split("=")[0]; String value = p.split("=")[1]; parametersmap.put(key, value); } request.setParameters(parametersmap); } }

} catch (URISyntaxException e) { // It is recommended to add logs in this place. e.printStackTrace(); } // Set the request method. request.setHttpMethod(httpMethod); if (headers != null) { // Add request header information if required. request.setHeaders(headers); } // Configure the request content. request.setContent(content);

// Select an algorithm for request signing. Signer signer = SignerFactory.getSigner(serviceName, region); // Sign the request, and the request will change after the signing. signer.sign(request, new BasicCredentials(this.ak, this.sk));

// Make a request that can be sent by the HTTP client. HttpRequestBase httpRequestBase = createRequest(url, null, request.getContent(), contentLength, httpMethod); Map<String, String> requestHeaders = request.getHeaders(); // Put the header of the signed request to the new request. for (String key : requestHeaders.keySet()) { if (key.equalsIgnoreCase(HttpHeaders.CONTENT_LENGTH.toString())) { continue; } httpRequestBase.addHeader(key, requestHeaders.get(key)); }

HttpResponse response = null; SSLContext sslContext = SSLContexts.custom() .loadTrustMaterial(null, new TrustSelfSignedStrategy()) .useTLS().build(); SSLConnectionSocketFactory sslSocketFactory = new SSLConnectionSocketFactory( sslContext, new AllowAllHostnameVerifier());

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

7

Page 12: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

client = HttpClients.custom().setSSLSocketFactory(sslSocketFactory) .build(); // Send the request, and a response will be returned. response = client.execute(httpRequestBase); return response; }

/** * Make a request that can be sent by the HTTP client. * * @param url * specifies the API access path. * @param header * specifies the header information to be added. * @param content * specifies the body content to be sent in the API call. * @param contentLength * specifies the length of the content. This parameter is optional. * @param httpMethod * specifies the HTTP method to be used. * @return specifies the request that can be sent by an HTTP client. */ private static HttpRequestBase createRequest(URL url, Header header, InputStream content, Long contentLength, HttpMethodName httpMethod) {

HttpRequestBase httpRequest; if (httpMethod == HttpMethodName.POST) { HttpPost postMethod = new HttpPost(url.toString());

if (content != null) { InputStreamEntity entity = new InputStreamEntity(content, contentLength); postMethod.setEntity(entity); } httpRequest = postMethod; } else if (httpMethod == HttpMethodName.PUT) { HttpPut putMethod = new HttpPut(url.toString()); httpRequest = putMethod;

if (content != null) { InputStreamEntity entity = new InputStreamEntity(content, contentLength); putMethod.setEntity(entity); } } else if (httpMethod == HttpMethodName.PATCH) { HttpPatch patchMethod = new HttpPatch(url.toString()); httpRequest = patchMethod;

if (content != null) { InputStreamEntity entity = new InputStreamEntity(content, contentLength); patchMethod.setEntity(entity); } } else if (httpMethod == HttpMethodName.GET) { httpRequest = new HttpGet(url.toString()); } else if (httpMethod == HttpMethodName.DELETE) { httpRequest = new HttpDelete(url.toString()); } else if (httpMethod == HttpMethodName.HEAD) { httpRequest = new HttpHead(url.toString()); } else { throw new RuntimeException("Unknown HTTP method name: " + httpMethod); }

httpRequest.addHeader(header); return httpRequest; }

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

8

Page 13: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

@Override public void close() { try { if (client != null) { client.close(); } } catch (IOException e) { // It is recommended to add logs in this place. e.printStackTrace(); } }

}

Demo.java:

package com.cloud.apigateway.sdk.demo;

import java.io.BufferedReader;import java.io.ByteArrayInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.net.MalformedURLException;import java.net.URL;

import org.apache.http.HttpResponse;

import com.cloud.sdk.http.HttpMethodName;

public class Demo {

//replace real region private static final String region = "regionName";

//replace real service name private static final String serviceName = "serviceName";

public static void main(String[] args) {

//replace real AK String ak = "akString"; //replace real SK String sk = "skString";

// get method //replace real url String url = "urlString"; get(ak, sk, url);

// post method //replace real url String postUrl = "urlString"; //replace real body String postbody = "bodyString"; post(ak, sk, postUrl, postbody);

// put method //replace real body String putbody = "bodyString"; //replace real url String putUrl = "urlString"; put(ak, sk, putUrl, putbody);

// delete method //replace real url String deleteUrl = "urlString"; delete(ak, sk, deleteUrl);

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

9

Page 14: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

}

public static void put(String ak, String sk, String requestUrl, String putBody) {

AccessService accessService = null; try { accessService = new AccessServiceImpl(serviceName, region, ak, sk); URL url = new URL(requestUrl); HttpMethodName httpMethod = HttpMethodName.PUT; InputStream content = new ByteArrayInputStream(putBody.getBytes()); HttpResponse response = accessService.access(url, content, (long) putBody.getBytes().length, httpMethod); System.out.println(response.getStatusLine().getStatusCode()); } catch (Exception e) { e.printStackTrace(); } finally { accessService.close(); }

} public static void patch(String ak, String sk, String requestUrl, String putBody) {

AccessService accessService = null; try { accessService = new AccessServiceImpl(serviceName, region, ak, sk); URL url = new URL(requestUrl); HttpMethodName httpMethod = HttpMethodName.PATCH; InputStream content = new ByteArrayInputStream(putBody.getBytes()); HttpResponse response = accessService.access(url, content, (long) putBody.getBytes().length, httpMethod); System.out.println(convertStreamToString(response.getEntity() .getContent())); } catch (Exception e) { e.printStackTrace(); } finally { accessService.close(); }

}

public static void delete(String ak, String sk, String requestUrl) {

AccessService accessService = null;

try { accessService = new AccessServiceImpl(serviceName, region, ak, sk); URL url = new URL(requestUrl); HttpMethodName httpMethod = HttpMethodName.DELETE;

HttpResponse response = accessService.access(url, httpMethod); System.out.println(convertStreamToString(response.getEntity() .getContent())); } catch (Exception e) { e.printStackTrace(); } finally { accessService.close(); }

}

public static void get(String ak, String sk, String requestUrl) {

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

10

Page 15: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

AccessService accessService = null;

try { accessService = new AccessServiceImpl(serviceName, region, ak, sk); URL url = new URL(requestUrl); HttpMethodName httpMethod = HttpMethodName.GET; HttpResponse response; response = accessService.access(url, httpMethod); System.out.println(convertStreamToString(response.getEntity() .getContent())); } catch (Exception e) { e.printStackTrace(); } finally { accessService.close(); }

}

public static void post(String ak, String sk, String requestUrl, String postbody) {

AccessService accessService = new AccessServiceImpl(serviceName, region, ak, sk); URL url = null; try { url = new URL(requestUrl); } catch (MalformedURLException e) { e.printStackTrace(); } InputStream content = new ByteArrayInputStream(postbody.getBytes()); HttpMethodName httpMethod = HttpMethodName.POST; HttpResponse response;

try { response = accessService.access(url, content, (long) postbody.getBytes().length, httpMethod); System.out.println(convertStreamToString(response.getEntity() .getContent())); } catch (Exception e) { e.printStackTrace(); } finally { accessService.close(); } }

private static String convertStreamToString(InputStream is) { BufferedReader reader = new BufferedReader(new InputStreamReader(is)); StringBuilder sb = new StringBuilder();

String line = null; try { while ((line = reader.readLine()) != null) { sb.append(line + "\n"); } } catch (IOException e) { e.printStackTrace(); } finally { try { is.close(); } catch (IOException e) { e.printStackTrace(); } }

return sb.toString(); }

}

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

11

Page 16: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

NOTE

1. Parameters URI, AK, SK, and HTTP METHOD are mandatory.

2. You can use the request.addHeader() method to add header information.

1.6 Obtaining a Project IDA project ID is required for some URLs when an API is called. It can be project_id ortenant_id because project_id has the same meaning as tenant_id in this document. Beforecalling an API, you need to obtain a project ID on the console. The steps are as follows:

1. Log in to the management console.2. Hover the mouse over the username and select Basic Information from the drop-down

list.3. On the Account Info page, click Manage after Security Credentials.

On the My Credential page, view the project ID in the project list.

Figure 1-1 Viewing the project ID

Volume Backup ServiceAPI Reference 1 API Calling

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

12

Page 17: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

2 Common Message Headers

This chapter describes common request and response REST message headers.

2.1 Common Request Headers

2.2 Common Response Headers

2.1 Common Request Headers

Table 2-1 Common request headers

Parameter Description Mandatory Example Value

x-sdk-date Specifies the timewhen the request issent. The time is inYYYYMMDD'T'HHMMSS'Z' format.The value is thecurrent GMT time ofthe system.

NoThis field ismandatory forAK/SKauthentication.

20150907T101459Z

Authorization Specifies theauthenticationinformation.The value can beobtained from therequest signingresult.For details, seesection 1.5.2Request SigningProcedure.

NoThis field ismandatory forAK/SKauthentication.

SDK-HMAC-SHA256Credential=ZIRRKMTWPTQFQI1WKNKB/20150907//ec2/sdk_request,SignedHeaders=content-type;host;x-sdk-date,Signature=55741b610f3c9fa3ae40b5a8021ebf7ebc2a28a603fc62d25cb3bfe6608e1994

Volume Backup ServiceAPI Reference 2 Common Message Headers

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

13

Page 18: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Description Mandatory Example Value

Host Specifies the serverdomain name andport number of theresources beingrequested. The valuecan be obtained fromthe URL of theservice API. Thevalue ishostname[:port]. Ifthe port number isnot specified, thedefault port is used.The default portnumber for https is443.

NoThis field ismandatory forAK/SKauthentication.

code.test.comorcode.test.com:443

Content-Type Specifies the requestbody MIME type.You are advised touse the default valueapplication/json.For interfaces usedto upload objects orimages, the value canvary depending onthe flow type.

Yes application/json

Content-Length Specifies the lengthof the request body.The unit is byte.

No 3495

X-Project-Id Specifies the projectID. Obtain theproject ID byfollowing theinstructions insection 1.6Obtaining a ProjectID.This parameter ismandatory for arequest from a DeCor multi-project user.

NoThis field ismandatory forrequests thatuse AK/SKauthenticationin theDedicatedCloud (DeC)scenario ormulti-projectscenario.

e9993fc787d94b6c886cbaa340f9c0f4

Volume Backup ServiceAPI Reference 2 Common Message Headers

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

14

Page 19: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Description Mandatory Example Value

X-Auth-Token Specifies the usertoken.For details abouthow to obtain thetoken, see section"Obtaining the UserToken" in theIdentity and AccessManagement APIReference. After therequest is processed,the value of X-Subject-Token inthe message headeris the token value.

NoThis field ismandatory fortokenauthentication.

The following is part of anexample token:MIIPAgYJKoZIhvcNAQc-CoIIO8zCCDu8CAQExDTALBglghkgBZQMEAgEwgg1QBgkqhkiG9w0BBwGggg1BBIINPXsidG9rZ.

NOTE

For details about other parameters in the message header, see the HTTP protocol documentation.

2.2 Common Response Headers

Table 2-2 Common response headers

Name Description Example Value

Content-Length Specifies the length of the response body.The unit is byte.

-

Date Specifies the GMT time when a requestresponse is returned.

Wed, 27 Dec 201606:49:46 GMT

Content-Type Specifies the response body MIME type. application/json

Volume Backup ServiceAPI Reference 2 Common Message Headers

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

15

Page 20: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

3 Volume Backup Service

3.1 Creating a VBS Backup

3.2 Deleting a VBS Backup (Deprecated)

3.3 Restoring a Disk Using a VBS Backup

3.4 Creating a VBS Backup (Native OpenStack API)

3.5 Querying Summary Information About VBS Backups (Native OpenStack API)

3.6 Querying Details About VBS Backups (Native OpenStack API)

3.7 Querying Details About a VBS Backup (Native OpenStack API)

3.8 Querying the Job Status

3.9 Deleting a VBS Backup (Native OpenStack API)

3.10 Restoring a Disk Using a VBS Backup (Native OpenStack API)

3.11 Creating a Backup Share

3.12 Deleting a Backup Share

3.13 Querying Backup Shares

3.14 Counting Backup Shares

3.15 Querying Details About a Backup Share

3.1 Creating a VBS Backup

Function

This interface is used to create a VBS backup.

URIl URI format

POST /v2/{tenant_id}/cloudbackups

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

16

Page 21: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

Requestl Parameter description

Parameter

Mandatory

Type Description

backup Yes dict Backup to be created

volume_id Yes string ID of the disk to be backed up

snapshot_id

No string Snapshot ID of the disk to be backed up

name Yes string Backup name. The value is a string of 1 to 64characters that can contain digits, letters,underscores (_), and hyphens (-).

description

No string Backup description. The value is a string of 1to 64 characters and cannot contain the less-than sign (<) or greater-than sign (>).

tags No list<dict> List of tags to be configured for the backupresources

key Yes string Tag key. The value can contain up to 36characters that do not include non-printableASCII characters (0–31) and the followingspecial characters: =*<>,\|/

value Yes string Tag value. The value can contain 0 to 43characters that do not include non-printableASCII characters (0–31) and the followingspecial characters: =*<>,\|/

NOTE

When you use Constant Restore for the first time and the to-be-restored disk has been backed upbefore the feature is enabled, you need to perform a full backup on the disk on the console. Afterdoing this, the disk backups generated through APIs will support this feature.

l Example request{ "backup": { "volume_id": "c68ae7fb-0aa5-4a97-ab01-ed02c5b7e768", "snapshot_id": null, "name": "backup1", "description": "Backup_Demo", "tags":[{ "key":"key", "value":"value"

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

17

Page 22: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

}] }}

Responsel Parameter description

Parameter

Mandatory

Type Description

job_id No string Job ID

message No string Error message returned after an error occurs

code No string Error code returned after an error occursFor details about error codes, see A.1 ErrorCodes.

l Example response

{"job_id": "70a599e0-31e7-49b7-b260-868f441e862b"}or{"error": {"message": "XXXX","code": "XXX"}}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

18

Page 23: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.2 Deleting a VBS Backup (Deprecated)

Function

This interface is used to delete a VBS backup.

URIl URI format

POST /v2/{tenant_id}/cloudbackups/{backup_id}l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

backup_id Yes ID of the backup to bedeleted

Request

None

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

19

Page 24: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Responsel Parameter description

Parameter

Mandatory

Type Description

job_id No string Job ID

message No string Error message returned after an error occurs

code No string Error code returned after an error occursFor details about error codes, see A.1 ErrorCodes.

l Example response

{"job_id": "70a599e0-31e7-49b7-b260-868f441e862b"}or{"error": {"message": "XXXX","code": "XXX"}}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

20

Page 25: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.3 Restoring a Disk Using a VBS Backup

Function

This interface is used to restore a disk using a VBS backup.

URIl URI format

POST /v2/{tenant_id}/cloudbackups/{backup_id}/restore

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

backup_id Yes ID of the backup used torestore a disk

Requestl Parameter description

Parameter

Mandatory

Type Description

restore Yes dict Operation of restoring the disk using a backup

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

21

Page 26: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter

Mandatory

Type Description

volume_id Yes string ID of the disk to be restored

l Example request{"restore":{"volume_id":"c96e4a94-927a-425c-8795-63f9964cfebd"}}

Responsel Parameter description

Parameter

Mandatory

Type Description

job_id No string Job ID

message No string Error message returned after an error occurs

code No string Error code returned after an error occursFor details about error codes, see A.1 ErrorCodes.

l Example response{"job_id": "70a599e0-31e7-49b7-b260-868f441e862b"}

or{"error": {"message": "XXXX","code": "XXX"}}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

22

Page 27: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.4 Creating a VBS Backup (Native OpenStack API)

Function

This interface is used to create a VBS backup.

URIl URI format

POST /v2/{tenant_id}/backups

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

23

Page 28: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Requestl Parameter description

Parameter

Mandatory

Type Description

backup Yes dict Backup to be created

volume_id Yes string ID of the disk to be backed up

snapshot_id

Yes string Snapshot ID of the disk to be backed up

name No string Backup name, which cannot start with autobk

description

No string Backup description

container No string Backup container. This parameter will beskipped.

incremental

No boolean Whether it is an incremental backup. The valuetrue indicates an incremental backup and falseindicates a full backup. VBS generates a fullbackup for the initial backup operation andincremental backups for subsequent backupoperations. Therefore, this parameter will beskipped.

force No boolean Whether to forcibly back up the attachedvolumes. The value true indicates a forciblebackup and false indicates a non-forciblebackup.

project_id No string Tenant ID

l Example request

{ "backup": { "volume_id": "c68ae7fb-0aa5-4a97-ab01-ed02c5b7e768", "snapshot_id": "2bb856e1-b3d8-4432-a858-09e4ce939389", "name": "backup1", "description": "Backup_Demo" }}

Responsel Parameter description

Parameter

Mandatory

Type Description

backup Yes dict Information about the created backup

id Yes string Backup ID

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

24

Page 29: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter

Mandatory

Type Description

name Yes string Backup name

links Yes list<dict> Information about the backup URL

href Yes string Backup URL

rel Yes string Relationship between the query result and href

l Example response{ "backup": { "id": "54ba0e69-48a0-4a77-9cdf-a7979a7e2648", "links": [ { "href": "https://volume.Region.dc1.domainname.com/v2/5751d8c3f2f6415993ee4326b41630ec/backups/54ba0e69-48a0-4a77-9cdf-a7979a7e2648", "rel": "self" }, { "href": "https://volume.Region.dc1.domainname.com/5751d8c3f2f6415993ee4326b41630ec/backups/54ba0e69-48a0-4a77-9cdf-a7979a7e2648", "rel": "bookmark" } ], "name": "backup1" }}

or{"badRequest": {"code": "XXXX","message": "XXX"}}

Return Valuel Normal

202

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

25

Page 30: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.5 Querying Summary Information About VBS Backups(Native OpenStack API)

Function

This interface is used to query summary information about a VBS backup.

URIl URI format

GET /v2/{tenant_id}/backups

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

l Request filter parameter description

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

26

Page 31: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter

Mandatory

Type Description

name No string Name of the backup to be queried. This parameteris used to query the backups whose names arespecified character strings.

status No string Status of the backup to be queried. This parameteris used to query the backups in a specified state.The value can be available, error, restoring,creating, deleting, or error_deleting.

offset No int Offset of the queried information

limit No int Maximum number of query results that can bereturned

volume_id

No string Disk ID of the backup to be queried. It is used toquery the backups for specific disks.

l Example request

GET /v2/{tenant_id}/backups?name=backup&status=error&limit=10&volume_id=7d7c6fbe-d7ee-4b4d-8bae-bdd08b5604bb

RequestNone

Responsel Parameter description

Parameter Mandatory Type Description

backups Yes list<dict> List of queried backups

id Yes string Backup ID

links Yes list<dict> Backup URL

name No string Backup name

backups_links No list<dict> Specifies that only part of atenant's backup informationis queried, such as query bypage with the limit tablespecified and when thenumber of backups exceeds1000.

href No string Specifies that the URL ofthe last backup is queried.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

27

Page 32: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Type Description

rel No string Relationship between thequery result and href. Thevalue next indicates thatsome backups are notobtained.

l Example response{"backups": [{"id": "1d1139d8-8989-49d3-8aa1-83eb691e6db2","links": [{"href": "http://192.168.82.222:8776/v2/b23b579f08c84228b9b4673c46f0c442/backups/1d1139d8-8989-49d3-8aa1-83eb691e6db2","rel": "self"},{"href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups/1d1139d8-8989-49d3-8aa1-83eb691e6db2","rel": "bookmark"}],"name": null},{"id": "b3cf7a16-decc-4beb-8077-682737d94a58","links": [{"href": "http://192.168.82.222:8776/v2/b23b579f08c84228b9b4673c46f0c442/backups/b3cf7a16-decc-4beb-8077-682737d94a58","rel": "self"},{"href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups/b3cf7a16-decc-4beb-8077-682737d94a58","rel": "bookmark"}],"name": null}],"backups_links": [ { "href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups?limit=1&offset=1&marker=b3cf7a16-decc-4beb-8077-682737d94a58", "rel": "next" } ]}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

28

Page 33: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.6 Querying Details About VBS Backups (NativeOpenStack API)

Function

This interface is used to query the details about VBS backups.

URIl URI format

GET /v2/{tenant_id}/backups/detail

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

29

Page 34: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

l Parameter description of field Request filter

Parameter

Mandatory

Type Description

name No string Name of the backup to be queried. This parameteris used to query the backups whose names arespecified character strings.

status No string Status of the backup to be queried. This parameteris used to query the backups in a specified state.The value can be available, error, restoring,creating, deleting, or error_deleting.

offset No int Offset of the queried information

limit No int Maximum number of query results that can bereturned

volume_id

No string Disk ID of the backup to be queried. It is used toquery the backups for specific disks.

l Example requestGET /v2/{tenant_id}/backups/detail?name=backup&status=error&limit=10&volume_id=7d7c6fbe-d7ee-4b4d-8bae-bdd08b5604bb

Request

None

Responsel Parameter description

Parameter Mandatory

Type Description

backups Yes list<dict> List of queried backups

status Yes string Backup status

description No string Backup description

links Yes list<dict> Backup URL

availability_zone Yes string AZ where the backup resides

volume_id Yes string Source volume ID of the backup

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

30

Page 35: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

fail_reason No string Cause of the backup failure

id Yes string Backup ID

size Yes int Backup size

object_count No int Number of objects on Object StorageService (OBS) for the disk data

container Yes string Container of the backup

name No string Backup name

created_at Yes string Backup creation time

os-bak-tenant-attr:tenant_id

Yes string ID of the tenant to which the backupbelongs

service_metadata No string Backup metadata

updated_at No string Time when the backup was updated

data_timestamp No string Current time

has_dependent_backups

No boolean Whether a dependent backup exists.VBS generates a full backup for theinitial backup operation andincremental backups for subsequentbackup operations. Therefore, thisparameter will be skipped.

snapshot_id No string ID of the snapshot associated with thebackup

is_incremental No boolean Whether the backup is an incrementalbackup. VBS generates a full backupfor the initial backup operation andincremental backups for subsequentbackup operations. Therefore, thisparameter will be skipped.

backups_links No list<dict> Specifies that only part of a tenant'sbackup information is queried, suchas query by page with the limit tablespecified and when the number ofbackups exceeds 1000.

href No string Specifies that the URL of the lastbackup is queried.

rel No string Relationship between the query resultand href. The value next indicatesthat some backups are not obtained.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

31

Page 36: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

l Example response{"backups": [{"status": "error","description": null,"links": [{"href": "http://192.168.82.222:8776/v2/b23b579f08c84228b9b4673c46f0c442/backups/1d1139d8-8989-49d3-8aa1-83eb691e6db2","rel": "self"},{"href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups/1d1139d8-8989-49d3-8aa1-83eb691e6db2","rel": "bookmark"}],"availability_zone": null,"volume_id": "2748f2f2-4394-4e6e-af8d-8dd34496c024","fail_reason": "Connection to swift failed: [Errno 111] ECONNREFUSED","id": "1d1139d8-8989-49d3-8aa1-83eb691e6db2","size": 1,"object_count": null,"container": "volumebackups","name": null,"created_at": "2013-06-27T08:48:03.000000","os-bak-tenant-attr:tenant_id": "b23b579f08c84228b9b4673c46f0c442","service_metadata": " {\"bootable\": false, \"backupurl\": \"58d94782-6509-45ad-9442-970d2a005050\", \"BackupSize\": 0, \"progress\": \"0\", \"snap_id\": \"665e411f5d87431ca98c199fbd4a64fd\", \"Type\": 0} "},{"status": "error","description": null,"links": [{"href": "http://192.168.82.222:8776/v2/b23b579f08c84228b9b4673c46f0c442/backups/80e17946-6e56-46e0-9547-e9ba4f1619bd","rel": "self"},{"href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups/80e17946-6e56-46e0-9547-e9ba4f1619bd","rel": "bookmark"}],"availability_zone": null,"volume_id": "2748f2f2-4394-4e6e-af8d-8dd34496c024","fail_reason": "Connection to swift failed: [Errno 111] ECONNREFUSED","id": "80e17946-6e56-46e0-9547-e9ba4f1619bd","size": 1,"object_count": null,"container": "volumebackups","name": null,"created_at": "2013-06-27T08:56:58.000000"},{"status": "error","description": null,"links": [{"href": "http://192.168.82.222:8776/v2/b23b579f08c84228b9b4673c46f0c442/backups/b3cf7a16-decc-4beb-8077-682737d94a58","rel": "self"},{"href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups/b3cf7a16-decc-4beb-8077-682737d94a58",

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

32

Page 37: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

"rel": "bookmark"}],"availability_zone": null,"volume_id": "2748f2f2-4394-4e6e-af8d-8dd34496c024","fail_reason": "Connection to swift failed: [Errno 111] ECONNREFUSED","id": "b3cf7a16-decc-4beb-8077-682737d94a58","size": 1,"object_count": null,"container": "volumebackups","name": null,"created_at": "2013-06-27T08:46:31.000000"}],"backups_links": [ { "href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups?limit=1&offset=1&marker=b3cf7a16-decc-4beb-8077-682737d94a58", "rel": "next" } ]}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

33

Page 38: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.7 Querying Details About a VBS Backup (NativeOpenStack API)

Function

This interface is used to query details about a VBS backup.

URIl URI format

GET /v2/{tenant_id}/backups/{backup_id}l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

backup_id Yes Backup ID

Request

None

Responsel Parameter description

Parameter Mandatory

Type Description

backup Yes dict List of queried backups

status Yes string Backup status

description No string Backup description

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

34

Page 39: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

links Yes list<dict> Backup URL

availability_zone Yes string AZ where the backup resides

volume_id Yes string Source volume ID of the backup

fail_reason No string Cause of the backup failure

id Yes string Backup ID

size Yes int Backup size

object_count No int Number of objects on OBS for the diskdata

container Yes string Container of the backup

name No string Backup name

created_at Yes string Backup creation time

os-bak-tenant-attr:tenant_id

Yes string ID of the tenant to which the backupbelongs

service_metadata No string Backup metadata

updated_at No string Time when the backup was updated

data_timestamp No string Current time

has_dependent_backups

No boolean Whether a dependent backup exists

snapshot_id No string ID of the snapshot associated with thebackup

is_incremental No boolean Whether the backup is an incrementalbackup

l Example response{"backup": {"status": "error","description": null,"links": [{"href": "http://192.168.82.222:8776/v2/b23b579f08c84228b9b4673c46f0c442/backups/1d1139d8-8989-49d3-8aa1-83eb691e6db2","rel": "self"},{"href": "http://192.168.82.222:8776/b23b579f08c84228b9b4673c46f0c442/backups/1d1139d8-8989-49d3-8aa1-83eb691e6db2","rel": "bookmark"}],"availability_zone": null,

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

35

Page 40: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

"volume_id": "2748f2f2-4394-4e6e-af8d-8dd34496c024","fail_reason": "Connection to swift failed: [Errno 111] ECONNREFUSED","id": "1d1139d8-8989-49d3-8aa1-83eb691e6db2","size": 1,"object_count": null,"container": "volumebackups","name": null,"created_at": "2013-06-27T08:48:03.000000","os-bak-tenant-attr:tenant_id": "b23b579f08c84228b9b4673c46f0c442","service_metadata": " {\"bootable\": false, \"backupurl\": \"58d94782-6509-45ad-9442-970d2a005050\", \"BackupSize\": 0, \"progress\": \"0\", \"snap_id\": \"665e411f5d87431ca98c199fbd4a64fd\", \"Type\": 0} "}}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

36

Page 41: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Error Code

For details, see A.1 Error Codes.

3.8 Querying the Job Status

Function

This interface is used to query the execution status of a job, such as VBS backup creation,VBS backup deletion, and VBS backup-based disk restoration.

URIl URI format

GET /v1/{tenant_id}/jobs/{job_id}l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

job_id Yes Job ID

Request

None

Responsel Parameter description

Parameter Type Mandatory

Description

status string Yes Job statusl SUCCESS: The job is successfully

executed.l RUNNING: The job is in progress.l FAIL: The job failed.l INIT: The job is being initialized.

entities map<string,string>

Yes Response to the job. Each type of job hasdifferent contents.

job_id string Yes Job ID

job_type string Yes Job type

begin_time string Yes Time when the job started

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

37

Page 42: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Type Mandatory

Description

end_time string Yes Time when the job finished

error_code string Yes Error code returned after the jobexecution fails

fail_reason string Yes Cause of the execution failure

message string No Error message returned after an erroroccurs

code string No Error code returned after an error occursFor details about error codes, see A.1Error Codes.

sub_jobs list No Execution information about a sub-job.When no sub-job exists, the value of thisparameter is left blank. The structure ofeach sub-job is similar to that of theparent job.

l Example response

{ "status": "SUCCESS", "entities": { "bks_create_volume_name": "autobk_volume", "backup_id": "ba5401a2-7cd2-4c01-8c0d-c936ab412d6d", "volume_id": "7e5fdc5a-5e36-4b22-8bcc-7f17037290cc", "snapshot_id": "a77a96bf-dd18-40bf-a446-fdcefc1719ec" }, "job_id": "4010b39b5281d3590152874bfa3b1604", "job_type": "bksCreateBackup", "begin_time": "2016-01-28T16:14:09.466Z", "end_time": "2016-01-28T16:25:27.690Z", "error_code": null, "fail_reason": null}or{"error": {"message": "XXXX","code": "XXX"}}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

38

Page 43: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.9 Deleting a VBS Backup (Native OpenStack API)

Function

This interface is used to delete a VBS backup.

URIl URI format

DELETE /v2/{tenant_id}/backups/{backup_id}l Parameter description

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

39

Page 44: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Description

tenant_id Yes Tenant ID

backup_id Yes ID of the backup to bedeleted

Request

None

Responsel Parameter description

Parameter

Mandatory

Type Description

message No string Error message returned after an error occurs

code No int Error code returned after an error occursFor details about error codes, see A.1 ErrorCodes.

l Example response

Noneor{ "itemNotFound": { "message": "Backup 592a0c4d-65a3-4051-8d51-1e2b6401b2d8 could not be found.", "code": 404 } }

Return Valuel Normal

202l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page orresources.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

40

Page 45: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error CodeFor details, see A.1 Error Codes.

3.10 Restoring a Disk Using a VBS Backup (NativeOpenStack API)

FunctionThis interface is used to restore a disk using a VBS backup.

URIl URI formatl POST /v2/{tenant_id}/backups/{backup_id}/restorel Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

backup_id Yes ID of the backup used torestore a disk

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

41

Page 46: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Requestl Parameter description

Parameter

Mandatory

Type Description

restore Yes dict Information about the disk to be restored

volume_id Yes string ID of the disk to be restored

l Example request{ "restore": { "volume_id": "2748f2f2-4394-4e6e-af8d-8dd34496c024" }}

Responsel Parameter description

Parameter Mandatory

Type Description

backup_id Yes Uuid Backup ID

volume_id Yes Uuid Volume ID

volume_name Yes String Volume name

l Example response{ "restore": { "backup_id": "1d1139d8-8989-49d3-8aa1-83eb691e6db2", "volume_id": "2748f2f2-4394-4e6e-af8d-8dd34496c024" "volume_name": "test_volume" }}

Return Valuel Normal

202

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page orresources.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

42

Page 47: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.11 Creating a Backup Share

Function

This interface is used to create a backup share from a backup.

URIl URI format

POST /v2/{project_id}/os-vendor-backup-sharing

l Parameter description

Parameter Mandatory Description

project_id Yes Project ID

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

43

Page 48: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Requestl Parameter description

Parameter Mandatory Type Description

shared Yes dict Information about the backup share

backup_id Yes string ID of the backup to be shared

to_project_ids

Yes list<string> IDs of projects with which the backupis shared

l Example request

{ "shared": { "to_project_ids": [ "722513ed0a324dadaabe5b2d0fe848c9", "722513ed0a324dadaabe5b2d0fe84919" ], "backup_id": "066b1e37-9305-4057-97e5-2e99b21fc71d" }}

Responsel Parameter description

Parameter Mandatory Type Description

shared Yes dict Information about the backup share

backup_id Yes string Backup ID

id Yes string Backup share ID

to_project_id Yes string ID of the project with which thebackup is shared

from_project_id

Yes string ID of the project that shares thebackup

created_at Yes string Creation time of the backup share

updated_at Yes string Update time of the backup share

deleted Yes string Whether the backup has been deleted

deleted_at Yes string Deletion time

l Example response

{ "shared": [ { "backup_id": "066b1e37-9305-4057-97e5-2e99b21fc71d", "deleted": null, "created_at": null, "updated_at": null, "to_project_id": "722513ed0a324dadaabe5b2d0fe848c9", "from_project_id": "c13f5220dc1949b0b741ea81a7cd5554", "deleted_at": null,

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

44

Page 49: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

"id": "8332443e-9866-41d8-8a58-a898cf5db030" } ]}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error CodeFor details, see A.1 Error Codes.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

45

Page 50: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

3.12 Deleting a Backup Share

Function

This interface is used to delete one or all shares of a backup.

URIl URI format

DELETE /v2/{project_id}/os-vendor-backup-sharing/{id}l Parameter description

Parameter Mandatory Description

project_id Yes Project ID

id Yes Backup ID or backupshare ID

l Request filter parameter description

Parameter Mandatory Type Description

is_backup_id

No boolean Whether the ID in the URL is a backupshare ID or a backup ID. The value trueindicates the backup ID, and all backupshares of the backup will be deleted. Thevalue false indicates the backup share ID.

l Example request

Deletes the specified backup share:DELETE /v2/{project_id}/os-vendor-backup-sharing/e842bf23-1e05-4c2c-b0f9-25222f4686daDelete all backup shares of the source backup:DELETE /v2/{project_id}/os-vendor-backup-sharing/e842bf23-1e05-4c2c-b0f9-25222f4686da

Request

None

Response

None

Return Valuel Normal

200l Abnormal

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

46

Page 51: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

3.13 Querying Backup Shares

Function

This interface is used to query backup shares.

URIl URI format

GET /v2/{project_id}/os-vendor-backup-sharing/detail

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

47

Page 52: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

l Parameter description

Parameter Mandatory Description

project_id Yes Project ID

l Request filter parameter description

Parameter Mandatory Type Description

share_to_me

No boolean If this parameter is set to true, thisinterface will list the backups sharedwith the current project. Otherwise, thisinterface will list the backups shared bythe current project.

volume_id No string Volume ID

name No string Backup name. Fuzzy match issupported.

status No string Backup status

backup_id No string Backup ID

from_project_id

No string ID of the project that shares the backup

to_project_id

No string ID of the project with which the backupis shared

avalilability_zone

No string AZ name

sort_dir No string Sorting direction

sort_key No string Sorts by attribute. Possible values arename, status, container_format,disk_format, size, id, created_at, orupdated_at. The default value iscreated_at.

limit No int Number of shares to be queried

offset No int Offset of the query

RequestNone

Responsel Parameter description

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

48

Page 53: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Type Description

shared Yes list<dict> Backup share list

backup_id Yes string Backup ID

created_at Yes string Creation time of the backup share

from_project_id

Yes string ID of the project that shares the backup

id Yes string Backup share ID

to_project_id

Yes string ID of the project with which the backupis shared

updated_at Yes string Update time of the backup share

backup Yes dict Details about the source backup

availability_zone

Yes string AZ where the backup resides

container Yes string Container of the backup

created_at Yes string Backup creation time

data_timestamp

Yes string Current time

description Yes string Backup description

fail_reason Yes string Cause of the backup failure

has_dependent_backup

Yes boolean Whether a dependent backup exists.VBS generates a full backup for theinitial backup operation and incrementalbackups for subsequent backupoperations. Therefore, this parameterwill be skipped.

id Yes string Backup ID

is_incremental

Yes boolean Whether the backup is an incrementalbackup. VBS generates a full backup forthe initial backup operation andincremental backups for subsequentbackup operations. Therefore, thisparameter will be skipped.

name Yes string Backup name

object_count

Yes int Number of objects on OBS for the diskdata

size Yes int Backup size

snapshot_id

Yes string ID of the snapshot associated with thebackup

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

49

Page 54: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Type Description

status Yes string Backup status

updated_at Yes string Update time of the backup

volume_id Yes string Source volume ID of the backup

service_metadata

Yes string Backup metadata

l Example response

{ "shared": [ { "backup": { "availability_zone": "AZ1", "container": null, "created_at": "2017-08-08T04:03:27.456859", "data_timestamp": "2017-08-08T04:03:27.456859", "description": null, "fail_reason": "Invalid InitiatorConnector protocol specified DSWARE", "has_dependent_backups": null, "id": "066b1e37-9305-4057-97e5-2e99b21fc71d", "is_incremental": null, "name": "lbf", "object_count": null, "size": 1, "snapshot_id": null, "status": "available", "updated_at": "2017-08-08T04:03:35.109308", "volume_id": "a7d7783f-02b7-4645-b0e3-61df63f0ba10", "service_metadata": null }, "backup_id": "066b1e37-9305-4057-97e5-2e99b21fc71d", "created_at": "2017-08-10T12:25:40.480424", "from_project_id": "c13f5220dc1949b0b741ea81a7cd5554", "id": "e842bf23-1e05-4c2c-b0f9-25222f4686da", "to_project_id": "722513ed0a324dadaabe5b2d0fe848b9", "updated_at": "2017-08-14T06:41:49.381069" }, { "backup": { "availability_zone": "AZ1", "container": null, "created_at": "2017-08-08T04:03:27.456859", "data_timestamp": "2017-08-08T04:03:27.456859", "description": null, "fail_reason": "Invalid InitiatorConnector protocol specified DSWARE", "has_dependent_backups": null, "id": "066b1e37-9305-4057-97e5-2e99b21fc71d", "is_incremental": null, "name": "lbf", "object_count": null, "size": 1, "snapshot_id": null, "status": "available", "updated_at": "2017-08-08T04:03:35.109308", "volume_id": "a7d7783f-02b7-4645-b0e3-61df63f0ba10", "service_metadata": null }, "backup_id": "066b1e37-9305-4057-97e5-2e99b21fc71d", "created_at": "2017-08-10T12:19:37.318031", "from_project_id": "c13f5220dc1949b0b741ea81a7cd5554",

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

50

Page 55: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

"id": "f842bf23-1e05-4c2c-b0f9-25222f4686da", "to_project_id": "722513ed0a324dadaabe5b2d0fe848a9", "updated_at": null } ]}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

51

Page 56: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

3.14 Counting Backup Shares

Function

This interface is used to count backup shares with conditions.

URIl URI format

GET /v2/{project_id}/os-vendor-backup-sharing/countl Parameter description

Parameter Mandatory Description

project_id Yes Project ID

l Request filter parameter description

Parameter Mandatory Type Description

share_to_me No boolean If this parameter is set to true, thisinterface will list the backups sharedwith the current project. Otherwise,this interface will list the backupsshared by the current project.

volume_id No string Volume ID

name No string Backup name. Fuzzy match issupported.

status No string Backup status

backup_id No string Backup ID

from_project_id

No string ID of the project that shares the backup

to_project_id

No string ID of the project with which thebackup is shared

avalilability_zone

No string AZ name

Request

None

Responsel Parameter description

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

52

Page 57: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Type Description

count Yes int Total count

l Example response{ "count": 2 }

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

53

Page 58: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Error Code

For details, see A.1 Error Codes.

3.15 Querying Details About a Backup Share

Function

This interface is used to query details about a backup share.

URIl URI format

GET /v2/{project_id}/os-vendor-backup-sharing/{id}l Parameter description

Parameter Mandatory Description

project_id Yes Project ID

id Yes Backup share ID

Request

None

Responsel Parameter description

Parameter Mandatory Type Description

shared Yes dict Information about the backup share

backup_id Yes string Backup ID

created_at Yes string Creation time of the backup share

from_project_id

Yes string ID of the project that shares thebackup

id Yes string Backup share ID

to_project_id Yes string ID of the project with which thebackup is shared

updated_at Yes string Update time of the backup share

backup Yes dict Details about the source backup

availability_zone

Yes string AZ where the backup resides

container Yes string Container of the backup

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

54

Page 59: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Type Description

created_at Yes string Backup creation time

data_timestamp

Yes string Current time

description Yes string Backup description

fail_reason Yes string Cause of the backup failure

has_dependent_backup

Yes boolean Whether a dependent backup exists.VBS generates a full backup for theinitial backup operation andincremental backups for subsequentbackup operations. Therefore, thisparameter will be skipped.

id Yes string Backup ID

is_incremental Yes boolean Whether the backup is an incrementalbackup. VBS generates a full backupfor the initial backup operation andincremental backups for subsequentbackup operations. Therefore, thisparameter will be skipped.

name Yes string Backup name

object_count Yes int Number of objects on OBS for thedisk data

size Yes int Backup size

snapshot_id Yes string ID of the snapshot associated with thebackup

status Yes string Backup status

updated_at Yes string Update time of the backup

volume_id Yes string Source volume ID of the backup

service_metadata

Yes string Backup metadata

l Example response

{ "shared": { "backup": { "availability_zone": "AZ1", "container": null, "created_at": "2017-08-08T04:03:27.000000", "data_timestamp": "2017-08-08T04:03:27.000000", "description": null, "fail_reason": "Invalid InitiatorConnector protocol specified DSWARE", "has_dependent_backups": null, "id": "066b1e37-9305-4057-97e5-2e99b21fc71d",

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

55

Page 60: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

"is_incremental": null, "name": "lbf", "object_count": 0, "size": 1, "snapshot_id": null, "status": "available", "updated_at": "2017-08-16T07:24:24.786297", "volume_id": "a7d7783f-02b7-4645-b0e3-61df63f0ba10", "service_metadata": null }, "backup_id": "066b1e37-9305-4057-97e5-2e99b21fc71d", "created_at": "2017-08-22T08:43:16.699374", "from_project_id": "c13f5220dc1949b0b741ea81a7cd5554", "id": "8332443e-9866-41d8-8a58-a898cf5db030", "to_project_id": "722513ed0a324dadaabe5b2d0fe848c9", "updated_at": null }}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

56

Page 61: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error CodeFor details, see A.1 Error Codes.

Volume Backup ServiceAPI Reference 3 Volume Backup Service

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

57

Page 62: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

4 Backup Policy

4.1 Creating a Backup Policy

4.2 Querying Backup Policies

4.3 Modifying a Backup Policy

4.4 Deleting a Backup Policy

4.5 Associating Resources with a Backup Policy

4.6 Disassociating Resources from a Backup Policy

4.7 Executing a Backup Policy At Once

4.8 Enabling or Disabling a Backup Policy

4.9 Querying Backup Jobs Triggered by a Backup Policy

4.10 Adding a Tag for a Backup Policy

4.11 Deleting a Tag of a Backup Policy

4.12 Querying All Backup Policy Tags

4.13 Querying the Tags of a Backup Policy

4.14 Batch Updating or Deleting Tags of a Backup Policy

4.15 Querying a Backup Policy Using Tags

4.1 Creating a Backup Policy

FunctionThis interface is used to create a backup policy. A tenant can create a maximum of 10 backuppolicies.

URIl URI format

POST /v2/{tenant_id}/backuppolicy

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

58

Page 63: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

Requestl Parameter description

Parameter Mandatory

Type Description

backup_policy_name

Yes string Backup policy nameThe name is a string of 1 to 64characters consisting of letters,digits, underscores (_), and hyphens(-). It cannot start with default.

scheduled_policy Yes dict Details about the scheduling policy

start_time Yes string Start time of the backup job. Youneed to convert the local time to theCoordinated Universal Time (UTC),and set the start time to an integralhour point. You can set multipletime points (at integral hours only),and use commas (,) to separate onetime point from another.The value is in the HH:mm format.

frequency No integer Backup interval (1 to 14 days).Select either this parameter orweek_frequency. If you select both,this parameter is used.

week_frequency No list<string> Specifies on which days of eachweek backup jobs are executed. Thevalue can be one or more of thefollowing:SUN, MON, TUE, WED, THU,FRI, SAT

rentention_num No integer Number (minimum: 2) of retainedbackups. Select either this parameteror rentention_day. If you selectboth, this parameter is used.

rentention_day No integer Retention days of backups

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

59

Page 64: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

remain_first_backup_of_curMonth

Yes string Whether to retain the first backup inthe current monthl Yl N

status Yes string Backup policy statusl ONl OFF

tags No list<dict> Tags to be configured for the backuppolicy

key Yes string Tag key. The value can contain up to36 characters that do not includenon-printable ASCII characters (0–31) and the following specialcharacters: =*<>,\|/

value Yes string Tag value. The value can contain 0to 43 characters that do not includenon-printable ASCII characters (0–31) and the following specialcharacters: =*<>,\|/

l Example request

{ "backup_policy_name": "policy_01", "scheduled_policy" : { "remain_first_backup_of_curMonth" : "Y", "rentention_num" : 10, "frequency" : 1, "start_time" : "12:00", "status" : "ON" }, "tags":[{ "key":"key", "value":"value" }]}

Responsel Parameter description

Parameter Mandatory

Type Description

backup_policy_id No string Backup policy ID returned if theoperation is successful

message No string Error message returned after an erroroccurs

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

60

Page 65: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response

{ "backup_policy_id": "af8a20b0-117d-4fc3-ae53-aa3968a4f870"}or{ "error": { "code": "XXXX", "message": "XXX" }}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

61

Page 66: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.2 Querying Backup Policies

Function

This interface is used to query all backup policies of a tenant.

URIl URI format

GET /v2/{tenant_id}/backuppolicyl Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

Request

None

Responsel Parameter description

Parameter Mandatory

Type Description

backup_policies Yes list<dict>

List of backup policies

backup_policy_name Yes string Backup policy name

scheduled_policy Yes dict Details about the scheduling policy

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

62

Page 67: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

start_time Yes string Start time points of the backup jobs,which are expressed in the UTC formatand separated from each other bycommas (,).

frequency Yes integer Backup interval (1 to 14 days)

week_frequency Yes list<string>

Week information list

rentention_num Yes integer Number (minimum: 2) of retainedbackups

rentention_day Yes integer Retention days of backups

remain_first_backup_of_curMonth

Yes string Whether to retain the first backup in thecurrent monthl Yl N

status Yes string Backup policy statusl ONl OFF

backup_policy_id Yes string Backup policy ID

policy_resource_count

Yes integer Number of volumes associated with thebackup policy

message No string Error message returned after an erroroccurs

code No string Error code returned after an error occursFor details about error codes, see A.1Error Codes.

l Example response

{ "backup_policies" : [ { "backup_policy_id" : "XX", "backup_policy_name": "plan01", "scheduled_policy" : { "remain_first_backup_of_curMonth" : "Y", "rentention_num" : 10, "frequency" : 1, "start_time" : "12:00", "status" : "ON" }, "policy_resource_count": 0 }, { "backup_policy_id" : "YY", "backup_policy_name ": "plan02", "scheduled_policy" : {

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

63

Page 68: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

"remain_first_backup_of_curMonth" : "Y", "rentention_num" : 10, "frequency" : 1, "start_time" : "14:00", "status" : "ON" }, "policy_resource_count": 10 }]}or{ "error": { "code": "XXXX", "message": "XXX" }}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

64

Page 69: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error CodeFor details, see A.1 Error Codes.

4.3 Modifying a Backup Policy

FunctionThis interface is used to modify a backup policy.

URIl URI format

PUT /v2/{tenant_id}/backuppolicy/{policy_id}l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

Requestl Parameter description

Parameter Mandatory

Type Description

backup_policy_name

No string Backup policy nameThe name is a string of 1 to 64characters consisting of letters,digits, underscores (_), and hyphens(-). It cannot start with default.The default backup policy cannot berenamed.

scheduled_policy No dict Details about the scheduling policy

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

65

Page 70: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

start_time No string Start time of the backup job. Youneed to convert the local time to theCoordinated Universal Time (UTC),and set the start time to an integralhour point. You can set multipletime points (at integral hours only),and use commas (,) to separate onetime point from another.The value is in the HH:mm format.

frequency No integer Backup interval (1 to 14 days).Select either this parameter orweek_frequency. If you select both,this parameter is used.

week_frequency No list<string> Specifies on which days of eachweek backup jobs are executed. Thevalue can be one or more of thefollowing:SUN, MON, TUE, WED, THU,FRI, SAT

rentention_num No integer Number (minimum: 2) of retainedbackups. Select either this parameteror rentention_day. If you selectboth, this parameter is used.

rentention_day No integer Retention days of backups

remain_first_backup_of_curMonth

No string Whether to retain the first backup inthe current monthl Yl N

status No string Backup policy statusl ONl OFF

l Example request

{ "backup_policy_name": "policy_01", "scheduled_policy" : { "remain_first_backup_of_curMonth" : "Y", "rentention_num" : 10, "frequency" : 1, "start_time" : "12:00", "status" : "ON" }}

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

66

Page 71: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Responsel Parameter description

Parameter Mandatory

Type Description

backup_policy_id No string Backup policy ID returned if theoperation is successful

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "backup_policy_id": "af8a20b0-117d-4fc3-ae53-aa3968a4f870"}

or{ "error": { "code": "XXXX", "message": "XXX" }}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

67

Page 72: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.4 Deleting a Backup Policy

Function

This interface is used to delete a backup policy.

URIl URI format

DELETE /v2/{tenant_id}/backuppolicy/{policy_id}l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

Request

None

Responsel Parameter description

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

68

Page 73: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response

Noneor{ "error": { "code": "XXXX", "message": "XXX" }}

Return Valuel Normal

204l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

69

Page 74: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.5 Associating Resources with a Backup Policy

Function

This interface is used to associate one or more resources with a backup policy.

URIl URI format

POST /v2/{tenant_id}/backuppolicyresourcesl Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

Requestl Parameter description

Parameter Mandatory

Type Description

backup_policy_id Yes string Backup policy ID

resources Yes list<dict> Information about the associatedresource

resource_id Yes string Resource ID

resource_type Yes string Resource typel Volume

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

70

Page 75: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

l Example request{ "backup_policy_id":"915d1fd8-63cb-4054-a2b0-2778210e3a75", "resources":[{ "resource_id":"0f187b65-8d0e-4fc0-9096-3b55d330531e", "resource_type":"volume" },{ "resource_id":"0f187b65-8d0e-4fc0-9096-3b55d330531d", "resource_type":"volume" }]}

Responsel Parameter description

Parameter Mandatory

Type Description

success_resources Yes list<dict>

List of successfully associatedresources

resource_id No string Resource ID

resource_type No string Resource type

availability_zone No string AZ to which the resource belongs

os_vol_host_attr No string Point of delivery (POD) to which theresource belongs

fail_resources Yes list<dict>

List of the resources that fail to beassociated

resource_id No string Resource ID

resource_type No string Resource type

availability_zone No string AZ to which the resource belongs

os_vol_host_attr No string POD to which the resource belongs

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "success_resources": [ { "resource_id": "bce8d47a-af17-4169-901f-4c7ae9f29c2c", "os_vol_host_attr": "pod01.cn-north-1", "availability_zone": "cn-north-1", "resource_type": "volume" } ],

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

71

Page 76: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

"fail_resources": [ ]}or{ "error": { "code": "XXXX", "message": "XXX" }}

Return Valuel Normal

200l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

72

Page 77: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Error Code

For details, see A.1 Error Codes.

4.6 Disassociating Resources from a Backup Policy

Function

This interface is used to disassociate one or more resources from a backup policy.

URIl URI format

POST /v2/{tenant_id}/backuppolicyresources/{policy_id}/deleted_resources

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

Requestl Parameter description

Parameter Mandatory

Type Description

resources Yes list<dict> Information about the associatedresource

resource_id Yes string Resource ID

l Example request{ "resources": [ { "resource_id": "bce8d47a-af17-4169-901f-4c7ae9f29c2c" } ]}

Responsel Parameter description

Parameter Mandatory

Type Description

success_resources Yes list<dict>

List of successfully disassociatedresources

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

73

Page 78: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

resource_id No string Resource ID

fail_resources Yes list<dict>

List of the resources that fail to bedisassociated

resource_id No string Resource ID

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "success_resources": [], "fail_resources": [ { "resource_id": "bbba7509-f457-4732-97f1-a8e24b6ed9bc" }] }

or{ "error": { "code": "XXXX", "message": "XXX" }}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

74

Page 79: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.7 Executing a Backup Policy At Once

Function

This interface is used to back up resources associated with a backup policy at once.

URIl URI format

POST /v2/{tenant_id}/backuppolicy/{policy_id}/action

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

Request

None

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

75

Page 80: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Responsel Parameter description

Parameter Mandatory

Type Description

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response

Noneor{ "error": { "message": "XXXX", "code": "XXX" }}

Return Valuel Normal

204l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

76

Page 81: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.8 Enabling or Disabling a Backup Policy

Function

This interface is used to enable or disable a backup policy. After a backup policy is enabled, itwill be scheduled based on the specified time. After a backup policy is disabled, it will not bescheduled.

Set the backup policy status to ON or OFF. For details, see 4.3 Modifying a Backup Policy.

status Yes string Backup policy statusl ONl OFF

4.9 Querying Backup Jobs Triggered by a Backup Policy

Function

This interface is used to query the status of backup jobs triggered by a backup policy.

URIl URI format

GET /v2/{tenant_id}/backuppolicy/{policy_id}/backuptasks

l Parameter description

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

77

Page 82: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

l Request filter parameter description

Parameter

Mandatory

Type Description

sort_dir No string Sorting order. Possible values are asc (ascending)and desc (descending).

limit No integer Maximum number of query results that can bereturned. The default value is 20.

marker No string Start number from which backup jobs are queried.The value is the backup job ID.

job_id No string Backup job ID

status No string Backup job statusl RUNNINGl EXECUTE_TIMEOUTl WAITINGl EXECUTE_FAILl EXECUTE_SUCCESSl SKIP

sort_key

No string Keyword for sorting query results. The value mustbe created_at.

offset No integer Amount of the offset. The default value is 0.

l Example request

GET /v2/{tenant_id}/backuppolicy/{policy_id}/backuptasks?limit=10

Request

None

Responsel Parameter description

Parameter Mandatory

Type Description

count Yes integer Total number of queried jobs

tasks Yes list<dict>

Details about the backup job

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

78

Page 83: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

status Yes dict Backup job statusl RUNNINGl EXECUTE_TIMEOUTl WAITINGl EXECUTE_FAILl EXECUTE_SUCCESSl SKIP

job_id Yes string Backup job ID

created_at Yes integer Time the backup job was created. Thetime is in UTC format, for example,2016-12-02T09:06:46.706.

finished_at Yes integer Time the backup job was completed.The time is in UTC format, forexample, 2016-12-02T13:00:00.121.

backup_name Yes string Backup name

resource_id Yes string Resource ID

resource_type Yes string Resource type

vbs_job_id No string VBS backup job ID

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "tasks": [ { "status": "RUNNING", "job_id": "0781095c-b8ab-4ce5-99f3-4c5f6ff75319", "created_at": "2016-12-03T06:24:34.467", "backup_name": "autobk_a61d", "resource_id": "f47a4ab5-11f5-4509-97f5-80ce0dd74e37", "resource_type": "volume" }, { "status": "EXECUTE_SUCCESS", "job_id": "c11b5a18-4559-4731-b7b3-58e2bd89cdb9", "created_at": "2016-12-02T09:06:46.706", "finished_at": "2016-12-02T13:00:00.121", "backup_name": "autobk_e6d2", "resource_id": "f47a4ab5-11f5-4509-97f5-80ce0dd74e37", "resource_type": "volume" }

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

79

Page 84: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

], "count": 2}

or{ "error": { "message": "XXXX", "code": "XXX" }}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

80

Page 85: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Error CodeFor details, see A.1 Error Codes.

4.10 Adding a Tag for a Backup Policy

FunctionThis interface is used to add a tag for a backup policy.

URIl URI format

POST /v2/{tenant_id}/backuppolicy/{policy_id}/tagsl Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

Requestl Parameter description

Parameter Mandatory

Type Description

tag Yes dict Tag to be added

key Yes string Tag key. The value can contain up to 36characters that do not include non-printable ASCII characters (0–31) andthe following special characters: =*<>,\|/

value Yes string Tag value. The value can be up to 43characters that do not include non-printable ASCII characters (0–31) andthe following special characters: =*<>,\|/

l Example request{ "tag":{ "key":"0f187b65-8d0e-4fc0-9096-3b55d330531e", "value":"volume" }}

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

81

Page 86: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Responsel Parameter description

Parameter Mandatory

Type Description

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response

{ "error": { "message": "XXXX", "code": "XXX" }}

Return Valuel Normal

204l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

82

Page 87: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.11 Deleting a Tag of a Backup Policy

Function

This interface is used to delete a tag of a backup policy.

URIl URI format

DELETE /v2/{tenant_id}/backuppolicy/{policy_id}/tags/{key}

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

key Yes Tag value, which must beconverted to a URL-encoded string

Requestl Example request

DELETE /v2/{tenant_id}/backuppolicy/{policy_id}/tags/{key}

Responsel Parameter description

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

83

Page 88: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "error": { "message": "XXXX", "code": "XXX" }}

Return Valuel Normal

204

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

84

Page 89: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.12 Querying All Backup Policy Tags

Function

This interface is used to query tags of all backup policies.

URIl URI format

GET /v2/{tenant_id}/backuppolicy/tags

l Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

l Example requestGET /v2/{tenant_id}/backuppolicy/tags

Request

None

Responsel Parameter description

Parameter Mandatory

Type Description

tags Yes list<dict> List of tag details

key Yes string Tag key

values Yes list<string> List of tag values

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

85

Page 90: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "tags": [ { "key": "RUNNING", "values":[ "0781095c-b8ab-4ce5-99f3-4c5f6ff75319", "2016-12-03T06:24:34.467" ] }, { "key": "WAITING", "values":[ "0781095c-b8ab-4ce5-99f3-4c5f6ff75319", "2016-12-03T06:24:34.467" ] } ]}

or{ "error": { "code": "XXXX", "message": "XXX" }}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

86

Page 91: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.13 Querying the Tags of a Backup Policy

Function

This interface is used to query the tags of a specific backup policy.

URIl URI format

GET /v2/{tenant_id}/backuppolicy/{policy_id}/tagsl Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

l Example request

GET /v2/{tenant_id}/backuppolicy/{policy_id}/tags

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

87

Page 92: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Request

None

Responsel Parameter description

Parameter Mandatory

Type Description

tags Yes list<dict> List of tag details

key Yes string Tag key

value Yes string Tag value

message No string Error message returned after an erroroccurs

code No string Error code returned after an error occursFor details about error codes, see A.1Error Codes.

l Example response{ "tags": [ { "key": "RUNNING", "value":"0781095c-b8ab-4ce5-99f3-4c5f6ff75319" }, { "key": "WAITING", "values":"2016-12-03T06:24:34.467" } ]}

or{ "error": { "message": "XXXX", "code": "XXX" }}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

88

Page 93: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error CodeFor details, see A.1 Error Codes.

4.14 Batch Updating or Deleting Tags of a Backup Policy

FunctionThis interface is used to update or delete the tags of a backup policy.

URIl URI format

POST /v2/{tenant_id}/backuppolicy/{policy_id}/tags/actionl Parameter description

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

89

Page 94: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory Description

tenant_id Yes Tenant ID

policy_id Yes Backup policy ID

Requestl Parameter description

Parameter Mandatory

Type Description

action Yes string Operator (case-sensitive). Possible valuesare:create: indicates that a tag will be createdonly when no tag with the same keyexists.update: indicates that a tag will becreated when no tag with the same keyexistsdelete: indicates deleting a tag.

tags Yes list<dict> List of tags you want to operate

key Yes string Tag key. The value can contain up to 36characters that do not include non-printable ASCII characters (0–31) andthe following special characters: =*<>,\|/

value Yes string Tag value The value can be up to 43characters that do not include non-printable ASCII characters (0–31) andthe following special characters: =*<>,\|/

l Example request{ "action":"delete", "tags":[{ "key":"0f187b65-8d0e-4fc0-9096-3b55d330531e", "value":"volume" },{ "key":"0f187b65-8d0e-4fc0-9096-3b55d330531d", "value":"volume" }]}

Responsel Parameter description

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

90

Page 95: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "error": { "message": "XXXX", "code": "XXX" }}

Return Valuel Normal

204

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

91

Page 96: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error Code

For details, see A.1 Error Codes.

4.15 Querying a Backup Policy Using Tags

Function

This interface is used to query a backup policy using tags.

URIl URI format

POST /v2/{tenant_id}/backuppolicy/resource_instances/actionl Parameter description

Parameter Mandatory Description

tenant_id Yes Tenant ID

Request

Request parameter

Parameter Mandatory

Type Description

tags No list<dict> List of included tags. Backups with thesetags will be filtered.

key No string Tag key

values No list<string> List of tag values

tags_any No list<dict> List of tags. Backups with any tags in thislist will be filtered.

key No string Tag key

values No list<string> List of tag values

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

92

Page 97: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

not_tags No list<dict> List of excluded tags. Backups withoutthese tags will be filtered.

key No string Tag key

values No list<string> List of tag values

not_tags_any No list<dict> List of tags. Backups without any of thesetags will be filtered.

key No string Tag key

values No list<string> List of tag values

matches No list<dict> Search criteria. Fuzzy search is supported.

key No string Field for searching. Currently, onlyresource_name is supported.

value No string Search value

limit No string Maximum number of query recordsreturned

offset No string Query offset

action Yes string Operator. Possible values are:filter: queries backups by specifyingfiltering conditions.count: queries backups by specifying thetotal number.

l Example request{ "limit": "10", "offset": "0", "tags": [ { "key": "Tag001", "values":["Value001","Value002"] } ], "action":"filter"}

Responsel Parameter description

Parameter Mandatory

Type Description

total_count Yes integer Total number of resources

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

93

Page 98: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Parameter Mandatory

Type Description

resources Yes list<dict> List of resources

resource_id Yes string Resource ID

resouce_detail Yes object Resource details, used for extension

resource_name Yes string Resource name

tags Yes list<dict> List of tags

key Yes string Tag key

value Yes string Tag value

message No string Error message returned after an erroroccurs

code No string Error code returned after an erroroccursFor details about error codes, see A.1Error Codes.

l Example response{ "total_count":10, "resources":[ { "resource_name": "name", "resource_id": "0781095c-b8ab-4ce5-99f3-4c5f6ff75319", "resource_detail": null, "tags": [{ "key":"key", "value":"value" }] } ]}

or{ "error": { "message": "XXXX", "code": "XXX" }}

Return Valuel Normal

200

l Abnormal

Return Value Description

400 Bad Request The server failed to process the request.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

94

Page 99: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Return Value Description

401 Unauthorized You must enter the username and password toaccess the requested page.

403 Forbidden You are forbidden to access the requested page.

404 Not Found The server could not find the requested page.

405 Method Not Allowed You are not allowed to use the methodspecified in the request.

406 Not Acceptable The response generated by the server could notbe accepted by the client.

407 Proxy Authentication Required You must use the proxy server forauthentication so that the request can beprocessed.

408 Request Timeout The request timed out.

409 Conflict The request could not be processed due to aconflict.

500 Internal Server Error Failed to complete the request because of aninternal service error.

501 Not Implemented Failed to complete the request because theserver does not support the requested function.

502 Bad Gateway Failed to complete the request because therequest is invalid.

503 Service Unavailable Failed to complete the request because theservice is unavailable.

504 Gateway Timeout A gateway timeout error occurred.

Error CodeFor details, see A.1 Error Codes.

Volume Backup ServiceAPI Reference 4 Backup Policy

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

95

Page 100: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

A Appendix

A.1 Error CodesModule Error Code Description

Shared VolumeBackup.0014 Failed to submit the task.

VolumeBackup.0041 Failed to check user rights.

VolumeBackup.0042 The user does not have the rights to performoperations.

VolumeBackup.0044 User rights are invalid.

Creating aBackup

VolumeBackup.0002 The request format is incorrect.

VolumeBackup.0003 Parameter name in the request is too long.

VolumeBackup.0004 Parameter name in the request contains invalidcharacters.

VolumeBackup.0005 Parameter name in the request starts with auto.

VolumeBackup.0006 Parameter description in the request is too long orcontains invalid characters.

VolumeBackup.0007 Parameter name in the request is empty.

VolumeBackup.0008 Failed to obtain the permission.

VolumeBackup.0009 Failed to obtain the key.

VolumeBackup.0010 Parameter volume_id in the request is empty.

VolumeBackup.0011 The format of parameter volume_id in the requestis incorrect.

VolumeBackup.0012 The disk status is not available or in_use.

VolumeBackup.0013 The previous backup creation task is not complete.

Volume Backup ServiceAPI Reference A Appendix

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

96

Page 101: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Module Error Code Description

VolumeBackup.0017 Failed to create the snapshot.

VolumeBackup.0018 The snapshot creation result is empty.

VolumeBackup.0019 Failed to query the snapshot during backupcreation.

VolumeBackup.0020 The snapshot query result is empty.

VolumeBackup.0021 The EVS disk does not exist or has been deleted.

VolumeBackup.0022 Failed to create the temporary disk.

VolumeBackup.0023 The result of creating the temporary disk is empty.

VolumeBackup.0024 Failed to query the temporary disk.

VolumeBackup.0025 The result of querying the temporary disk is empty.

VolumeBackup.0026 Parameter name in the request is too short.

VolumeBackup.0027 Failed to create the backup.

VolumeBackup.0028 The backup creation result is empty.

VolumeBackup.0029 Failed to query the backup result.

VolumeBackup.0030 The backup query result is empty.

VolumeBackup.0035 Failed to query all disks of a user.

VolumeBackup.0036 Failed to query all backups of a user.

VolumeBackup.0037 Failed to query the snapshot status.

VolumeBackup.0038 Failed to query the status of the temporary disk.

VolumeBackup.0039 Failed to query the backup status.

VolumeBackup.0040 The number of backups for the disk has reached theupper limit (20).

VolumeBackup.0043 Failed to query the disk or backup.

VolumeBackup.0049 The tag parameter is invalid.

VolumeBackup.0050 The number of tags has reached the upper limit.

VolumeBackup.0062 The snapshot status is error.

VolumeBackup.0063 The status of the temporary disk is error.

VolumeBackup.0064 The backup status is error.

VolumeBackup.0070 Failed to query the quota information.

VolumeBackup.0071 The quota for the number of SAS disks has beenused up.

Volume Backup ServiceAPI Reference A Appendix

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

97

Page 102: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Module Error Code Description

VolumeBackup.0072 The quota for the capacity of SAS disks has beenused up.

VolumeBackup.0073 The quota for the number of SATA disks has beenused up.

VolumeBackup.0074 The quota for the capacity of SATA disks has beenused up.

VolumeBackup.0075 The quota for the number of SSD disks has beenused up.

VolumeBackup.0076 The quota for the capacity of SSD disks has beenused up.

VolumeBackup.0077 The quota for the number of SAS disk snapshotshas been used up.

VolumeBackup.0078 The quota for the number of SATA disk snapshotshas been used up.

VolumeBackup.0079 The quota for the number of SSD disk snapshotshas been used up.

VolumeBackup.0080 The quota for the number of backups has been usedup.

VolumeBackup.0081 The quota for the capacity of backups has beenused up.

VolumeBackup.0082 The quota for the number of disks has been usedup.

VolumeBackup.0083 The quota for the capacity of disks has been usedup.

VolumeBackup.0084 The quota for the number of snapshots has beenused up.

Deleting aBackup

VolumeBackup.0100 Failed to submit the subtask.

VolumeBackup.0101 Failed to delete the snapshot.

VolumeBackup.0102 Failed to delete the backup.

VolumeBackup.0103 Failed to query the backup details.

VolumeBackup.0104 Failed to obtain the image information.

VolumeBackup.0105 The format of the backup deletion request isincorrect.

VolumeBackup.0109 Failed to query the snapshot during backupdeletion.

VolumeBackup.0110 Failed to query the backup.

Volume Backup ServiceAPI Reference A Appendix

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

98

Page 103: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Module Error Code Description

VolumeBackup.0113 The backup has already been used to create animage and cannot be deleted.

VolumeBackup.0123 Failed to query all backups.

VolumeBackup.0125 Failed to perform the backup deletion operation.

VolumeBackup.0129 Deleting this type of backups is not allowed.

VolumeBackup.0900 The service is unavailable.

Restoring aDisk Usinga Backup

VolumeBackup.0111 The disk to be restored or the backup used torestore the disk does not exist.

VolumeBackup.0200 Failed to restore data.

VolumeBackup.0201 The data restoration result is empty.

VolumeBackup.0202 The disk status is error.

VolumeBackup.0203 Parameter backup_id in the request is empty.

VolumeBackup.0204 The format of parameter backup_id in the requestis incorrect.

VolumeBackup.0205 The disk status is unavailable.

VolumeBackup.0206 A backup is being created for the disk.

VolumeBackup.0207 The disk to be queried does not exist.

VolumeBackup.0208 Parameter volume_id in the request is incorrect.

VolumeBackup.0209 The capacity of the disk must be greater than orequal to that of the backup.

VolumeBackup.0210 The format of the disk restoration request isincorrect.

VolumeBackup.0089 The disk backup status is unavailable.

BackupPolicy

AutoBackup.0000 The request is empty.

AutoBackup.0001 The object contained in the request is empty.

AutoBackup.0002 The token contained in the request header is empty.

AutoBackup.0003 The token contained in the request header hasexpired.

AutoBackup.0005 Failed to obtain the domain ID from the tokencontained in the request header.

AutoBackup.0006 The policy ID contained in the request is empty.

AutoBackup.0008 Failed to convert the request into a JSON object.

Volume Backup ServiceAPI Reference A Appendix

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

99

Page 104: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Module Error Code Description

AutoBackup.0009 An exception occurred in internal systemprocessing.

AutoBackup.0100 The tenant cannot modify the default backup policy.

AutoBackup.0101 The length of the backup policy name is invalid.

AutoBackup.0102 The parameter of the backup policy name is invalid.

AutoBackup.0103 The parameter of the backup job start time isinvalid.

AutoBackup.0104 The parameter of the backup policy status isinvalid.

AutoBackup.0105 The parameter of whether to retain the first backupin the current month is invalid.

AutoBackup.0106 The parameter of the backup job interval is invalid.

AutoBackup.0107 The parameter of the number of retained backups isinvalid.

AutoBackup.0108 The parameter of the retention days is invalid.

AutoBackup.0109 The parameter of the backup job interval is invalid.

AutoBackup.0203 The number of existing backup policies has reachedthe upper limit.

AutoBackup.0204 The number of associated volumes has reached theupper limit.

AutoBackup.0205 The policy does not exist.

AutoBackup.1100 The queried policy does not exist.

AutoBackup.1300 Failed to delete the policy.

AutoBackup.1400 The resource to be associated is invalid.

AutoBackup.1700 Failed to execute the backup policy.

AutoBackup.0206 The status of the volume to be associated is invalid.

AutoBackup.0207 The resource to be associated is empty.

AutoBackup.0208 An exception occurred when you were obtainingdetails about the associated resource.

AutoBackup.0209 The resource ID or name is empty.

AutoBackup.0210 HANA volumes cannot be associated with thebackup policy.

AutoBackup.0211 The resource type is invalid.

AutoBackup.0213 The request is not authorized.

Volume Backup ServiceAPI Reference A Appendix

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

100

Page 105: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Module Error Code Description

AutoBackup.0217 The snapshot quota is insufficient.

AutoBackup.0218 The backup quota is insufficient.

AutoBackup.0220 DESS volumes cannot be associated with thebackup policy.

AutoBackup.0221 The request cannot contain less-than signs (<) orgreater-than signs (>).

AutoBackup.0222 Only specified actions are supported.

AutoBackup.9002 An internal exception occurred in systemauthentication.

Volume Backup ServiceAPI Reference A Appendix

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

101

Page 106: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

B Change History

Release Date What's New

2018-05-15 This issue is the eleventh official release.Updated the following content:l Added the tags parameter to the sections "Creating a VBS Backup"

and "Creating a Backup Policy".l Added sections "Adding a Tag for a Backup Policy", "Deleting a Tag

of a Backup Policy", "Querying All Backup Policy Tags", "BatchUpdating or Deleting Tags of a Backup Policy", "Querying the Tagsof a Backup Policy", and "Querying a Backup Policy Using Tags".

l Added the sections "Creating a Backup Share", "Deleting a BackupShare", "Querying Backup Shares", "Counting Backup Shares", and"Querying Details About a Backup Share".

2018-02-06 This issue is the tenth official release.Updated the following content:l Added the section "Deleting a VBS Backup (Native OpenStack

API)".

Volume Backup ServiceAPI Reference B Change History

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

102

Page 107: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Release Date What's New

2017-11-16 This issue is the ninth official release.Updated the following content:l Added response parameters to the section "Querying Details About

VBS Backups (Native OpenStack API)".l Added response parameters to the section "Querying Details About a

VBS Backup (Native OpenStack API)".l Added the section "Restoring a Disk Using a VBS Backup (Native

OpenStack API)".l Added request parameters to the section "Creating a Backup Policy".l Added request parameters to the section "Modifying a Backup

Policy".l Added response parameters to the section "Querying Backup

Policies".l Added response parameters to the section "Querying Backup Jobs

Triggered by a Backup Policy".l Modified the example request in the section of "Token

Authentication".

2017-04-28 This issue is the eighth official release.Updated the following content:l Added the snapshot_id parameter to the section "Creating a VBS

Backup".

2017-02-28 This issue is the seventh official release.Updated the following content:l Modified the sections "Querying Details About VBS Backups" and

Querying Details About a VBS Backup". Added the content of os-bak-tenant-attr:tenant_id to the parameter description and exampleresponse.

l Added the description of parameter backup_policy_name toParameter description in section "Modifying a Backup Policy".

2017-01-20 This issue is the sixth official release.Updated the following content:l Added error codes AutoBackup.0008 and AutoBackup.0213 to the

list of error codes in the appendix.

2016-12-30 This issue is the fifth official release.Updated the following content:l Added the section "Backup Policy."l Added the description of backup policy APIs in appendix "Error

Codes".

Volume Backup ServiceAPI Reference B Change History

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

103

Page 108: API Reference - Huawei · 4/28/2017  · Access Management API Reference. 3. Make a call to a service API, add X-Auth-Token to the message header, and set the value of X-Auth-Token

Release Date What's New

2016-08-25 This issue is the fourth official release.Updated the following content:l Modified the section "Querying the Job Status".l Updated the parameter description.

2016-06-02 This issue is the third official release.Updated the following content:l Modified the error code description in "Error Code Description".l Modified sections "Querying Summary Information About VBS

Backups" and "Querying Details About VBS Backups". Added thecontent of backups_links to the parameter description and exampleresponse.

2016-01-22 This issue is the second official release.Updated the following content:l Modified the section "Request Signing Procedure". Updated the SDK

package and signing procedure.l Modified the section "Sample Code". Optimized the code.l Modified the section "Common Request Message Header". Added a

message header, and changed some message headers to optionalitems.

2015-10-15 This issue is the first official release.

Volume Backup ServiceAPI Reference B Change History

Issue 11 (2018-05-15) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

104