api reference · access management api reference. 3. make a call to a service api, add x-auth-token...
TRANSCRIPT
Cloud Server Backup Service
API Reference
Issue 05
Date 2018-08-06
HUAWEI TECHNOLOGIES CO., LTD.
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 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
i
Contents
1 API Invoking Method...................................................................................................................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 the Project ID or Tenant ID......................................................................................................................... 12
2 Common Message Headers....................................................................................................... 132.1 Common Request Headers........................................................................................................................................... 132.2 Common Response Headers.........................................................................................................................................15
3 CSBS...............................................................................................................................................163.1 Resource Management................................................................................................................................................. 163.1.1 Creating a Resource Backup......................................................................................................................................163.1.2 Querying Backup Capabilities of Resources............................................................................................................. 203.1.3 Querying Restoration Capabilities of Resources.......................................................................................................223.2 Backup Policy Management.........................................................................................................................................253.2.1 Creating a Backup Policy.......................................................................................................................................... 253.2.2 Deleting a Backup Policy.......................................................................................................................................... 353.2.3 Updating a Backup Policy......................................................................................................................................... 363.2.4 Querying a Backup Policy.........................................................................................................................................453.2.5 Querying the Backup Policy List...............................................................................................................................513.3 Backup Management.................................................................................................................................................... 583.3.1 Executing a Backup Policy........................................................................................................................................583.3.2 Querying the Number of Backups............................................................................................................................. 613.3.3 Querying a Single Backup.........................................................................................................................................643.3.4 Querying All Backups............................................................................................................................................... 693.3.5 Deleting a Backup..................................................................................................................................................... 773.4 Restoration Management..............................................................................................................................................793.4.1 Creating a Restoration Task.......................................................................................................................................79
Cloud Server Backup ServiceAPI Reference Contents
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
ii
3.5 Quota Management.......................................................................................................................................................833.5.1 Querying Quotas........................................................................................................................................................83
A Appendix......................................................................................................................................86A.1 Error Codes..................................................................................................................................................................86
B Change History............................................................................................................................91
Cloud Server Backup ServiceAPI Reference Contents
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
iii
1 API Invoking Method
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 the Project ID or Tenant 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.
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
1
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.
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
2
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.
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
3
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 from the following link:
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 use an HTTP client to sendan 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.
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
4
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; }
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
5
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); }
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
6
/** {@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());
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
7
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; }
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
8
@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);
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
9
}
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) {
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
10
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(); }
}
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
11
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 the Project ID or Tenant 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
Cloud Server Backup ServiceAPI Reference 1 API Invoking Method
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
12
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 time when therequest is sent. The time is inYYYYMMDD'T'HHMMSS'Z' format.The value is the currentGMT time of the system.
NoThis field ismandatory forAK/SKauthentication.
20150907T101459Z
Authorization Specifies the authenticationinformation.The value can be obtainedfrom the request signingresult.For details, see section 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
Cloud Server Backup ServiceAPI Reference 2 Common Message Headers
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
13
Parameter Description Mandatory Example Value
Host Specifies the server domainname and port number of theresources being requested.The value can be obtainedfrom the URL of the serviceAPI. The value ishostname[:port]. If the portnumber is not specified, thedefault port is used. Thedefault port number forhttps is 443.
NoThis field ismandatory forAK/SKauthentication.
code.test.comorcode.test.com:443
Content-Type Specifies the request bodyMIME type. You are advisedto use the default valueapplication/json. Forinterfaces used to uploadobjects or images, the valuecan vary depending on theflow type.
Yes application/json
Content-Length
Specifies the length of therequest body. The unit isbyte.
No 3495
X-Project-Id Specifies the project ID.Obtain the project ID byfollowing the instructions insection 1.6 Obtaining theProject ID or Tenant ID.This parameter is mandatoryfor a request from a DeC ormulti-project user.
NoThis field ismandatory forrequests that useAK/SKauthentication inthe DedicatedCloud (DeC)scenario or multi-project scenario.
e9993fc787d94b6c886cbaa340f9c0f4
X-Auth-Token Specifies the user token.For details about how toobtain the token, see section"Obtaining the User Token"in the Identity and AccessManagement API Reference.After the request isprocessed, the value of X-Subject-Token in the headeris the token value.
NoThis field ismandatory fortokenauthentication.
The following is partof an example token:MIIPAgYJKoZIhvc-NAQcCoIIO8zCCDu8CAQExDTALBglghkgBZQMEAgEwgg1QBgkqhkiG9w0BBwGggg1BBIINPXsidG9rZ.
NOTE
For details about other parameters in the header, see the HTTP protocol documentation.
Cloud Server Backup ServiceAPI Reference 2 Common Message Headers
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
14
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
Cloud Server Backup ServiceAPI Reference 2 Common Message Headers
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
15
3 CSBS
3.1 Resource Management
3.2 Backup Policy Management
3.3 Backup Management
3.4 Restoration Management
3.5 Quota Management
3.1 Resource Management
3.1.1 Creating a Resource Backup
Function
This API is used to select and directly back up resources.
URIl URI format
POST /v1/{project_id}/providers/{provider_id}/resources/{resource_id}/action
l Parameter description
Name Mandatory
Type Description
project_id Yes String -
provider_id Yes String Backup provider ID, currently fixed atfc4d5750-22e7-4798-8a46-f48f62c4c1da
resource_id Yes String Backup object ID
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
16
NOTICEBackup provider IDs mentioned in this document are all fc4d5750-22e7-4798-8a46-f48f62c4c1da.
Requestl Element description
Name Mandatory
Type Description
protect Yes protect_param
Backup parameters
l Parameter description of field protect_param
Name Mandatory
Type Description
backup_name No String Backup name. The value consists of 1to 255 characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
description No String Backup description. The valueconsists of 0 to 255 characters andmust not contain a greater-than sign(>) or less-than sign (<).
resource_type No String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS). If this parameter is notpassed, the backup object typedefaults to OS::Nova::Server.
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
17
l Example requestPOST /v1/{project_id}/providers/{provider_id}/resources/{resource_id}/action{ "protect" : { "backup_name" : "backup", "description" : "backup des", "extra_info" : { "exclude_volumes": ["8a8ccde2-0b9a-4450-a5f3-150816635f46"] } }}
Responsel Element description
Name Mandatory
Type Description
checkpoint Yes protect_resp
Backup response
l Parameter description of field protect_resp
Name Mandatory
Type Description
status Yes String Backup status
created_at Yes String Creation time
id Yes String Backup record ID
resource_graph Yes String Resource graph
project_id Yes String -
protection_plan No plan_resp Backup plan information
l Parameter description of field plan_resp
Name Mandatory
Type Description
id Yes String Backup plan ID
name Yes String Backup plan name
resources No List<resource>
Backup object list
l Parameter description of field resource
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
18
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
l Example response
{ "checkpoint" : { "status" : "protecting", "created_at" : "2017-04-18T01:21:52.701973", "id" : "4468f4b8-7c78-4222-a2ca-346b5d557dd2", "resource_graph" : null, "project_id" : "b942cc8342734d15bcb246babb1953cf", "protection_plan" : { "id" : "fake_04f8ea0f-2000-4389-a5ce-93a3e20d0faf", "resources" : [ { "type" : "OS::Nova::Server", "id" : "9506416d-db6c-406e-8bca-c0f43793d914", "name" : "resource_9506416d-db6c-406e-8bca-c0f43793d914", "extra_info" : { "exclude_volumes": ["8a8ccde2-0b9a-4450-a5f3-150816635f46"] } } ], "name" : "server protect plan for 9506416d-db6c-406e-8bca-c0f43793d914" } }}
Return Valuesl Normal
Return Value Description
200 OK
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
19
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.1.2 Querying Backup Capabilities of Resources
Function
This API is used to query whether resources can be backed up.
URIl URI format
POST /v1/{project_id}/providers/{provider_id}/resources/actionl Parameter description
Name Mandatory
Type Description
project_id Yes String -
provider_id Yes String Backup provider ID
Requestl Element description
Name Mandatory
Type Description
check_protectable Yes List<protectable_param>
Query parameter list
l Parameter description of field protectable_param
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
20
Name Mandatory
Type Description
resource_id Yes String ID of the resource, ECS, or EVS diskto be checked
resource_type Yes String Type of the resource to be checkedPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
l Example request
POST /v1/{project_id}/providers/{provider_id}/resources/action{ "check_protectable" : [ { "resource_id" : "6507cb66-90dc-4a12-a573-c9f3398f899d", "resource_type" : "OS::Nova::Server" } ]}
Responsel Element description
Name Mandatory
Type Description
protectable Yes List<check_resp>
Check result list
l Parameter description of field check_resp
Name Mandatory
Type Description
result Yes Boolean Whether backup or restoration issupported
resource_type Yes String Resource type
error_code No String Error code
error_msg No String Error reason
resource_id Yes String Resource ID
l Example response
{ "protectable" : [ { "resource_id" : "6507cb66-90dc-4a12-a573-c9f3398f899d", "resource_type" : "OS::Nova::Server", "result" : true, "error_msg" : "", "error_code" : "" } ]}
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
21
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.1.3 Querying Restoration Capabilities of Resources
Function
This API is used to query whether target resources can be restored.
URIl URI format
POST /v1/{project_id}/providers/{provider_id}/resources/action
l Parameter description
Name Mandatory
Type Description
project_id Yes String -
provider_id Yes String Backup provider ID
Requestl Element description
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
22
Name Mandatory
Type Description
check_restorable Yes List<restorable_param>
Query parameter list
l Parameter description of field restorable_param
Name Mandatory
Type Description
checkpoint_item_id Yes String ID of the backup to be restored
target Yes restorable_target
Restoration target
l Parameter description of field restorable_target
Name Mandatory
Type Description
resource_id Yes String ID of the target to which the backup isrestored
resource_type Yes String Type of the target to which the backupis restoredPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
volumes Yes List<restore_volume_mapping>
EVS disk mapping list for restoringan ECS
l Parameter description of field restore_volume_mapping
Name Mandatory
Type Description
backup_id Yes String EVS disk ID
volume_id Yes String ID of the target EVS disk for therestoration
l Example request
POST /v1/{project_id}/providers/{provider_id}/resources/action{ "check_restorable" : [ { "checkpoint_item_id" : "8986ce68-3da7-4d29-9cc2-1921e9504975", "target" : {
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
23
"resource_type" : "OS::Nova::Server", "resource_id" : "5aa119a8-d25b-45a7-8d1b-88e127885635", "volumes" : [ { "backup_id" : "7ea119a8-d25b-43a7-8d1b-88e12788513a", "volume_id" : "45baf976-c20a-4894-a7c3-c94b7376bf55" } ] } } ]}
Responsel Element description
Name Mandatory
Type Description
restorable Yes List<check_resp>
Response parameter list
l Parameter description of field check_resp
Name Mandatory
Type Description
result Yes Boolean Whether backup or restoration issupported
resource_type Yes String Resource type
error_code No String Error code
error_msg No String Error reason
resource_id Yes String Resource ID
l Example response{ "restorable" : [ { "resource_id" : "6507cb66-90dc-4a12-a573-c9f3398f899d", "resource_type" : "OS::Nova::Server", "result" : true, "error_msg" : "", "error_code" : "" } ]}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
24
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.2 Backup Policy Management
3.2.1 Creating a Backup Policy
Function
This API is used to backup servers periodically.
URIl URI format
POST /v1/{project_id}/policiesl Parameter description
Name Mandatory
Type Description
project_id Yes String -
Requestl Element description
Name Mandatory
Type Description
policy Yes policy_create
Creation parameters
l Parameter description of field policy_create
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
25
Name Mandatory
Type Description
description No String Backup policy descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
name Yes String Backup policy nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
parameters Yes policy_param
Backup parameters
provider_id Yes String Backup provider ID
resources Yes List<resource>
Backup object listThe list can be blank.
scheduled_operations
Yes List<scheduled_operation_create>
Scheduling period. A backup policyhas only one backup period.
l Parameter description of field policy_param
Name Mandatory
Type Description
common No common_param
General backup policy parameters,which are blank by default
l Parameter description of field resource
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
26
Name Mandatory
Type Description
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
l Parameter description of field scheduled_operation_create
Name Mandatory
Type Description
description No String Scheduling period descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
enabled No Boolean Whether the scheduling period isenabledThe default value is true. If it is set tofalse, automatic scheduling isdisabled but manual scheduling issupported.
name No String Scheduling period nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
operation_type Yes String Operation type, which can be backupEnum:[ backup]
operation_definition
Yes operation_definition
Scheduling period parameters
trigger Yes trigger Scheduling policy
l Parameter description of field operation_definition
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
27
Name Mandatory
Type Description
max_backups No Integer Maximum number of backups thatcan be automatically created for abackup objectThe maximum value is 99999. -1indicates that backups will not becleared based on the quantity limit.
retention_duration_days
No Integer Duration of retaining a backup, indaysThe maximum value is 99999. -1indicates that backups will not becleared based on the retentionduration.
permanent No Boolean Whether backups are permanentlyretained
plan_id No String Backup policy ID
provider_id No String Backup provider ID
l Parameter description of field trigger
Name Mandatory
Type Description
properties Yes trigger_properties
Scheduler properties
l Parameter description of field trigger_properties
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
28
Name Mandatory
Type Description
pattern Yes String Scheduling policy of the schedulerThe value consists of a maximum of10,240 characters. The schedulingpolicy complies with iCalendar RFC2445, but it supports only fourparameters, which are FREQ,BYDAY, BYHOUR, andBYMINUTE. FREQ can be set onlyto WEEKLY and DAILY, BYDAYcan be set to MO, TU, WE, TH, FR,SA, or SU (seven days of a week),BYHOUR ranges from 0 hours to 23hours, and BYMINUTE ranges from0 minutes to 59 minutes. Thescheduling interval must not be lessthan 1 hour. A maximum of 24 timepoints are allowed in a day. In apolicy, you are advised to set one timepoint for one day.
l Example requestPOST /v1/{project_id}/policies{ "policy" : { "name" : "my-plan", "description" : "My plan", "provider_id" : "c714180d-ea34-4b13-9a5e-577c7c416eec", "parameters" : "common" : { } }, "scheduled_operations" : [ { "name" : "my-backup-policy", "description" : "My backup policy", "enabled" : true, "operation_definition" : { "max_backups" : 20 }, "trigger" : { "properties" : { "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n" } }, "operation_type" : "backup" } ], "resources" : [ { "id" : "45baf976-c20a-4894-a7c3-c94b7376bf55", "type" : "OS::Nova::Server", "name" : "resource1", "extra_info" : { "exclude_volumes": ["8a8ccde2-0b9a-4450-a5f3-150816635f46"] } }, { "id" : "5aa119a8-d25b-45a7-8d1b-88e127885635",
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
29
"type" : "OS::Nova::Server", "name" : "resource2" } ] }}
Responsel Element description
Name Mandatory
Type Description
policy Yes policy_resp
-
l Parameter description of field policy_resp
Name Mandatory
Type Description
created_at Yes String Creation time
description No String Backup policy descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
id Yes String Backup policy ID
name Yes String Backup policy nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
parameters Yes policy_param
Parameters of a backup policy
project_id Yes String Tenant ID
provider_id Yes String Backup provider ID
resources Yes List<resource>
Backup object list
scheduled_operations
Yes List<scheduled_operation_resp>
Scheduling period list
status No String Backup policy status
l Parameter description of field policy_param
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
30
Name Mandatory
Type Description
common No common_param
Common parameters of a backuppolicy
l Parameter description of field resource
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
l Parameter description of field scheduled_operation_resp
Name Mandatory
Type Description
description No String Scheduling period descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
enabled No Boolean Whether the scheduling period isenabledThe default value is true. If it is set tofalse, automatic scheduling isdisabled but manual scheduling issupported.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
31
Name Mandatory
Type Description
name No String Scheduling period nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
operation_type Yes String Operation type, which can be backupEnum:[ backup]
operation_definition
Yes operation_definition
Scheduling period parameters
trigger No trigger_resp
Scheduling policy
id Yes String Scheduling period ID
trigger_id No String Scheduler ID
l Parameter description of field operation_definition
Name Mandatory
Type Description
max_backups No Integer Maximum number of backups thatcan be automatically created for abackup objectThe maximum value is 99999. -1indicates that backups will not becleared based on the quantity limit.
retention_duration_days
No Integer Duration of retaining a backup, indaysThe maximum value is 99999. -1indicates that backups will not becleared based on the retentionduration.
permanent No Boolean Whether backups are permanentlyretained
plan_id No Stirng Backup policy ID
provider_id No String Backup provider ID
l Parameter description of field trigger_resp
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
32
Name Mandatory
Type Description
properties Yes trigger_properties_resp
Scheduler properties
id Yes String Scheduler ID
name No String Scheduler name
type No String Scheduler type
l Parameter description of field trigger_properties_resp
Name Mandatory
Type Description
pattern Yes String Scheduling policy of the schedulerThe value consists of a maximum of10,240 characters. The schedulingpolicy complies with iCalendar RFC2445, but it supports only fourparameters, which are FREQ,BYDAY, BYHOUR, andBYMINUTE. FREQ can be set onlyto WEEKLY and DAILY, BYDAYcan be set to MO, TU, WE, TH, FR,SA, or SU (seven days of a week),BYHOUR ranges from 0 hours to 23hours, and BYMINUTE ranges from0 minutes to 59 minutes. Thescheduling interval must not be lessthan 1 hour. A maximum of 24 timepoints are allowed in a day. In apolicy, you are advised to set one timepoint for one day.
start_time No String Start time of the scheduler
l Example response
{ "policy" : { "created_at" : "2017-03-07T09:27:40.928000", "description" : "My plan", "id" : "f766c171-9336-479a-8b30-b83cabf6381e", "name" : "my-plan", "parameters" : { "common" : { } }, "project_id" : "tenant", "provider_id" : "c714180d-ea34-4b13-9a5e-577c7c416eec", "resources" : [ { "id" : "45baf976-c20a-4894-a7c3-c94b7376bf55", "name" : "resource1", "type" : "OS::Nova::Server",
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
33
"extra_info" : { "exclude_volumes": ["8a8ccde2-0b9a-4450-a5f3-150816635f46"] } }, { "id" : "5aa119a8-d25b-45a7-8d1b-88e127885635", "name" : "resource2", "type" : "OS::Nova::Server" } ], "scheduled_operations" : [ { "description" : "My backup policy", "enabled" : true, "id" : "9303a23d-e433-48e7-b88a-5ee6442e434e", "name" : "my-backup-policy", "operation_definition" : { "max_backups" : "20", "plan_id" : "f766c171-9336-479a-8b30-b83cabf6381e", "provider_id" : "c714180d-ea34-4b13-9a5e-577c7c416eec" }, "operation_type" : "backup", "trigger" : { "id" : "8178846b-766d-4fe6-941f-b38c76b6f3b9", "name" : "default", "properties" : { "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", "start_time" : "2017-03-07 09:27:41" }, "type" : "time" }, "trigger_id" : "8178846b-766d-4fe6-941f-b38c76b6f3b9" } ], "status" : "suspended" }}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
34
Error Codes
For details, see A.1 Error Codes.
3.2.2 Deleting a Backup Policy
Function
This API is used to delete the backup policy of a specific ID.
URIl URI format
DELETE /v1/{project_id}/policies/{policy_id}l Parameter description
Name Mandatory
Type Description
project_id Yes String -
policy_id Yes String Backup policy ID
Requestl Element description
None
l Example requestDELETE /v1/{project_id}/policies/{policy_id}
Responsel Element description
Nonel Example response
None
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
35
Return Value Description
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error CodesFor details, see A.1 Error Codes.
3.2.3 Updating a Backup Policy
FunctionThis API is used to update the backup policy of a specific ID.
URIl URI
PUT /v1/{project_id}/policies/{policy_id}l Parameter description
Name Mandatory
Type Description
project_id Yes String -
policy_id Yes String Backup policy ID
Requestl Element description
Name Mandatory
Type Description
policy Yes policy_update
-
l Parameter description of field policy_update
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
36
Name Mandatory
Type Description
description No String Backup policy descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
name No String Backup policy nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
parameters No policy_param
Backup parameters
resources No List<resource>
Backup objects
scheduled_operations
No List<scheduled_operation_update>
Scheduling period. A backup policyhas only one backup period.
l Parameter description of field policy_param
Name Mandatory
Type Description
common No common_param
General backup policy parameters,which are blank by default
l Parameter description of field resource
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
extra_info No Dict Additional information about thebackup object
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
37
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
l Parameter description of field scheduled_operation_update
Name Mandatory
Type Description
description No String Scheduling period descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
enabled No Boolean Whether the scheduling period isenabledThe default value is true. If it is set tofalse, automatic scheduling isdisabled but manual scheduling issupported.
name No String Scheduling period nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
operation_definition
No operation_definition
Scheduling period parameter
trigger No trigger Scheduling policy
id Yes String Scheduling period ID
l Parameter description of field operation_definition
Name Mandatory
Type Description
max_backups No Integer Maximum number of backups thatcan be automatically created for abackup objectThe maximum value is 99999. -1indicates that backups will not becleared based on the quantity limit.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
38
Name Mandatory
Type Description
retention_duration_days
No Integer Duration of retaining a backup, indaysThe maximum value is 99999. -1indicates that backups will not becleared based on the retentionduration.
permanent No Boolean Whether backups are permanentlyretained
plan_id No String Backup policy ID
provider_id No String Backup provider ID
l Parameter description of field trigger
Name Mandatory
Type Description
properties Yes trigger_properties
Scheduler properties
l Parameter description of field trigger_properties
Name Mandatory
Type Description
pattern Yes String Scheduling policy of the schedulerThe value consists of a maximum of10,240 characters. The schedulingpolicy complies with iCalendar RFC2445, but it supports only fourparameters, which are FREQ,BYDAY, BYHOUR, andBYMINUTE. FREQ can be set onlyto WEEKLY and DAILY, BYDAYcan be set to MO, TU, WE, TH, FR,SA, or SU (seven days of a week),BYHOUR ranges from 0 hours to 23hours, and BYMINUTE ranges from0 minutes to 59 minutes. Thescheduling interval must not be lessthan 1 hour. A maximum of 24 timepoints are allowed in a day. In apolicy, you are advised to set one timepoint for one day.
l Example request
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
39
PUT /v1/{project_id}/policies/{policy_id}{ "policy" : { "name" : "my-plan", "scheduled_operations" : [ { "id" : "fed3c8f1-7b6e-4e24-b1ad-473838bad569", "name" : "my-backup-policy", "description" : "My backup policy ", "enabled" : true, "operation_definition" : { "retention_duration_days" : -1, "max_backups" : 20 }, "trigger" : { "properties" : { "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n" } } ] }}
Responsel Element description
Name Mandatory
Type Description
policy Yes policy_resp
-
l Parameter description of field policy_resp
Name Mandatory
Type Description
created_at Yes String Creation time
description No String Backup policy descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
id Yes String Backup policy ID
name Yes String Backup policy nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
parameters Yes policy_param
Parameters of a backup policy
project_id Yes String Tenant ID
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
40
Name Mandatory
Type Description
provider_id Yes String Backup provider ID
resources Yes List<resource>
Backup object list
scheduled_operations
Yes List<scheduled_operation_resp>
Scheduling period list
status No String Backup policy status
l Parameter description of field policy_param
Name Mandatory
Type Description
common No common_param
General backup policy parameters,which are blank by default
l Parameter description of field resource
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
41
l Parameter description of field scheduled_operation_resp
Name Mandatory
Type Description
description No String Scheduling period descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
enabled No Boolean Whether the scheduling period isenabledThe default value is true. If it is set tofalse, automatic scheduling isdisabled but manual scheduling issupported.
name No String Scheduling period nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
operation_type Yes String Operation type, which can be backupEnum:[ backup]
operation_definition
Yes operation_definition
Scheduling period parameters
trigger No trigger_resp
Scheduling policy
id Yes String Scheduling period ID
trigger_id No String Scheduler ID
l Parameter description of field operation_definition
Name Mandatory
Type Description
max_backups No Integer Maximum number of backups thatcan be automatically created for abackup objectThe maximum value is 99999. -1indicates that backups will not becleared based on the quantity limit.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
42
Name Mandatory
Type Description
retention_duration_days
No Integer Duration of retaining a backup, indaysThe maximum value is 99999. -1indicates that backups will not becleared based on the retentionduration.
permanent No Boolean Whether backups are permanentlyretained
plan_id No String Backup policy ID
provider_id No String Backup provider ID
l Parameter description of field trigger_resp
Name Mandatory
Type Description
properties Yes trigger_properties_resp
Scheduler properties
id Yes String Scheduler ID
name No String Scheduler name
type No String Scheduler type
l Parameter description of field trigger_properties_resp
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
43
Name Mandatory
Type Description
pattern Yes String Scheduling policy of the schedulerThe value consists of a maximum of10,240 characters. The schedulingpolicy complies with iCalendar RFC2445, but it supports only fourparameters, which are FREQ,BYDAY, BYHOUR, andBYMINUTE. FREQ can be set onlyto WEEKLY and DAILY, BYDAYcan be set to MO, TU, WE, TH, FR,SA, or SU (seven days of a week),BYHOUR ranges from 0 hours to 23hours, and BYMINUTE ranges from0 minutes to 59 minutes. Thescheduling interval must not be lessthan 1 hour. A maximum of 24 timepoints are allowed in a day. In apolicy, you are advised to set one timepoint for one day.
start_time No String Start time of the scheduler
l Example response
{ "policy" : { "status" : "suspended", "provider_id" : "fc4d5750-22e7-4798-8a46-f48f62c4c1da", "description" : "", "scheduled_operations" : [ { "description" : "My backup policy ", "enabled" : true, "trigger" : { "properties" : { "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", "start_time" : "2017-04-09 14:31:25" } }, "operation_definition" : { "provider_id" : "fc4d5750-22e7-4798-8a46-f48f62c4c1da", "plan_id" : "17e2b861-3a35-434d-afbb-073d5cd5af08", "max_backups" : "20", "retention_duration_days" : "-1", "permanent" : "False", "consistency" : "True" }, "operation_type" : "backup", "id" : "fed3c8f1-7b6e-4e24-b1ad-473838bad569", "name" : "my-backup-policy" } ], "id" : "17e2b861-3a35-434d-afbb-073d5cd5af08", "name" : "my-plan", "parameters" : { "common" : { }
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
44
}, "created_at" : "2017-04-09T14:31:25.504569", "project_id" : "0c89d4e457c3401a89c65420fd45f3a2", "resources" : [ { "type" : "OS::Nova::Server", "id" : "8421f405-1334-4206-b71c-b3f64d39abc4", "name" : "wqeq3", "extra_info" : { } } ] }}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.2.4 Querying a Backup Policy
Function
This API is used to query the backup policy of a specific ID.
URIl URI format
GET /v1/{project_id}/policies/{policy_id}
l Parameter description
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
45
Name Mandatory
Type Description
project_id Yes String -
policy_id Yes String Backup policy ID
Requestl Element description
None
l Example requestGET /v1/{project_id}/policies/{policy_id}
Responsel Element description
Name Mandatory
Type Description
policy Yes policy_resp
Query response
l Parameter description of field policy_resp
Name Mandatory
Type Description
created_at Yes String Creation time
description No String Backup policy descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
id Yes String Backup policy ID
name Yes String Backup policy nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
parameters Yes policy_param
Parameters of a backup policy
project_id Yes String Tenant ID
provider_id Yes String Backup provider ID
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
46
Name Mandatory
Type Description
resources Yes List<resource>
Backup object list
scheduled_operations
Yes List<scheduled_operation_resp>
Scheduling period list
status No String Backup policy status
l Parameter description of field policy_param
Name Mandatory
Type Description
common No common_param
General backup policy parameters,which are blank by default
l Parameter description of field resource
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
l Parameter description of field scheduled_operation_resp
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
47
Name Mandatory
Type Description
description No String Scheduling period descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
enabled No Boolean Whether the scheduling period isenabledThe default value is true. If it is set tofalse, automatic scheduling isdisabled but manual scheduling issupported.
name No String Scheduling period nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
operation_type Yes String Operation type, which can be backupEnum:[ backup]
operation_definition
Yes operation_definition
Scheduling period parameters
trigger No trigger_resp
Scheduling policy
id Yes String Scheduling period ID
trigger_id No String Scheduler ID
l Parameter description of field operation_definition
Name Mandatory
Type Description
max_backups No Integer Maximum number of backups thatcan be automatically created for abackup objectThe maximum value is 99999. -1indicates that backups will not becleared based on the quantity limit.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
48
Name Mandatory
Type Description
retention_duration_days
No Integer Duration of retaining a backup, indaysThe maximum value is 99999. -1indicates that backups will not becleared based on the retentionduration.
permanent No Boolean Whether backups are permanentlyretained
plan_id No String Backup policy ID
provider_id No String Backup provider ID
l Parameter description of field trigger_resp
Name Mandatory
Type Description
properties Yes trigger_properties_resp
Scheduler properties
id Yes String Scheduler ID
name No String Scheduler name
type No String Scheduler type
l Parameter description of field trigger_properties_resp
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
49
Name Mandatory
Type Description
pattern Yes String Scheduling policy of the schedulerThe value consists of a maximum of10,240 characters. The schedulingpolicy complies with iCalendar RFC2445, but it supports only fourparameters, which are FREQ,BYDAY, BYHOUR, andBYMINUTE. FREQ can be set onlyto WEEKLY and DAILY, BYDAYcan be set to MO, TU, WE, TH, FR,SA, or SU (seven days of a week),BYHOUR ranges from 0 hours to 23hours, and BYMINUTE ranges from0 minutes to 59 minutes. Thescheduling interval must not be lessthan 1 hour. A maximum of 24 timepoints are allowed in a day. In apolicy, you are advised to set one timepoint for one day.
start_time No String Start time of the scheduler
l Example response
{ "policy" : { "created_at" : "2017-03-07T09:31:08.265000", "description" : "My plan", "id" : "27b11f3f-578d-4464-89d1-7c6d5894f753", "name" : "my-plan", "parameters" : { "common" : { } }, "project_id" : "tenant", "provider_id" : "c714180d-ea34-4b13-9a5e-577c7c416eec", "resources" : [ { "id" : "45baf976-c20a-4894-a7c3-c94b7376bf55", "name" : "resource1", "type" : "OS::Nova::Server", "extra_info" : { "exclude_volumes": ["8a8ccde2-0b9a-4450-a5f3-150816635f46"] } }, { "id" : "5aa119a8-d25b-45a7-8d1b-88e127885635", "name" : "resource2", "type" : "OS::Nova::Server", "extra_info" : { } } ], "scheduled_operations" : [ { "description" : "My backup policy", "enabled" : true, "id" : "3b2fdf8c-2cc2-4887-9605-a8443922f6f2", "name" : "my-backup-policy", "operation_definition" : { "max_backups" : "20", "plan_id" : "27b11f3f-578d-4464-89d1-7c6d5894f753",
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
50
"provider_id" : "c714180d-ea34-4b13-9a5e-577c7c416eec" }, "operation_type" : "backup", "trigger" : { "id" : "f1246246-ec6a-4e9a-917e-d050dc2808c9", "name" : "default", "properties" : { "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", "start_time" : "2017-03-07 09:31:08" }, "type" : "time" }, "trigger_id" : "f1246246-ec6a-4e9a-917e-d050dc2808c9" } ], "status" : "suspended" }}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error CodesFor details, see A.1 Error Codes.
3.2.5 Querying the Backup Policy List
FunctionThis API is used to query the backup policy list.
URIl URI format
GET /v1/{project_id}/policies
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
51
l Parameter description
Name Mandatory
Type Description
project_id Yes String -
Requestl Parameter description
Name Mandatory
Type Description
limit No Integer Number of backup policies displayedper page
marker No String Backup policy ID of the last recorddisplayed on the previous page
sort No String The value of sort is a group ofproperties separated by commas (,)and sorting directions. The format is<key1>[:<direction>],<key2>[:<direction>], where the value of direction isasc (in ascending order) or desc (indescending order). If the parameterdirection is not specified, backuppolicies are sorted in descendingorder by time. The value of sortcontains a maximum of 255characters.
name No String Exact matching based on field name
all_tenants No Boolean Whether backup policies of all tenantscan be queriedThis parameter is only available foradministrators.
offset No Integer Offset value
l Element description
None
l Example requestQuerying all backup policies:GET /v1/{project_id}/policiesQuerying backup policies with certain conditions:GET /v1/{project_id}/policies?sort=created_at%3Aasc&limit=3&offset=3
Responsel Element description
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
52
Name Mandatory
Type Description
policies Yes List<policy_resp>
-
l Parameter description of field policy_resp
Name Mandatory
Type Description
created_at Yes String Creation time
description No String Backup policy descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
id Yes String Backup policy ID
name Yes String Backup policy nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
parameters Yes policy_param
Parameters of a backup policy
project_id Yes String Tenant ID
provider_id Yes String Backup provider ID
resources Yes List<resource>
Backup object list
scheduled_operations
Yes List<scheduled_operation_resp>
Scheduling period list
status No String Backup policy status
l Parameter description of field policy_param
Name Mandatory
Type Description
common No common_param
General backup policy parameters,which are blank by default
l Parameter description of field resource
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
53
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of the backupobjectPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
l Parameter description of field scheduled_operation_resp
Name Mandatory
Type Description
description No String Scheduling period descriptionThe value consists of 0 to 255characters and must not contain agreater-than sign (>) or less-than sign(<).
enabled No Boolean Whether the scheduling period isenabledThe default value is true. If it is set tofalse, automatic scheduling isdisabled but manual scheduling issupported.
name No String Scheduling period nameThe value consists of 1 to 255characters and can contain onlyletters, digits, underscores (_), andhyphens (-).
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
54
Name Mandatory
Type Description
operation_type Yes String Operation type, which can be backupEnum:[ backup]
operation_definition
Yes operation_definition
Scheduling period parameters
trigger No trigger_resp
Scheduling policy
id Yes String Scheduling period ID
trigger_id No String Scheduler ID
l Parameter description of field operation_definition
Name Mandatory
Type Description
max_backups No Integer Maximum number of backups thatcan be automatically created for abackup objectThe maximum value is 99999. -1indicates that backups will not becleared based on the quantity limit.
retention_duration_days
No Integer Duration of retaining a backup, indaysThe maximum value is 99999. -1indicates that backups will not becleared based on the retentionduration.
permanent No Boolean Whether backups are permanentlyretained
plan_id No String Backup policy ID
provider_id No String Backup provider ID
l Parameter description of field trigger_resp
Name Mandatory
Type Description
properties Yes trigger_properties_resp
Scheduler properties
id Yes String Scheduler ID
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
55
Name Mandatory
Type Description
name No String Scheduler name
type No String Scheduler type
l Parameter description of field trigger_properties_resp
Name Mandatory
Type Description
pattern Yes String Scheduling policy of the schedulerThe value consists of a maximum of10,240 characters. The schedulingpolicy complies with iCalendar RFC2445, but it supports only fourparameters, which are FREQ,BYDAY, BYHOUR, andBYMINUTE. FREQ can be set onlyto WEEKLY and DAILY, BYDAYcan be set to MO, TU, WE, TH, FR,SA, or SU (seven days of a week),BYHOUR ranges from 0 hours to 23hours, and BYMINUTE ranges from0 minutes to 59 minutes. Thescheduling interval must not be lessthan 1 hour. A maximum of 24 timepoints are allowed in a day. In apolicy, you are advised to set one timepoint for one day.
start_time No String Start time of the scheduler
l Example response
{ "policies" : [ { "created_at" : "2017-03-07T09:31:08.265000", "description" : "My plan", "id" : "27b11f3f-578d-4464-89d1-7c6d5894f753", "name" : "my-plan", "parameters" : { "common" : { } }, "project_id" : "tenant", "provider_id" : "c714180d-ea34-4b13-9a5e-577c7c416eec", "resources" : [ { "id" : "45baf976-c20a-4894-a7c3-c94b7376bf55", "name" : "resource1", "type" : "OS::Nova::Server", "extra_info" : { "exclude_volumes": ["8a8ccde2-0b9a-4450-a5f3-150816635f46"] } }, { "id" : "5aa119a8-d25b-45a7-8d1b-88e127885635", "name" : "resource2", "type" : "OS::Nova::Server",
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
56
"extra_info" : { } } ], "scheduled_operations" : [ { "description" : "My backup policy", "enabled" : true, "id" : "3b2fdf8c-2cc2-4887-9605-a8443922f6f2", "name" : "my-backup-policy", "operation_definition" : { "max_backups" : "20", "plan_id" : "27b11f3f-578d-4464-89d1-7c6d5894f753", "provider_id" : "c714180d-ea34-4b13-9a5e-577c7c416eec" }, "operation_type" : "backup", "trigger" : { "id" : "f1246246-ec6a-4e9a-917e-d050dc2808c9", "name" : "default", "properties" : { "pattern" : "BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nRRULE:FREQ=WEEKLY;BYDAY=TH;BYHOUR=12;BYMINUTE=27\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n", "start_time" : "2017-03-07 09:31:08" }, "type" : "time" }, "trigger_id" : "f1246246-ec6a-4e9a-917e-d050dc2808c9" } ], "status" : "suspended" } ]}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error CodesFor details, see A.1 Error Codes.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
57
3.3 Backup Management
3.3.1 Executing a Backup Policy
Function
This API is used to manually create a backup policy and backups.
URIl URI format
POST /v1/{project_id}/providers/{provider_id}/checkpoints
l Parameter description
Name Mandatory
Type Description
project_id Yes String -
provider_id Yes String Backup provider ID
Requestl Element description
Name Mandatory
Type Description
checkpoint Yes checkpoint_req
-
l Parameter description of field checkpoint_req
Name Mandatory
Type Description
parameters Yes checkpoint_param
Backup parameters
plan_id Yes String Backup policy ID. Refer to thebackup policy ID that is returned bythe API of "Querying the BackupPolicy List."
l Parameter description of field checkpoint_param
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
58
Name Mandatory
Type Description
auto_trigger No Boolean Whether automatic trigger is enabled
resources No List<String>
IDs of resources to be backed up
l Example requestPOST /v1/{project_id}/providers/{provider_id}/checkpoints{ "checkpoint" : { "plan_id" : "62171999-3df1-42f7-9513-6f9b1bea4744", "parameters" : { "auto_trigger" : false, "resources" : [ "7a32a8b5-7977-4e24-b5da-e0eb457db75b", "b2b433bf-7dd6-4a74-aa8f-85673dfbda48" ] } }}
Responsel Element description
Name Mandatory
Type Description
checkpoint Yes checkpoint_resp
-
l Parameter description of field checkpoint_resp
Name Mandatory
Type Description
status Yes String Status
created_at Yes String Creation time
id Yes String Backup record ID
resource_graph Yes String Resource graph
project_id Yes String Project ID
protection_plan No plan_resp Backup policy information
l Parameter description of field plan_resp
Name Mandatory
Type Description
id Yes String Backup policy ID
name Yes String Backup policy name
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
59
Name Mandatory
Type Description
resources No List<resource>
Backup object list
l Parameter description of field resource
Name Mandatory
Type Description
id Yes String ID of the object to be backed up
type Yes String Entity object type of backup objectsPossible values areOS::Nova::Server (ECS) andOS::Ironic::BareMetalServer(BMS).
name Yes String Backup object name
extra_info No Dict Additional information about thebackup object
l Parameter description of field extra_info
Name Mandatory
Type Description
exclude_volumes No List<volume_id>
Volume ID list. If the backup object isan ECS , volumes whose IDs arespecified in this parameter will not bebacked up.
l Example response{ "checkpoint" : { "status" : "protecting", "created_at" : "2016-12-06T21:20:29.898823", "id" : "14626f11-b54a-44ea-8e69-7463e527506a", "resource_graph" : null, "project_id" : "b942cc8342734d15bcb246babb1953cf", "protection_plan" : { "id" : "6a6cda7e-7b89-4b14-8e5c-3b6821a97d2c", "resources" : [ { "type" : "OS::Nova::Server", "id" : "1c960fe4-e679-421a-97cd-4f7463d2344b", "name" : "server0", "extra_info": { "exclude_volumes": ["53dbb1f8-0b14-4850-9346-ef5067acbeb5"] } } ], "name" : "backup" } }}
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
60
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.3.2 Querying the Number of Backups
Function
This API is used to query the number of backups.
URIl URI format
GET /v1/{project_id}/checkpoint_items/count
l Parameter description
Name Mandatory
Type Description
project_id Yes String -
Requestl Parameter description
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
61
Name Mandatory
Type Description
status No String Query based on field status issupported.
limit No Integer Number of backups displayed perpage
marker No String ID of the last record displayed on theprevious page
sort No String The value of sort is a group ofproperties separated by commas (,)and sorting directions. The format is<key1>[:<direction>],<key2>[:<direction>], where the value of direction isasc (in ascending order) or desc (indescending order). If the parameterdirection is not specified, backuppolicies are sorted in descendingorder by time. The value of sortcontains a maximum of 255characters.
all_tenants No Boolean Whether backups of all tenants arequeried
name No String Query based on field name issupported.
az No String AZ-based filtering is supported.
resource_id No String Filtering based on the backup objectID is supported.
resource_name No String Filtering based on the backup objectname is supported.
start_time No String Filtering based on the backup starttime is supported.
end_time No String Filtering based on the backup endtime is supported.
image_type No String Filtering based on the backup type issupported.
policy_id No String Filtering based on policy_id issupported.
ip No String Searching based on the VM's IPaddress is supported.
offset No Integer Offset value
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
62
Name Mandatory
Type Description
checkpoint_id No String Filtering based on checkpoint_id issupported.
resource_type No String Type of backup objects
l Element description
None
l Example requestQuerying the total number of backups:GET /v1/{project_id}/checkpoint_items/countQuerying the number of backups with certain conditions:GET /v1/{project_id}/checkpoint_items/count?starus=error
Responsel Element description
Name Mandatory
Type Description
count Yes Integer Number of backups
l Example response
{ "count" : 10}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
63
Error Codes
For details, see A.1 Error Codes.
3.3.3 Querying a Single Backup
Function
This API is used to query the backup of a specific ID.
URIl URI format
GET /v1/{project_id}/checkpoint_items/{checkpoint_item_id}l Parameter description
Name Mandatory
Type Description
project_id Yes String -
checkpoint_item_id Yes String Backup ID
Requestl Element description
None
l Example requestGET /v1/{project_id}/checkpoint_items/{checkpoint_item_id}
Responsel Element description
Name Mandatory
Type Description
checkpoint_item Yes checkpoint_item
-
l Parameter description of field checkpoint_item
Name Mandatory
Type Description
checkpoint_id Yes String Backup record ID
created_at Yes Stringl Creation time
extend_info No Dict Extension information
id Yes String Backup ID
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
64
Name Mandatory
Type Description
name Yes String Backup name
resource_id Yes String Backup object ID
status Yes String Backup status. Possible values arewaiting_protect, protecting,available, waiting_restore,restoring, error, waiting_delete,deleting, and deleted.Enum:[ waiting_protect, protecting,available, waiting_restore, restoring,error, waiting_delete,deleting,deleted]
updated_at Yes String Update time
backup_data Yes Dict VM metadata
description No string Backup description
resource_type No String Type of the backup object
l Parameter description of field extend_info
Name Mandatory
Type Description
auto_trigger No Boolean Whether automatic trigger is enabled
average_speed No Integer Average speed
copy_from No String This parameter is left blank bydefault.
copy_status No String The default value is na.
fail_code No fail_code Error code
fail_op No String Type of the failed operationEnum: [backup, restore, delete]
fail_reason No String Description of the failure cause
image_type No String Backup type
incremental No Boolean Whether incremental backup is used
progress No Integer Progress
resource_az No String AZ to which the backup resourcebelongs
resource_name No String Backup object name
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
65
Name Mandatory
Type Description
resource_type No String Type of the backup object
size No Integer Backup capacity
space_saving_ratio No Integer Space saving rate
volume_backups No List<volume_backup>
Volume backup list
finished_at No String Backup completion time
supported_restore_mode
No String Restoration mode. Possible values arena, snapshot, and backup.If the value is snapshot, the backupcan be used to create a full-ECSimage.backup: Data is restored frombackups of the EVS disks of the ECS.na: Restoration is not supported.
os_images_data No List<image_data>
Image data
support_lld No Boolean Whether to allow lazyloading for fastrestoration
retention_duration No Integer Replica retention period, in days.Value -1 indicates that replicas will beretained permanently.
l Parameter description of field backup_data
Name Mandatory
Type Description
__openstack_region_name
No String Name of the AZ where the ECSresides
cloudservicetype No String ECS type
disk No String System disk size corresponding to theECS specifications
imagetype No String Image typeThe value can be:gold: public imageprivate: private imagemarket: market image
ram No String Memory size of the ECS, in MB
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
66
Name Mandatory
Type Description
vcpus No String CPU cores corresponding to the ECS
eip No String Elastic IP address of the ECS
private_ip No String Internal IP address of the ECS
l Parameter description of field image_data
Name Mandatory
Type Description
image_id Yes String Image ID
l Parameter description of field fail_code
Name Mandatory
Type Description
Code No Long Error code
Description No String Error description
l Parameter description of field volume_backup
Name Mandatory
Type Description
average_speed No Integer Average speed
bootable Yes Boolean Whether the disk is bootable
id Yes String Cinder backup ID
image_type Yes String Backup set type: backupEnum:[ backup]
incremental Yes Boolean Whether incremental backup is used
name Yes String EVS disk backup name
size Yes Integer Accumulated size (MB) of backups
source_volume_id Yes String Source volume ID
source_volume_size
Yes Integer Source volume size in GB
space_saving_ratio No Integer Space saving rate
status Yes String Status
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
67
Name Mandatory
Type Description
source_volume_name
Yes String Source volume name
snapshot_id No String ID of the snapshot from which thebackup is generated
l Example response
{ "checkpoint_item": { "status": "available", "backup_data": { "eip": "", "cloudservicetype": "", "ram": 4096, "vcpus": 4, "__openstack_region_name": "", "private_ip": "", "disk": 0, "imagetype": "" }, "name": "backup_d32c", "resource_id": "f45c477a-57e5-465f-999f-d845083962db", "created_at": "2017-04-15T04:20:37.277880", "checkpoint_id": "f672a1bb-6912-446a-816c-72792c5263e0", "updated_at": "2017-04-15T04:25:38.680638", "resource_type": "OS::Nova::Server", "extend_info": { "auto_trigger": false, "space_saving_ratio": 0, "copy_status": "na", "fail_reason": "", "resource_az": "az1.dc1", "image_type": "backup", "finished_at": "2017-04-15T04:25:38.675478", "average_speed": 0, "copy_from": "", "supported_restore_mode": "backup", "support_lld": False, "os_images_data": [ { "image_id": "fe84dd80-0229-4918-8d3d-cbb33154b565" } ], "volume_backups": [ { "status": "available", "space_saving_ratio": 0, "name": "manualbk_47222", "bootable": true, "average_speed": 0, "source_volume_size": 20, "source_volume_id": "ee27f809-6fb5-40ae-ac46-c932bb4ee8fe", "incremental": false, "image_type": "backup", "source_volume_name": "karbor_02", "id": "70675cbc-d3a8-43a7-9f81-c8b6bc3f5d6d", "size": 0, "snapshot_id": "36f520e1-d2ea-4907-956a-3d9cd53e2d38" }, { "status": "available", "space_saving_ratio": 0, "name": "manualbk_47222",
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
68
"bootable": true, "average_speed": 0, "source_volume_size": 20, "source_volume_id": "e7f48980-927c-48de-afd4-f0245d2e5100", "incremental": false, "image_type": "backup", "source_volume_name": "karbor_01", "id": "8eb98e91-8924-4d4b-b6d6-28fb7b751e9c", "size": 0, "snapshot_id": "36f520e1-d2ea-4907-956a-3d9cd53e2d38" } ], "fail_code": {}, "incremental": false, "taskid": "e0a21692-2192-11e7-bf23-0242ac110007", "hypervisor_type": "QEMU", "progress": 100, "fail_op": "", "resource_name": "karbor_02", "size": 0 }, "id": "90c1d5fa-1b9f-4aeb-b2f4-81c806e98190" }}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.3.4 Querying All Backups
Function
This API is used to query all backups.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
69
URIl URI format
GET /v1/{project_id}/checkpoint_itemsl Parameter description
Name Mandatory
Type Description
project_id Yes String -
Requestl Parameter description
Name Mandatory
Type Description
status No String Query based on field status issupported.
limit No Integer Number of backups displayed perpage
marker No String ID of the last record displayed on theprevious page
sort No String The value of sort is a group ofproperties separated by commas (,)and sorting directions. The format is<key1>[:<direction>],<key2>[:<direction>], where the value of direction isasc (in ascending order) or desc (indescending order). If the parameterdirection is not specified, the defaultsorting direction is desc. The value ofsort contains a maximum of 255characters.
all_tenants No Boolean Whether backups of all tenants arequeried
name No String Query based on field name issupported.
az No String AZ-based filtering is supported.
resource_id No String Filtering based on the backup objectID is supported.
resource_name No String Filtering based on the backup objectname is supported.
start_time No String Filtering based on the backup starttime is supported.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
70
Name Mandatory
Type Description
end_time No String Filtering based on the backup endtime is supported.
image_type No String Filtering based on the backup type issupported.
policy_id No String Filtering based on policy_id issupported.
ip No String Searching based on the VM's IPaddress is supported.
offset No Integer Offset value
checkpoint_id No String Filtering based on checkpoint_id issupported.
resource_type No String Type of backup objects
l Element description
None
l Example requestQuerying all backups:GET /v1/{project_id}/checkpoint_itemsQuerying backups with specified parameters:GET /v1/{project_id}/checkpoint_items?name=backup&status=error&limit=2
Responsel Element description
Name Mandatory
Type Description
checkpoint_items No List<checkpoint_item>
-
l Parameter description of field checkpoint_item
Name Mandatory
Type Description
checkpoint_id Yes String Backup record ID
created_at Yes String Creation time
extend_info No Dict Extension information
id Yes String Backup ID
name Yes String Backup name
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
71
Name Mandatory
Type Description
resource_id Yes String Backup object ID
status Yes String Backup statusThe value can be waiting_protect,protecting, available,waiting_restore, restoring, error,waiting_delete, deleting, or deleted.
updated_at Yes String Update time
backup_data Yes Dict VM metadata
description No string Backup description
resource_type No String Type of backup objects
l Parameter description of field extend_info
Name Mandatory
Type Description
auto_trigger No Boolean Whether automatic trigger is enabled
average_speed No Integer Average speed
copy_from No String This parameter is left blank bydefault.
copy_status No String The default value is na.
fail_code No fail_code Error code
fail_op No String Type of the failed operationEnum: [backup, restore, delete]
fail_reason No String Description of the failure cause
image_type No String Backup type: backup by default
incremental No Boolean Whether incremental backup is used
progress No Integer Progress
resource_az No String AZ to which the backup resourcebelongs
resource_name No String Backup object name
resource_type No String Type of backup objects
size No Integer Backup capacity
space_saving_ratio No Integer Space saving rate
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
72
Name Mandatory
Type Description
volume_backups No List<volume_backup>
Volume backup list
finished_at No String Backup completion time
supported_restore_mode
No String Restoration mode. Possible values arena, snapshot, and backup.If the value is snapshot, the backupcan be used to create a full-ECSimage.backup: Data is restored frombackups of the EVS disks of the ECS.na: Restoration is not supported.
os_images_data No List<image_data>
Image data
support_lld No Boolean Whether to allow lazyloading for fastrestoration
retention_duration No Integer Replica retention period, in days.Value -1 indicates that replicas will beretained permanently.
l Parameter description of field image_data
Name Mandatory
Type Description
image_id Yes String Image ID
l Parameter description of field backup_data
Name Mandatory
Type Description
__openstack_region_name
No String Name of the AZ where the ECSresides
cloudservicetype No String ECS type
disk No String System disk size corresponding to theECS specifications
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
73
Name Mandatory
Type Description
imagetype No String Image typeThe value can be:gold: public imageprivate: private imagemarket: market image
ram No String Memory size of the ECS, in MB
vcpus No String CPU cores corresponding to the ECS
eip No String Elastic IP address of the ECS
private_ip No String Internal IP address of the ECS
l Parameter description of field fail_code
Name Required
Type Notes
Code No Long Error code
Description No String Error description
l Parameter description of field volume_backup
Name Mandatory
Type Description
average_speed No Integer Average speed
bootable Yes Boolean Whether the disk is bootable
id Yes String Cinder backup ID
image_type Yes String Backup set type: backupEnum:[ backup]
incremental Yes Boolean Whether incremental backup is used
name Yes String EVS disk backup name
size Yes Integer Accumulated size (MB) of backups
source_volume_id Yes String Source volume ID
source_volume_size
Yes Integer Source volume size in GB
space_saving_ratio No Integer Space saving rate
status Yes String Status
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
74
Name Mandatory
Type Description
source_volume_name
Yes String Source volume name
snapshot_id No String ID of the snapshot from which thebackup is generated
l Parameter description of field replication_record
Name Mandatory
Type Description
id Yes String Replication record ID
source_region Yes String Replication source region
source_project_id Yes String ID of the replication source project
source_checkpoint_id
Yes String ID of the source backup record usedfor replication
source_checkpoint_item_id
Yes String ID of the source backup used forreplication
destination_region Yes String ID of the replication destinationregion
destination_project_id
Yes String ID of the replication destinationproject
destination_checkpoint_id
Yes String Record ID of the destination backupused for replication
destination_checkpoint_item_id
Yes String Replica ID
status Yes String Replication status, which can bereplicating, success, fail, skip, orwaiting_replicate
plan_id Yes String ID of the in-use replication policy
created_at Yes String Replication start time
extra_info Yes Dict Additional information of thereplication
l Example response
{ "checkpoint_items" : [ { "status" : "available", "backup_data" : { "eip" : "", "cloudservicetype" : "", "ram" : 4096, "vcpus" : 4,
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
75
"__openstack_region_name" : "", "private_ip" : "", "disk" : 0, "imagetype" : "" }, "name" : "backup_d32c", "resource_id" : "f45c477a-57e5-465f-999f-d845083962db", "created_at" : "2017-04-15T04:20:37.277880", "checkpoint_id" : "f672a1bb-6912-446a-816c-72792c5263e0", "updated_at" : "2017-04-15T04:25:38.680638", "resource_type": "OS::Nova::Server", "extend_info" : { "auto_trigger" : false, "space_saving_ratio" : 0, "copy_status" : "na", "fail_reason" : "", "resource_az" : "az1.dc1", "image_type" : "backup", "finished_at" : "2017-04-15T04:25:38.675478", "average_speed" : 0, "copy_from" : "", "supported_restore_mode": "backup", "support_lld": False, "os_images_data": [ { "image_id": "fe84dd80-0229-4918-8d3d-cbb33154b565" } ], "volume_backups" : [ { "status" : "available", "space_saving_ratio" : 0, "name" : "manualbk_47222", "bootable" : true, "average_speed" : 0, "source_volume_size" : 20, "source_volume_id" : "ee27f809-6fb5-40ae-ac46-c932bb4ee8fe", "incremental" : false, "image_type" : "backup", "source_volume_name" : "karbor_xj_02", "id" : "70675cbc-d3a8-43a7-9f81-c8b6bc3f5d6d", "size" : 0, "snapshot_id": "36f520e1-d2ea-4907-956a-3d9cd53e2d38" }, { "status" : "available", "space_saving_ratio" : 0, "name" : "manualbk_47222", "bootable" : true, "average_speed" : 0, "source_volume_size" : 20, "source_volume_id" : "e7f48980-927c-48de-afd4-f0245d2e5100", "incremental" : false, "image_type" : "backup", "source_volume_name" : "karbor_01", "id" : "8eb98e91-8924-4d4b-b6d6-28fb7b751e9c", "size" : 0, "snapshot_id": "36f520e1-d2ea-4907-956a-3d9cd53e2d38" } ], "fail_code" : { }, "incremental" : false, "taskid" : "e0a21692-2192-11e7-bf23-0242ac110007", "hypervisor_type" : "QEMU", "progress" : 100, "fail_op" : "", "resource_name" : "karbor_02", "size" : 0 }, "id" : "90c1d5fa-1b9f-4aeb-b2f4-81c806e98190" } ]}
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
76
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.3.5 Deleting a Backup
Function
This API is used to delete a backup.
URIl URI format
DELETE /v1/{project_id}/providers/{provider_id}/checkpoints/{checkpoint_id}l Parameter description
Name Mandatory
Type Description
project_id Yes String -
provider_id Yes String Backup provider ID
checkpoint_id Yes String Backup record ID
Requestl Parameter description
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
77
Name Mandatory
Type Description
checkpoint_items No String Indicates the ID list of the backuprecords to be deleted. If thisparameter is not set, all backuprecords of checkpoint will be deleted.
l Element description
None
l Example requestDeleting all backups in the specified backup record:DELETE /v1/{project_id}/providers/{provider_id}/checkpoints/{checkpoint_id}Deleting a single backup in the specified backup record:DELETE /v1/{project_id}/providers/{provider_id}/checkpoints/{checkpoint_id}?checkpoint_items={checkpoint_items_id}
Responsel Element description
Nonel Example response
None
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
78
3.4 Restoration Management
3.4.1 Creating a Restoration Task
Function
This API is used to perform backup-based restoration.
URIl URI format
POST /v1/{project_id}/restoresl Parameter description
Name Mandatory
Type Description
project_id Yes String -
Requestl Element description
Name Mandatory
Type Description
restore Yes restore_req
Restoration request
l Parameter description of field restore_req
Name Mandatory
Type Description
checkpoint_id Yes String Backup record ID
parameters Yes restore_param
Restoration parameters
provider_id Yes String Backup provider ID
restore_target No String Restoration target
l Parameter description of field restore_param
Name Mandatory
Type Description
checkpoint_item_id No String Backup ID
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
79
Name Mandatory
Type Description
power_on No Boolean Whether to power on the VM afterrestoration
targets Yes restore_target
Restoration target
l Parameter description of field restore_target
Name Mandatory
Type Description
server_id No String ID of the ECS to be restored
volumes No List<restore_volume_mapping>
List of the mappings between diskbackups and target disks
l Parameter description of field restore_volume_mapping
Name Mandatory
Type Description
backup_id Yes String EVS disk ID
volume_id Yes String ID of the target EVS disk for therestoration
l Example request
POST /v1/{project_id}/restores{ "restore" : { "provider_id" : "fc4d5750-22e7-4798-8a46-f48f62c4c1da", "checkpoint_id" : "a2b9fb53-2770-4fcd-9bad-6cadd56e6c09", "parameters" : { "checkpoint_item_id" : "504b7d59-c361-411f-9ed3-814f35d08e3d", "power_on" : true, "targets" : { "server_id" : "f45c477a-57e5-465f-999f-d845083962db", "volumes" : [ { "backup_id" : "bc118c24-3234-4afd-8423-d66d3d677649", "volume_id" : "ee27f809-6fb5-40ae-ac46-c932bb4ee8fe" } ] } } }}
Responsel Element description
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
80
Name Mandatory
Type Description
restore Yes restore_resp
Restoration response
l Parameter description of field restore_resp
Name Mandatory
Type Description
id Yes String Restoration ID
checkpoint_id Yes String Backup record ID
parameters Yes restore_param
Restoration parameters
project_id Yes String Tenant ID
provider_id Yes String Backup provider ID
resources_reason No Dict Cause of the resource restorationfailure
resources_status No Dict Resource status
restore_target No String Restoration target
status No String Status
l Parameter description of field restore_param
Name Mandatory
Type Description
checkpoint_item_id No String Backup ID
power_on No String Whether to power on the VM afterrestoration
targets Yes restore_target
Restoration target
l Parameter description of field restore_target
Name Mandatory
Type Description
server_id No String ID of the ECS to be restored
volumes No List<restore_volume_mapping>
List of the mappings between diskbackups and target disks
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
81
Name Mandatory
Type Description
resource_type No String Type of the object to be restored
l Parameter description of field restore_volume_mapping
Name Mandatory
Type Description
backup_id Yes String EVS disk ID
volume_id Yes String ID of the target EVS disk for therestoration
l Example response{ "restore" : { "restore_target" : "http://192.168.1.2:35357/v2.0/", "status" : "in_progress", "provider_id" : "fc4d5750-22e7-4798-8a46-f48f62c4c1da", "resources_status" : { }, "parameters" : { "power_on" : true, "targets" : { "server_id" : "f45c477a-57e5-465f-999f-d845083962db", "volumes" : [ { "backup_id" : "bc118c24-3234-4afd-8423-d66d3d677649", "volume_id" : "ee27f809-6fb5-40ae-ac46-c932bb4ee8fe" } ] }, "checkpoint_item_id" : "504b7d59-c361-411f-9ed3-814f35d08e3d" }, "checkpoint_id" : "a2b9fb53-2770-4fcd-9bad-6cadd56e6c09", "project_id" : "b942cc8342734d15bcb246babb1953cf", "id" : "d3a54e80-6483-485d-98f6-c0409e6f2e0a", "resources_reason" : { } }}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
82
Return Value Description
404 Requested object not found.
500 Service internal error.
503 Service unavailable.
Error Codes
For details, see A.1 Error Codes.
3.5 Quota Management
3.5.1 Querying Quotas
Function
This API is used to query quotas of a tenant.
URIl URI format
GET /v1/{project_id}/quotasl Parameter description
Name Mandatory
Type Description
project_id Yes String -
Requestl Element description
None
l Example requestGET /v1/{project_id}/quotas
Responsel Element description
Name Mandatory
Type Description
quotas Yes quota -
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
83
l Parameter description of field quota
Name Mandatory
Type Description
resources Yes List<resource_resp>
Quota resources
l Parameter description of field resource_resp
Name Mandatory
Type Description
unit No String Unit
used Yes Integer Used quota
quota Yes Integer Quota size
type Yes String TypeEnum:[backup_capacity,copy_capacity,backups]
l Example response{ "quotas" : { "resources" : [ { "type" : "backup_capacity", "unit" : "GB", "quota" : 100, "used" : 0 } ] }}
Return Valuesl Normal
Return Value Description
200 OK
l Abnormal
Return Value Description
400 Invalid request parameters.
401 Authentication failed.
403 No operation permission.
404 Requested object not found.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
84
Return Value Description
500 Service internal error.
503 Service unavailable.
Error CodesFor details, see A.1 Error Codes.
Cloud Server Backup ServiceAPI Reference 3 CSBS
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
85
A Appendix
A.1 Error CodesA response error is returned as follows:
{ "error_code": xxxx,//Error code "error_msg": xxxxx//Error description}
Table A-1 describes the error codes.
Table A-1 Error code description
Error Code Description
CSBS.0001 Cause: The number of backup policies has reached the upper limit.Suggestion: Delete an existing backup policy and try again.
CSBS.0002 Cause: The number of ECSs in the backup policy has reached the upperlimit.Suggestion: Reduce ECSs and try again.
CSBS.1000 Cause: The backup policy has expired.Suggestion: Contact the administrator.
CSBS.1001 Cause: The backup task cannot be executed, because a manual backup taskis being executed.Suggestion: Re-execute the backup task after the manual backup task iscomplete.
CSBS.1002 Cause: The selected ECS is being backed up.Suggestion: Try again after the backup task is complete.
CSBS.2001 Cause: A task is being executed by using this backup policy.Suggestion: Try again after the task is complete.
Cloud Server Backup ServiceAPI Reference A Appendix
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
86
Error Code Description
CSBS.2003 Cause: The selected backup is in the Backing up, Restoring, or Deletingstate.Suggestion: Try again after the task is complete.
CSBS.3000 Cause: The backup policy does not exist.Suggestion: None.
CSBS.3001 Cause: The backup does not exist.Suggestion: None.
CSBS.4000 Cause: The current backup status does not allow restoration.Suggestion: Try again later or contact technical support.
CSBS.6000 Cause: The ECS does not exist.Suggestion: None.
CSBS.6001 Cause: The ECS has stopped.Suggestion: None.
CSBS.6003 Cause: Only ECS backup is supported currently.Suggestion: Select ECSs and add them to the backup policy.
CSBS.6004 Cause: The ECS has been added to the backup policy and cannot be addedagain.Suggestion: None.
CSBS.6005 Cause: The current ECS status does not allow backup.Suggestion: Ensure that the ECS status allows restoration and try again.
CSBS.6006 Cause: This type of ECS does not support backup.Suggestion: Select ECSs of a correct type.
CSBS.6007 Cause: ECSs without EVS disks do not support backup.Suggestion: None.
CSBS.6008 Cause: The ECS does not support backup, because the EVS disks on theECS are from different back-end storage devices.Suggestion: None.
CSBS.6009 Cause: This ECS cannot be added to the backup policy, because some EVSdisks attached to this ECS have been added to other backup policies.Suggestion: Disassociate the EVS disks from the backup policy or detachthem.
CSBS.6010 Cause: The ECS does not support backup, because it hosts shared EVSdisks.Suggestion: None.
Cloud Server Backup ServiceAPI Reference A Appendix
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
87
Error Code Description
CSBS.6011 Cause: The back-end storage device to which the EVS disk belongs doesnot support backup.Suggestion: None.
CSBS.6013 Cause: Only ECS restoration is supported currently.Suggestion: Select ECSs for restoration.
CSBS.6014 Cause: The specified EVS disk is not attached to the ECS to be restored.Suggestion: Select an EVS disk attached to the ECS to be restored.
CSBS.6015 Cause: The current ECS status does not allow restoration.Suggestion: Ensure that the ECS status allows restoration and try again.
CSBS.6016 Cause: This type of ECS does not support restoration.Suggestion: Select ECSs of a correct type.
CSBS.6017 Cause: The specified backup disk is not in the specified backup.Suggestion: Select a backup disk in the specified backup for restoration.
CSBS.6018 Cause: The system does not support the restoration of some backup disksin the backup.Suggestion: Select all backup disks in the backup for restoration.
CSBS.6019 Cause: The type of the target ECS is different from that of the source ECS.Suggestion: Select a target ECS of the same type as the source ECS.
CSBS.6020 Cause: ECSs without EVS disks do not support restoration.Suggestion: None.
CSBS.6021 Cause: The backup disk cannot be restored to a shared EVS disk of theECS.Suggestion: Restore the backup disk to a non-shared EVS disk of the ECS.
CSBS.6022 Cause: The back-end storage device to which the EVS disk belongs doesnot support restoration.Suggestion: None.
CSBS.6023 Cause: The backup data disk cannot be restored to the boot disk of theECS.Suggestion: Restore the backup data disk to a data disk of the ECS.
CSBS.6024 Cause: Restoration cannot be executed, because the capacity of thespecified EVS disk attached to the ECS is less than that of the backup disk.Suggestion: Expand the EVS disk and try again, or restore data of thebackup disk to a disk that has a larger capacity.
CSBS.6025 Cause: Restoration is not supported between the AZ to which the specifiedbackup belongs and the AZ to which the ECS belongs.Suggestion: Contact the administrator to reconfigure the AZ.
Cloud Server Backup ServiceAPI Reference A Appendix
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
88
Error Code Description
CSBS.6027 Cause: The AZ to which the ECS belongs does not support backup.Suggestion: Contact the administrator to reconfigure the AZ.
CSBS.6028 Cause: Quota information failed to be obtained.Suggestion: Check the network connection or contact technical support.
CSBS.6030 Cause: The backup task cannot be executed, because an automatic backuptask is being executed using this backup policy.Suggestion: Re-execute the backup task after the automatic backup task iscomplete.
CSBS.6031 Cause: The replication task cannot be executed, because a manualreplication task is being executed.Suggestion: Re-execute the replication task after the manual replicationtask is complete.
CSBS.6032 Cause: There are no ECSs that can be backed up in the backup policy.Suggestion: None.
CSBS.6033 Cause: An ECS with DSS disks cannot be backed up.Suggestion: None.
CSBS.6034 Cause: An ECS with DESS disks cannot be backed up.Suggestion: None.
CSBS.6040 Cause: The backup to be deleted does not exist.Suggestion: None.
CSBS.8012 Cause: Replicas cannot be used for replication.Suggestion: None.
CSBS.8014 Cause: The policy is being used for replication. Try later.Suggestion: None.
CSBS.8015 Cause: The backup is being replicated or has been replicated to thedestination region.Suggestion: None.
CSBS.8017 Cause: Insufficient permission to replicate the target ECS to this project.Suggestion: None.
CSBS.8021 Cause: The backup is not in the Available state and cannot be used forreplication.Suggestion: None.
CSBS.8022 Cause: Replicas cannot be used for replication.Suggestion: None.
Cloud Server Backup ServiceAPI Reference A Appendix
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
89
Error Code Description
CSBS.8023 Cause: Replication is not allowed, because the backup source is not anECS.Suggestion: None.
CSBS.8024 Cause: Replication is not allowed, because the source ECS of the backupdoes not contain any system disk.Suggestion: None.
CSBS.9001 Cause: Parameter verification failed.Suggestion: Check whether the parameter settings are correct.
CSBS.9002 Cause: You do not have the permission to perform this operation.Suggestion: None.
CSBS.9003 Cause: The license file is invalid.Suggestion: Apply for a new license file.
CSBS.9006 Cause: The quota is insufficient.Suggestion: Contact the administrator to change the quota or delete thebackups that are no longer needed.
CSBS.9007 Cause: The backup policy name already exists.Suggestion: Change the name and try again.
CSBS.9009 Cause: The user is not authenticated by real name. Authenticate the user'sreal name and try again.Suggestion: Authenticate the user's real name and try again.
CSBS.9998 Cause: Service unavailable.Suggestion: None.
CSBS.9999 Cause: Internal system error.Suggestion: Try later or contact technical support.
Karbor native APIs:
http://developer.openstack.org/api-ref/data-protection-orchestration/v1/index.html
Cloud Server Backup ServiceAPI Reference A Appendix
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
90
B Change History
Release Date What's New
2018-08-06 This is the fifth official release.Updated the following content:Added fields related to BMS backup.
2018-05-30 This is the fourth official release.Updated the following content:l Added description of image-related fields.l Added fields related to backup by specifying disks.
2017-12-30 This issue is the third official release.Updated the following content:l Resolved some ease-of-use issues.
2017-11-15 This issue is the second official release.Updated the following content:l Added the support for specifying the backup interval in units of
days.
2017-07-30 This issue is the first official release.
Cloud Server Backup ServiceAPI Reference B Change History
Issue 05 (2018-08-06) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.
91