api reference...welcome to relational database service api reference. rds is an online relational...
TRANSCRIPT
Relational Database Service
API Reference
Issue 25
Date 2021-01-18
HUAWEI TECHNOLOGIES CO., LTD.
Copyright © Huawei Technologies Co., Ltd. 2021. All rights reserved.
No part of this document may be reproduced or transmitted in any form or by any means without priorwritten consent 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 andthe customer. All or part of the products, services and features described in this document may not bewithin the purchase 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, guaranteesor representations 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: https://e.huawei.com
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. i
Contents
1 Before You Start....................................................................................................................... 11.1 Overview.................................................................................................................................................................................... 11.2 API Calling..................................................................................................................................................................................11.3 Endpoints....................................................................................................................................................................................11.4 Constraints................................................................................................................................................................................. 11.5 Concepts..................................................................................................................................................................................... 21.6 Selecting an API Type.............................................................................................................................................................3
2 API Overview............................................................................................................................ 4
3 Calling APIs............................................................................................................................... 63.1 Making an API Request......................................................................................................................................................... 63.2 Authentication....................................................................................................................................................................... 103.3 Response.................................................................................................................................................................................. 12
4 Obtaining an API Version.................................................................................................... 144.1 Querying API Versions......................................................................................................................................................... 144.2 Querying a Specified API Version.................................................................................................................................... 17
5 API v3 (Recommended)....................................................................................................... 205.1 Querying Version Information About a DB Engine................................................................................................... 205.2 Querying Database Specifications.................................................................................................................................. 225.3 Querying the Storage Type of a Database...................................................................................................................255.4 DB Instance Management................................................................................................................................................. 275.4.1 Creating a DB Instance.................................................................................................................................................... 275.4.2 Changing a DB Instance Name.................................................................................................................................... 605.4.3 Changing a DB Instance Description.......................................................................................................................... 625.4.4 Applying for a Private Domain Name........................................................................................................................ 635.4.5 Modifying a Private Domain Name............................................................................................................................ 655.4.6 Changing DB Instance Specifications......................................................................................................................... 665.4.7 Scaling Up Storage Space of a DB Instance............................................................................................................. 705.4.8 Changing a Single DB Instance to Primary/Standby DB Instances.................................................................. 735.4.9 Rebooting a DB Instance................................................................................................................................................ 755.4.10 Querying the Available SQL Server Character Set...............................................................................................765.4.11 Deleting a DB Instance................................................................................................................................................. 785.4.12 Querying Details About DB Instances......................................................................................................................79
Relational Database ServiceAPI Reference Contents
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. ii
5.4.13 Binding and Unbinding an EIP................................................................................................................................... 935.4.14 Resetting a Database Password................................................................................................................................. 955.4.15 Changing the Failover Priority.................................................................................................................................... 975.4.16 Manually Switching Primary/Standby DB Instances........................................................................................... 995.4.17 Changing the Data Synchronize Model of Primary/Standby DB Instances..............................................1005.4.18 Migrating a Standby DB Instance........................................................................................................................... 1025.4.19 Configuring the Maintenance Window.................................................................................................................1035.5 Database Security...............................................................................................................................................................1055.5.1 Configuring SSL............................................................................................................................................................... 1055.5.2 Changing a Database Port........................................................................................................................................... 1065.5.3 Changing a Security Group..........................................................................................................................................1075.5.4 Changing a Private IP Address....................................................................................................................................1095.6 Parameter Configuration................................................................................................................................................. 1105.6.1 Obtaining a Parameter Template List...................................................................................................................... 1105.6.2 Creating a Parameter Template................................................................................................................................. 1135.6.3 Modifying a Parameter Template..............................................................................................................................1175.6.4 Applying a Parameter Template................................................................................................................................ 1195.6.5 Modifying Parameters of a Specified DB Instance.............................................................................................. 1225.6.6 Obtaining the Parameter Template of a Specified DB Instance..................................................................... 1255.6.7 Obtaining Parameters in a Specified Parameter Template.............................................................................. 1275.6.8 Deleting a Parameter Template................................................................................................................................. 1315.7 Backup and Restoration................................................................................................................................................... 1325.7.1 Setting an Automated Backup Policy.......................................................................................................................1325.7.2 Setting a Cross-Region Backup Policy......................................................................................................................1385.7.3 Obtaining an Automated Backup Policy................................................................................................................. 1415.7.4 Querying Information About a Cross-Region Backup Policy........................................................................... 1435.7.5 Creating a Manual Backup.......................................................................................................................................... 1455.7.6 Obtaining Details About Backups............................................................................................................................. 1505.7.7 Querying Information About a Cross-Region Backup List................................................................................ 1565.7.8 Querying Information About DB Instances for Which Cross-Region Backups Are Created .................1605.7.9 Obtaining the Link for Downloading a Backup File............................................................................................1635.7.10 Deleting a Manual Backup........................................................................................................................................ 1655.7.11 Querying the Restoration Time Range..................................................................................................................1665.7.12 Querying the Restoration Time Range of a Cross-Region Backup ............................................................ 1685.7.13 Restoring Data to a New DB Instance.................................................................................................................. 1705.7.14 Restoring Data to an Existing DB Instance..........................................................................................................2055.7.15 Restoring Tables to a Specified Point in Time (MySQL)................................................................................. 2135.8 Log Information Queries..................................................................................................................................................2155.8.1 Querying Database Error Logs................................................................................................................................... 2155.8.2 Querying Database Slow Logs................................................................................................................................... 2185.8.3 Obtaining Slow Query Log Statistics........................................................................................................................2215.8.4 Obtaining Links for Downloading Slow Query Logs...........................................................................................224
Relational Database ServiceAPI Reference Contents
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. iii
5.8.5 Setting SQL Audit............................................................................................................................................................2265.8.6 Querying the Policy for SQL Audit Logs................................................................................................................. 2285.8.7 Obtaining an Audit Log List........................................................................................................................................ 2305.8.8 Obtaining the Link for Downloading an Audit Log............................................................................................ 2335.9 Database and Account Management (MySQL).......................................................................................................2345.9.1 Precautions........................................................................................................................................................................ 2345.9.2 Creating a Database...................................................................................................................................................... 2345.9.3 Querying Details About a Database (Discarded)................................................................................................ 2375.9.4 Querying Details About Databases...........................................................................................................................2395.9.5 Querying Authorized Databases of a Specified User..........................................................................................2415.9.6 Deleting a Database...................................................................................................................................................... 2435.9.7 Creating a Database Account..................................................................................................................................... 2455.9.8 Querying Details About a Database User (Discarded)...................................................................................... 2475.9.9 Querying Details About Database Users................................................................................................................ 2495.9.10 Querying Authorized Users of a Specified Database....................................................................................... 2525.9.11 Deleting a Database Account...................................................................................................................................2545.9.12 Configuring a Password for a Database Account..............................................................................................2555.9.13 Authorizing a Database Account............................................................................................................................ 2575.9.14 Revoking Permissions of a Database Account....................................................................................................2605.10 Database and Account Management (Microsoft SQL Server).........................................................................2635.10.1 Creating a Database.................................................................................................................................................... 2635.10.2 Querying Details About Databases........................................................................................................................ 2655.10.3 Deleting a Database.................................................................................................................................................... 2685.10.4 Creating a Database Account...................................................................................................................................2695.10.5 Querying Details About Database Users.............................................................................................................. 2715.10.6 Querying Authorized Users of a Specified Database....................................................................................... 2735.10.7 Deleting a Database Account...................................................................................................................................2755.10.8 Authorizing a Database Account............................................................................................................................ 2775.10.9 Revoking Permissions of a Database Account....................................................................................................2795.11 Database and Account Management (PostgreSQL)............................................................................................2815.11.1 Creating a Database.................................................................................................................................................... 2815.11.2 Creating a Database Account...................................................................................................................................2855.11.3 Creating a Database Schema................................................................................................................................... 2875.11.4 Authorizing a Database Account............................................................................................................................ 2905.11.5 Resetting a Password for a Database Account...................................................................................................2945.11.6 Querying Details About Databases........................................................................................................................ 2965.11.7 Querying Details About Database Users.............................................................................................................. 2985.11.8 Querying Details About Database Schemas....................................................................................................... 3025.12 Recycling a DB Instance.................................................................................................................................................3045.12.1 Modify Recycling Policy.............................................................................................................................................. 3045.13 Tag Management............................................................................................................................................................. 3065.13.1 Adding Tags in Batches.............................................................................................................................................. 306
Relational Database ServiceAPI Reference Contents
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. iv
5.13.2 Deleting Tags in Batches............................................................................................................................................ 3085.13.3 Querying Project Tags................................................................................................................................................. 3105.14 Obtaining Task Information......................................................................................................................................... 3125.14.1 Obtaining Information About a Task with a Specified ID.............................................................................. 3125.14.2 Obtaining Task Information of a Specified SQL Server DB Instance in a Specified Time Range..... 319
6 Appendix............................................................................................................................... 3266.1 Abnormal Request Results.............................................................................................................................................. 3266.2 Status Codes......................................................................................................................................................................... 3266.3 Error Codes........................................................................................................................................................................... 3306.4 Obtaining a Project ID...................................................................................................................................................... 3366.5 Replication Mode Table.................................................................................................................................................... 3376.6 RDS Monitoring Metrics Description........................................................................................................................... 338
A Change History....................................................................................................................350
Relational Database ServiceAPI Reference Contents
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. v
1 Before You Start
1.1 OverviewWelcome to Relational Database Service API Reference. RDS is an online relationaldatabase service based on the cloud computing platform. RDS is reliable, scalable,and easy to manage, and immediately ready for use. RDS provides acomprehensive performance monitoring system, multi-level security protectionmeasures, and a professional database management platform, allowing you toeasily set up and scale a relational database.
This document describes how to use application programming interfaces (APIs) toperform operations on RDS DB instances, such as DB instance creation, backupand restoration, query, parameter modifications, and deletion. For details about allsupported operations, see API Overview.
If you plan to access RDS through an API, ensure that you are familiar with RDSconcepts. For details, see Service Overview in Relational Database Service UserGuide.
1.2 API CallingRDS supports Representational State Transfer (REST) APIs, allowing you to callAPIs using HTTPS. For details about API calling, see Calling APIs.
1.3 EndpointsAn endpoint is the request address for calling an API. Endpoints vary dependingon services and regions. For the OMS endpoints, see Regions and Endpoints.
1.4 Constraints● The numbers of RDS DB instances that you can create are determined by your
quota. To view or increase the quota, see Managing Quotas.● For more constraints, see API description.
Relational Database ServiceAPI Reference 1 Before You Start
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 1
1.5 Concepts● Account
An account is created after your registration. The account has full accesspermissions for all of its cloud services and resources. It can be used to resetuser passwords and grant user permissions. The account is a payment entityand should not be used directly to perform routine management. For securitypurposes, create IAM users and grant them permissions for routinemanagement.
● IAM UserAn IAM user is created using an account to use cloud services. Each IAM userhas its own identity credentials (password and access keys).The account name, username, and password will be required for APIauthentication.
● RegionA region is a geographic area in which cloud resources are deployed.Availability zones (AZs) in the same region can communicate with each otherover an intranet, while AZs in different regions are isolated from each other.Deploying cloud resources in different regions can better suit certain userrequirements or comply with local laws or regulations.
● AZAn AZ contains one or more physical data centers. Each AZ has independentcooling, fire extinguishing, moisture-proof, and electricity facilities. Within anAZ, computing, network, storage, and other resources are logically dividedinto multiple clusters. AZs within a region are interconnected using high-speed optical fibers to support cross-AZ high-availability systems.
● ProjectProjects group and isolate resources (including compute, storage, and networkresources) across physical regions. A default project is provided for eachregion, and subprojects can be created under each default project. Users canbe granted permissions to access all resources in a specific project. For morerefined access control, create subprojects under a project and purchaseresources in the subprojects. Users can then be assigned permissions to accessonly specific resources in the subprojects.
Figure 1-1 Project isolating model
Relational Database ServiceAPI Reference 1 Before You Start
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 2
● Enterprise ProjectEnterprise projects group and manage resources across regions. Resources inenterprise projects are logically isolated from each other. An enterprise projectcan contain resources in multiple regions, and resources can be directlytransferred between enterprise projects.For more information about enterprise projects and how to obtain enterpriseproject IDs, see Enterprise Management User Guide.
1.6 Selecting an API Type
Table 1-1 API type description
Version Recommended Description
v3 Yes APIs for RDS with customizedspecifications
Relational Database ServiceAPI Reference 1 Before You Start
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 3
2 API Overview
RDS APIs enable you to use all RDS functions, including creating DB instances,obtaining log information, and backing up and restoring data.
Type Subtype Description
RDS APIs(v3)
API VersionQueries
Obtain API versions, including the API versionlist and API version information.
RDS APIs(v3)
DB EngineVersion Queries
Query the DB version information of aspecified DB engine.
RDS APIs(v3)
DB SpecificationsQueries
Query the DB specifications of a specified DBengine version.
RDS APIs(v3)
DB Storage TypeQueries
Query the storage type of a specified DBengine version.
RDS APIs(v3)
DB InstanceManagement
Manage DB instances, including creating aDB instance, adjusting instance storagespace, rebooting a DB instance, deleting a DBinstance, obtaining a DB instance list, andobtaining detailed information of a specifiedDB instance.
RDS APIs(v3)
DatabaseSecurity
Improve database security, includingconfiguring SSL data encryption, changingdatabase ports, modifying security groups,and changing private IP addresses.
RDS APIs(v3)
ParameterConfiguration
Configure parameters, including obtaining aparameter list, obtaining configurationparameter information, obtaining defaultparameters of a DB instance, settingconfiguration parameters, restoringparameters to their default values, obtaininga parameter template list, and obtaining aparameter template.
Relational Database ServiceAPI Reference 2 API Overview
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 4
Type Subtype Description
RDS APIs(v3)
Backup andRestoration
Back up and restore data, including settingan automated backup policy, obtaining anautomated backup policy, creating a manualbackup, and deleting a manual backup.
RDS APIs(v3)
Log InformationQueries
Obtain log information, including queryingdatabase error logs and querying databaseslow logs.
RDS APIs(v3)
Database andAccountManagement(MySQL)
Create and query databases, create, query,and delete accounts, and grant and revokepermissions of accounts.
RDS APIs(v3)
Database andAccountManagement(Microsoft SQLServer)
Create and query databases, create, query,and delete accounts, and grant and revokepermissions to accounts
RDS APIs(v3)
Database andAccountManagement(PostgreSQL)
Create and query databases, and create andquery accounts.
RDS APIs(v3)
Recycle Bin Set a recycling policy.
RDS APIs(v3)
Tag Management Manage tags, including adding tags inbatches, deleting tags in batches, andquerying project tags.
RDS APIs(v3)
Task InformationQueries
Obtain information about a specified task inthe task center.
Relational Database ServiceAPI Reference 2 API Overview
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 5
3 Calling APIs
3.1 Making an API RequestThis section describes the structure of a REST API, and uses the IAM API forobtaining a user token as an example to describe how to call an API. Theobtained token is used to authenticate the calling of other APIs.
Request URIA request URI consists of the following:
{URI-scheme}://{Endpoint}/{resource-path}?{query-string}
Although a request URI is included in a request header, most programminglanguages or frameworks require the request URI to be separately transmitted,rather than being conveyed in a request message.
Table 3-1 Parameters in a URI
Parameter Description
URI-scheme Protocol used to transmit requests. All APIs use HTTPS.
Endpoint Domain name or IP address of the server bearing the RESTservice. The endpoint varies between services in differentregions. It can be obtained from Regions and Endpoints.For example, the endpoint of IAM in the CN North-Beijing1region is iam.cn-north-1.myhuaweicloud.com.
resource-path Access path of an API for performing a specified operation.Obtain the path from the URI of an API. For example, theresource-path of the API used to obtain a user token is /v3/auth/tokens.
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 6
Parameter Description
query-string Query parameter, which is optional. Ensure that a questionmark (?) is included before each query parameter that is in theformat of "Parameter name=Parameter value". For example, ?limit=10 indicates that a maximum of 10 data records will bedisplayed.
For example, to obtain an IAM token in the CN North-Beijing1 region, obtain theendpoint (iam.cn-north-1.myhuaweicloud.com) for this region and the resource-path (/v3/auth/tokens) in the URI of the API used to obtain a user token. Then,construct the URI as follows:
https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokens
Figure 3-1 Example URI
NO TE
To simplify the URI display in this document, each API is provided only with a resource-pathand a request method. The URI-scheme of all APIs is HTTPS, and the endpoints of all APIsin the same region are identical.
Request MethodsThe HTTP protocol defines the following request methods that can be used tosend a request to the server:
Table 3-2 HTTP methods
Method Description
GET Requests the server to return specified resources.
PUT Requests the server to update specified resources.
POST Requests the server to add resources or perform specialoperations.
DELETE Requests the server to delete specified resources, forexample, an object.
For example, in the case of the API used to obtain a user token, the requestmethod is POST. The request is as follows:
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 7
POST https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokens
Request HeaderYou can also add additional fields to a request, such as the fields required by aspecified URI or an HTTP method. For example, to request for the authenticationinformation, add Content-Type, which specifies the request body type.
Table 3-3 lists common request header fields.
Table 3-3 Common request headers
Name Description Mandatory Example
Host Specifies therequested serverinformation, whichcan be obtainedfrom the URL ofthe service API. Thevalue is in thehostname[:port]format. If the portnumber is notspecified, thedefault port isused. The defaultport number forhttps is 443.
NoThisparameter ismandatory forAK/SKauthentication.
code.test.comorcode.test.com:443
Content-Type Specifies the MIMEtype of the requestbody. You areadvised to use thedefault valueapplication/json.For APIs used toupload objects orimages, the valuecan vary dependingon the flow type.
Yes application/json
Content-Length
Specifies the lengthof the requestbody. The unit isbyte.
No 3495
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 8
Name Description Mandatory Example
X-Project-Id Specifies theproject ID. Obtainthe project ID byfollowing theinstructions inObtaining aProject ID.
NoThisparameter ismandatory forrequests thatuse AK/SKauthentication in theDedicatedCloud (DeC)scenario ormulti-projectscenario.
e9993fc787d94b6c886cbaa340f9c0f4
X-Auth-Token Specifies the usertoken.The user token is aresponse to the APIused to obtain auser token. ThisAPI is the only onethat does notrequireauthentication.After the request isprocessed, thevalue of X-Subject-Token in themessage header isthe token value.
NoThisparameter ismandatory fortokenauthentication.
The following is part ofan example token:MIIPAgYJKoZIhvcNAQc-Co...ggg1BBIINPXsidG9rZ
NO TE
In addition to supporting token-based authentication, APIs support authentication usingaccess key ID/secret access key (AK/SK). During AK/SK-based authentication, an SDK is usedto sign the request, and the Authorization (signature information) and X-Sdk-Date (timewhen the request is sent) header fields are automatically added to the request.
For more information, see AK/SK-based Authentication in Authentication.
The API used to obtain a user token does not require authentication. Therefore,only the Content-Type field needs to be added to requests for calling the API. Anexample of such requests is as follows:POST https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokensContent-Type: application/json
(Optional) Request Body
This part is optional. The body of a request is often sent in a structured format(for example, JSON or XML) as specified in the Content-Type header field. If the
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 9
request body contains Chinese characters, these characters must be coded inUTF-8.
The request body varies between APIs. Certain APIs do not require the requestbody, such as the APIs requested using the GET and DELETE methods.
In the case of the API used to obtain a user token, the request parameters andparameter description can be obtained from the API request. The followingprovides an example request with a body included. Replace username,domainname, ******** (login password), and xxxxxxxxxxxxxxxxxx (project name,such as cn-north-1) with actual values. You can obtain the values from Regionsand Endpoints.
NO TE
The scope parameter specifies where a token takes effect. You can set scope to an accountor a project under an account. In the following example, the token takes effect only for theresources in a specified project. For more information about this API, see Obtaining a UserToken.
POST https://iam.cn-north-1.myhuaweicloud.com/v3/auth/tokensContent-Type: application/json
{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "xxxxxxxxxxxxxxxxxx" } } }}
If all data required for the API request is available, you can send the request to callthe API through curl, Postman, or coding. In the response to the API used toobtain a user token, x-subject-token is the desired user token. This token canthen be used to authenticate the calling of other APIs.
3.2 AuthenticationRequests for calling an API can be authenticated using either of the followingmethods:
● Token-based authentication: Requests are authenticated using a token.● AK/SK-based authentication: Requests are authenticated by encrypting the
request body using an AK/SK pair. Authentication using AK/SK isrecommended because it is more secure than authentication using tokens.
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 10
Token-based AuthenticationNO TE
The validity period of a token is 24 hours. When using a token for authentication, cache itto prevent frequently calling the IAM API used to obtain a user token.
A token specifies temporary permissions in a computer system. During APIauthentication using a token, the token is added to requests to get permissions forcalling the API.
When calling an API to obtain a user token, you must set auth.scope in therequest body to project.
{ "auth": { "identity": { "methods": [ "password" ], "password": { "user": { "name": "username", "password": "********", "domain": { "name": "domainname" } } } }, "scope": { "project": { "name": "xxxxxxxx" } } } }
In Making an API Request, the process of calling the API used to obtain a usertoken is described.
After a token is obtained, add the X-Auth-Token header field must be added torequests to specify the token when calling other APIs. For example, if the token isABCDEFJ...., X-Auth-Token: ABCDEFJ.... can be added to a request as follows:
Content-Type: application/jsonX-Auth-Token: ABCDEFJ....
AK/SK-based AuthenticationNO TE
AK/SK-based authentication supports API requests with a body not larger than 12 MB. ForAPI requests with a larger body, token-based authentication is recommended.
In AK/SK-based authentication, AK/SK is used to sign requests and the signature isthen added to the requests for authentication.
● AK: access key ID, which is a unique identifier associated with a secret accesskey and is used in conjunction with a secret access key to sign requestscryptographically.
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 11
● SK: secret access key used in conjunction with an AK to sign requestscryptographically. It identifies a request sender and prevents the request frombeing modified.
In AK/SK-based authentication, you can use an AK/SK to sign requests based onthe signature algorithm or use the signing SDK to sign requests. For details abouthow to sign requests or use the signing SDK, see API Request Signing Guide.
NO TICE
The signing SDK is only used for signing requests and is different from the SDKsprovided by services.
3.3 Response
Status CodeAfter sending a request, you will receive a response, including the status code,response header, and response body.
A status code is a group of digits ranging from 1xx to 5xx. It indicates the status ofa response. For more information, see Status Codes.
For example, if status code 201 is returned for calling the API used to obtain auser token, the request is successful.
Response HeaderSimilar to a request, a response also has a header, for example, Content-Type.
Figure 3-2 shows the response header for the API used to obtain a user token.The x-subject-token header field is the desired user token. This token can then beused to authenticate the calling of other APIs.
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 12
Figure 3-2 Header fields of the response to the request for obtaining a user token
(Optional) Response BodyThis part is optional. The body of a response is often returned in structured format(for example, JSON or XML) as specified in the Content-Type header field. Theresponse body transfers content except the response header.
The following is part of the response body for the API used to obtain a usertoken.{ "token": { "expires_at": "2019-02-13T06:52:13.855000Z", "methods": [ "password" ], "catalog": [ { "endpoints": [ { "region_id": "az-01",......
If an error occurs during API calling, an error code and a message will bedisplayed. The following shows an error response body.{ "error_code": "AS.0001", "error_msg": "The format of message is error"}
In the response body, error_code is an error code, and error_msg providesinformation about the error.
Relational Database ServiceAPI Reference 3 Calling APIs
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 13
4 Obtaining an API Version
4.1 Querying API Versions
Function
This API is used to query the supported RDS API versions.
NO TICE
The v1 API documentation has been brought offline, and so will the correspondingsoftware. To prevent your services from being affected, you are advised to switchservices to the v3 API.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/rds/● Example
https://rds.ap-southeast-1.myhuaweicloud.com/rds/● Parameter description
None
Request
None
Response● Normal response
Relational Database ServiceAPI Reference 4 Obtaining an API Version
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 14
Table 4-1 Parameter description
Name Type Description
versions Array of objects Indicates the list ofdetailed API versioninformation.For details, see Table4-2.
Table 4-2 versions field data structure description
Name Type Description
id String Indicates the APIversion.● v1: indicates the API
v1 version.NOTICE
The v1 APIdocumentation hasbeen brought offline,and so will thecorrespondingsoftware. To preventyour services frombeing affected, youare advised to switchservices to the v3 API.
● v3: indicates the APIv3 version.
links Array of objects Indicates the API linkinformation. The valueis empty when theversion is v1 or v3.For details, see Table4-3.
status String Indicates the versionstatus.CURRENT: indicatesthat the version isrecommended.DEPRECATED: indicatesa deprecated versionwhich may be deletedlater.
Relational Database ServiceAPI Reference 4 Obtaining an API Version
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 15
Name Type Description
updated String Indicates the versionupdate time.The format is yyyy-mm-dd Thh:mm:ssZ.T is the separatorbetween the calendarand the hourlynotation of time. Zindicates theCoordinated UniversalTime (UTC).
Table 4-3 links field data structure description
Name Type Description
href String Indicates the API URLand the value is "".
rel String Its value is self,indicating that href is alocal link.
● Example normal response
{ "versions": [{ "id": "v3", "links": [], "status": "CURRENT", "updated": "2019-01-15T12:00:00Z" }, { "id": "v1", "links": [], "status": "DEPRECATED", "updated": "2017-02-07T17:34:02Z" } ]}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Relational Database ServiceAPI Reference 4 Obtaining an API Version
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 16
4.2 Querying a Specified API Version
Function
This API is used to query the specified API version.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/rds/{version}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/rds/v1
● Parameter description
Table 4-4 Parameter description
Name Mandatory Description
version Yes Specifies the API version. It is case-sensitive.For details, see id in Table 4-2 insection Querying API Versions.
Request
None
Response● Normal response
Table 4-5 Parameter description
Name Type Description
versions Object Indicates the list ofdetailed API versioninformation.For details, see Table4-6.
Relational Database ServiceAPI Reference 4 Obtaining an API Version
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 17
Name Type Description
version Object Indicates the list ofdetailed API versioninformation.For details, see Table4-6.
Table 4-6 versions field data structure description
Name Type Description
id String Indicates the APIversion.
links Array Indicates the APIversion linkinformation. Its value isempty.For details, see Table4-7.
status String Indicates the versionstatus.
updated String Indicates the versionupdate time.The format is yyyy-mm-dd Thh:mm:ssZ.T is the separatorbetween the calendarand the hourly notationof time. Z indicates theUTC.
Table 4-7 links field data structure description
Name Type Description
href String Indicates the API URLand the value is "".
rel String Its value is self,indicating that href is alocal link.
● Example normal response
{ "version": { "id": "v1",
Relational Database ServiceAPI Reference 4 Obtaining an API Version
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 18
"links": [], "status": "DEPRECATED", "updated": "2017-02-07T17:34:02Z" }, "versions": { "id": "v1", "links": [], "status": "DEPRECATED", "updated": "2017-02-07T17:34:02Z" }}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
Relational Database ServiceAPI Reference 4 Obtaining an API Version
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 19
5 API v3 (Recommended)
5.1 Querying Version Information About a DB Engine
FunctionThis API is used to query the database version information of a specified DBengine.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/datastores/{database_name}● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/619d3e78f61b4be68bc5aa0b59edcf7b/datastores/mysql
● Parameter description
Table 5-1 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 20
Name Mandatory Description
database_name
Yes Specifies the DB engine. Its value can beany of the following and is case-insensitive:● MySQL● PostgreSQL● SQLServer
RequestNone
Response● Normal response
Table 5-2 Parameter description
Name Type Description
dataStores Array of objects Indicates the list of databaseversions.For details, see Table 5-3.
Table 5-3 dataStores field data structure description
Name Type Description
id String Indicates the database version ID.Its value is unique.
name String Indicates the database versionnumber. Only the major versionnumber (two digits) is returned.For example, if the versionnumber is MySQL 5.6.X, only 5.6is returned.8.0 is available only for userswith the required permission. Youcan contact customer service toapply for the permission.
● Example normal response
{ "dataStores": [{ "id": "87620726-6802-46c0-9028-a8785e1f1921", "name": "8.0" }, {
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 21
"id": "87620726-6802-46c0-9028-a8785e1f1922", "name": "5.7" }, { "id": "e8a8b8cc-63f8-4fb5-8d4a-24c502317a62", "name": "5.6" }]}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.2 Querying Database Specifications
Function
This API is used to query the database specifications of a specified DB engineversion.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/flavors/{database_name}?version_name={version_name}&spec_code={spec_code}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/flavors/mysql?version_name=5.7&spec_code=rds.mysql.m1.xlarge.rr
● Parameter description
Table 5-4 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 22
Name Mandatory Description
database_name
Yes Specifies the DB engine name. Its valuecan be any of the following and is case-insensitive:● MySQL● PostgreSQL● SQLServer
version_name No Specifies the database version. Fordetails about how to obtain thedatabase version, see section QueryingVersion Information About a DBEngine. (The minor version issupported.)
spec_code No Specifies the specification code.
RequestNone
Response● Normal response
Table 5-5 Parameter description
Name Type Description
flavors Array of objects Indicates the DBinstance specificationsinformation list.For details, see Table5-6.
Table 5-6 flavors field data structure description
Name Type Description
vcpus String Indicates the CPU size. For example, the value 1indicates 1 vCPU.
ram Integer Indicates the memory size in GB.
id String Indicates the flavor ID. The value must be unique.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 23
Name Type Description
spec_code String Indicates the resource specification code. Userds.mysql.m1.xlarge.rr as an example.For more information, see DB Instance Classes.● rds: indicates the RDS product.● mysql: indicates the DB engine.● m1.xlarge: indicates the high memory
performance specifications.● rr: indicates the read replica (.ha indicates
primary/standby DB instances).
version_name
Array Indicates the database version.For the MySQL engine, an example value is{5.6,5.7,8.0}.
instance_mode
String Indicates the DB instance type. Its value can be anyof the following:● ha: indicates primary/standby DB instances.● replica: indicates read replicas.● single: indicates single DB instances.
az_status Map<String,String>
Indicates the status of the AZ to which the DBinstance specifications belong. Its value can be anyof the following:● normal: indicates that the AZ is on sale.● unsupported: indicates that the DB instance
specifications are not supported by the AZ.● sellout: indicates that the DB instance
specifications are sold out.
● Example normal response{ "flavors": [{ "vcpus": "1", "ram": 2, "id":"2988b9cc-2aac-3a94-898c-14666702f129", "spec_code": "rds.mysql.c2.medium.ha", "version_name": "{5.6,5.7,8.0}", "instance_mode": "ha", "az_status": { "az1": "normal", "az2": "normal" } }, { "vcpus": "1", "ram": 2, "id":"2988b9cc-2aac-3a94-898c-14666702f130", "spec_code": "rds.mysql.c2.medium.rr", "version_name": "{5.6,5.7,8.0}", "instance_mode": "replica",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 24
"az_status": { "az1": "normal", "az2": "normal" } } ]}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.3 Querying the Storage Type of a Database
Function
This API is used to query the storage type of a specified DB engine version.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/storage-type/{database_name}?version_name={version_name}&ha_mode={ha_mode}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/storage-type/mysql?version_name=5.7&ha_mode=ha
● Parameter description
Table 5-7 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain the projectID, see Obtaining a Project ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 25
Name Mandatory Description
database_name
Yes Specifies the DB engine name. Its valuecan be any of the following and is case-insensitive:● MySQL● PostgreSQL● SQLServer
version_name Yes Specifies the database version. For detailsabout how to obtain the database version,see section Querying Version InformationAbout a DB Engine.
ha_mode No Specifies the HA mode. The value optionsare as follows:● single● ha● replica
RequestNone
Response● Normal response
Table 5-8 Parameter description
Name Type Description
storage_type Array ofobjects
Indicates the DB instance specificationsinformation list.For details, see Table 5-9.
Table 5-9 storage_type field data structure description
Name Type Description
name String Indicates the storage type. Its value can be any ofthe following:● ULTRAHIGH: indicates the SSD type.● LOCALSSD: indicates the local SSD.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 26
Name Type Description
az_status Map<String,String>
Indicates the status of the AZ to which the DBinstance specifications belong. Its value can be anyof the following:● normal: indicates that the AZ is on sale.● unsupported: indicates that the DB instance
specifications are not supported by the AZ.● sellout: indicates that the DB instance
specifications are sold out.
● Example normal response
{ "storage_type": [{ "name": "COMMON", "az_status": { "az1": "normal", "az2": "normal" } }, { "name": "ULTRAHIGH", "az_status": { "az1": "normal", "az2": "normal" } } ]}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4 DB Instance Management
5.4.1 Creating a DB Instance
Function
This API is used to create a single RDS DB instance, primary/standby DB instances,or a read replica.
● Before calling an API, you need to understand the API in Authentication.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 27
● Before calling this API, obtain the required region and endpoint.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances
● Parameter description
Table 5-10 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
Request
Table 5-11 Parameter description (creating single, primary/standby, anddistributed DB instances)
Name Mandatory Type Description
name Yes String Specifies the DBinstance name.DB instances of thesame type can havesame names under thesame tenant.The value must be 4 to64 characters in lengthand start with a letter.It is case-sensitive andcan contain only letters,digits, hyphens (-), andunderscores (_).
datastore Yes Object Specifies the databaseinformation.For details, see Table5-13.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 28
Name Mandatory Type Description
ha No Object Specifies the HAconfigurationparameters, which areused when creatingprimary/standby DBinstances.For details, see Table5-14.
configuration_id
No String Specifies the parametertemplate ID.For details, see id inTable 5-95 in sectionObtaining aParameter TemplateList.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 29
Name Mandatory Type Description
port No String Specifies the databaseport information.● The MySQL
database portranges from 1024 to65535 (excluding12017 and 33071,which are occupiedby the RDS systemand cannot beused).
● The PostgreSQLdatabase portranges from 2100 to9500.
● The Microsoft SQLServer database portis 1433 or rangesfrom 2100 to 9500(excluding 5355 and5985). For MicrosoftSQL Server 2017Enterprise, Standard,and Web editions,the database port is1433 or ranges from2100 to 9500,excluding 5050,5353, and 5986.
If this parameter is notset, the default value isas follows:● For MySQL, the
default value is3306.
● For PostgreSQL, thedefault value is5432.
● For Microsoft SQLServer, the defaultvalue is 1433.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 30
Name Mandatory Type Description
password No String Specifies the databasepassword.Valid value:● The password of
MySQL andPostgreSQL mustconsist of 8 to 32characters andcontain at leastthree types of thefollowing characters:uppercase letters,lowercase letters,digits, and specialcharacters (~!@#%^*-_=+?).
● The password ofSQL Server mustconsist of 8 to 32characters andcontain at leastthree types of thefollowing characters:uppercase letters,lowercase letters,digits, and specialcharacters (~!@#$%^*-_=+?).
You are advised toenter a strongpassword to improvesecurity, preventingsecurity risks such asbrute force cracking.
backup_strategy
No Object Specifies the advancedbackup policy.For details, see Table5-15.
enterprise_project_id
No String Specifies the enterpriseproject ID.
disk_encryption_id
No String Specifies the key ID fordisk encryption. Thedefault value is empty.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 31
Name Mandatory Type Description
flavor_ref Yes String Specifies thespecification code. Thevalue cannot be empty.For details, seespec_code in Table 5-6in section QueryingDatabaseSpecifications.
volume Yes Object Specifies the volumeinformation.For details, see Table5-16.
region Yes String Specifies the region ID.The value cannot beempty. For detailsabout how to obtainthis parameter value,see Regions andEndpoints.
availability_zone
Yes String Specifies the AZ ID. Ifthe DB instance is not asingle instance, youneed to specify an AZfor each node of theinstance and separatethe AZs with commas(,). For details, see theexample.The value cannot beempty. For detailsabout how to obtainthis parameter value,see Regions andEndpoints.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 32
Name Mandatory Type Description
vpc_id Yes String Specifies the VPC ID. Toobtain this parametervalue, use either of thefollowing methods:● Method 1: Log in to
VPC console andview the VPC ID inthe VPC details.
● Method 2: See the"Querying VPCs"section in the VirtualPrivate Cloud APIReference.
subnet_id Yes String Specifies the networkID. To obtain thisparameter value, useeither of the followingmethods:● Method 1: Log in to
VPC console andclick the targetsubnet on theSubnets page. Youcan view thenetwork ID on thedisplayed page.
● Method 2: See the"Querying Subnets"section in the VirtualPrivate Cloud APIReference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 33
Name Mandatory Type Description
data_vip No String Specifies the floating IPaddress of a DBinstance. To obtain thisparameter value, useeither of the followingmethods:● Method 1: Log in to
VPC console andclick the targetsubnet on theSubnets page. Youcan view the subnetCIDR block on thedisplayed page.
● Method 2: See the"Querying Subnets"section in the VirtualPrivate Cloud APIReference.
security_group_id
Yes String Specifies the securitygroup which the RDSDB instance belongs to.To obtain thisparameter value, useeither of the followingmethods:● Method 1: Log in to
VPC console. ChooseAccess Control >Security Groups inthe navigation paneon the left. On thedisplayed page, clickthe target securitygroup. You can viewthe security group IDon the displayedpage.
● Method 2: See the"Querying SecurityGroups" section inthe Virtual PrivateCloud API Reference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 34
Name Mandatory Type Description
charge_info No Object Specifies the billinginformation, which isyearly/monthly or pay-per-use (defaultsetting).For details, see Table5-17.
time_zone No String Specifies the UTC timezone.● If this parameter is
not specified, thetime zone of eachengine is as follows:– RDS for MySQL
uses UTC bydefault.
– RDS forPostgreSQL usesUTC by default.
– Microsoft SQLServer uses ChinaStandard Time inthe Chinesemainland site andUTC in theinternational siteby default.
● For MySQL orPostgreSQL, if thisparameter isspecified, the valueranges fromUTC-12:00 to UTC+12:00 at the fullhour. For example,the parameter canbe UTC+08:00 ratherthan UTC+08:30.
● For Microsoft SQLServer, refer to Table5-19 whenspecifying thisparameter. The timezone is expressed asa character string,for example, ChinaStandard Time.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 35
Name Mandatory Type Description
tags No Array ofobjects
Specifies the tag list.DB instances arecreated based on tagkeys and values.● {key} indicates the
tag key. It must beunique and cannotbe empty.
● {value} indicates thetag value, which canbe empty.
If you want to createDB instances withmultiple tag keys andvalues, separate themwith commas (,). Amaximum of 10 key-value pairs can beadded.For details, see Table5-18.
unchangeable_param
No Object Specifies the list ofunchangeableparameters. Theunchangeableparameters need to bespecified beforedatabase initializationand cannot be modifiedafter being specified.For details, see Table5-20.
collation No String This parameter appliesonly to Microsoft SQLServer DB instances.Value range: charactersets queried inQuerying theAvailable SQL ServerCharacter Set.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 36
Table 5-12 Parameter description (Microsoft SQL Server does not support yearly/monthly read replicas)
Name Mandatory Type Description
name Yes String Specifies the DB instancename.DB instances of the sametype can have same namesunder the same tenant.The value must be 4 to 64characters in length andstart with a letter. It iscase-sensitive and cancontain only letters, digits,hyphens (-), andunderscores (_).
replica_of_id Yes String Specifies the primary DBinstance ID for creating aread replica.For details, see id in Table5-63 in section QueryingDetails About DBInstances.
enterprise_project_id
No String Specifies the project ID.
disk_encryption_id
No String Specifies the key ID fordisk encryption. Thedefault value is empty.
flavor_ref Yes String Specifies the specificationcode. The value cannot beempty.For details, see spec_codein Table 5-6 in sectionQuerying DatabaseSpecifications.
volume Yes Object Specifies the volumeinformation.For details, see Table 5-16.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 37
Name Mandatory Type Description
region No String Specifies the region ID.Currently, read replicas canbe created only in thesame region as that of theprimary DB instance.The value cannot beempty. For details abouthow to obtain thisparameter value, seeRegions and Endpoints.
availability_zone
Yes String Specifies the AZ ID.The value cannot beempty. For details abouthow to obtain thisparameter value, seeRegions and Endpoints.
charge_info No Object Specifies the billinginformation, which isyearly/monthly or pay-per-use (default setting).For details, see Table 5-17.
Table 5-13 datastore field data structure description
Name Mandatory Type Description
type Yes String Specifies the DBengine. Value:● MySQL● PostgreSQL● SQLServer
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 38
Name Mandatory Type Description
version Yes String Specifies the databaseversion.● MySQL databases
support 5.6, 5.7,and 8.0. Examplevalue: 5.7 8.0 isavailable only forusers with therequiredpermission. Youcan contactcustomer service toapply for thepermission.
● PostgreSQLdatabases supportPostgreSQL 1.0(Enhanced Edition),9.5, 9.6, 10, 11, and12. Example value:9.6
● Microsoft SQLServer databasesonly support 2017Enterprise Edition,2017 StandardEdition, 2017 WebEdition, 2014Standard Edition,2014 EnterpriseEdition, 2016Standard Edition,2016 EnterpriseEdition, 2012Enterprise Edition,2012 StandardEdition, 2012 WebEdition, 2008 R2Enterprise Edition,2008 R2 WebEdition, 2014 WebEdition, and 2016Web Edition.Example value:2014_SE
For details aboutsupported databaseversions, see sectionQuerying Version
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 39
Name Mandatory Type Description
Information About aDB Engine.
Table 5-14 ha field data structure description
Name Mandatory Type Description
mode Yes String Specifies the DB instancetype. The value is Ha(primary/standby DBinstances) and is case-insensitive.
replication_mode
Yes String Specifies the replicationmode for the standby DBinstance.Value:● For MySQL, the value is
async or semisync.● For PostgreSQL, the
value is async or sync.● For Microsoft SQL
Server, the value issync.
NOTE● async indicates the
asynchronous replicationmode.
● semisync indicates thesemi-synchronousreplication mode.
● sync indicates thesynchronous replicationmode.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 40
Table 5-15 backup_strategy field data structure description
Name Mandatory Type Description
start_time Yes String Specifies the backup timewindow. Automatedbackups will be triggeredduring the backup timewindow.The value cannot beempty. It must be a validvalue in the "hh:mm-HH:MM" format. Thecurrent time is in the UTCformat.● The HH value must be
1 greater than the hhvalue.
● The values of mm andMM must be the sameand must be set to anyof the following: 00,15, 30, or 45.
Example value:● 08:15-09:15● 23:00-00:00
keep_days No Integer Specifies the retentiondays for specific backupfiles.The value range is from 0to 732. If this parameter isnot specified or set to 0,the automated backuppolicy is disabled. Toextend the retentionperiod, contact customerservice. Automatedbackups can be retainedfor up to 2562 days.NOTICE
Primary/standby DBinstances of Microsoft SQLServer do not supportdisabling the automatedbackup policy.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 41
Table 5-16 volume field data structure description
Name Mandatory Type Description
type Yes String Specifies the volume type.Its value can be any of thefollowing and is case-sensitive:● ULTRAHIGH: indicates
the SSD type.● LOCALSSD: indicates
the local SSD.
size Yes Integer Specifies the volume size.Its value must be amultiple of 10 and thevalue range is from 40 GBto 4000 GB.MySQL supports storagespace from 11 GB to10,000 GB for some users.If you want to create a DBinstance with storagespace up to 10,000 GB orscale up to 10,000 GB,contact customer service.NOTE
For read replicas, thisparameter is invalid. Thevolume size is the same asthat of the primary DBinstance by default.
Table 5-17 charge_info field data structure description
Name Mandatory Type Description
charge_mode Yes String Specifies the billing mode.Valid value:● prePaid: indicates the
yearly/monthly billingmode.
● postPaid: indicates thepay-per-use billingmode.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 42
Name Mandatory Type Description
period_type No String Specifies the subscriptionperiod.Valid value:● month: indicates that
the subscription unit ismonth.
● year: indicates that thesubscription unit isyear.NOTE
This parameter is validand mandatory ifcharge_mode is set toprePaid.
period_num No Integer This parameter is validand mandatory ifcharge_mode is set toprePaid.Valid value:● When period_type is
set to month, theparameter valueranges from 1 to 9.
● When period_type isset to year, theparameter valueranges from 1 to 3.
Table 5-18 tags field data structure description
Name Mandatory
Type Description
key Yes String Specifies the tag key. It contains amaximum of 36 Unicode characters.The value cannot be an empty string,a space, or left blank.Only uppercase letters, lowercaseletters, digits, hyphens (-), andunderscores (_) are allowed.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 43
Name Mandatory
Type Description
value Yes String Specifies the tag value. It contains amaximum of 43 Unicode characters.The value can be an empty characterstring.Only uppercase letters, lowercaseletters, digits, periods (.), hyphens (-),and underscores (_) are allowed.
Table 5-19 Mapping between time zones and UTC offsets
Time Zone Standard Time Offset Remarks
Afghanistan StandardTime
UTC+04:30 Kabul
Alaskan Standard Time UTC-09:00 Alaska
Arabian Standard Time UTC+04:00 Abu Dhabi, Muscat
Atlantic Standard Time UTC-04:00 Atlantic Time (Canada)
AUS Central StandardTime
UTC+09:30 Darwin
AUS Eastern StandardTime
UTC+10:00 Canberra, Melbourne,Sydney
Belarus Standard Time UTC+03:00 Minsk
Canada Central StandardTime
UTC-06:00 Saskatchewan
Cape Verde StandardTime
UTC-01:00 Cape Verde Is.
Cen. Australia StandardTime
UTC+09:30 Adelaide
Central AmericaStandard Time
UTC-06:00 Central America
Central Asia StandardTime
UTC+06:00 Astana
Central BrazilianStandard Time
UTC-04:00 Cuiaba
Central EuropeanStandard Time
UTC+01:00 Belgrade, Bratislava,Budapest, Ljubljana,Prague
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 44
Time Zone Standard Time Offset Remarks
Central EuropeanStandard Time
UTC+01:00 Sarajevo, Skopje,Warsaw, Zagreb
Central Pacific StandardTime
UTC+11:00 Solomon Islands, NewCaledonia
Central Standard Time UTC-06:00 Central Time (US andCanada)
China Standard Time UTC+08:00 Beijing, Chongqing, HongKong, and Urumqi
E. Africa Standard Time UTC+03:00 Nairobi
E. Australia StandardTime
UTC+10:00 Brisbane
E. Europe Standard Time UTC+02:00 Chisinau
E. South AmericaStandard Time
UTC-03:00 Brasilia
Eastern Standard Time UTC-05:00 Eastern Time (US andCanada)
Georgian Standard Time UTC+04:00 Tbilisi
GMT Standard Time UTC Dublin, Edinburgh,Lisbon, London
Greenland StandardTime
UTC–03:00 Greenland
Greenwich StandardTime
UTC Monrovia, Reykjavik
GTB Standard Time UTC+02:00 Athens, Bucharest
Hawaiian Standard Time UTC-10:00 Hawaii
India Standard Time UTC+05:30 Chennai, Kolkata,Mumbai, New Delhi
Jordan Standard Time UTC+02:00 Amman
Korea Standard Time UTC+09:00 Seoul
Middle East StandardTime
UTC+02:00 Beirut
Mountain Standard Time UTC-07:00 Mountain Time (US andCanada)
US Mountain StandardTime
UTC-07:00 Arizona
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 45
Time Zone Standard Time Offset Remarks
New Zealand StandardTime
UTC+12:00 Auckland, Wellington
Newfoundland StandardTime
UTC-03:30 Newfoundland
Pacific SA Standard Time UTC-03:00 Santiago
Pacific Standard Time UTC-08:00 Pacific Time (US andCanada)
Russian Standard Time UTC+03:00 Moscow, St. Petersburg,Volgograd
SA Pacific Standard Time UTC-05:00 Bogota, Lima, Quito, RioBranco
SE Asia Standard Time UTC+07:00 Bangkok, Hanoi, Jakarta
China Standard Time UTC+08:00 Kuala Lumpur, Singapore
Tokyo Standard Time UTC+09:00 Osaka, Sapporo, Tokyo
US Eastern StandardTime
UTC-05:00 Indiana (East)
UTC UTC Coordinated UniversalTime
UTC-02 UTC-02:00 Coordinated UniversalTime–02
UTC-08 UTC-08:00 Coordinated UniversalTime–08
UTC-09 UTC-09:00 Coordinated UniversalTime–09
UTC-11 UTC-11:00 Coordinated UniversalTime–11
UTC+12 UTC+12:00 Coordinated UniversalTime+12
W. Australia StandardTime
UTC+08:00 Perth
W. Central AfricaStandard Time
UTC+01:00 West Central Africa
W. Europe Standard Time UTC+01:00 Amsterdam, Berlin, Bern,Rome, Stockholm,Vienna
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 46
Table 5-20 unchangeable_param field data structure description
Name Mandatory
Type Description
lower_case_table_names
No String Specifies whether table names arecase sensitive. The default value is 1.This parameter is supported forMySQL 8.0 only.Value range:● 0: Table names are fixed and case
sensitive.● 1: Table names are stored in
lowercase and are case insensitive.NOTE
When data is restored to an existing DBinstance, the case sensitivity setting of theexisting DB instance must be the same asthat of the original DB instance.Otherwise, the restoration may fail.
NO TE
The values of region and availability_zone are used as examples.
● Request exampleCreating a single DB instance:{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "5.6" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "data_vip": "192.168.0.147", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": 8635, "backup_strategy": { "start_time": "08:15-09:15", "keep_days": 12 }, "charge_info": { "charge_mode": "postPaid" }, "password": "Test@12345678", "configuration_id": "452408-ef4b-44c5-94be-305145fg", "enterprise_project_id": "fdsa-3rds",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 47
"time_zone": "UTC+04:00", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ]}
Creating a single MySQL 8.0 DB instance with initialization parametersspecified:{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "8.0" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "eu-de", "region": "aaa", "availability_zone": "eu-de-01", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "data_vip": "192.168.0.147", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": 8635, "backup_strategy": { "start_time": "08:15-09:15", "keep_days": 12 }, "charge_info": { "charge_mode": "postPaid" }, "password": "Test@12345678", "configuration_id": "452408-ef4b-44c5-94be-305145fg" "enterprise_project_id": "fdsa-3rds", "time_zone": "UTC+04:00", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ], "unchangeable_param": { "lower_case_table_names": "1" }}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 48
Creating a SQL Server DB instance with collation specified{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "8.0" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "eu-de", "region": "aaa", "availability_zone": "eu-de-01", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "data_vip": "192.168.0.147", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": 8635, "backup_strategy": { "start_time": "08:15-09:15", "keep_days": 12 }, "charge_info": { "charge_mode": "postPaid" }, "collation": "Cyrillic_General_CI_AS", "password": "Test@12345678", "configuration_id": "452408-ef4b-44c5-94be-305145fg" "enterprise_project_id": "fdsa-3rds", "time_zone": "UTC+04:00", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ],}
Creating primary/standby DB instances:
{ "name": "rds-instance-rep2", "datastore": { "type": "MySQL", "version": "5.6" }, "ha": { "mode": "ha", "replication_mode": "semisync" }, "flavor_ref": "rds.mysql.s1.large.ha", "volume": { "type": "ULTRAHIGH", "size": 100
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 49
}, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb,ccc", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "data_vip": "192.168.0.147", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": 8635, "backup_strategy": { "start_time": "08:15-09:15", "keep_days": 12 }, "charge_info": { "charge_mode": "postPaid" }, "password": "Test@12345678", "configuration_id": "452408-ef4b-44c5-94be-305145fg", "enterprise_project_id": "fdsa-3rds", "time_zone": "UTC+04:00", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ]}
Creating a read replica:{ "name": "rds-instance-rep2", "replica_of_id": "afdsad-fds-fdsagin01", "flavor_ref": "rds.mysql.s1.large.rr", "volume": { "type": "ULTRAHIGH" }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "enterprise_project_id": "fdsa-3rds", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" } ]}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 50
Table 5-21 Parameter description
Name Type Description
instance Object Indicates the DBinstance information.For details, see Table5-22.
job_id String Indicates the ID of theDB instance creationtask.This parameter isreturned only whenpay-per-use DBinstances are created.
order_id String Indicates the order ID.This parameter isreturned for thecreation of a yearly/monthly DB instance.
Table 5-22 instance field data structure description
Name Type Description
id String Indicates the DBinstance ID.NOTE
The v3 DB instance ID isincompatible with the v1DB instance ID.
name String Indicates the DBinstance name.Indicates the DBinstance name. DBinstances of the sametype can have samenames under the sametenant.The value must be 4 to64 characters in lengthand start with a letter.It is case-insensitiveand can contain onlyletters, digits, hyphens(-), and underscores(_).
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 51
Name Type Description
status String Indicates the DBinstance status. Forexample, BUILDindicates that the DBinstance is beingcreated.This parameter isreturned only whenpay-per-use DBinstances are created.
datastore Object Indicates the databaseinformation.For details, see Table5-23.
ha Object Indicates the HAconfigurationparameters. Thisparameter is returnedonly when primary/standby DB instancesare created.For details, see Table5-24.
configuration_id String Indicates the parametertemplate ID. Thisparameter is returnedonly when a customparameter template isused during DBinstance creation.
port String Indicates the databaseport, which is the sameas the requestparameter.
backup_strategy Object Indicates theautomated backuppolicy.For details, see Table5-25.
enterprise_project_id String Indicates the project ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 52
Name Type Description
disk_encryption_id String Indicates the key ID fordisk encryption. Bydefault, this parameteris empty and isreturned only when it isspecified during the DBinstance creation.
flavor_ref String Indicates thespecification code. Thevalue cannot be empty.For details, seespec_code in Table 5-6in section QueryingDatabaseSpecifications.
volume Object Indicates the volumeinformation.For details, see Table5-26.
region String Indicates the region ID.
availability_zone String Indicates the AZ ID.
vpc_id String Indicates the VPC ID. Toobtain this parametervalue, use either of thefollowing methods:● Method 1: Log in to
VPC console andview the VPC ID inthe VPC details.
● Method 2: See the"Querying VPCs"section in the VirtualPrivate Cloud APIReference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 53
Name Type Description
subnet_id String Indicates the networkID. To obtain thisparameter value, useeither of the followingmethods:● Method 1: Log in to
VPC console andclick the targetsubnet on theSubnets page. Youcan view thenetwork ID on thedisplayed page.
● Method 2: See the"Querying Subnets"section in the VirtualPrivate Cloud APIReference.
security_group_id String Indicates the securitygroup which the RDSDB instance belongs to.To obtain thisparameter value, useeither of the followingmethods:● Method 1: Log in to
VPC console. ChooseAccess Control >Security Groups inthe navigation paneon the left. On thedisplayed page, clickthe target securitygroup. You can viewthe security groupID on the displayedpage.
● Method 2: See the"Querying SecurityGroups" section inthe Virtual PrivateCloud API Reference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 54
Name Type Description
charge_info Object Indicates the billinginformation, which isyearly/monthly or pay-per-use.For details, see Table5-27.
collation String Indicates the collationset for Microsoft SQLServer.
Table 5-23 datastore field data structure description
Name Type Description
type String Indicates the DB engine. Value:● MySQL● PostgreSQL● SQLServer
version String Indicates the database version.For details about supported databaseversions, see section Querying VersionInformation About a DB Engine.
Table 5-24 ha field data structure description
Name Type Description
mode String Indicates the DB instance type. Thevalue is Ha (primary/standby DBinstances).
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 55
Name Type Description
replication_mode
String Indicates the replication mode for thestandby DB instance. This parameter isvalid when the mode is Ha.Value:● For MySQL, the value is async or
semisync.● For PostgreSQL, the value is async or
sync.● For Microsoft SQL Server, the value is
sync.NOTE
● async indicates the asynchronousreplication mode.
● semisync indicates the semi-synchronousreplication mode.
● sync indicates the synchronousreplication mode.
Table 5-25 backupStrategy field data structure description
Name Type Description
start_time String Specifies the backup time window.Automated backups will be triggeredduring the backup time window.The value cannot be empty. It must bea valid value in the "hh:mm-HH:MM"format. The current time is in the UTCformat.● The HH value must be 1 greater
than the hh value.● The values of mm and MM must be
the same and must be set to any ofthe following: 00, 15, 30, or 45.
Example value:● 08:15-09:15● 23:00-00:00If backup_strategy in the requestbody is empty, 02:00-03:00 is returnedfor start_time by default.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 56
Name Type Description
keep_days Integer Indicates the retention days for specificbackup files.The value range is from 0 to 732. Ifthis parameter is not specified or set to0, the automated backup policy isdisabled. To extend the retentionperiod, contact customer service.Automated backups can be retainedfor up to 2562 days.If backup_strategy in the requestbody is empty, 7 is returned forkeep_days by default.
Table 5-26 volume field data structure description
Name Type Description
type String Indicates the volume type.Its value can be any of the followingand is case-sensitive:● ULTRAHIGH: indicates the SSD
type.
size Integer Indicates the volume size.Its value range is from 40 GB to 4000GB. The value must be a multiple of10.For some users, storage space rangesfrom 40 GB to 6000 GB. If you want tocreate a DB instance with storagespace up to 6000 GB or scale up to10,000 GB, contact customer service toapply for the permission.
Table 5-27 chargeInfo field data structure description
Name Type Description
charge_mode String Indicates the billing information,which is yearly/monthly or pay-per-use.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 57
Name Type Description
period_num Integer Indicates the subscription period,which is calculated by month.This parameter is valid whencharge_mode is set to prePaid(creating yearly/monthly DBinstances).
NO TE
The values of region and availability_zone are used as examples.
● Example normal responseCreating a single MySQL DB instance:{ "instance": { "id": "dsfae23fsfdsae3435in01", "name": "trove-instance-rep2", "datastore": { "type": "MySQL", "version": "5.6" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": "8635", "backup_strategy": { "start_time": "08:15-09:15", "keep_days": 3 }, "configuration_id": "452408-44c5-94be-305145fg", "charge_info": { "charge_mode": "postPaid" } }, "job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"}
Creating a single SQL Server DB instance:{ "instance": { "id": "dsfae23fsfdsae3435in01", "name": "trove-instance-rep2", "datastore": { "type": "sqlserver", "version": "2014_SE" }, "flavor_ref": "rds.mssql.2014.se.s3.large.2", "volume": {
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 58
"type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": "8635", "backup_strategy": { "start_time": "08:15-09:15", "keep_days": 3 }, "configuration_id": "452408-44c5-94be-305145fg", "charge_info": { "charge_mode": "postPaid" }, "collation": "Cyrillic_General_CI_AS" }, "job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"}
Creating primary/standby DB instances:{ "instance":{ "id": "dsfae23fsfdsae3435in01", "name": "trove-instance-rep2", "datastore": { "type": "MySQL", "version": "5.6" }, "ha": { "mode": "ha", "replication_mode": "semisync" }, "flavor_ref": "rds.mysql.s1.large.ha", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb,ccc", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": "8635", "backup_strategy": { "start_time": "08:15-09:15", "keep_days": 3 }, "configuration_id": "452408-44c5-94be-305145fg", "charge_info": { "charge_mode": "postPaid" }, }, "job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d" }
Creating a read replica:
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 59
{ "instance":{ "id": "dsfae23fsfdsae3435in01", "name": "trove-instance-rep2", "flavor_ref": "rds.mysql.s1.large.rr", "volume": { "type": "ULTRAHIGH", "size": 100 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "region": "aaa", "availability_zone": "bbb", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "port": "8635", "configuration_id": "452408-44c5-94be-305145fg" }, "job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"
}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.2 Changing a DB Instance Name
Function
This API is used to change a DB instance name.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/name
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/054ea741f700d4a32f1bc00f5c80dd4c/instances/5b409baece064984a1b3eef6addae50cin01/name
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 60
Table 5-28 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-29 Parameter description
Name Mandatory Type Description
name Yes String Specifies the DB instance name.DB instances of the same typecan have same names under thesame tenant.The value must be 4 to 64characters in length and startwith a letter. It is case-sensitiveand can contain only letters,digits, hyphens (-), andunderscores (_).
● Request example{ "name": "Test_2345674"}
Response● Normal response
None
● Example normal response
None
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 61
Error CodeFor details, see Error Codes.
5.4.3 Changing a DB Instance Description
FunctionThis API is used to change a DB instance description.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsThis API supports PostgreSQL only.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/alias● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/054ea741f700d4a32f1bc00f5c80dd4c/instances/5b409baece064984a1b3eef6addae50cin01/alias
● Parameter description
Table 5-30 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-31 Parameter description
Name Mandatory Type Description
alias Yes String The value consists of 0 to 64characters, including letters,digits, periods (.), underscores(_), and hyphens (-).
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 62
● Request example{ "alias": "alias-test"}
Response● Normal response
Table 5-32 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.4 Applying for a Private Domain Name
Function
This API is used to bind a private domain name to a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints
This API supports PostgreSQL only.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/create-dns● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 63
https://rds.ap-southeast-1.myhuaweicloud.com/v3/054ea741f700d4a32f1bc00f5c80dd4c/instances/5b409baece064984a1b3eef6addae50cin01/create-dns
● Parameter description
Table 5-33 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-34 Parameter description
Name Mandatory Type Description
dns_type Yes String Specifies the domain name type.Currently, only private issupported.
● Request example
{ "dns_type": "private"}
Response● Normal response
Table 5-35 Parameter description
Name Type Description
job_id String Indicates the ID of thetask for applying for aprivate domain name.
● Normal response
{ "job_id": "b9e057a0-f0fb-4987-9d21-f3a7550b32e7"}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 64
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.5 Modifying a Private Domain Name
Function
This API is used to modify a private domain name.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
This API supports PostgreSQL only.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/modify-dns
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/054ea741f700d4a32f1bc00f5c80dd4c/instances/5b409baece064984a1b3eef6addae50cin01/modify-dns
● Parameter description
Table 5-36 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 65
Table 5-37 Parameter description
Name Mandatory Type Description
dns_name Yes String Specifies the prefix of the newdomain name. Value range:The value contains 8 to 64characters. Only uppercaseletters, lowercase letters, anddigits are allowed.
● Request example
{ "dns_name": "testModifyDnsNewName"}
Response● Normal response
Table 5-38 Parameter description
Name Type Description
job_id String Indicates the ID of thetask for modifying aprivate domain name.
● Normal response
{ "job_id": "b9e057a0-f0fb-4987-9d21-f3a7550b32e7"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.6 Changing DB Instance Specifications
Function
This API is used to change DB instance specifications.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 66
NO TE
Services will be interrupted for 5 to 10 minutes when you change DB instancespecifications. Exercise caution when performing this operation.
Constraints● The new DB instance specifications must be different from the original DB
instance specifications.● The instance class can be modified only for DB instances whose status is
Available.● The specifications of a DB instance can be changed only to the specifications
of the same DB instance type. (For example, the specifications of a single DBinstance cannot be changed to those of primary/standby DB instances.)
● The exclusive instance class of MySQL DB instances using local disks cannotbe scaled down.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/action● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/action
● Parameter description
Table 5-39 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-40 Parameter description
Name Mandatory Type Description
resize_flavor
Yes Object For details, see Table5-41.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 67
Table 5-41 resize_flavor field data structure description
Name Mandatory Type Description
spec_code Yes String Specifies theresourcespecificationcode. Userds.mysql.m1.xlarge as anexample. rdsindicates RDS,mysql indicatesthe DB engine,and m1.xlargeindicates theperformancespecification(large-memory).The parametercontaining rrindicates theread replicaspecifications.The parameternot containing rrindicates thesingle orprimary/standbyDB instancespecifications.
is_auto_pay No Boolean Specifieswhether theorder will beautomaticallypaid when thespecifications ofyearly/monthlyDB instances arechanged.● true: indicates
the order willbeautomaticallypaid.
● false:indicates theorder will bemanuallypaid. Thedefault valueis false.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 68
– Request exampleMySQL:{ "resize_flavor": { "spec_code": "rds.mysql.m1.xlarge", "is_auto_pay": true }}
PostgreSQL:{ "resize_flavor": { "spec_code": "rds.pg.c2.medium.ha", "is_auto_pay": true }}
Microsoft SQL Server:{ "resize_flavor": { "spec_code": "rds.mssql.2014.se.s3.large.2", "is_auto_pay": true }}
Response● Pay-per-use
– Normal response
Table 5-42 Parameter description
Name Type Description
job_id String Indicates the task ID.
– Example normal response
{ "job_id": "2b414788a6004883a02390e2eb0ea227"}
– Abnormal responseFor details, see Abnormal Request Results.
● Yearly/Monthly– Normal response
Table 5-43 Parameter description
Name Type Description
order_id String Indicates the order ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 69
– Example normal response{ "order_id": "CS2009151216NO2U1"}
– Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.4.7 Scaling Up Storage Space of a DB Instance
FunctionThis API is used to scale up storage space of a DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● The sizes of the primary and standby DB instances are the same. When you
scale the primary DB instance, its standby DB instance is also scaled.● The DB instances can be scaled when they are in the Available state.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/action● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/action
● Parameter description
Table 5-44 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 70
Request● Parameter description
Table 5-45 Parameter description
Name Mandatory Type Description
enlarge_volume Yes Object Specifies the targetstorage space after scalingup.For details, see Table5-46.
Table 5-46 enlarge_volume field data structure description
Name Mandatory Type Description
size Yes Integer The minimum start valueof each scaling is 10 GB.A DB instance can bescaled up only by amultiple of 10 GB. Valuerange: 40 GB to 4000 GB● MySQL supports
storage space from 11GB to 10,000 GB. Youcan contact customerservice to apply for thepermission.
● PostgreSQL supportsstorage space from 40GB to 15,000 GB. Youcan contact customerservice to apply for thepermission.
is_auto_pay No Boolean Specifies whether theorder will beautomatically paid whenthe storage space ofyearly/monthly DBinstances is scaled.● true: indicates the
order will beautomatically paid.
● false: indicates theorder will be manuallypaid. The default valueis false.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 71
● Request example{ "enlarge_volume": { "size": 400, "is_auto_pay": true }}
Response● Pay-per-use
– Normal response
Table 5-47 Parameter description
Name Type Description
job_id String Indicates the task ID.
– Example normal response{ "job_id": "2b414788a6004883a02390e2eb0ea227"}
– Abnormal response
For details, see Abnormal Request Results.
● Yearly/Monthly
– Normal response
Table 5-48 Parameter description
Name Type Description
order_id String Indicates the order ID.
– Example normal response{ "order_id": "CS2009151216NO2U2"}
– Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 72
5.4.8 Changing a Single DB Instance to Primary/Standby DBInstances
Function
This API is used to change a single DB instance to primary/standby DB instances.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● Single DB instances with certain specifications cannot be changed to primary/
standby DB instances.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/action
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/action
● Parameter description
Table 5-49 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-50 Parameter description
Name Mandatory Type Description
single_to_ha Yes Object For details, see Table5-51.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 73
Table 5-51 single_to_ha field data structure description
Name Mandatory Type Description
az_code_new_node
Yes String Specifies the AZ codeof the DB instancenode.
password No String This parameter ismandatory only whena Microsoft SQLServer DB instancetype is changed fromsingle to primary/standby.
● Request example{ "single_to_ha": { "az_code_new_node": "az2xahz", "password": "Test@1234567" }}
Response● Normal response
Table 5-52 Parameter description
Name Type Description
job_id String Indicates the task ID.
● Example normal response{ "job_id": "2b414788a6004883a02390e2eb0ea227"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 74
5.4.9 Rebooting a DB Instance
FunctionThis API is used to reboot a DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
NO TICE
The RDS DB instance will be unavailable during the reboot process. Exercisecaution when performing this operation.
ConstraintsThe DB instance cannot reboot when it is being created, scaled, backed up, frozen,restored, or its instance class or port is being changed.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/action● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/action
● Parameter description
Table 5-53 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 75
Table 5-54 Parameter description
Name Mandatory Type Description
restart Yes None This parameter isleft blank.
● Request example
{ "restart": {}}
Response● Normal response
Table 5-55 Parameter description
Name Type Description
job_id String Indicates the task ID.
● Example normal response
{ "job_id": "2b414788a6004883a02390e2eb0ea227"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.10 Querying the Available SQL Server Character Set
Function
This API is used to query the SQL Server character set list.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/collations● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 76
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/collations
● Parameter description
Table 5-56 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
Request
None
Response● Normal response
Table 5-57 Parameter description
Name Type Description
charSets List<String> Indicates the characterset information list.
● Example normal response{ "charSets": ["Chinese_PRC_CI_AS", "SQL_Latin1_General_CP1_CI_AS", "French_BIN", "Chinese_PRC_Stroke_BIN", "Chinese_PRC_CI_AI"]}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 77
5.4.11 Deleting a DB Instance
Function
This API is used to delete a DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id}● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01
● Parameter description
Table 5-58 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID compliantwith the UUID format.
Request
None
Response● Normal response
Table 5-59 Parameter description
Name Type Description
job_id String Indicates the ID of theinstance deletion task.
● Example normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 78
{ "job_id": "dff1d289-4d03-4942-8b9f-463ea07c000d"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.4.12 Querying Details About DB Instances
FunctionThis API is used to query DB instances according to search criteria.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances?id={id}&name={name}&type={type}&datastore_type={datastore_type}&vpc_id={vpc_id}&subnet_id={subnet_id}&offset={offset}&limit={limit}&tags={key}={value}
● Example– Querying all DB instances
https://rds.ap-southeast-1.myhuaweicloud.com/v3/97b026aa9cc4417888c14c84a1ad9860/instances
– Querying DB instances based on search criteriahttps://rds.ap-southeast-1.myhuaweicloud.com/v3/97b026aa9cc4417888c14c84a1ad9860/instances?id=ed7cc6166ec24360a5ed5c5c9c2ed726in01&name=hy&type=Ha&datastore_type=MySQL&vpc_id=19e5d45d-70fd-4a91-87e9-b27e71c9891f&subnet_id=bd51fb45-2dcb-4296-8783-8623bfe89bb7&offset=0&limit=10&tags=rds001=001,rds002=002
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 79
Table 5-60 Parameter description
Name Type Mandatory Description
project_id String Yes Specifies the project ID of atenant in a region.For details about how to obtainthe project ID, see Obtaining aProject ID.
id String No Specifies the DB instance ID.The asterisk (*) is reserved forthe system. If the instance IDstarts with *, it indicates thatfuzzy match is performed basedon the value following *Otherwise, the exact match isperformed based on theinstance ID. The value cannotcontain only asterisks (*).
name String No Specifies the DB instance name.The asterisk (*) is reserved forthe system. If the instance namestarts with *, it indicates thatfuzzy match is performed basedon the value following *Otherwise, the exact match isperformed based on theinstance name. The value cannotcontain only asterisks (*).
type String No Specifies the instance type-based query. The value is Single,Ha, Replica, or Enterprise,which corresponds to singleinstance, primary/standbyinstance, read replica, anddistributed instance (enterprise)respectively.
datastore_type
String No Specifies the database type. Itsvalue can be any of thefollowing and is case-sensitive:● MySQL● PostgreSQL● SQLServer
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 80
Name Type Mandatory Description
vpc_id String No Specifies the VPC ID.● Method 1: Log in to VPC
console and view the VPC IDin the VPC details.
● Method 2: See the "QueryingVPCs" section in the VirtualPrivate Cloud API Reference.
subnet_id String No Specifies the network ID of thesubnet.● Method 1: Log in to VPC
console and click the targetsubnet on the Subnets page.You can view the network IDon the displayed page.
● Method 2: See the "QueryingSubnets" section in theVirtual Private Cloud APIReference.
offset Integer No Specifies the index position. Ifoffset is set to N, the resourcequery starts from the N+1 pieceof data. The value is 0 bydefault, indicating that thequery starts from the first pieceof data. The value must be apositive number.
limit Integer No Specifies the number of recordsto be queried. The default valueis 100. The value cannot be anegative number. The minimumvalue is 1 and the maximumvalue is 100.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 81
Name Type Mandatory Description
tags Arrayofobjects
No Specifies queries based on theinstance tag keys and values.● {key} indicates the tag key. It
must be unique and cannotbe empty.
● {value} indicates the tagvalue, which can be leftempty.
To query instances with multipletag keys and values, separatekey-value pairs with commas (,).A maximum of 10 key-valuepairs are supported.For details, see Table 5-61.
Table 5-61 tags field data structure description
Name Type Mandatory Description
key String Yes Specifies the tag key, whichcontains a maximum of 127Unicode characters. key cannotbe an empty string, a space, orleft blank. Before using key,delete single-byte character(SBC) spaces before and afterthe value. The value cannotcontain the following specialcharacters: +/?#&=,%
value String No Specifies the tag value, whichcontains a maximum of 255Unicode characters. Before usingvalue, delete SBC spaces beforeand after the value. The valuecannot contain the followingspecial characters: +/?#&=,%If the value is empty, it indicatesany_value (querying any value).
RequestNone
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 82
Response● Normal response
Table 5-62 Parameter description
Name Type Description
instances Array of objects Indicates the DBinstance information.For details, see Table5-63.
total_count Integer Indicates the totalnumber of records.
Table 5-63 instances field data structure description
Name Type Description
id String Indicates the DB instance ID.
name String Indicates the created DB instancename.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 83
Name Type Description
status String Indicates the DB instance status.Value:If the value is BUILD, the DB instanceis being created.If the value is ACTIVE, the DBinstance is normal.If the value is FAILED, the DBinstance is abnormal.If the value is FROZEN, the DBinstance is frozen.If the value is MODIFYING, the DBinstance is being scaled up.If the value is REBOOTING, the DBinstance is being rebooted.If the value is RESTORING, the DBinstance is being restored.If the value is MODIFYINGINSTANCE TYPE, the DB instance ischanging from primary to standby.If the value is SWITCHOVER, theprimary/standby switchover is beingperformed.If the value is MIGRATING, the DBinstance is being migrated.If the value is BACKING UP, the DBinstance is being backed up.If the value is MODIFYINGDATABASE PORT, the database portis being changed.If the value is STORAGE FULL, the DBinstance storage space is full.
private_ips List<String> Indicates the private IP address list. Itis a blank string until an ECS iscreated.
private_dns_names
List<String> Indicates the private domain namelist of the DB instance. After a DBinstance is created, you need tomanually apply for a private domainname.
public_ips List<String> Indicates the public IP address list.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 84
Name Type Description
port Integer Indicates the database port number.● The MySQL database port ranges
from 1024 to 65535 (excluding12017 and 33071, which areoccupied by the RDS system andcannot be used).
● The PostgreSQL database portranges from 2100 to 9500.
● The Microsoft SQL Server databaseport is 1433 or ranges from 2100to 9500 (excluding 5355 and5985). For Microsoft SQL Server2017 Enterprise, Standard, andWeb editions, the database port is1433 or ranges from 2100 to 9500,excluding 5050, 5353, and 5986.
If this parameter is not set, thedefault value is as follows:● For MySQL, the default value is
3306.● For PostgreSQL, the default value
is 5432.● For Microsoft SQL Server, the
default value is 1433.
type String The value is Single, Ha, Replica, orEnterprise, which corresponds tosingle instance, primary/standbyinstance, read replica, and distributedinstance (enterprise), respectively.
ha Object Indicates the primary/standby DBinstance information. Returned onlywhen you obtain a primary/standbyDB instance list.For details, see Table 5-64.
region String Indicates the region where the DBinstance is deployed.
datastore Object Indicates the database information.For details, see Table 5-65.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 85
Name Type Description
created String Indicates the creation time in the"yyyy-mm-ddThh:mm:ssZ" format.T is the separator between thecalendar and the hourly notation oftime. Z indicates the time zone offset.For example, if the time zone offset isone hour, the value of Z is +0100.The value is empty when the DBinstance is being created. After theDB instance is created, the value isnot empty.
updated String Indicates the update time. The formatis the same as that of the createdfield.The value is empty when the DBinstance is being created. After theDB instance is created, the value isnot empty.
db_user_name String Indicates the default username.
vpc_id String Indicates the VPC ID.
subnet_id String Indicates the network ID of thesubnet.
security_group_id
String Indicates the security group ID.
flavor_ref String Indicates the specification code.
volume Object Indicates the volume information.For details, see Table 5-66.
switch_strategy String Indicates the database switchoverpolicy. The value can be reliability oravailability, indicating the reliabilityfirst and availability first, respectively.
backup_strategy
Object Indicates the backup policy.For details, see Table 5-67.
maintenance_window
String Indicates the start time of themaintenance time window in the UTCformat.
nodes Array of objects Indicates the primary/standby DBinstance information.For details, see Table 5-68.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 86
Name Type Description
related_instance
Array of objects Indicates the list of associated DBinstances.For details, see Table 5-69.
disk_encryption_id
String Indicates the disk encryption key ID.
enterprise_project_id
String Indicates the enterprise project ID.
time_zone String Indicates the time zone.
charge_info Object Indicates the billing information,which is yearly/monthly or pay-per-use. By default, pay-per-use is used.For details, see Table 5-70.
tags Array of objects Indicates the tag list. If there is no tagin the list, an empty array is returned.For details, see Table 5-71.
backup_used_space
Double Indicates the backup space usage inGB.This field is returned only when youquery information about a specifiedSQL Server DB instance.
storage_used_space
Double Indicates the storage space usage inGB.This field is returned only when youquery information about a specifiedSQL Server DB instance.
order_id String Indicates the order ID. This field isreturned only when DB instance isbilled on a yearly/monthly basis.
associated_with_ddm
Boolean Indicates whether a DDM instancehas been associated.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 87
Table 5-64 ha field data structure description
Name Type Description
replication_mode
String Indicates the replication mode for thestandby DB instance.The value cannot be empty.● For MySQL, the value is async or
semisync.● For PostgreSQL, the value is async or
sync.● For Microsoft SQL Server, the value is
sync.NOTE
● async indicates the asynchronousreplication mode.
● semisync indicates the semi-synchronousreplication mode.
● sync indicates the synchronousreplication mode.
Table 5-65 datastore field data structure description
Name Type Description
type String Indicates the DB engine.
version String Indicates the database version.
Table 5-66 volume field data structure description
Name Type Description
type String Indicates the volume type.
size Integer Indicates the volume size.
Table 5-67 backup_strategy field data structure description
Name Type Description
start_time String Indicates the backup time window.Automated backups will be triggeredduring the backup time window.The time is in the UTC format.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 88
Name Type Description
keep_days Integer Indicates the number of days to retainthe generated backup files.The value ranges from 0 to 732. If thevalue is 0, the automated backup policyis not configured or has been disabled.To extend the retention period, contactcustomer service. Automated backupscan be retained for up to 2562 days.
Table 5-68 nodes field data structure description
Name Type Description
id String Indicates the node ID.
name String Indicates the node name.
role String Indicates the node type. The value canbe master, slave, or readreplica,indicating the primary node, standbynode, and read replica node,respectively.
status String Indicates the node status.
availability_zone
String Indicates the AZ.
Table 5-69 related_instance field data structure description
Name Type Description
id String Indicates the associated DB instance ID.
type String Indicates the associated DB instancetype.● replica_of: indicates the primary DB
instance.● replica: indicates read replicas.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 89
Table 5-70 chargeInfo field data structure description
Name Mandatory Type Description
charge_mode
Yes String Indicates the billing mode.Valid value:● prePaid: indicates the
yearly/monthly billing mode.● postPaid: indicates the pay-
per-use billing mode.
Table 5-71 tags field data structure description
Name Type Description
key String Indicates the tag key.
value String Indicates the tag value.
NO TE
The values of region and availability_zone are used as examples.
● Example normal responseQuery DB instances based on search criteria.{ "instances": [{ "id": "ed7cc6166ec24360a5ed5c5c9c2ed726in01", "status": "ACTIVE", "name": "mysql-0820-022709-01", "port": 3306, "type": "Single", "region": "aaa", "datastore": { "type": "MySQL", "version": "5.7" }, "created": "2018-08-20T02:33:49+0800", "updated": "2018-08-20T02:33:50+0800", "volume": { "type": "ULTRAHIGH", "size": 100 }, "nodes": [{ "id": "06f1c2ad57604ae89e153e4d27f4e4b8no01", "name": "mysql-0820-022709-01_node0", "role": "master", "status": "ACTIVE", "availability_zone": "bbb" }], "private_ips": ["192.168.0.142"], "private_dns_names": ["ed7cc6166ec24360a5ed5c5c9c2ed726in01.internal.cn-xianhz-1.mysql.rds.myhuaweicloud.com"], "public_ips": ["10.154.219.187", "10.154.219.186"],
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 90
"db_user_name": "root", "vpc_id": "b21630c1-e7d3-450d-907d-39ef5f445ae7", "subnet_id": "45557a98-9e17-4600-8aec-999150bc4eef", "security_group_id": "38815c5c-482b-450a-80b6-0a301f2afd97", "flavor_ref": "rds.mysql.s1.large", "switch_strategy": "", "charge_info": { "charge_mode": "postPaid" }, "backup_strategy": { "start_time": "19:00-20:00", "keep_days": 7 }, "maintenance_window": "02:00-06:00", "related_instance": [], "disk_encryption_id": "", "enterprise_project_id": "0", "time_zone": "", "tags" [ { "key": "rds001", "value": "001" }, { "key": "rds002", "value": "002" } ], "associated_with_ddm": false}], "total_count": 1}
● Query all DB instances.
{ "instances": [{ "id": "ed7cc6166ec24360a5ed5c5c9c2ed726in01", "status": "ACTIVE", "name": "mysql-0820-022709-01", "port": 3306, "type": "Single", "region": "aaa", "datastore": { "type": "MySQL", "version": "5.7" }, "created": "2018-08-20T02:33:49+0800", "updated": "2018-08-20T02:33:50+0800", "volume": { "type": "ULTRAHIGH", "size": 100 }, "nodes": [{ "id": "06f1c2ad57604ae89e153e4d27f4e4b8no01", "name": "mysql-0820-022709-01_node0", "role": "master", "status": "ACTIVE", "availability_zone": "bbb" }], "private_ips": ["192.168.0.142"], "private_dns_names": ["ed7cc6166ec24360a5ed5c5c9c2ed726in01.internal.cn-xianhz-1.mysql.rds.myhuaweicloud.com"], "public_ips": ["10.154.219.187", "10.154.219.186"],
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 91
"db_user_name": "root", "vpc_id": "b21630c1-e7d3-450d-907d-39ef5f445ae7", "subnet_id": "45557a98-9e17-4600-8aec-999150bc4eef", "security_group_id": "38815c5c-482b-450a-80b6-0a301f2afd97", "flavor_ref": "rds.mysql.s1.large", "switch_strategy": "", "charge_info": { "charge_mode": "postPaid" }, "backup_strategy": { "start_time": "19:00-20:00", "keep_days": 7 }, "maintenance_window": "02:00-06:00", "related_instance": [], "disk_encryption_id": "", "enterprise_project_id": "0", "time_zone": "", "tags" [ { "key": "rds001", "value": "001" }, { "key": "rds002", "value": "002" } ], "associated_with_ddm": false }, { "id": "ed7cc6166ec24360a5ed5c5c9c2ed726in02", "status": "ACTIVE", "name": "mysql-0820-022709-02", "port": 3306, "type": "Single", "region": "aaa", "datastore": { "type": "MySQL", "version": "5.7" }, "created": "2018-08-20T02:33:49+0800", "updated": "2018-08-20T02:33:50+0800", "volume": { "type": "ULTRAHIGH", "size": 100 }, "nodes": [{ "id": "06f1c2ad57604ae89e153e4d27f4e4b8no01", "name": "mysql-0820-022709-01_node0", "role": "master", "status": "ACTIVE", "availability_zone": "bbb" }], "private_ips": ["192.168.0.142"], "private_dns_names": ["ed7cc6166ec24360a5ed5c5c9c2ed726in01.internal.cn-xianhz-1.mysql.rds.myhuaweicloud.com"], "public_ips": ["10.154.219.187", "10.154.219.186"], "db_user_name": "root", "vpc_id": "b21630c1-e7d3-450d-907d-39ef5f445ae7", "subnet_id": "45557a98-9e17-4600-8aec-999150bc4eef", "security_group_id": "38815c5c-482b-450a-80b6-0a301f2afd97", "flavor_ref": "rds.mysql.s1.large",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 92
"switch_strategy": "", "charge_info": { "charge_mode": "postPaid" }, "backup_strategy": { "start_time": "19:00-20:00", "keep_days": 7 }, "maintenance_window": "02:00-06:00", "related_instance": [], "disk_encryption_id": "", "enterprise_project_id": "0", "time_zone": "", "tags" [ { "key": "rds001", "value": "001" }, { "key": "rds002", "value": "002" } ], "associated_with_ddm": false }], "total_count": 2}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.4.13 Binding and Unbinding an EIP
FunctionThis API is used to bind an EIP to a DB instance for public access or unbind an EIPfrom the DB instance as required.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsAn EIP cannot be bound to or unbound from a DB instance that is being created,modified, restored, frozen, or rebooted.
URI● URI format
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 93
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/public-ip● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/public-ip
● Parameter description
Table 5-72 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-73 Parameter description
Name Mandatory Type Description
public_ip No String NOTICEWhen is_bind istrue, public_ip ismandatory.
Specifies the EIPto be bound. Thevalue must be inthe standard IPaddress format.
public_ip_id No String NOTICEWhen is_bind istrue, public_ip_idis mandatory.
Specifies the EIPID. The valuemust be in thestandard UUIDformat.
is_bind Yes Boolean ● true: Bind anEIP.
● false: Unbindan EIP.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 94
● Request example{ "public_ip":"10.145.51.214", "public_ip_id":"8403e9cd-a7fa-4288-8b15-c7ceac1etest", "is_bind":true}
Response● Normal response
None● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.14 Resetting a Database Password
Function
This API is used to reset the password if you forget the password of your databaseaccount when using RDS. If an error occurs on the root account, for example, theroot account is lost or deleted, you can restore the root account rights throughresetting the password.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints
The password cannot be reset if the DB instance is in any of the followingstatuses: creating, rebooting, upgrading, changing instance class, creating users, ordeleting users.
This API is supported only for MySQL DB instances.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/password● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/password
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 95
Table 5-74 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-75 Parameter description
Name Mandatory Type Description
db_user_pwd
Yes String Specifies the database password.Valid value:The value cannot be left blank.It consists of 8 to 32 charactersand contains at least three typesof the following characters:uppercase letters, lowercaseletters, digits, and specialcharacters.● For MySQL DB instances, the
special characters can be anyof the following: ~!@#%^*-_=+?,
You are advised to enter astrong password to improvesecurity, preventing security riskssuch as brute force cracking.
● Request example
{ "db_user_pwd": "Test_2345674"}
Response● Normal response
None● Example normal response
{}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 96
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.15 Changing the Failover Priority
Function
This API is used to change the failover priority for primary/standby DB instances tomeet different service requirements. You can select Reliability First orAvailability First.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● This API is supported for MySQL only.
● This API is supported for primary/standby DB instances only.
● The password cannot be reset if the DB instance is in any of the followingstatuses: creating, upgrading, creating users, or deleting users.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/failover/strategy
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/failover/strategy
● Parameter description
Table 5-76 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 97
Request● Parameter description
Table 5-77 Parameter description
Name Mandatory Type Description
repairStrategy
Yes String Specifies the failover priority.Valid value:● reliability: Data reliability is
preferentially ensured duringthe failover to minimize theamount of lost data. It isrecommended for servicesthat require high dataconsistency.
● availability: Data availabilityis preferentially ensuredduring the failover to recoverservices quickly. It isrecommended for servicesthat have high requirementson the database onlineduration.
● Request example
{ "repairStrategy": "availability"}
Response● Normal response
None● Example normal response
{}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 98
5.4.16 Manually Switching Primary/Standby DB Instances
Function
This API is used to manually switch primary/standby DB instances as required.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● This API is supported for MySQL and PostgreSQL.
● This API is supported for primary/standby DB instances only.
● Primary/standby DB instances cannot be manually switched if they are in anyof the following statuses:
– MySQL and PostgreSQL: creating, rebooting, upgrading, changinginstance class, restoring, changing port, or creating database account
– MySQL: deleting database account
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/failover
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/failover
● Parameter description
Table 5-78 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
None
● Request example{}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 99
Response● Normal response
Name Description
workflowId Indicates the task ID.
instanceId Indicates the DB instance ID.
nodeId Indicates the node ID.
● Example normal response
{ "workflowId":"072beb09-0573-40bf-bfe8-4be5cec9e85a", "instanceId":"794c38e5309344818f4b33b86ebce9b4in03", "nodeId":"b94ba815747040f1b0d641cd13364a06no03"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.4.17 Changing the Data Synchronize Model of Primary/Standby DB Instances
Function
This API is used to change the data synchronize model of primary/standby DBinstances based on service requirements.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● This API is supported for MySQL only.● This API is supported for primary/standby DB instances only.● The synchronize model cannot be changed if the DB instance is in any of the
following statuses: creating, upgrading, changing instance class, creatingusers, or deleting users.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/failover/mode
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 100
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/failover/mode
● Parameter description
Table 5-79 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-80 Parameter description
Name Mandatory Type Description
mode Yes String Specifies the synchronize model.For MySQL, the value can beany of the following:● async: asynchronous● semisync: semi-synchronous
● Request example
{ "mode": "semisync"}
Response● Normal response
Name Description
workflowId Indicates the task ID.
instanceId Indicates the DB instance ID.
replicationMode Indicates the replication mode.
● Example normal response
{ "instanceId": "c8a7d0abe94840dda99bc437e9442982in01",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 101
"replicationMode": "semisync", "workflowId": "7b55d6ca-dc8e-4844-a9da-6c53a1506db3"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.4.18 Migrating a Standby DB Instance
FunctionThis API is used to migrate a standby DB instance based on service requirements.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● This API is supported for MySQL only.● This API is supported for primary/standby DB instances only.● The standby DB instance cannot be migrated if the primary DB instance is in
any of the following statuses: creating, rebooting, upgrading, changinginstance class, changing port, creating users, or deleting users.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/migrateslave● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/migrateslave
● Parameter description
Table 5-81 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 102
Request● Parameter description
Table 5-82 Parameter description
Name Mandatory Type Description
nodeId Yes String Specifies the ID of the standbynode.
azCode Yes String Specifies the code of the AZ towhich the standby DB instanceis to be migrated.
● Request example
{ "nodeId": "0119b1068b874cb4a5202989a06b6094no01", "azCode": "az2xahz"}
Response● Normal response
Name Description
workflowId Indicates the task ID.
● Example normal response
{ "workflowId":"7b55d6ca-dc8e-4844-a9da-6c53a1506db3"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.4.19 Configuring the Maintenance Window
FunctionThis API is used to change the maintenance window as required. To preventservice interruption, the maintenance window should fall within the off-peakhours.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 103
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/ops-window● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/ops-window
● Parameter description
Table 5-83 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-84 Parameter description
Name Mandatory Type Description
start_time Yes String Specifies the start time (UTC).
end_time Yes String Specifies the end time (UTC).NOTE
The gap between the start timeand end time must be four hours.
● Request example
{ "start_time": "22:00", "end_time":"02:00"}
Response● Example normal response
{}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 104
5.5 Database Security
5.5.1 Configuring SSL
Function
This API is used to configure SSL to encrypt connections.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
SSL cannot be configured when a DB instance is being created, rebooted, orupgraded, its specifications are being modified, or database users are beingcreated or deleted.
This API is supported only for MySQL DB instances.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/ssl
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/ssl
● Parameter description
Table 5-85 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 105
Table 5-86 Parameter description
Name Mandatory Type Description
ssl_option Yes boolean Specifies whether to enable SSL.● true: SSL is enabled.● false: SSL is disabled.
● Request example
{ "ssl_option": true}
Response● Example normal response
{}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.5.2 Changing a Database Port
FunctionThis API is used to change a database port.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsThe database port cannot be changed when a DB instance is being created orrebooted, its specifications are being modified, database users are being created ordeleted, or backups are being created for the DB instance.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/port● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/port
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 106
● Parameter description
Table 5-87 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-88 Parameter description
Name Mandatory
Type Description
port Yes Integer Specifies the port number.The MySQL port number rangesfrom 1024 to 65535, excluding12017 and 33071.
● Request example
{ "port": 8836}
Response● Normal response
Name Description
workflowId Indicates the task ID.
● Example normal response
{ "workflowId":"83abc7bc-2c70-4534-8565-351187b37715"}
● Abnormal responseFor details, see Abnormal Request Results.
5.5.3 Changing a Security Group
FunctionThis API is used to change the security group of a DB instance.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 107
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints
The synchronize model cannot be changed if the DB instance is in any of thefollowing statuses: creating, upgrading, changing instance class, creating users, ordeleting users.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/security-group● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/security-group
● Parameter description
Table 5-89 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-90 Parameter description
Name Mandatory
Type Description
security_group_id
Yes String Specifies the security group ID.
● Request example
{ "security_group_id": "23423kljlj432lk0sdf0234eaa"}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 108
Name Description
workflowId Indicates the task ID.
● Example normal response{ "workflowId":"83abc7bc-2c70-4534-8565-351187b37715"}
● Abnormal response
For details, see Abnormal Request Results.
5.5.4 Changing a Private IP Address
Function
This API is used to change the private IP address of a DB instance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
The private IP address of a DB instance cannot be changed when the instance isbeing created, rebooted, or upgraded, its specifications are being modified, ordatabase users are being created or deleted.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/ip
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/ip
● Parameter description
Table 5-91 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 109
Request● Parameter description
Table 5-92 Parameter description
Name Mandatory
Type Description
new_ip Yes String Indicates the private IP address.
● Request example
{ "new_ip": "192.168.0.213"}
Response● Normal response
Name Description
workflowId Indicates the task ID.
● Example normal response
{ "workflowId":"83abc7bc-2c70-4534-8565-351187b37715"}
● Abnormal responseFor details, see Abnormal Request Results.
5.6 Parameter Configuration
5.6.1 Obtaining a Parameter Template List
FunctionThis API is used to obtain the parameter template list, including default parametertemplates of all databases and those created by users.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.
URI● URI format
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 110
GET https://{Endpoint}/v3/{project_id}/configurations● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations
● Parameter description
Table 5-93 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
Request
None
Response● Normal response
Table 5-94 Parameter description
Name Type Description
configurations Array of objects Indicates the parametertemplate list.For details, see Table5-95.
Table 5-95 configurations field data structure description
Name Type Description
id String Indicates the parameter template ID.
name String Indicates the parameter template name.
description String Indicates the parameter template description.
datastore_version_name
String Indicates the database version name.
datastore_name
String Indicates the database name.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 111
Name Type Description
created String Indicates the creation time in the followingformat: yyyy-MM-ddTHH:mm:ssZ.T is the separator between the calendar andthe hourly notation of time. Z indicates thetime zone offset. For example, in the Beijingtime zone, the time zone offset is shown as+0800.
updated String Indicates the update time in the followingformat: yyyy-MM-ddTHH:mm:ssZ.T is the separator between the calendar andthe hourly notation of time. Z indicates thetime zone offset. For example, in the Beijingtime zone, the time zone offset is shown as+0800.
user_defined
Boolean Indicates whether the parameter template iscreated by users.● false: The parameter template is a default
parameter template.● true: The parameter template is a custom
template.
● Example normal response
{ "configurations": [{ "id": "887ea0d1bb0843c49e8d8e5a09a95652pr01", "name": "configuration_test", "description": "configuration_test", "datastore_version_name": "5.6", "datastore_name": "mysql", "created": "2019-05-15T11:53:34+0000", "updated": "2019-05-15T11:53:34+0000", "user_defined": true }, { "id": "3bc1e9cc0d34404b9225ed7a58fb284epr01", "name": "Default-MySQL-5.7", "description": "Default parameter group for MySQL 5.7", "datastore_version_name": "5.7", "datastore_name": "mysql", "created": "2019-05-27T03:38:51+0000", "updated": "2019-05-27T03:38:51+0000", "user_defined": false } ]}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 112
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.6.2 Creating a Parameter Template
Function
This API is used to create a parameter template and configure the name,description, DB engine, and parameter values in the parameter template.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.
● The name of the created parameter template cannot be the same as that ofthe default or an existing parameter template.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/configurations● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations
● Parameter description
Table 5-96 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant ina region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 113
Table 5-97 Parameter description
Name Mandatory Type Description
name Yes String Specifies the parametertemplate name. It contains amaximum of 64 charactersand can contain onlyuppercase letters, lowercaseletters, digits, hyphens (-),underscores (_), and periods(.).
description No String Specifies the parametertemplate description. Itcontains a maximum of 256characters and cannotcontain the following specialcharacters: >!<"&'= Its value isleft blank by default.
values No Map<String,String>
Specifies the parametervalues defined by users basedon the default parametertemplates. By default, theparameter values cannot bechanged.For details, see Table 5-98.
datastore Yes Object Specifies the database object.For details, see Table 5-99.
Table 5-98 values field data structure description
Name Mandatory Type Description
key No String Specifies the parametername. For example, in"max_connections": "10",the key is max_connections.If key is left blank, theparameter value cannot bechanged. If key is not empty,the parameter value cannotbe empty, either.
value No String Specifies the parameter value.For example, in"max_connections": "10",the value is 10.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 114
Table 5-99 datastore field data structure description
Name Mandatory Type Description
type Yes String Specifies the DB engine. Itsvalue can be any of thefollowing and is case-insensitive:● MySQL● PostgreSQL● SQLServer
version Yes String Specifies the databaseversion. For details, seeConstraints. Example values:● MySQL: 5.7● PostgreSQL: 9.5● Microsoft SQL Server:
2014_SE
● Request example
{ "name": "configuration_test", "description": "configuration_test", "values": { "max_connections": "10", "autocommit": "OFF" }, "datastore": { "type": "mysql", "version": "5.6" }}
Response● Normal response
Table 5-100 Parameter description
Name Type Description
configuration Object Indicates the parametertemplate information.For details, see Table5-101.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 115
Table 5-101 configuration field data structure description
Name Type Description
id String Indicates the parameter template ID.
name String Indicates the parameter templatename.
datastore_version_name
String Indicates the database version name.
datastore_name String Indicates the database name.
description String Indicates the parameter templatedescription.
created String Indicates the creation time in thefollowing format: yyyy-MM-ddTHH:mm:ssZ.T is the separator between thecalendar and the hourly notation oftime. Z indicates the time zone offset.For example, in the Beijing time zone,the time zone offset is shown as+0800.
updated String Indicates the update time in thefollowing format: yyyy-MM-ddTHH:mm:ssZ.T is the separator between thecalendar and the hourly notation oftime. Z indicates the time zone offset.For example, in the Beijing time zone,the time zone offset is shown as+0800.
● Example normal response
{ "configuration": { "id": "463b4b58-d0e8-4e2b-9560-5dea4552fde9", "name": "configuration_test", "datastore_version_name": "5.6", "datastore_name": "mysql", "description": "configuration_test", "created": "2017-04-09T08:27:56+0800", "updated": "2017-04-09T08:27:56+0800" }}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 116
Error CodeFor details, see Error Codes.
5.6.3 Modifying a Parameter Template
FunctionThis API is used to modify a specified parameter template, including the name,description, and values of specified parameters in the parameter template.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.● The modified parameter template name must be different from the name of
an existing or a default parameter template. Default parameter templatescannot be modified.
● The values of the edited parameters must be within the default value rangeof the specified database version. For details about the range of parametervalues, see "Modifying Parameters in a Parameter Template" in the RelationalDatabase Service User Guide.
● Modifying sensitive parameters, for example, lower_case_table_names, mayhave risks. For details, see Precautions for Modifying MySQL Parameters inthe Relational Database User Guide.
● The parameter values to be changed cannot be left blank at the same time.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/configurations/{config_id}● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations/463b4b58-d0e8-4e2b-9560-5dea4552fde9
● Parameter description
Table 5-102 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
config_id Yes Specifies the parameter template ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 117
Request● Parameter description
NO TICE
At least one parameter in the request body must be specified. Otherwise, therequest fails to be delivered.
Table 5-103 Parameter description
Name Mandatory Type Description
name No String Specifies the parametertemplate name. Itcontains a maximum of64 characters and cancontain only uppercaseletters, lowercase letters,digits, hyphens (-),underscores (_), andperiods (.).
description No String Specifies the parametertemplate description. Itcontains a maximum of256 characters and doesnot support the followingspecial characters: !<>='&"Its value is left blank bydefault.
values No Map<String,String>
Specifies the parametervalues defined by usersbased on the defaultparameter templates. Ifthis parameter is leftblank, the parametervalue cannot be changed.For details, see Table5-104.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 118
Table 5-104 values field data structure description
Name Mandatory Type Description
key No String Specifies the parametername. For example, in"max_connections":"10", the key ismax_connections. If keyis not empty, theparameter value cannotbe empty, either.
value No String Specifies the parametervalue. For example, in"max_connections":"10", the value is 10.
● Request example{ "name": "configuration_test", "description": "configuration_test", "values": { "max_connections": "10", "autocommit": "OFF" } }
Response● Normal response
None
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.6.4 Applying a Parameter Template
Function
This API is used to apply a parameter template to one or more DB instances.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 119
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/configurations/{config_id}/apply● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations/463b4b58-d0e8-4e2b-9560-5dea4552fde9/apply
● Parameter description
Table 5-105 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
config_id Yes Specifies the parameter template ID.
Request● Parameter description
Table 5-106 Parameter description
Name Mandatory Type Description
instance_ids Yes Array of strings Specifies the DBinstance ID listobject.
● Request example{ "instance_ids": ["73ea2bf70c73497f89ee0ad4ee008aa2in01", "fe5f5a07539c431181fc78220713aebein01"]}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 120
Table 5-107 Parameter description
Name Type Description
configuration_id String Specifies the parametertemplate ID.
configuration_name
String Specifies the parametertemplate name.
apply_results Array of objects Specifies the result ofapplying the parametertemplate.For details, see Table5-108.
success Boolean Indicates whether eachparameter template isapplied to DB instancessuccessfully.● true: Each
parameter templateis applied to DBinstancessuccessfully.
● false: One or moreparameter templatesfailed to be applied.
Table 5-108 apply_results field data structure description
Name Type Description
instance_id String Indicates the DB instanceID.
instance_name String Indicates the DB instancename.
restart_required Boolean Indicates whether areboot is required.● true: A reboot is
required.● false: A reboot is not
required.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 121
Name Type Description
success Boolean Indicates whether eachparameter template isapplied to DB instancessuccessfully.● true: The application
is successful.● false: The application
failed.
● Example normal response
{ "configuration_id": "cf49bbd7d2384878bc3808733c9e9d8bpr01", "configuration_name": "paramsGroup-bcf9", "apply_results": [{ "instance_id": "fe5f5a07539c431181fc78220713aebein01", "instance_name": "zyy1", "restart_required": false, "success": false }, { "instance_id": "73ea2bf70c73497f89ee0ad4ee008aa2in01", "instance_name": "zyy2", "restart_required": false, "success": false }], "success": false}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.6.5 Modifying Parameters of a Specified DB Instance
FunctionThis API is used to modify parameters in the parameter template of a specified DBinstance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 122
● The values of the edited parameters must be within the default value rangeof the specified database version. For details about the range of parametervalues, see "Modifying Parameters in a Parameter Template" in the RelationalDatabase Service User Guide.
● Modifying sensitive parameters, for example, lower_case_table_names, mayhave risks. For details, see Precautions for Modifying MySQL Parameters inthe Relational Database User Guide.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/configurations● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/configurations
● Parameter description
Table 5-109 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant ina region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-110 Parameter description
Name Mandatory Type Description
values Yes Map<String,String>
Specifies the parametervalues defined by usersbased on the defaultparameter templates.For details, see Table5-111.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 123
Table 5-111 values field data structure description
Name Mandatory Type Description
key Yes String Specifies the parametername. For example, in"max_connections":"10", the key ismax_connections.
value Yes String Specifies the parametervalue. For example, in"max_connections":"10", the value is 10.
● Request example
{ "values": { "xxx": "10", "yyy": "OFF" }}
Response● Normal response
Table 5-112 Parameter description
Name Type Description
restart_required Boolean Indicates whether areboot is required.● true: A reboot is
required.● false: A reboot is not
required.
● Example normal response
{ "restart_required": false}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 124
5.6.6 Obtaining the Parameter Template of a Specified DBInstance
Function
This API is used to obtain information about the parameter template of a specifiedDB instance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/configurations● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/configurations
● Parameter description
Table 5-113 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
instance_id Yes Specifies the DB instance IDcompliant with the UUID format.
Request
None
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 125
Table 5-114 Parameter description
Name Type Description
datastore_version_name
String Indicates the database version name.
datastore_name
String Indicates the database name.
created String Indicates the creation time in thefollowing format: yyyy-MM-ddTHH:mm:ssZ.T is the separator between thecalendar and the hourly notation oftime. Z indicates the time zone offset.For example, in the Beijing time zone,the time zone offset is shown as +0800.
updated String Indicates the update time in thefollowing format: yyyy-MM-ddTHH:mm:ssZ.T is the separator between thecalendar and the hourly notation oftime. Z indicates the time zone offset.For example, in the Beijing time zone,the time zone offset is shown as +0800.
configuration_parameters
Array of objects Indicates the parameters defined byusers based on the default parametertemplates.For details, see Table 5-115.
Table 5-115 configuration_parameters field data structure description
Name Type Description
name String Indicates the parameter name.
value String Indicates the parameter value.
restart_required Boolean Indicates whether a reboot is required.● false: A reboot is not required.● true: A reboot is required.
readonly Boolean Indicates whether the parameter isread-only.● false: The parameter is not read-
only.● true: The parameter is read-only.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 126
Name Type Description
value_range String Indicates the parameter value range. Ifthe type is Integer, the value is 0 or 1. Ifthe type is Boolean, the value is true orfalse.
type String Indicates the parameter type, whichcan be integer, string, boolean, list, orfloat.
description String Indicates the parameter description.
● Example normal response
{ "datastore_version_name": "5.7", "datastore_name": "mysql", "created": "2018-10-11 11:40:44", "updated": "2018-10-11 11:40:44", "configuration_parameters": [{ "name": "auto_increment_increment", "value": "1", "restart_required": false, "readonly": false, "value_range": "1-65535", "type": "integer", "description": auto_increment_increment and auto_increment_offset are used for master-to-master replication and to control the operations of the AUTO_INCREMENT column. }]}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.6.7 Obtaining Parameters in a Specified Parameter Template
FunctionThis API is used to obtain parameters of a specified parameter template.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 127
URI● URI format
GET https://{Endpoint}/v3/{project_id}/configurations/{config_id}● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations/463b4b58-d0e8-4e2b-9560-5dea4552fde9
● Parameter description
Table 5-116 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
config_id Yes Specifies the parameter template ID.When this parameter is empty (notspace), the URL of the parametertemplate list is obtained. For details,see Obtaining a Parameter TemplateList.
RequestNone
Response● Normal response
Table 5-117 Parameter description
Name Type Description
id String Indicates the parametertemplate ID.
name String Indicates the parametertemplate name.
datastore_version_name
String Indicates the database versionname.
datastore_name
String Indicates the database name.
description String Indicates the parametertemplate description.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 128
Name Type Description
created String Indicates the creation time inthe following format: yyyy-MM-ddTHH:mm:ssZ.T is the separator between thecalendar and the hourlynotation of time. Z indicatesthe time zone offset. Forexample, in the Beijing timezone, the time zone offset isshown as +0800.
updated String Indicates the update time in thefollowing format: yyyy-MM-ddTHH:mm:ssZ.T is the separator between thecalendar and the hourlynotation of time. Z indicatesthe time zone offset. Forexample, in the Beijing timezone, the time zone offset isshown as +0800.
configuration_parameters
Array of objects Indicates the parametersdefined by users based on thedefault parameter templates.For details, see Table 5-118.
Table 5-118 configuration_parameters field data structure description
Name Type Description
name String Indicates the parametername.
value String Indicates the parametervalue.
restart_required Boolean Indicates whether arestart is required.● false: indicates that
a restart is notrequired.
● true: indicates thata restart is required.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 129
Name Type Description
readonly Boolean Indicates whether theparameter is read-only.● false: indicates that
the parameter is notread-only.
● true: indicates thatthe parameter isread-only.
value_range String Indicates the parametervalue range. Forexample, the value ofinteger is 0–1, and thevalue of boolean istrue or false.
type String Indicates the parametertype, which can beinteger, string,boolean, list, or float.
description String Indicates the parameterdescription.
● Example normal response
{ "id": "07fc12a8e0e94df7a3fcf53d0b5e1605pr01", "name": "default-mysql-5.6", "datastore_version_name": "5.6", "datastore_name": "mysql", "description": "Default parameter group for mysql 5.6", "created": "2017-05-05T04:40:51+0800", "updated": "2017-05-05T04:40:51+0800", "configuration_parameters": [ { "name": "auto_increment_increment", "value": "1", "restart_required": false, "readonly": true, "value_range": "1-65535", "type": "integer", "description": "auto_increment_increment and auto_increment_offset are intended for use with master-to-master replication, and can be used to control the operation of AUTO_INCREMENT columns." }, { "name": "autocommit", "value": "ON", "restart_required": false, "readonly": true, "value_range": "ON|OFF", "type": "boolean", "description": "The autocommit mode. If set to ON, all changes to a table take effect immediately. If set to OFF, you must use COMMIT to accept a transaction or ROLLBACK to cancel it. "
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 130
} ] }
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.6.8 Deleting a Parameter Template
FunctionThis API is used to delete a specified parameter template.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● The following DB engines are supported: MySQL, PostgreSQL, and Microsoft
SQL Server.● Default parameter templates cannot be deleted.
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/configurations/{config_id}● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/configurations/463b4b58-d0e8-4e2b-9560-5dea4552fde9
● Parameter description
Table 5-119 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant ina region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
config_id Yes Specifies the parameter template ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 131
RequestNone
Response● Normal response
None● Abnormal response
For details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7 Backup and Restoration
5.7.1 Setting an Automated Backup Policy
FunctionThis API is used to set an automated backup policy.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/policy● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/backups/policy
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 132
Table 5-120 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
Request● Parameter description
Table 5-121 Parameter description
Name Mandatory Type Description
backup_policy Yes Object Specifies thebackup policyobjects, includingthe backupretention period(days) andbackup starttime.For details, seeTable 5-122.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 133
Name Mandatory Type Description
reserve_backups No Boolean Specifieswhether toretainautomated andunsynchronizedbackups. Thisparameter isonly valid whenthe automatedbackup policy isdisabled.● true: indicates
thatautomatedandunsynchronized backups areretained.
● false:indicates thatautomatedandunsynchronized backups aredeleted whenthe backuppolicy isdisabled.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 134
Table 5-122 backup_policy field data structure description
Name Mandatory Type Description
keep_days Yes Integer Specifies thenumber of daysto retain thegeneratedbackup files.The value rangeis from 0 to 732.The value 0indicates thatthe automatedbackup policy isdisabled. Toextend theretention period,contact customerservice.Automatedbackups can beretained for upto 2562 days.NOTICE
Once theautomatedbackup policy isdisabled,automatedbackups are nolonger createdand allincrementalbackups aredeletedimmediately.Operationsrelated to theincrementalbackups,includingdownloads,replications,restorations, andrebuilds, may fail.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 135
Name Mandatory Type Description
start_time No String Specifies thebackup timewindow.Automatedbackups will betriggered duringthe backup timewindow. Thisparameter ismandatoryexcept that theautomatedbackup policy isdisabled.The value mustbe a valid valuein the "hh:mm-HH:MM" format.The current timeis in the UTCformat.● The HH value
must be 1greater thanthe hh value.
● The values ofmm and MMmust be thesame andmust be set toany of thefollowing: 00,15, 30, or 45.
Example value:● 08:15-09:15● 23:00-00:00
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 136
Name Mandatory Type Description
period No String Specifies thebackup cycleconfiguration.Data will beautomaticallybacked up onthe selected daysevery week. Thisparameter ismandatoryexcept that theautomatedbackup policy isdisabled.Value range: Thevalue is anumberseparated bycommas (,),indicating thedays of theweek.For example, thevalue 1,2,3,4indicates thatthe backupperiod isMonday,Tuesday,Wednesday, andThursday.
● Request example
Modifying the automated backup policy:{ "backup_policy": { "keep_days": 7, "start_time": "19:00-20:00", "period": "1,2" }}
Disabling the automated backup policy:{ "backup_policy": { "keep_days": 0 }, "reserve_backups": false}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 137
Response● Normal response
None
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.7.2 Setting a Cross-Region Backup Policy
Function
This API is used to set a cross-region backup policy in the source backup region.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● Only MySQL supports cross-region backup policies.
● The retention period of automated full backup files must be the same as thatof automated incremental backup files.
● Automated incremental backup can be enabled only after automated fullbackup is enabled.
● If automated full backup and automated incremental backup are bothenabled and you want to disable them, disable automated incrementalbackup first and then automated full backup.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/offsite-policy
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/backups/offsite-policy
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 138
Table 5-123 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-124 Parameter description
Name Mandatory
Type Description
policy_para Yes Object Specifies the backup policy object,including the backup type, backupretention days, target region ID, andtarget project ID.For details, see Table 5-125.
Table 5-125 policy_para field data structure description
Name Mandatory
Type Description
backup_type Yes String Specifies the backup type. Its valuecan be any of the following:● auto: automated full backup● incremental: automated
incremental backup● all: automated full backup and
automated incremental backup
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 139
Name Mandatory
Type Description
keep_days Yes Integer Specifies the number of days toretain the generated backup files.Value range: 0-732The value 0 indicates that theautomated backup policy isdisabled. To extend the retentionperiod, contact customer service.Automated backups can be retainedfor up to 2,562 days.NOTICE
Once the automated backup policy isdisabled, automated backups are nolonger created and all incrementalbackups are deleted immediately.Operations related to the incrementalbackups, including downloads,replications, restorations, and rebuilds,may fail.
destination_region
Yes String Specifies the target region ID forthe cross-region backup policy.
destination_project_id
Yes String Specifies the target project ID forthe cross-region backup policy.
● Request example
Updating the cross-region automated full backup policy:{ "policy_para": { "backup_type": "auto", "keep_days": 7, "destination_region": "eu-de", "destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c" }}
Disabling the automated backup policy:{ "policy_para": { "backup_type": "auto", "keep_days": 0, "destination_region": "eu-de", "destination_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c" }}
Response● Normal Response
None● Abnormal Response
For details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 140
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.7.3 Obtaining an Automated Backup Policy
Function
This API is used to obtain an automated backup policy.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/policy
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/backups/policy
● Parameter description
Table 5-126 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
Request
None
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 141
Table 5-127 Parameter description
Name Type Description
backup_policy Object Indicates the backuppolicy objects, includingthe backup retentionperiod (days) andbackup start time.For details, see Table5-128.
Table 5-128 backup_policy field data structure description
Name Type Description
keep_days Integer Indicates the numberof days to retain thebackup files.
start_time String Indicates the backuptime window.Automated backupswill be triggered duringthe backup timewindow.
period String Indicates the backupcycle configuration.Data will beautomatically backedup on the selected daysevery week.
● Example normal response
When the automated backup policy is disabled:{ "backup_policy": { "keep_days": 0 }}
When the automated backup policy is enabled:{ "backup_policy": { "keep_days": 7, "start_time": "19:00-20:00", "period": "1,2" }}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 142
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7.4 Querying Information About a Cross-Region BackupPolicy
FunctionThis API is used to query information about a cross-region backup policy in thesource backup region.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsOnly MySQL supports cross-region backup policy queries.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/offsite-policy
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/backups/offsite-policy
● Parameter description
Table 5-129 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
RequestNone
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 143
Response● Normal response
Table 5-130 Parameter description
Name Type Description
policy_para Object Indicates the backup policy object,including the backup type, backupretention days, target region ID, andtarget project ID.For details, see Table 5-131.
Table 5-131 policy_para field data structure description
Name Type Description
backup_type String Indicates the backup type. Its value canbe any of the following:● auto: automated full backup● incremental: automated incremental
backup● all: automated full backup and
automated incremental backup
keep_days Integer Indicates the number of days to retainthe backup files.
destination_region
String Indicates the target region ID for thecross-region backup policy.
destination_project_id
String Indicates the target project ID for thecross-region backup policy.
● Example normal response
When both the automated backup policy and incremental backup policyare disabled:{ "backup_policy": { "keep_days": 0 }}
When both the automated backup policy and incremental backup policyare enabled:{ "policy_para": [ { "keep_days": 7, "backup_type": "auto", "destination_region": "cn-guangzhou-1", "destination_project_id": "0503fd7f7580d3262fc5c001170fbab9"
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 144
}, { "keep_days": 7, "backup_type": "incremental", "destination_region": "cn-guangzhou-1", "destination_project_id": "0503fd7f7580d3262fc5c001170fbab9" } ]}
● Abnormal ResponseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7.5 Creating a Manual Backup
FunctionThis API is used to create a manual backup.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● Microsoft SQL Server supports batch calling of this API to create manual
backups for one database.● Read replicas do not support manual backup creation.● The backup name must be unique.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/backups● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/backups
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 145
Table 5-132 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
Request● Parameter description
Table 5-133 Parameter description
Name Mandatory Type Description
instance_id Yes String Specifies the DBinstance ID.
name Yes String Specifies thebackup name. Itmust be 4 to 64characters inlength and startwith a letter. It iscase-sensitiveand can containonly letters,digits, hyphens(-), andunderscores (_).The backupname must beunique.
description No String Specifies thebackupdescription. Itcontains amaximum of 256characters andcannot containthe followingspecialcharacters: >!<"&'=
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 146
Name Mandatory Type Description
databases No Array ofobjects
Specifies a list ofself-builtMicrosoft SQLServer databasesthat are partiallybacked up. (OnlyMicrosoft SQLServer supportpartial backups.)For details, seeTable 5-134.
Table 5-134 databases field data structure description
Name Mandatory Type Description
name Yes String Specifies thenames of self-built databases.
● Request example
Creating a manual backup for a MySQL or PostgreSQL DB instance:{ "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01", "name": "backup", "description": "manual backup"}
Creating a manual backup for a Microsoft SQL Server DB instance:{ "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04", "name": "backup", "description": "manual backup", "databases": [{ "name": "db1" }, { "name": "db2" }]}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 147
Table 5-135 Parameter description
Name Type Description
backup Object Indicates the backupinformation.For details, see Table5-136.
Table 5-136 backup field data structure description
Name Type Description
id String Indicates the backupID.
instance_id String Indicates the DBinstance ID.
name String Indicates the backupname.
description String Indicates the backupdescription.
databases Array of objects Indicates a list of self-built Microsoft SQLServer databases thatare partially backed up.(Only Microsoft SQLServer support partialbackups.)For details, see Table5-134.
begin_time String Indicates the backupstart time in the "yyyy-mm-ddThh:mm:ssZ"format, where "T"indicates the start timeof the time field, and"Z" indicates the timezone offset.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 148
Name Type Description
status String Indicates the backupstatus. Value:● BUILDING: Backup
in progress● COMPLETED:
Backup completed● FAILED: Backup
failed● DELETING: Backup
being deleted
type String Indicates the backuptype. Value:● auto: automated full
backup● manual: manual full
backup● fragment:
differential fullbackup
● incremental:automatedincremental backup
● Example normal response
Creating a manual backup for a MySQL or PostgreSQL DB instance:{ "backup": { "id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe", "name": "backupDemo", "description": "This is a description", "begin_time": "2016-09-12T01:17:05", "status": "BUILDING", "type": "manual", "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01" }}
Creating a manual backup for a Microsoft SQL Server DB instance:{ "backup": { "id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe", "name": "backupDemo", "description": "This is a description", "begin_time": "2016-09-12T01:17:05", "status": "BUILDING", "type": "manual", "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01", "databases": [{ "name": "db1" }]
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 149
}}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.7.6 Obtaining Details About Backups
Function
This API is used to obtain details about backups.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints
This API is used to query full backups of MySQL, PostgreSQL, and Microsoft SQLServer databases and incremental backups of MySQL and PostgreSQL databases.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/backups?instance_id={instance_id}&backup_id={backup_id}&backup_type={backup_type}&offset={offset}&limit={limit}&begin_time={begin_time}&end_time={end_time}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/backups?instance_id=43e4feaab48f11e89039fa163ebaa7e4br01&offset=0&limit=10&begin_time=2018-08-06T10:41:14+0800&end_time=2018-08-16T10:41:14+0800
● Parameter description
Table 5-137 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of atenant in a region.For details about how to obtainthe project ID, see Obtaining aProject ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 150
Name Mandatory Description
instance_id Yes Specifies the DB instance ID.
backup_id No Specifies the backup ID.
backup_type No Specifies the backup type. Value:● auto: automated full backup● manual: manual full backup● fragment: differential full
backup● incremental: automated
incremental backup
offset No Specifies the index position. Ifoffset is set to N, the resourcequery starts from the N+1 pieceof data. The value is 0 by default,indicating that the query startsfrom the first piece of data. Thevalue must be a positive number.
limit No Specifies the number of recordsto be queried. The default valueis 100. The value cannot be anegative number. The minimumvalue is 1 and the maximumvalue is 100.
begin_time No Specifies the start time forobtaining the backup list. Theformat of the start time is "yyyy-mm-ddThh:mm:ssZ".T is the separator between thecalendar and the hourly notationof time. Z indicates the time zoneoffset. For example, in the Beijingtime zone, the time zone offset isshown as +0800.NOTE
When begin_time is not empty,end_time is mandatory.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 151
Name Mandatory Description
end_time No Specifies the end time forobtaining the backup list. Theformat of the end time is "yyyy-mm-ddThh:mm:ssZ" and the endtime must be later than the starttime.T is the separator between thecalendar and the hourly notationof time. Z indicates the time zoneoffset. For example, in the Beijingtime zone, the time zone offset isshown as +0800.NOTE
When end_time is not empty,begin_time is mandatory.
RequestNone
Response● Normal response
Table 5-138 Parameter description
Name Type Description
backups Array of objects Indicates the backup list.For details, see Table 5-139.
total_count Integer Indicates the total number ofrecords.
Table 5-139 backups field data structure description
Name Type Description
id String Indicates the backup ID.
name String Indicates the backup name.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 152
Name Type Description
type String Indicates the backup type. Value:● auto: automated full backup● manual: manual full backup● fragment: differential full
backup● incremental: automated
incremental backup
size Long Indicates the backup size in KB.
status String Indicates the backup status.Value:● BUILDING: Backup in
progress● COMPLETED: Backup
completed● FAILED: Backup failed● DELETING: Backup being
deleted
begin_time String Indicates the backup start timein the "yyyy-mm-ddThh:mm:ssZ"format.T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
end_time String Indicates the backup end time.● For a full backup, it indicates
the full backup end time.● For a MySQL incremental
backup, it indicates the timewhen the last transaction inthe backup file is submitted.
The format is yyyy-mm-ddThh:mm:ssZ. T is theseparator between the calendarand the hourly notation of time.Z indicates the time zone offset.For example, in the Beijing timezone, the time zone offset isshown as +0800.
datastore Object Indicates the database version.For details, see Table 5-140.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 153
Name Type Description
databases Array of objects Indicates a list of self-builtMicrosoft SQL Server databasesthat support partial backups.For details, see Table 5-141.
instance_id String Indicates the ID of the DBinstance for which the backup iscreated.
associated_with_ddm
Boolean Indicates whether a DDMinstance has been associated.
Table 5-140 datastore field data structure description
Name Type Description
type String Indicates the DB engine. Itsvalue can be any of thefollowing and is case-insensitive:● MySQL● PostgreSQL● SQLServer
version String Indicates the database version.
Table 5-141 databases field data structure description
Name Type Description
name String Indicates the name of the self-built database.
● Example normal response
Obtaining a backup list of a MySQL DB instance:{ "backups": [{ "id": "43e4feaab48f11e89039fa163ebaa7e4br01", "name": "xxxx.xxx", "type": "auto", "size": 2803, "status": "COMPLETED", "begin_time": "2018-08-06T12:41:14+0800", "end_time": "2018-08-06T12:43:14+0800", "datastore": { "type": "MySQL", "version": "5.6" }, "instance_id": "a48e43ff268f4c0e879652d65e63d0fbin01",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 154
"associated_with_ddm": false }], "total_count": 1}
Obtaining a backup list of a PostgreSQL DB instance:{ "backups": [{ "id": "43e4feaab48f11e89039fa163ebaa7e4br03", "name": "xxxx.xxx", "type": "incremental", "size": 2803, "status": "COMPLETED", "begin_time": "2018-08-06T12:41:14+0800", "end_time": "2018-08-06T12:43:14+0800", "datastore": { "type": "PostgreSQL", "version": "9.6" }, "instance_id": "a48e43ff268f4c0e879652d65e63d0fbin03 ", "associated_with_ddm": false }], "total_count": 1}
Obtaining a backup list of a Microsoft SQL Server DB instance:{ "backups": [{ "id ": "43e4feaab48f11e89039fa163ebaa7e4br04", "name": "xxxx.xxx", "type": "manual", "size": 2803, "status": "COMPLETED", "begin_time": "2018-08-06T12:41:14+0800", "end_time": "2018-08-06T12:43:14+0800", "datastore": { "type": "SQLServer", "version": "2014_WEB" }, "databases": [{ "name": "user01" }, { "name": "user02" }], "instance_id": "a48e43ff268f4c0e879652d65e63d0fbin04", "associated_with_ddm": false }], "total_count": 1}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 155
5.7.7 Querying Information About a Cross-Region Backup List
FunctionThis API is used to query information about a cross-region backup list in the targetbackup region.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsThis API is supported for MySQL only.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/offsite-backups?instance_id={instance_id}&backup_id={backup_id}&backup_type={backup_type}&offset={offset}&limit={limit}&begin_time={begin_time}&end_time={end_time}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/offsite-backups?instance_id=43e4feaab48f11e89039fa163ebaa7e4br01&offset=0&limit=10&begin_time=2018-08-06T10:41:14+0800&end_time=2018-08-16T10:41:14+0800
● Parameter description
Table 5-142 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain the projectID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
backup_id No Specifies the backup ID.
backup_type Yes Specifies the backup type. Its value can beany of the following:● auto: automated full backup● incremental: automated incremental
backup
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 156
Name Mandatory
Description
offset No Specifies the index position. If offset is set toN, the resource query starts from the N+1piece of data. The value is 0 by default,indicating that the query starts from the firstpiece of data. The value must be a positivenumber.
limit No Specifies the number of records to bequeried. The default value is 100. The valuecannot be a negative number. The minimumvalue is 1 and the maximum value is 100.
begin_time No Specifies the start time for obtaining thecross-region backup list. The format of thestart time is "yyyy-mm-ddThh:mm:ssZ".T is the separator between the calendar andthe hourly notation of time. Z indicates thetime zone offset. For example, in the Beijingtime zone, the time zone offset is shown as+0800.NOTE
When begin_time is not empty, end_time ismandatory.
end_time No Specifies the end time for obtaining thecross-region backup list. The format of theend time is "yyyy-mm-ddThh:mm:ssZ" andthe end time must be later than the starttime.T is the separator between the calendar andthe hourly notation of time. Z indicates thetime zone offset. For example, in the Beijingtime zone, the time zone offset is shown as+0800.NOTE
When end_time is not empty, begin_time ismandatory.
RequestNone
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 157
Table 5-143 Parameter description
Name Type Description
backups Array of objects Indicates the backup list.For details, see Table 5-144.
total_count Integer Indicates the total number ofrecords.
Table 5-144 backups field data structure description
Name Type Description
id String Indicates the backup ID.
name String Indicates the backup name.
type String Indicates the backup type. Itsvalue can be any of thefollowing:● auto: automated full backup● incremental: automated
incremental backup
size Long Indicates the backup size in KB.
status String Indicates the backup status. Itsvalue can be any of thefollowing:● BUILDING: Backup in
progress● COMPLETED: Backup
completed● FAILED: Backup failed● DELETING: Backup being
deleted
begin_time String Indicates the backup start timein the "yyyy-mm-ddThh:mm:ssZ"format.T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 158
Name Type Description
end_time String Indicates the backup end time.● For a full backup, it indicates
the full backup end time.● For an incremental backup, it
indicates the time when thelast transaction in the backupfile was submitted.
The format is yyyy-mm-ddThh:mm:ssZ. T is theseparator between the calendarand the hourly notation of time.Z indicates the time zone offset.For example, in the Beijing timezone, the time zone offset isshown as +0800.
datastore Object Indicates the database version.For details, see Table 5-145.
instance_id String Indicates the ID of the DBinstance for which the backup iscreated.
Table 5-145 datastore field data structure description
Name Type Description
type String Indicates the DB engine.Currently, only MySQL issupported.
version String Indicates the database version.
● Example normal response
{ "backups": [{ "id": "43e4feaab48f11e89039fa163ebaa7e4br01", "name": "xxxx.xxx", "type": "auto", "size": 2803, "status": "COMPLETED", "begin_time": "2018-08-06T12:41:14+0800", "end_time": "2018-08-06T12:43:14+0800", "datastore": { "type": "MySQL", "version": "5.6" }, "instance_id": "a48e43ff268f4c0e879652d65e63d0fbin01" }], "total_count": 1}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 159
● Abnormal ResponseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7.8 Querying Information About DB Instances for WhichCross-Region Backups Are Created
FunctionThis API is used to query the list of DB instances for which cross-region backupsare created in the target backup region.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsThis API is supported for MySQL only.
URI● URI format
GET https://{Endpoint}/v3/backups/offsite-backup-instance?offset={offset}&limit={limit}
● Example– Querying all DB instance lists
https://rds.ap-southeast-1.myhuaweicloud.com/v3/backups/offsite-backup-instance
– Querying DB instance lists based on search criteriahttps://rds.ap-southeast-1.myhuaweicloud.com/v3/backups/offsite-backup-instance?offset=0&limit=10
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 160
Table 5-146 Parameter description
Name Type Mandatory
Description
offset Integer No Specifies the index position. If offset is setto N, the resource query starts from the N+1 piece of data. The value is 0 by default,indicating that the query starts from thefirst piece of data. The value must be apositive number.
limit Integer No Specifies the number of records to bequeried. The default value is 100. The valuecannot be a negative number. Theminimum value is 1 and the maximumvalue is 100.
Request
None
Response● Normal response
Table 5-147 Parameter description
Name Type Description
offsite_backup_instance
Array ofobjects
Indicates information about DBinstances for which cross-region backupsare created.For details, see Table 5-148.
total_count Integer Indicates the total number of records.
Table 5-148 offsite_backup_instance field data structure description
Name Type Description
id String Indicates the DB instance ID.
name String Indicates the name of the DB instancefor which cross-region backups arecreated.
source_region String Indicates the source backup region.
source_project_id
String Indicates the project ID in the sourcebackup region.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 161
Name Type Description
datastore Object Indicates the database information.For details, see Table 5-149.
destination_region
String Indicates the region where the cross-region backup is located.
destination_project_id
String Indicates the project ID in the targetbackup region.
keep_days Integer Indicates how many days cross-regionbackups are retained.
Table 5-149 datastore field data structure description
Name Type Description
type String Indicates the DB engine. Currently, onlyMySQL is supported.
version String Indicates the database version.
● Example normal response
Querying DB instance lists based on search criteria:{ "total_count": 1, "offsite_backup_instances": [{ "id": "ed7cc6166ec24360a5ed5c5c9c2ed726in01", "name": "rds-instance-rep2", "source_region": "aaa", "source_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c", "datastore": { "type": "MySQL", "version": "5.7" }, "destination_region": "bbb", "destination_project_id": "0503fd7f7580d3262fc5c001170fbab9", "keep_days": 7 } ]}
● Querying all DB instance lists:
{ "total_count": 1, "offsite_backup_instances": [{ "id": "ed7cc6166ec24360a5ed5c5c9c2ed726in01", "name": "rds-instance-rep2", "source_region": "aaa", "source_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c", "datastore": { "type": "MySQL", "version": "5.7" },
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 162
"destination_region": "bbb", "destination_project_id": "0503fd7f7580d3262fc5c001170fbab9", "keep_days": 7 } ]}
● Abnormal ResponseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7.9 Obtaining the Link for Downloading a Backup File
FunctionThis API is used to obtain the link for downloading a backup file.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsThis API is used to query full backups of MySQL, PostgreSQL, and Microsoft SQLServer databases and incremental backups of MySQL and PostgreSQL databases.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/backup-files?backup_id={backup_id}● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/97b026aa9cc4417888c14c84a1ad9860/backup-files?backup_id=c0c9f155c7b7423a9d30f0175998b63bbr01
● Parameter description
Table 5-150 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of atenant in a region.For details about how to obtainthe project ID, see Obtaining aProject ID.
backup_id Yes Specifies the backup ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 163
Request
None
Response● Normal response
Table 5-151 Parameter description
Name Type Description
files Array of objects Indicates the list of backup files.For details, see Table 5-152.
bucket String Indicates the name of the bucketwhere the file is located.
Table 5-152 files field data structure description
Name Type Description
name String Indicates the file name.
size Long Indicates the file size in KB.
download_link String Indicates the link fordownloading the backup file.
link_expired_time
String Indicates the link expirationtime. The format is "yyyy-mm-ddThh:mm:ssZ". T is theseparator between the calendarand the hourly notation of time.Z indicates the time zone offset.For example, in the Beijing timezone, the time zone offset isshown as +0000.
● Example normal response
{ "files": [ { "name": "43e4feaab48f11e89039fa163ebaa7e4br01.xxx", "size": 2803, "download_link":"https://obs.domainname.com/rdsbucket.username.1/xxxxxx", "link_expired_time":"2018-08-016T10:15:14+0000" } ], "bucket": "rdsbucket.bucketname"}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 164
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.7.10 Deleting a Manual Backup
Function
This API is used to delete a manual backup.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/backups/{backup_id}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/backups/2f4ddb93-b901-4b08-93d8-1d2e472f30fe
● Parameter description
Table 5-153 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
backup_id Yes Specifies the ID of themanual backup.
Request
None
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 165
Response● Normal response
None● Abnormal response
For details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7.11 Querying the Restoration Time Range
FunctionThis API is used to query the restoration time range of a DB instance.
If the backup retention period has been set to a long period, you are advised toset the query date by referring to Table 5-154.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/restore-time?date=2020-12-26
● Example– Querying all restoration time ranges
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/restore-time
– Querying the restoration time range based on a specified datehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/restore-time?date=2020-12-26
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 166
Table 5-154 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
date No Specifies the date to bequeried. The value is inthe yyyy-mm-ddformat, and the timezone is UTC.
RequestNone
Response● Normal response
Table 5-155 Parameter description
Name Type Description
restore_time Array of objects Indicates the list ofrestoration time ranges.For details, see Table5-156.
Table 5-156 restore_time field data structure description
Name Type Description
start_time Integer Indicates the start timeof the restoration timerange in the UNIXtimestamp format. Theunit is millisecond andthe time zone is UTC.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 167
Name Type Description
end_time Integer Indicates the end timeof the restoration timerange in the UNIXtimestamp format. Theunit is millisecond andthe time zone is UTC.
● Example normal response
{ "restore_time": [ { "start_time": 1532001446987, "end_time": 1532742139000 } ] }
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7.12 Querying the Restoration Time Range of a Cross-Region Backup
FunctionThis API is used to query the restoration time range of a cross-region backup inthe backup target region.
If the backup retention period has been set to a long period, you are advised toset the query date by referring to Table 5-157.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsThis API is supported for MySQL only.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/offsite-restore-time?date=2020-12-26
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 168
● Example– Querying all restoration time ranges of a cross-region backup
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/offsite-restore-time
– Querying the restoration time range of a cross-region backup based on aspecified datehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/offsite-restore-time?date=2020-12-26
● Parameter description
Table 5-157 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtainthe project ID, see Obtaining aProject ID.
instance_id Yes Specifies the DB instance ID.
date No Specifies the date to be queried.The value is in the yyyy-mm-ddformat, and the time zone is UTC.
RequestNone
Response● Normal response
Table 5-158 Parameter description
Name Type Description
restore_time Array ofobjects
Indicates the list of restorationtime ranges.For details, see Table 5-159.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 169
Table 5-159 restore_time field data structure description
Name Type Description
start_time Integer Indicates the start time of therestoration time range in theUNIX timestamp format. The unitis millisecond and the time zoneis UTC.
end_time Integer Indicates the end time of therestoration time range in theUNIX timestamp format. The unitis millisecond and the time zoneis UTC.
● Example normal response
{ "restore_time": [ { "start_time": 1532001446987, "end_time": 1532742139000 } ] }
● Abnormal ResponseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.7.13 Restoring Data to a New DB Instance
Function
This API is used to restore data to a new DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● The DB engine of the original DB instance must be the same as that of the
target DB instance. For example, if the original DB instance is running MySQL,the target DB instance must also run MySQL.
● All DB engine versions of the original and new DB instances must beconsistent.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 170
● The total volume size of the new DB instance must be greater than or equalto that of the original DB instance.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances
● Parameter description
Table 5-160 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 171
Table 5-161 Parameter description
Name Mandatory Type Description
name Yes String Specifies the DBinstance name.DB instances ofthe same typecan have samenames under thesame tenant,except thatMicrosoft SQLServer DBinstances of thesame type musthave uniquenames under thesame tenant.The value mustbe 4 to 64characters inlength and startwith a letter. It iscase-insensitiveand can containonly letters,digits, hyphens(-), andunderscores (_).
ha No Object Specifies the HAconfigurationparameters,which are usedwhen creatingprimary/standbyDB instances.For details, seeTable 5-162.
configuration_id No String Specifies theparametertemplate ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 172
Name Mandatory Type Description
port No String Specifies thedatabase portinformation.● The MySQL
database portranges from1024 to65535(excluding12017 and33071, whichare occupiedby the RDSsystem andcannot beused).
● ThePostgreSQLdatabase portranges from2100 to 9500.
● The MicrosoftSQL Serverdatabase portis 1433 orranges from2100 to 9500(excluding5355 and5985). ForMicrosoft SQLServer 2017Enterprise,Standard, andWeb editions,the databaseport is 1433or rangesfrom 2100 to9500,excluding5050, 5353,and 5986.
If this parameteris not set, thedefault value isas follows:
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 173
Name Mandatory Type Description
● For MySQL,the defaultvalue is 3306.
● ForPostgreSQL,the defaultvalue is 5432.
● For MicrosoftSQL Server,the defaultvalue is 1433.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 174
Name Mandatory Type Description
password Yes String Specifies thedatabasepassword.Valid value:● The password
of MySQL andPostgreSQLmust consistof 8 to 32charactersand containat least threetypes of thefollowingcharacters:uppercaseletters,lowercaseletters, digits,and specialcharacters (~!@#%^*-_=+?).
● The passwordof SQL Servermust consistof 8 to 32charactersand containat least threetypes of thefollowingcharacters:uppercaseletters,lowercaseletters, digits,and specialcharacters (~!@#$%^*-_=+?).
You are advisedto enter a strongpassword toimprove security,preventingsecurity riskssuch as bruteforce cracking.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 175
Name Mandatory Type Description
backup_strategy No Object Specifies theadvanced backuppolicy.For details, seeTable 5-163.
enterprise_project_id
No String Specifies theproject ID.
disk_encryption_id
No String Specifies the keyID for diskencryption. Thedefault value isempty.
flavor_ref Yes String Specifies thespecificationcode. The valuecannot be empty.For details, seespec_code insectionQueryingDatabaseSpecifications.
volume Yes Object Specifies thevolumeinformation.For details, seeTable 5-164.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 176
Name Mandatory Type Description
availability_zone Yes String Specifies the AZID. If the DBinstance is not asingle instance,you need tospecify an AZ foreach node of theinstance andseparate the AZswith commas (,).For details, seethe example.The value cannotbe empty. Fordetails abouthow to obtainthis parametervalue, seeRegions andEndpoints.
vpc_id Yes String Specifies the VPCID. To obtain thisparameter value,use either of thefollowingmethods:● Method 1:
Log in to VPCconsole andview the VPCID in the VPCdetails.
● Method 2: Seethe "QueryingVPCs" sectionin the VirtualPrivate CloudAPI Reference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 177
Name Mandatory Type Description
subnet_id Yes String Specifies thenetwork ID. Toobtain thisparameter value,use either of thefollowingmethods:● Method 1:
Log in to VPCconsole andclick thetarget subneton theSubnetspage. You canview thenetwork ID onthe displayedpage.
● Method 2: Seethe "QueryingSubnets"section in theVirtual PrivateCloud APIReference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 178
Name Mandatory Type Description
data_vip No String Specifies thefloating IPaddress of a DBinstance. Toobtain thisparameter value,use either of thefollowingmethods:● Method 1:
Log in to VPCconsole andclick thetarget subneton theSubnetspage. You canview thesubnet CIDRblock on thedisplayedpage.
● Method 2: Seethe "QueryingSubnets"section in theVirtual PrivateCloud APIReference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 179
Name Mandatory Type Description
security_group_id No String Specifies thesecurity groupwhich the RDSDB instancebelongs to. Toobtain thisparameter value,use either of thefollowingmethods:● Method 1:
Log in to VPCconsole.ChooseAccessControl >SecurityGroups in thenavigationpane on theleft. On thedisplayedpage, click thetarget securitygroup. Youcan view thesecurity groupID on thedisplayedpage.
● Method 2: Seethe "QueryingSecurityGroups"section in theVirtual PrivateCloud APIReference.
restore_point Yes Object Specifies therestorationinformation.For details, seeTable 5-165.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 180
Name Mandatory Type Description
charge_info No Object Specifies thebillinginformation,which is yearly/monthly or pay-per-use (defaultsetting).Currently, onlyMicrosoft SQLServer DBinstancessupportrestoration ofyearly/monthlyDB instances tonew DBinstances.For details, seeTable 5-166.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 181
Name Mandatory Type Description
time_zone No String Specifies the UTCtime zone.● If this
parameter isnot specified,the time zoneof eachengine is asfollows:– RDS for
MySQL:Chinesemainlandsite andinternational site useUTC bydefault.
– RDS forPostgreSQL: Chinesemainlandsite andinternational site useUTC bydefault.
– MicrosoftSQL Serveruses ChinaStandardTime in theChinesemainlandsite andUTC in theinternational site bydefault.
● For MySQL orPostgreSQL, ifthisparameter isspecified, thevalue rangesfromUTC-12:00 toUTC+12:00 atthe full hour.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 182
Name Mandatory Type Description
For example,the parametercan be UTC+08:00 ratherthan UTC+08:30.
● For MicrosoftSQL Server,refer to Table5-19 whenspecifying thisparameter.
collation No String This parameterapplies only toMicrosoft SQLServer DBinstances.Value range:character setsqueried inQuerying theAvailable SQLServerCharacter Set.
Table 5-162 ha field data structure description
Name Mandatory Type Description
mode Yes String Specifies the DBinstance type.The value is Ha(primary/standbyDB instances)and is case-insensitive.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 183
Name Mandatory Type Description
replication_mode Yes String Specifies thereplication modefor the standbyDB instance.The value cannotbe empty.● For MySQL,
the value isasync orsemisync.
● ForPostgreSQL,the value isasync or sync.
● For MicrosoftSQL Server,the value issync.
NOTE● async
indicates theasynchronousreplicationmode.
● semisyncindicates thesemi-synchronousreplicationmode.
● sync indicatesthesynchronousreplicationmode.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 184
Table 5-163 backup_strategy field data structure description
Name Mandatory Type Description
start_time Yes String Specifies thebackup timewindow.Automatedbackups will betriggered duringthe backup timewindow.The value cannotbe empty. Itmust be a validvalue in the"hh:mm-HH:MM" format.The current timeis in the UTCformat.● The HH value
must be 1greater thanthe hh value.
● The values ofmm and MMmust be thesame andmust be set toany of thefollowing: 00,15, 30, or 45.
Example value:● 08:15-09:15● 23:00-00:00
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 185
Name Mandatory Type Description
keep_days No Integer Specifies theretention daysfor specificbackup files.The value rangeis from 0 to 732.If this parameteris not specifiedor set to 0, theautomatedbackup policy isdisabled. Toextend theretention period,contact customerservice.Automatedbackups can beretained for upto 2562 days.
Table 5-164 volume field data structure description
Name Mandatory Type Description
type Yes String Specifies thevolume type.Its value can beany of thefollowing and iscase-sensitive:● ULTRAHIGH:
indicates theSSD type.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 186
Name Mandatory Type Description
size Yes Integer Specifies thevolume size.Its value range isfrom 40 GB to4000 GB. Thevalue must be amultiple of 10.For some users,storage spaceranges from 40GB to 6000 GB. Ifyou want tocreate a DBinstance withstorage space upto 6000 GB orscale up to10,000 GB,contact customerservice to applyfor thepermission.NOTICE
The volume sizeof the new DBinstance must begreater than orequal to that ofthe original DBinstance.
Table 5-165 restore_point field data structure description
Name Mandatory Type Description
instance_id Yes String Specifies the DBinstance ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 187
Name Mandatory Type Description
type Yes String Specifies therestorationmode.Enumeratedvalues include:● backup:
indicatesrestorationfrom backupfiles. In thismode,backup_id ismandatorywhen type isnotmandatory.
● timestamp:indicatespoint-in-timerestoration. Inthis mode,restore_timeis mandatorywhen type ismandatory.
backup_id No String Specifies the IDof the backupused to restoredata. Thisparameter mustbe specifiedwhen the backupfile is used forrestoration.NOTICE
When type is notmandatory,backup_id ismandatory.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 188
Name Mandatory Type Description
restore_time No Integer Specifies thetime point ofdata restorationin the UNIXtimestamp. Theunit ismillisecond andthe time zone isUTC.NOTICE
When type ismandatory,restore_time ismandatory.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 189
Name Mandatory Type Description
database_name No Map<String,String>
This parameterapplies only tothe MicrosoftSQL Server DBengine. If thisparameter isspecified, youcan restorespecificdatabases in theDB instance andcustomize thedatabase namesas required.● The new
databasenames mustbe differentfrom theoriginaldatabasenames. If youdo notcustomize thedatabasenames, datawill berestored tothe originaldatabases bydefault.NOTICE
If thisparameter isnot specified,all databasesare restoredby default.
Examplevalue:"database_name":{"Originaldatabasename":"Newdatabasename"}
● The newdatabasenames cannot
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 190
Name Mandatory Type Description
contain thefollowingfields (case-insensitive):rdsadmin,master, msdb,tempdb,model, andresource.
● Eachdatabasename consistsof 1 to 64characters.Only letters,digits,hyphens (-),andunderscores(_) areallowed.
Table 5-166 charge_info field data structure description
Name Mandatory
Type Description
charge_mode Yes String Specifies the billing mode.Value range:● prePaid: indicates the yearly/
monthly billing mode.● postPaid: indicates the pay-per-
use billing mode.
period_type No String Specifies the subscription type.Value range:● month: indicates that the service
is subscribed by month.● year: indicates that the service is
subscribed by year.NOTE
This parameter is valid and mandatoryif charge_mode is set to prePaid.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 191
Name Mandatory
Type Description
period_num No Integer Specifies the subscription period. Thisparameter is valid and mandatory ifcharge_mode is set to prePaid.Value range:● When period_type is set to
month, the parameter valueranges from 1 to 9.
● When period_type is set to year,the parameter value ranges from 1to 3.
● Request example
Use backup files for restoration:MySQL/PostgreSQL:{ "name": "targetInst", "availability_zone": "bbb,ccc", "ha": { "mode": "ha", "replication_mode": "async" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 40 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "data_vip": "192.168.0.147", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "backup_strategy": { "keep_days": 2, "start_time": "19:00-20:00" }, "password": "Demo@12345678", "configuration_id": "52e86e87445847a79bf807ceda213165pr01", "enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c", "time_zone": "UTC+04:00", "restore_point": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01", "type": "backup", "backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe" }}
Microsoft SQL Server:{ "name": "targetInst", "availability_zone": "bbb,ccc", "ha": {
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 192
"mode": "ha", "replication_mode": "sync" }, "flavor_ref": "rds.mssql.2014.se.s3.xlarge.2.ha", "volume": { "type": "ULTRAHIGH", "size": 40 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "data_vip": "192.168.0.147", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "backup_strategy": { "keep_days": 2, "start_time": "19:00-20:00" }, "charge_info": { "charge_mode": "prePaid", "period_type": "month"," "period_num": 1, "is_auto_renew": false, " "is_auto_pay": true }, "password": "Demo@12345678", "configuration_id": "52e86e87445847a79bf807ceda213165pr04", "enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c", "time_zone": "UTC+04:00", "collation":"Cyrillic_General_CI_AS", "restore_point": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04", "type": "backup", "backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe", "database_name": { "db1": "dbtest1", "db2": "" } }}
Use PITR for restoration:MySQL/PostgreSQL:{ "name": "targetInst", "availability_zone": "bbb,ccc", "ha": { "mode": "ha", "replication_mode": "async" }, "flavor_ref": "rds.mysql.s1.large", "volume": { "type": "ULTRAHIGH", "size": 40 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "data_vip": "192.168.0.147", "backup_strategy": { "keep_days": 2, "start_time": "19:00-20:00"
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 193
}, "password": "Demo@12345678", "configuration_id": "52e86e87445847a79bf807ceda213165pr01", "enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c", "time_zone": "UTC+04:00", "restore_point": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01", "type": "timestamp", "restore_time": 1532001446987 }}
Microsoft SQL Server:{ "name": "targetInst", "availability_zone": "bbb,ccc", "ha": { "mode": "ha", "replication_mode": "sync" }, "flavor_ref": "rds.mssql.2014.se.s3.xlarge.2.ha", "volume": { "type": "ULTRAHIGH", "size": 40 }, "disk_encryption_id": "2gfdsh-844a-4023-a776-fc5c5fb71fb4", "vpc_id": "490a4a08-ef4b-44c5-94be-3051ef9e4fce", "subnet_id": "0e2eda62-1d42-4d64-a9d1-4e9aa9cd994f", "data_vip": "192.168.0.147", "security_group_id": "2a1f7fc8-3307-42a7-aa6f-42c8b9b8f8c5", "backup_strategy": { "keep_days": 2, "start_time": "19:00-20:00" }, "charge_info": { "charge_mode": "prePaid", "period_type": "month"," "period_num": 1, "is_auto_renew": false, " "is_auto_pay": true }, "password": "Demo@12345678", "configuration_id": "52e86e87445847a79bf807ceda213165pr04", "enterprise_project_id": "ba1f7fc8-3307-42a7-aa6f-42c8b9b8f85c", "time_zone": "UTC+04:00", "collation":"Cyrillic_General_CI_AS", "restore_point": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04", "type": "timestamp", "restore_time": 1532001446987, "database_name": { "db1": "dbtest1", "db2": "" } }}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 194
Table 5-167 Parameter description
Name Type Description
instance Object Indicates the DBinstance information.For details, see Table5-168.
job_id String Indicates the ID of theDB instance creationtask. This parameter isreturned only for therestoration to a new DBinstance billed on thepay-per-use basis.
order_id String Indicates the order ID.This parameter isreturned only for thecreation of a MicrosoftSQL Server DB instancebilled on the yearly/monthly basis.
Table 5-168 instance description
Name Type Description
id String Indicates the DBinstance ID.
name String Indicates the DBinstance name.DB instances of thesame type can havesame names under thesame tenant, exceptthat Microsoft SQLServer DB instances ofthe same type musthave unique namesunder the same tenant.The value must be 4 to64 characters in lengthand start with a letter.It is case-insensitiveand can contain onlyletters, digits, hyphens(-), and underscores(_).
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 195
Name Type Description
status String Indicates the DBinstance status. Forexample, BUILDindicates that the DBinstance is beingcreated.
datastore Object Indicates the databaseinformation.For details, see Table5-169.
ha Object Indicates the HAconfigurationparameters. Thisparameter is returnedonly when primary/standby DB instancesare created.For details, see Table5-170.
configuration_id String Indicates the parametertemplate ID. Thisparameter is returnedonly when a customparameter template isused during DBinstance creation.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 196
Name Type Description
port String Indicates the databaseport information.● The MySQL
database portranges from 1024 to65535 (excluding12017 and 33071,which are occupiedby the RDS systemand cannot beused).
● The PostgreSQLdatabase portranges from 2100 to9500.
● The Microsoft SQLServer database portis 1433 or rangesfrom 2100 to 9500(excluding 5355 and5985). For MicrosoftSQL Server 2017Enterprise, Standard,and Web editions,the database port is1433 or ranges from2100 to 9500,excluding 5050,5353, and 5986.
If this parameter is notset, the default value isas follows:● For MySQL, the
default value is3306.
● For PostgreSQL, thedefault value is5432.
● For Microsoft SQLServer, the defaultvalue is 1433.
backup_strategy Object Indicates theautomated backuppolicy.For details, see Table5-171.
enterprise_project_tag String Indicates the project ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 197
Name Type Description
flavor_ref String Indicates thespecification ID.For details, seespec_code in Table 5-6in section QueryingDatabaseSpecifications.
volume Object Indicates the volumeinformation.For details, see Table5-172.
region String Indicates the region ID.
availability_zone String Indicates the AZ ID.
vpc_id String Indicates the VPC ID. Toobtain this parametervalue, use either of thefollowing methods:● Method 1: Log in to
VPC console andview the VPC ID inthe VPC details.
● Method 2: See the"Querying VPCs"section in the VirtualPrivate Cloud APIReference.
subnet_id String Indicates the networkID. To obtain thisparameter value, useeither of the followingmethods:● Method 1: Log in to
VPC console andclick the targetsubnet on theSubnets page. Youcan view thenetwork ID on thedisplayed page.
● Method 2: See the"Querying Subnets"section in the VirtualPrivate Cloud APIReference.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 198
Name Type Description
security_group_id String Indicates the securitygroup which the RDSDB instance belongs to.To obtain thisparameter value, useeither of the followingmethods:● Method 1: Log in to
VPC console. ChooseAccess Control >Security Groups inthe navigation paneon the left. On thedisplayed page, clickthe target securitygroup. You can viewthe security groupID on the displayedpage.
● Method 2: See the"Querying SecurityGroups" section inthe Virtual PrivateCloud API Reference.
collation String Indicates the collationfor Microsoft SQLServer.
charge_info Object Indicates the billingmode, which is yearly/monthly or pay-per-use.For details, see Table5-166.
Table 5-169 datastore field data structure description
Name Mandatory Type Description
type Yes String Indicates the DBengine. Its valuecan be any of thefollowing and iscase-insensitive:● MySQL● PostgreSQL● SQLServer
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 199
Name Mandatory Type Description
version Yes String Indicates thedatabase version.For details aboutsupporteddatabaseversions, seesection QueryingVersionInformationAbout a DBEngine.
Table 5-170 ha field data structure description
Name Mandatory Type Description
mode Yes String Indicates the DBinstance type.The value is Ha(primary/standbyDB instances).
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 200
Name Mandatory Type Description
replication_mode Yes String Indicates thereplication modefor the standbyDB instance.The value cannotbe empty.● For MySQL,
the value isasync orsemisync.
● ForPostgreSQL,the value isasync or sync.
● For MicrosoftSQL Server,the value issync.
NOTE● async
indicates theasynchronousreplicationmode.
● semisyncindicates thesemi-synchronousreplicationmode.
● sync indicatesthesynchronousreplicationmode.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 201
Table 5-171 backupStrategy field data structure description
Name Mandatory Type Description
start_time Yes String Indicates thebackup timewindow.Automatedbackups will betriggered duringthe backup timewindow.The value cannotbe empty. Itmust be a validvalue in the"hh:mm-HH:MM" format.The current timeis in the UTCformat.● The HH value
must be 1greater thanthe hh value.
● The values ofmm and MMmust be thesame andmust be set toany of thefollowing: 00,15, 30, or 45.
Example value:● 08:15-09:15● 23:00-00:00
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 202
Name Mandatory Type Description
keep_days No Integer Indicates theretention daysfor specificbackup files.The value rangeis from 0 to 732.If this parameteris not specifiedor set to 0, theautomatedbackup policy isdisabled. Toextend theretention period,contact customerservice.Automatedbackups can beretained for upto 2562 days.
Table 5-172 volume field data structure description
Name Mandatory Type Description
type Yes String Indicates thevolume type.Its value can beany of thefollowing and iscase-sensitive:● ULTRAHIGH:
indicates theSSD type.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 203
Name Mandatory Type Description
size Yes Integer Indicates thevolume size.Its value range isfrom 40 GB to4000 GB. Thevalue must be amultiple of 10.For some users,storage spaceranges from 40GB to 6000 GB. Ifyou want tocreate a DBinstance withstorage space upto 6000 GB orscale up to10,000 GB,contact customerservice to applyfor thepermission.
● Example normal response
MySQL{ "instance": { "id": "f5ffdd8b1c98434385eb001904209eacin01", "name": "demoname", "status": "BUILD", "datastore": { "type": "MySQL", "version": "5.6.41" }, "port": "3306", "volume": { "type": "ULTRAHIGH", "size": "40" }, "region": "aaa", "backup_strategy": { "start_time": "02:00-03:00", "keep_days": "7" }, "flavor_ref": "rds.mysql.s1.large", "availability_zone": "bbb", "vpc_id": "19e5d45d-70fd-4a91-87e9-b27e71c9891f", "subnet_id": "bd51fb45-2dcb-4296-8783-8623bfe89bb7", "security_group_id": "23fd0cd4-15dc-4d65-bdb3-8844cc291be0" }, "job_id": "bf003379-afea-4aa5-aa83-4543542070bc"}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 204
SQL Server{ "instance": { "id": "f5ffdd8b1c98434385eb001904209eacin01", "name": "demoname", "status": "BUILD", "datastore": { "type": "sqlserver", "version": "2014_SE" }, "port": "2100", "volume": { "type": "ULTRAHIGH", "size": "40" }, "region": "aaa", "backup_strategy": { "start_time": "02:00-03:00", "keep_days": "7" }, "flavor_ref": "rds.mssql.2014.se.s3.large.2", "availability_zone": "bbb", "vpc_id": "19e5d45d-70fd-4a91-87e9-b27e71c9891f", "subnet_id": "bd51fb45-2dcb-4296-8783-8623bfe89bb7", "security_group_id": "23fd0cd4-15dc-4d65-bdb3-8844cc291be0", "charge_info": { "charge_mode": "prePaid", "period_num": 1 }, "collation": "Cyrillic_General_CI_AS" }, "order_id": "CS20122919584LQ7K"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.7.14 Restoring Data to an Existing DB Instance
FunctionThis API is used to restore a database to an existing DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● Microsoft SQL Server supports batch calling of this API to restore one
database to an existing DB instance.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 205
● This API does not support PostgreSQL instance restoration.● When data is restored to an existing DB instance, the API has the following
constraints:– The DB engine of the original DB instance must be the same as that of
the target DB instance. For example, if the original DB instance is runningMySQL, the target DB instance must also run MySQL.
– The target DB instance version must be later than or equal to that of thesource instance. For example, MySQL 5.7.25 DB instance can be restoredto MySQL 5.7.27 DB instance. For constraints of Microsoft SQL Server, seeTable 5-173.
– The total storage space of the target DB instance must be greater than orequal to that of the original DB instance.
– Cross-region restoration is not supported.– For MySQL DB instances, when data is restored to an existing DB
instance, the case sensitivity setting of the existing DB instance must bethe same as that of the original DB instance. Otherwise, the restorationmay fail.
● When data is restored to an original DB instance:This API is supported only for the Microsoft SQL Server DB engine.
Table 5-173 Restoring to the DB engine versions supported by RDS for SQLServer
Original DB Engine Version Restore To
2008 Standard Edition 2008 Standard Edition
2012 Web Edition 2012 Web Edition2012 Standard Edition2012 Enterprise Edition
2012 Standard Edition 2012 Standard Edition2012 Enterprise Edition
2012 Enterprise Edition 2012 Enterprise Edition
2014 Standard Edition 2014 Standard Edition2014 Enterprise Edition
2014 Enterprise Edition 2014 Enterprise Edition
2016 Standard Edition 2016 Standard Edition2016 Enterprise Edition
2016 Enterprise Edition 2016 Enterprise Edition
2017 Web Edition 2017 Web Edition2017 Standard Edition2017 Enterprise Edition
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 206
Original DB Engine Version Restore To
2017 Standard Edition 2017 Standard Edition2017 Enterprise Edition
2017 Enterprise Edition 2017 Enterprise Edition
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/recovery
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/recovery
● Parameter description
Table 5-174 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
Request● Parameter description
Table 5-175 Parameter description
Name Mandatory Type Description
source Yes Object Specifies therestorationinformation.For details, seeTable 5-176.
target Yes Object Specifies therestorationtarget.For details, seeTable 5-177.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 207
Table 5-176 source field data structure description
Name Mandatory Type Description
instance_id Yes String Specifies the DBinstance ID.
type No String Specifies therestorationmode.Enumeratedvalues include:● backup:
indicatesusing backupfiles forrestoration. Inthis mode,type is notmandatoryandbackup_id ismandatory.
● timestamp:indicates thepoint-in-timerestorationmode. In thismode, type ismandatoryandrestore_timeis nomandatory.
backup_id No String Specifies the IDof the backupused to restoredata. Thisparameter mustbe specifiedwhen the backupfile is used forrestoration.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 208
Name Mandatory Type Description
restore_time No Integer Specifies thetime point ofdata restorationin the UNIXtimestamp. Theunit ismillisecond andthe time zone isUTC.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 209
Name Mandatory Type Description
database_name No Map<String,String>
This parameterapplies only tothe MicrosoftSQL Server DBengine. If thisparameter isspecified, youcan restorespecificdatabases in theDB instance andcustomize thedatabase namesas required.● The new
databasenames mustbe differentfrom theoriginaldatabasenames andtargetdatabasenames. If youdo notcustomize thedatabasenames, datawill berestored tothe originaldatabases bydefault.NOTICE
If thisparameter isnot specified,all databasesare restoredby default.
Examplevalue:"database_name":{"Originaldatabasename":"Newdatabasename"}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 210
Name Mandatory Type Description
● The newdatabasenames cannotcontain thefollowingfields (case-insensitive):rdsadmin,master, msdb,tempdb,model, andresource.
● Eachdatabasename consistsof 1 to 64characters.Only letters,digits,hyphens (-),andunderscores(_) areallowed.
Table 5-177 target field data structure description
Name Mandatory Type Description
instance_id Yes String Specifies the IDof the DBinstance whichthe backup willbe restored to.
● Request example
Use backup files for restoration:MySQL:{ "source": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01", "type": "backup", "backup_id": "2f4ddb93-b901-4b08-93d8-1d2e472f30fe" }, "target": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01" }}
Microsoft SQL Server:
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 211
{ "source": { "instance_id": "61879e6085bc44d1831b0ce62d988fd9in04", "type": "backup", "backup_id": "b021670e69ba4538b7b2ed07257306aebr04", "database_name": { "db1": "dbtest1", "db2": "" } }, "target": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04" }}
Use PITR for restoration:
MySQL:{ "source": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01", "type": "timestamp", "restore_time": 1532001446987 }, "target": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin01" }}
Microsoft SQL Server:{ "source": { "instance_id": "61879e6085bc44d1831b0ce62d988fd9in04", "type": "timestamp", "restore_time": 1532001446987, "database_name": { "db1": "dbtest1", "db2": "" } }, "target": { "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin04" }}
Response● Normal response
Table 5-178 Parameter description
Name Type Description
job_id String Indicates the task ID.
● Example normal response{ "job_id": "ff80808157127d9301571bf8160c001d"}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 212
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.7.15 Restoring Tables to a Specified Point in Time (MySQL)
Function
To ensure data integrity and reduce impact on the original instance performance,the system restores the full and incremental data at the selected time point to atemporary DB instance, automatically exports the tables to be restored, and thenrestores the tables to the original DB instance.
NO TICE
This operation will generate restored tables on the original DB instance. Ensurethat the original DB instance has sufficient storage capacity.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● This API is supported for MySQL only.
● This API is not supported for MySQL 8.0 DB instances.
URI● URI format
POST
https://{Endpoint}/v3/{project_id}/instances/{instance_id}/restore/tables
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/restore/tables
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 213
Table 5-179 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain the projectID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-180 Parameter description
Name Mandatory Type Description
restoreTime Yes Long Specifies the backup time point.
restoreTables
Yes Array ofobjects
Database information. Fordetails, see Table 5-181.
Table 5-181 restoreTables field data structure description
Name Mandatory Type Description
database Yes String Specifies the database name.
tables Yes Array ofobjects
Specifies the table information.For details, see Table 5-182.
Table 5-182 tables field data structure description
Name Mandatory Type Description
oldName Yes String Specifies theoriginal tablename before therestoration.
newName Yes String Specifies thetable name afterthe restoration.
● Request example
{ "restoreTime": 1583720991838,
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 214
"restoreTables": [ { "database": "restoretest", "tables": [ { "oldName": "test", "newName": "test_1583720991838" } ] } ]}
Response● Normal response
Name Type Description
jobId String Indicates the task ID.
● Example normal response
{ "jobId":"7b55d6ca-dc8e-4844-a9da-6c53a1506db3"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.8 Log Information Queries
5.8.1 Querying Database Error Logs
FunctionThis API is used to query the latest 2000 database error logs.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/errorlog?start_date={start_date}&end_date={end_date}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 215
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/errorlog?offset=1&limit=10&start_date=2018-08-06T10:41:14+0800&end_date=2018-08-07T10:41:14+0800&level=ALL
● Parameter description
Table 5-183 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the ID of the queried DBinstance.
start_date Yes Specifies the start time in the "yyyy-mm-ddThh:mm:ssZ" format.T is the separator between the calendarand the hourly notation of time. Zindicates the time zone offset. Forexample, in the Beijing time zone, thetime zone offset is shown as +0800.
end_date Yes Specifies the end time in the "yyyy-mm-ddThh:mm:ssZ" format.T is the separator between the calendarand the hourly notation of time. Zindicates the time zone offset. Forexample, in the Beijing time zone, thetime zone offset is shown as +0800.You can only query error logs generatedwithin a month.
offset No Specifies the page offset, such as 1, 2, 3,or 4. The parameter value is 1 by defaultif it is not specified.
limit No Specifies the number of records on eachpage. Its value range is from 1 to 100.The parameter value is 10 by default if itis not specified.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 216
Name Mandatory Description
level No Specifies the log level. The default valueis ALL. Valid value:● ALL● INFO● LOG● WARNING● ERROR● FATAL● PANIC● NOTE
RequestNone
Response● Normal response
Table 5-184 Parameter description
Name Type Description
error_log_list
Array of objects Indicates detailedinformation.For details, see Table5-185.
total_record
Integer Indicates the totalnumber of records.
Table 5-185 error_log_list field data structure description
Name Type Description
time String Indicates the time in the UTC format.
level String Indicates the log level.
content String Indicates the log content.
● Example normal response
{ "error_log_list": [{ "time": "2018-12-04T14:24:42", "level": "ERROR",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 217
"content": "Slave I/O for channel '': error connecting to master '[email protected]:3306' - retry-time: 60 retries: 1, Error_code: 203" }, { "time": "2018-12-04T14:24:42", "level": "ERROR", "content": "Slave I/O for channel '': error connecting to master '[email protected]:8081' - retry-time: 60 retries: 1, Error_code: 203" }], "total_record": 2}
● Abnormal ResponseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.8.2 Querying Database Slow Logs
FunctionThis API is used to query the latest 2000 database slow query logs.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsOnly the MySQL DB instances are supported.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/slowlog?start_date={start_date}&end_date={end_date}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/slowlog?offset=1&limit=10&start_date=2018-08-06T10:41:14+0800&end_date=2018-08-07T10:41:14+0800&type=INSERT
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 218
Table 5-186 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the ID of the queried DBinstance.
start_date Yes Specifies the start date in the "yyyy-mm-ddThh:mm:ssZ" format.T is the separator between the calendarand the hourly notation of time. Zindicates the time zone offset. Forexample, in the Beijing time zone, thetime zone offset is shown as +0800.
end_date Yes Specifies the end time in the "yyyy-mm-ddThh:mm:ssZ" format.T is the separator between the calendarand the hourly notation of time. Zindicates the time zone offset. Forexample, in the Beijing time zone, thetime zone offset is shown as +0800. Youcan only query slow logs generatedwithin a month.
offset No Specifies the page offset, such as 1, 2, 3,or 4. The parameter value is 1 by defaultif it is not specified.
limit No Specifies the number of records on eachpage. Its value range is from 1 to 100.The parameter value is 10 by default ifit is not specified.
type No Specifies the statement type. If it is leftblank, all statement types are queried.Valid value:● INSERT● UPDATE● SELECT● DELETE● CREATE
Request
None
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 219
Response● Normal response
Table 5-187 Parameter description
Name Type Description
slow_log_list Array of objects Indicates detailedinformation.For details, see Table5-188.
total_record Integer Indicates the totalnumber of records.
Table 5-188 slow_log_list field data structure description
Name Type Description
count String Indicates the number of executions.
time String Indicates the execution time.
lock_time String Indicates the lock wait time.
rows_sent String Indicates the number of sent rows.
rows_examined
String Indicates the number of scanned rows.
database String Indicates the database which the slow log belongsto.
users String Indicates the account.
query_sample
String Indicates the execution syntax.
type String Indicates the statement type.
start_time String Indicates the time in the UTC format.
client_ip String Indicates the IP address.
● Example normal response
{ "total_record": 1, "slow_log_list": [ { "count": "1", "time": "1.04899 s", "lock_time": "0.00003 s", "rows_sent": "0", "rows_examined": "0", "database": "mysql",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 220
"users": "root", "query_sample": "INSERT INTO time_zone_name (Name, Time_zone_id) VALUES (N, @time_zone_id);", "type": "INSERT", "start_time": "2018-08-06T10:41:14", "client_ip": "192.*.*.1" } ]}
● Abnormal Response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.8.3 Obtaining Slow Query Log Statistics
Function
This API is used to query and collect statistics on slow query logs based on servicerequirements.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
This API is supported for MySQL only.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/slowlog/statistics?cur_page={cur_page}&per_page={per_page}&type={type}&start_date={start_date}&end_date={end_date}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/slowlog/statistics?cur_page=1&per_page=2&type=INSERT&start_date=2020-02-06T10:41:14+0800&end_date=2020-02-07T10:41:14+0800
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 221
Table 5-189 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the ID of the DB instance to bequeried.
cur_page Yes Specifies the page offset (the current pagenumber, such as 1, 2, 3, or 4.)
per_page Yes Specifies the number of records on each page.The value ranges from 0 to 100.
start_date Yes Specifies the start date in the "yyyy-mm-ddThh:mm:ssZ" format.T is the separator between the calendar andthe hourly notation of time. Z indicates thetime zone offset. For example, in the Beijingtime zone, the time zone offset is shown as+0800.
end_date Yes Specifies the end time in the "yyyy-mm-ddThh:mm:ssZ" format.T is the separator between the calendar andthe hourly notation of time. Z indicates thetime zone offset. For example, in the Beijingtime zone, the time zone offset is shown as+0800.
type Yes Specifies the statement type. If it is left blank,all statement types are queried. Valid value:● INSERT● UPDATE● SELECT● DELETE● CREATE
RequestNone
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 222
Table 5-190 Description
Name Type Description
pageNumber
Integer Indicates the current page number.
pageRecord Integer Indicates the number of records on each page.
slowLogList List See Table 5-191.
totalRecord Integer Indicates the total number of records.
startTime Long Indicates the start time.
endTime Long Indicates the end time.
Table 5-191 slow_log_list field data structure description
Name Type Description
count String Indicates the number of executions.
time String Indicates the execution time.
lockTime String Indicates the lock wait time.
rowsSent String Indicates the number of sent rows.
rowsExamined
String Indicates the number of scanned rows.
database String Indicates the database which the slow log belongsto.
users String Indicates the account.
querySample
String Indicates the execution syntax.
type String Indicates the statement type.
clientIP String Indicates the IP address.
● Example normal response
{ "pageNumber": 1, "pageRecord": 10, "slowLogList": [], "totalRecord": 0, "startTime": null, "endTime":null}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 223
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.8.4 Obtaining Links for Downloading Slow Query Logs
FunctionThis API is used to obtain links for downloading slow query logs.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/slowlog-download
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/slowlog-download
● Parameter description
Table 5-192 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the ID of the DB instance to bequeried.
Request● Parameter description
Table 5-193 Parameter description
Name Mandatory Type Description
request_id Yes String Specifies the request ID inUUID format forobtaining slow query logs.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 224
Name Mandatory Type Description
file_name No String Specifies the name of thefile to be downloaded.This parameter ismandatory when the DBengine is SQL Server.
● Request example{ "request_id":"6e0e7ee2-a3b5-4bc1-a5a8-cb2987ac4771", "file_name":"sqlserver_slowlog_name"}
Response● Normal response
Table 5-194 Parameter description
Name Type Description
list List Indicates the links fordownloading slow query logs.For details, see Table 5-195.
status String Indicates the status ofgenerating links fordownloading slow query logs.● FINISH: The download link
has been generated.● CREATING: A file is being
generated and the downloadlink is to be prepared.
● FAILED: Log files fail to beprepared.
count Integer Indicates the number of links fordownloading slow query logs.
Table 5-195 linkInfo field data structure description
Name Type Description
workflow_id String Indicates the task ID.
file_name String Indicates the name ofthe generated file fordownloading slowquery logs.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 225
Name Type Description
status String Indicates thegeneration status ofthe current link.
file_size String Indicates the file size.
file_link String Indicates the downloadlink.
create_at Long Indicates thegeneration time.
update_at Long Indicates the updatetime.
● Example normal response
{ "list": [ { "workflow_id": "44fb1d85-2fcc-4d63-ad3b-c3d1ecd7000e", "file_name": "054bc9c1f680d55c1f36c006e5a9f67b_slowlog_download_20200515080614589", "status": "SUCCESS", "file_size": "0", "file_link": "https://rdsbucket.opxxx.svc.rds.xxxxx.cnxianhz1.ur.obs.cn-xianhz-1.myhuaweicloud.com:443/054bc9c1f680d55c1f36c006e5a9f67b_slowlog_download_20200515080614589?AWSAccessKeyId=1BQ38TBCQHAVQXBUMUTC&Expires=1589530200&response-cache-control=no-cache%2Cno-store&Signature=Fgi4%2BLOJ9frAXyOkz5hRoW5O%2BUM%3D", "create_at": 1589529991385, "updated_at": null } ], "status": "finish", "count": 1}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.8.5 Setting SQL Audit
Function
This API is used to set a policy for SQL audit logs.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 226
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/auditlog-policy● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/auditlog-policy
● Parameter description
Table 5-196 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
Request● Parameter description
Table 5-197 Parameter description
Name Mandatory Type Description
keep_days Yes Integer Specifies the number ofdays for storing auditlogs. The value range isfrom 0 to 732.● 0: indicates that SQL
audit is disabled.● 1 to 732: indicates the
retention days foraudit logs after SQLaudit is enabled.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 227
Name Mandatory Type Description
reserve_auditlogs No Boolean This parameter is validonly when SQL audit isdisabled.● true (default value):
indicates that historicalaudit logs are retainedwhen SQL audit isdisabled.
● false: indicates thatexisting historical auditlogs are deleted whenSQL audit is disabled.
● Request example
Update the policy for SQL audit logs:{ "keep_days":5}
Disable the policy for SQL audit logs:{ "keep_days":0, "reserve_auditlogs":false}
Response● Normal response
None● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.8.6 Querying the Policy for SQL Audit Logs
Function
This API is used to query the policy for SQL audit logs.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 228
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/auditlog-policy● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/auditlog-policy
● Parameter description
Table 5-198 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
RequestNone
Response● Normal response
Table 5-199 Parameter description
Name Type Description
keep_days Integer Specifies the number of days forstoring audit logs. The value is 0when SQL audit is disabled.
● Example normal response
{ "keep_days":7}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 229
Error CodeFor details, see Error Codes.
5.8.7 Obtaining an Audit Log List
FunctionThis API is used to obtain an audit log list.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/auditlog?start_time={start_time}&end_time={end_time}&offset={offset}&limit={limit}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/auditlog?start_time=2019-11-06T09:00:00+0800&end_time=2019-11-07T10:40:15+0800&offset=0&limit=10
● Parameter description
Table 5-200 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain the projectID, see Obtaining a Project ID.
instance_id Yes Specifies the ID of the queried DB instance.
start_time Yes Specifies the start time for obtaining thebackup list. The format of the start time is"yyyy-mm-ddThh:mm:ssZ".
T is the separator between the calendarand the hourly notation of time. Zindicates the time zone offset. Forexample, in the Beijing time zone, the timezone offset is shown as +0800.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 230
Name Mandatory Description
end_time Yes Specifies the end time for obtaining thebackup list. The format of the end time is"yyyy-mm-ddThh:mm:ssZ" and the endtime must be later than the start time. Thetime span cannot be longer than 30 days.T is the separator between the calendarand the hourly notation of time. Zindicates the time zone offset. Forexample, in the Beijing time zone, the timezone offset is shown as +0800.
offset Yes Specifies the index position.If offset is set to N, the resource querystarts from the N+1 piece of data. Thevalue is 0 by default, indicating that thequery starts from the first piece of data.The value must be a positive number.
limit Yes Specifies the number of records to bequeried. The value range is from 1 to 50.
Request
None
Response● Normal response
Table 5-201 Parameter description
Name Type Description
auditlogs Array of objects Indicates detailed information.For details, see Table 5-202.
total_record Integer Indicates the total number ofrecords.
Table 5-202 auditlogs field data structure description
Name Type Description
id String Indicates the audit log ID.
name String Indicates the audit log filename.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 231
Name Type Description
size Long Indicates the size in KB of theaudit log.
begin_time String Indicates the start time of theaudit log. The format is "yyyy-mm-ddThh:mm:ssZ".T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
end_time String Indicates the end time of theaudit log. The format is "yyyy-mm-ddThh:mm:ssZ".T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
● Example normal response
{ "auditlogs": [{ "id": "fa163ea0e2bet11e9d832166a2cf894c5br01", "name": "317156_20190916032844_eb8fe5d181ec44a2850302691541f760in01_Audit_166a2cf8-d832-11e9-94c5-fa163ea0e2be", "size": 20481.835938, "begin_time": "2019-11-06T09:03:34+0800", "end_time": "2019-11-06T10:39:15+0800" }, { "id": "fa163ea0e2bet11e9d832136a668094c5br01", "name": "317162_20190916032838_eb8fe5d181ec44a2850302691541f760in01_Audit_136a6680-d832-11e9-94c5-fa163ea0e2be", "size": 20481.835938, "begin_time": "2019-11-07T09:04:35+0800", "end_time":"2019-11-07T10:38:16+0800" }], "total_record": 2}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 232
Error Code
For details, see Error Codes.
5.8.8 Obtaining the Link for Downloading an Audit Log
Function
This API is used to obtain the link for downloading an audit log.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/auditlog-links● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/auditlog-links
● Parameter description
Table 5-203 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain the projectID, see Obtaining a Project ID.
instance_id Yes Specifies the ID of the queried DB instance.
Request● Parameter description
Table 5-204 Parameter description
Name Mandatory Type Description
ids Yes Array of strings Specifies the list of auditlogs. A maximum of 50audit log IDs are allowedin the list.
● Request example
{ "ids": ["fa163e9970a3t11e9d834e122fdceb1d6br01",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 233
"fa163ea0e2bet11e9d8364943103c94c5br01"]}
Response● Normal response
Table 5-205 Parameter description
Name Type Description
links Array of strings Indicates the list of audit logdownload links. The validityperiod is 5 minutes.
● Example normal response
{ "links": ["https://obs.domainname.com/rdsbucket.username.1/xxxxxx", "https://obs.domainname.com/rdsbucket.username.2/xxxxxx"]}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.9 Database and Account Management (MySQL)
5.9.1 PrecautionsThe lower_case_table_names parameter controls whether the MySQL databaseand table names are case sensitive. This parameter setting may affect thedatabase or table configurations when the APIs in the following sections in thischapter are invoked. For example, if you have set the table names to be caseinsensitive and enter a table name containing uppercase letters, the name of thecreated table may contain only lowercase letters because the letter cases areinsensitive. Therefore, when using the following APIs, ensure that the case of yourinput is the same as the actual case to avoid being affected by the case setting.
5.9.2 Creating a Database
FunctionThis API is used to create a database in a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 234
● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database
● Parameter description
Table 5-206 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 235
Table 5-207 Parameter description
Name Mandatory Type Description
name Yes String Specifies thedatabase name.The database namecontains 1 to 64characters. Onlyletters, digits,hyphens (-),underscores (_), anddollar signs ($) areallowed. The totalnumber of hyphens(-) and dollar signs($) cannot exceed 10.MySQL 8.0 does notsupport dollar signs($).
character_set Yes String Specifies thecharacter set used bythe database, such asutf8, gbk, and ascii.
● Request example
{ "name": "rds-test", "character_set": "utf8"}
Response● Normal response
Table 5-208 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 236
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.9.3 Querying Details About a Database (Discarded)
Function
This API is used to query details about a database on a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be queried when the DB instance is in the abnormal or frozenstate.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database
● Parameter description
Table 5-209 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request
None
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 237
Table 5-210 Parameter description
Name Type Description
databases Array of objects Each element in the listindicates a database.For details, see Table5-211.
Table 5-211 databases element structure description
Name Type Description
name String Indicates the databasename.
character_set String Indicates the characterset used by thedatabase, such as utf8,gbk, and ascii.
users Array of objects Each element in the listindicates an accountassociated with thedatabase.For details, see Table5-212.
Table 5-212 users element structure description
Name Type Description
name String Indicates an accountname.
readonly Boolean Indicates the read-onlypermission.● true: indicates the
read-onlypermission.
● false: indicates theread and writepermission.
● Example normal response
{ "databases": [ { "name": "rds-test", "character_set": "utf8", "users": [
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 238
{ "name": "rds", "readonly": false } ] }, { "name": "testdb1", "character_set": "utf8", "users": [] }, { "name": "tt", "character_set": "utf8", "users": [] } ]}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.9.4 Querying Details About Databases
Function
This API is used to query details about databases on a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.● The database list of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database/detail?page={page}&limit={limit}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database/detail?page=1&limit=10
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 239
● Parameter description
Table 5-213 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
page Yes Specifies the page number. The valuestarts from 1.
limit Yes Specifies the number of records oneach page. The value ranges from 1(inclusive) to 100 (inclusive).
RequestNone
Response● Normal response
Table 5-214 Parameter description
Name Type Description
databases Array of objects Each element in the listindicates a database.For details, see Table5-215.
total_count Integer Indicates the totalnumber of databases.
Table 5-215 databases element structure description
Name Type Description
name String Indicates the databasename.
character_set String Indicates the characterset used by thedatabase, such as utf8,gbk, and ascii.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 240
● Example normal response{ "databases": [ { "name": "rds-test", "character_set": "utf8" }, { "name": "testdb1", "character_set": "utf8" }, { "name": "tt", "character_set": "utf8" } ], "total_count": 3}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.9.5 Querying Authorized Databases of a Specified User
FunctionThis API is used to query authorized databases of a specified database user.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be queried when the DB instance is in the abnormal or frozenstate.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/database?user-name={user-name}&page={page}&limit={limit}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/database?user-name=rds&page=1&limit=10
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 241
Table 5-216 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
user-name Yes Specifies the database username.
page Yes Specifies the page number. The valuestarts from 1.
limit Yes Specifies the number of records on eachpage. The value ranges from 1(inclusive) to 100 (inclusive).
RequestNone
Response● Normal response
Table 5-217 Parameter description
Name Type Description
databases Array of objects Each element in the listindicates a database.For details, see Table5-218.
total_count Integer Indicates the totalnumber of databases.
Table 5-218 databases element structure description
Name Type Description
name String Indicates the databasename.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 242
Name Type Description
readonly Boolean Indicates the read-onlypermission.● true: indicates the
database is read-only.
● false: indicates thedatabase is readableand writable.
● Example normal response
{ "databases": [ { "name": "rds-test", "readonly": false }, { "name": "testdb1", "readonly": true }, { "name": "tt", "readonly": false } ], "total_count": 3}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.9.6 Deleting a Database
FunctionThis API is used to delete a database from a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 243
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database/{db_name}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database/rds-test
● Parameter description
Table 5-219 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
db_name Yes Specifies the name of the database tobe deleted.
Request● Parameter description
No request body● Request example
{}
Response● Normal response
Table 5-220 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 244
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.9.7 Creating a Database Account
Function
This API is used to create a database account for a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user
● Parameter description
Table 5-221 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 245
Table 5-222 Parameter description
Name Mandatory Type Description
name Yes String Specifies theusername of thedatabase account.The usernameconsists of 1 to 32characters. Onlylowercase letters,digits, hyphens (-),and underscores (_)are allowed.● If the database
version is MySQL5.6, the usernameconsists of 1 to 16characters.
● If the databaseversion is MySQL5.7 or 8.0, theusername consistsof 1 to 32characters.
password Yes String Specifies thepassword of thedatabase account.Valid value:The value cannot beempty and must be8-32 characters. Itcan contain onlyuppercase letters,lowercase letters,digits, and the specialcharacters (~!@#%^*-_=+?). The valuecannot be the sameas the name value orthe name value inreverse order.You are advised toenter a strongpassword to improvesecurity, preventingsecurity risks such asbrute force cracking.
● Request example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 246
{ "name": "rds", "password": "Test@12345678"}
Response● Normal response
Table 5-223 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.9.8 Querying Details About a Database User (Discarded)
FunctionThis API is used to query details about a database user of a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.● The database list of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 247
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user
● Parameter description
Table 5-224 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request
None
Response● Normal response
Table 5-225 Parameter description
Name Type Description
users Array of objects Each element in the listindicates a databaseaccount.For details, see Table5-226.
Table 5-226 users element structure description
Name Type Description
name String Indicates an accountname.
databases Array of objects Each element in the listindicates a databaseassociated with theaccount.For details, see Table5-227.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 248
Table 5-227 databases element structure description
Name Type Description
name String Indicates a databasename.
readonly Boolean Indicates the read-onlypermission.● true: indicates the
read-onlypermission.
● false: indicates theread and writepermission.
● Example normal response
{ "users": [ { "name": "rds", "databases": [ { "name": "rds-test", "readonly": false } ] }, { "name": "rds001", "databases": null } ]}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.9.9 Querying Details About Database Users
Function
This API is used to query details about database users of a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 249
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.● The database user list of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/detail?page={page}&limit={limit}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/detail?page=1&limit=10
● Parameter description
Table 5-228 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
page Yes Specifies the page number. The value startsfrom 1.
limit Yes Specifies the number of records on each page.The value ranges from 1 (inclusive) to 100(inclusive).
RequestNone
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 250
Table 5-229 Parameter description
Name Type Description
users Array of objects Each element in the listindicates a databaseaccount.For details, see Table5-230.
total_count Integer Indicates the totalnumber of databaseusers.
Table 5-230 users element structure description
Name Type Description
name String Indicates the accountname.
state String Indicates the databaseuser status.● unavailable: The
database user isunavailable.
● available: Thedatabase user isavailable.
● Example normal response{ "users": [ { "name": "rdsuser", "state": "available" }, { "name": "login001", "state": "available" } ], "total_count": 3 }
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 251
Error Code
For details, see Error Codes.
5.9.10 Querying Authorized Users of a Specified Database
Function
This API is used to query authorized users of a specified database.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.
● The database list of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database/db_user?db-name={db-name}&page={page}&limit={limit}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database/db_user?db-name=rds&page=1&limit=10
● Parameter description
Table 5-231 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant ina region.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
db-name Yes Specifies the database name.
page Yes Specifies the page number. The valuestarts from 1.
limit Yes Specifies the number of records oneach page. The value ranges from 1(inclusive) to 100 (inclusive).
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 252
Request
None
Response● Normal response
Table 5-232 Parameter description
Name Type Description
users Array of objects Each element in the listindicates a databaseaccount.For details, see Table5-233.
total_count Integer Indicates the totalnumber of databaseusers.
Table 5-233 users element structure description
Name Type Description
name String Indicates the accountname.
readonly Boolean Indicates the read-onlypermission.● true: indicates the
database is read-only.
● false: indicates thedatabase is readableand writable.
● Example normal response{ "users": [ { "name": "rds", "readonly": false }, { "name": "rds001", "readonly": false } ], "total_count": 3}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 253
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.9.11 Deleting a Database Account
FunctionThis API is used to delete a database account from a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/{user_name}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/rds
● Parameter description
Table 5-234 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtainthe project ID, see Obtaining aProject ID.
instance_id Yes Specifies the DB instance ID.
user_name Yes Specifies the username of theaccount to be deleted.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 254
Request● Parameter description
No request body● Request example
{}
Response● Normal response
Table 5-235 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.9.12 Configuring a Password for a Database Account
FunctionThis API is used to configure a password for a database account.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/resetpwd
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 255
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/resetpwd
● Parameter description
Table 5-236 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-237 Parameter description
Name Mandatory
Type Description
name Yes String Specifies the username of thedatabase account.
password Yes String Specifies the password of thedatabase account.Valid value:The value cannot be empty andmust be 8-32 characters inlength. It contains at least threetypes of the following characters:uppercase letters, lowercaseletters, digits, and specialcharacters (~!@#%^*-_=+?). Thevalue must be different from thename value and the value spelledbackwards.You are advised to enter a strongpassword to improve security,preventing security risks such asbrute force cracking.
● Request example
{ "name": "rds",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 256
"password": "Test@12345678"}
Response● Normal response
Table 5-238 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.9.13 Authorizing a Database Account
Function
This API is used to set permissions of a database account in a specified DBinstance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_privilege● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 257
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_privilege
● Parameter description
Table 5-239 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenantin a region.For details about how to obtain theproject ID, see Obtaining a ProjectID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-240 Parameter description
Name Mandatory Type Description
db_name Yes String Specifies thedatabase name.
users Yes Array ofobjects
Specifies the accountthat associated withthe database. A singlerequest supports amaximum of 50elements.For details on theelement structure,see Table 5-241.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 258
Table 5-241 users field data structure description
Name Mandatory Type Description
name Yes String Specifies theusername of thedatabase account.The usernameconsists of 1 to 32characters. Onlylowercase letters,digits, hyphens (-),and underscores (_)are allowed.● If the database
version is MySQL5.6, the usernameconsists of 1 to 16characters.
● If the databaseversion is MySQL5.7 or 8.0, theusername consistsof 1 to 32characters.
readonly Yes Boolean Specifies the read-only permission.● true: indicates the
read-onlypermission.
● false: indicates theread and writepermission.
● Request example{ "db_name": "rds-test", "users": [ { "name": "rds", "readonly": false }, { "name": "rds001", "readonly": true } ]}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 259
Table 5-242 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response{ "resp": "successful"}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.9.14 Revoking Permissions of a Database Account
Function
This API is used to revoke permissions of a database account in a specified DBinstance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_privilege
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_privilege
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 260
Table 5-243 Parameter description
Name Mandatory Description
project_id Yes Specifies the project ID of a tenant in aregion.For details about how to obtain theproject ID, see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-244 Parameter description
Name Mandatory Type Description
db_name Yes String Specifies thedatabase name.
users Yes Array of objects Specifies the accountthat associated withthe database. A singlerequest supports amaximum of 50elements.For more informationabout the elementstructure, see Table5-245.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 261
Table 5-245 users field data structure description
Name Mandatory Type Description
name Yes String Specifies theusername of thedatabase account.The usernameconsists of 1 to 32characters. Onlylowercase letters,digits, hyphens (-),and underscores (_)are allowed.● If the database
version is MySQL5.6, the usernameconsists of 1 to 16characters.
● If the databaseversion is MySQL5.7 or 8.0, theusername consistsof 1 to 32characters.
● Request example{ "db_name": "rds-test", "users": [ { "name": "rds" }, { "name": "rds001" } ]}
Response● Normal response
Table 5-246 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 262
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.10 Database and Account Management (MicrosoftSQL Server)
5.10.1 Creating a Database
FunctionThis API is used to create a database in a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 263
Table 5-247 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-248 Parameter description
Name Mandatory
Type Description
name Yes String Specifies thedatabase name.The database namecan contain 1 to 64characters, includingletters, digits,hyphens (-), andunderscores (_). Itcannot start or endwith an RDS for SQLServer systemdatabase name.RDS for SQL Serversystem databasesinclude master, msdb,model, tempdb,resource, andrdsadmin.
● Request example
{ "name": "rds-test"}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 264
Table 5-249 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response{ "resp": "successful"}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.10.2 Querying Details About Databases
Function
This API is used to query details about databases on a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.
● The database user list of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database/detail?page={page}&limit={limit}&db-name={db-name}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database/detail?page=1&limit=10&db-name=testdb1
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 265
Table 5-250 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
page Yes Specifies the page number. The value startsfrom 1.
limit Yes Specifies the number of records on each page.The value ranges from 1 (inclusive) to 100(inclusive).
db-name No Specifies the database name. When thisparameter is specified, the page and limitparameters need to be specified but do nottake effect.
RequestNone
Response● Normal response
Table 5-251 Parameter description
Name Type Description
databases Array of objects Each element in the listindicates a database.For details, see Table5-252.
total_count Integer Indicates the totalnumber of databases.
Table 5-252 databases element structure description
Name Type Description
name String Indicates the databasename.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 266
Name Type Description
character_set String Indicates the characterset used by thedatabase, such asChinese_PRC_CI_AS.
state String Indicates the databasestatus. Its value can beany of the following:● Creating: The
database is beingcreated.
● Running: Thedatabase is running.
● Deleting: Thedatabase is beingdeleted.
● Not Exists: Thedatabase does notexist.
● Example normal response
{ "databases": [ { "name": "master", "character_set": "Chinese_PRC_CI_AS", "state": "Running" }, { "name": "msdb", "character_set": "Chinese_PRC_CI_AS", "state": "Running" }, { "name": "model", "character_set": "Chinese_PRC_CI_AS", "state": "Running" }, { "name": "tempdb", "character_set": "Chinese_PRC_CI_AS", "state": "Running" }, { "name": "rdsadmin", "character_set": "Chinese_PRC_CI_AS", "state": "Running" }, { "name": "rds-test", "character_set": "Chinese_PRC_CI_AS", "state": "Running" } ],
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 267
"total_count": 6}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.10.3 Deleting a Database
FunctionThis API is used to delete a database from a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database/{db_name}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database/rds-test
● Parameter description
Table 5-253 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
db_name Yes Specifies the name of the database to bedeleted.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 268
Request
None
Response● Normal response
Table 5-254 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.10.4 Creating a Database Account
Function
This API is used to create a database account for a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 269
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user
● Parameter description
Table 5-255 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-256 Parameter description
Name Mandatory
Type Description
name Yes String Specifies the username of thedatabase account.It contains 1 to 128 charactersand must be different fromsystem usernames.System users include rdsadmin,rdsuser, rdsbackup, andrdsmirror.
password Yes String Specifies the password of thedatabase account.The value cannot be left blank. Itconsists of 8 to 128 charactersand contains at least three typesof the following characters:uppercase letters, lowercaseletters, digits, and specialcharacters.You are advised to enter a strongpassword to improve security,preventing security risks such asbrute force cracking.
● Request example
{ "name": "rds",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 270
"password": "Test@12345678"}
Response● Normal response
Table 5-257 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.10.5 Querying Details About Database Users
Function
This API is used to query details about database users of a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.● The database user list of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/detail?page={page}&limit={limit}
● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 271
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/detail?page=1&limit=10
● Parameter description
Table 5-258 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
page Yes Specifies the page number. The value startsfrom 1.
limit Yes Specifies the number of records on each page.The value ranges from 1 (inclusive) to 100(inclusive).
RequestNone
Response● Normal response
Table 5-259 Parameter description
Name Type Description
users Array of objects Each element in the listindicates a databaseaccount.For details, see Table5-260.
total_count Integer Indicates the totalnumber of databaseusers.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 272
Table 5-260 users element structure description
Name Type Description
name String Indicates the accountname.
state String Indicates the databaseuser status.● unavailable: The
database user isunavailable.
● available: Thedatabase user isavailable.
● Example normal response
{ "users": [ { "name": "rdsuser", "state": "available" }, { "name": "login001", "state": "available" } ], "total_count": 2 }
● Abnormal responseFor details, see Abnormal Request Results.
Status CodesFor details, see Status Codes.
Error CodesFor details, see Error Codes.
5.10.6 Querying Authorized Users of a Specified Database
FunctionThis API is used to query authorized users of a specified database.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 273
● Authorized users of a specified database for read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database/db_user?db-name={db-name}&page={page}&limit={limit}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database/db_user?db-name=rds&page=1&limit=10
● Parameter description
Table 5-261 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
db-name Yes Specifies the database name.
page Yes Specifies the page number. The value startsfrom 1.
limit Yes Specifies the number of records on each page.The value ranges from 1 (inclusive) to 100(inclusive).
Request
None
Response● Normal response
Table 5-262 Parameter description
Name Type Description
users Array of objects Each element in the listindicates a databaseaccount.For details, see Table5-263.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 274
Name Type Description
total_count Integer Indicates the totalnumber of databaseusers.
Table 5-263 users element structure description
Name Type Description
name String Indicates the accountname.
● Example normal response
{ "users": [ { "name": "rds"
}, { "name": "rds001"
} ], "total_count": 3}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.10.7 Deleting a Database Account
FunctionThis API is used to delete a database account from a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 275
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/{user_name}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/rds
● Parameter description
Table 5-264 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
user_name Yes Specifies the username of the account to bedeleted.
Request● Parameter description
No request body● Request example
{}
Response● Normal response
Table 5-265 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 276
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.10.8 Authorizing a Database Account
Function
This API is used to set permissions of a database account in a specified DBinstance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_privilege
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_privilege
● Parameter description
Table 5-266 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 277
Table 5-267 Parameter description
Name Mandatory
Type Description
db_name Yes String Specifies thedatabase name.
users Yes Array of objects Specifies the accountthat associated withthe database. Asingle requestsupports a maximumof 50 elements.For details on theelement structure,see Table 5-268.
Table 5-268 users field data structure description
Name Mandatory
Type Description
name Yes String Specifies theusername of thedatabase account.It contains 1 to 128characters and mustbe different fromsystem usernames.System users includerdsadmin, rdsuser,rdsbackup, andrdsmirror.
● Request example
{ "db_name": "rds-test", "users": [ { "name": "rds" }, { "name": "rds001" } ]}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 278
Table 5-269 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response{ "resp": "successful"}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.10.9 Revoking Permissions of a Database Account
Function
This API is used to revoke permissions of a database account in a specified DBinstance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
DELETE https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_privilege
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_privilege
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 279
Table 5-270 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-271 Parameter description
Name Mandatory
Type Description
db_name Yes String Specifies thedatabase name.
users Yes Array of objects Specifies the accountthat associated withthe database. Asingle requestsupports a maximumof 50 elements.For more informationabout the elementstructure, see Table5-272.
Table 5-272 users field data structure description
Name Mandatory
Type Description
name Yes String Specifies theusername of thedatabase account.It contains 1 to 128characters and mustbe different fromsystem usernames.System users includerdsadmin, rdsuser,rdsbackup, andrdsmirror.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 280
● Request example
{ "db_name": "rds-test", "users": [ { "name": "rds" }, { "name": "rds001" } ]}
Response● Normal response
Table 5-273 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.11 Database and Account Management (PostgreSQL)
5.11.1 Creating a Database
Function
This API is used to create a database in a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 281
Constraints● Databases cannot be created when the DB instance is in any of the following
statuses: creating, changing instance class, changing port, frozen, orabnormal.
● If you create a database using other methods instead of invoking an v3 API,for example, logging in to a node or using a client tool, the database nameverification rule is inconsistent with that of the v3 API. As a result, the v3 APImay fail to be invoked to perform operations on the database.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database
● Parameter description
Table 5-274 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 282
Table 5-275 Parameter description
Name Mandatory
Type Description
name Yes String Specifies thedatabase name.The value contains 1to 63 characters,including letters,digits, andunderscores (_). Itcannot start with pgor a digit, and mustbe different from RDSfor PostgreSQLtemplate librarynames.RDS for PostgreSQLtemplate librariesinclude postgres,template0 andtemplate1.
owner No String Specifies thedatabase user. Thedefault value is root.The value must be anexisting usernameand must be differentfrom systemusernames.System users includerdsAdmin, rdsMetric,rdsBackup, rdsRepl,rdsProxy, andrdsDdm.
template No String Specifies the name ofthe databasetemplate. The valuecan be template0 ortemplate1 (defaultvalue).
character_set No String Specifies thedatabase characterset. The default valueis UTF8.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 283
Name Mandatory
Type Description
lc_collate No String Specifies thedatabase collocation.The default value isen_US.UTF-8.NOTICE
For different collationrules, the executionresult of a statementmay be different.For example, theexecution result ofselect 'a'>'A'; is falsewhen this parameter isset to en_US.utf8 andis true when thisparameter is set to 'C'.If a database ismigrated from "O" toPostgreSQL, thisparameter needs to beset to 'C' to meet yourexpectations. You canquery the supportedcollation rules fromthe pg_collation table.
lc_ctype No String Specifies thedatabaseclassification. Thedefault value isen_US.UTF-8.
● Request example
{ "name": "rds_test", "owner": "test", "template": "template0", "character_set": "UTF8", "lc_collate": "en_US.UTF-8", "lc_ctype": "en_US.UTF-8"}
Response● Normal response
Table 5-276 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 284
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.11.2 Creating a Database Account
FunctionThis API is used to create a database account for a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user
● Parameter description
Table 5-277 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 285
Request● Parameter description
Table 5-278 Parameter description
Name Mandatory
Type Description
name Yes String Specifies the username of thedatabase account.The username contains 1 to 63characters, including letters,digits, and underscores (_). Itcannot start with pg or a digitand must be different fromsystem usernames.System users include rdsAdmin,rdsMetric, rdsBackup, rdsRepl,rdsProxy, and rdsDdm.
password Yes String Specifies the password of thedatabase account.The value cannot be empty andcontains 8 to 32 characters. Itconsists of at least three types ofthe following: uppercase letters,lowercase letters, digits, andspecial characters (~!@#%^*-_=+?). The value cannot be thesame as the name value or thename value in reverse order.You are advised to enter a strongpassword to improve security,preventing security risks such asbrute force cracking.
● Request example
{ "name": "rds", "password": "Test@12345678"}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 286
Table 5-279 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response{ "resp": "successful"}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.11.3 Creating a Database Schema
Function
This API is used to create a database schema in a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
Databases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/schema
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/schema
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 287
Table 5-280 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-281 Parameter description
Name Mandatory
Type Description
db_name Yes String Specifies thedatabase name.The value contains 1to 63 characters,including letters,digits, andunderscores (_). Itcannot start with pgor a digit, and mustbe different from RDSfor PostgreSQLtemplate librarynames.RDS for PostgreSQLtemplate librariesinclude postgres,template0, andtemplate1.
schemas Yes Array of objects Each element is theschema informationassociated with thedatabase. A singlerequest supports amaximum of 20elements.For details on theelement structure,see Table 5-282.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 288
Table 5-282 schemas field data structure description
Name Mandatory
Type Description
schema_name
Yes String Specifies the schemaname.The value contains 1to 63 characters,including letters,digits, andunderscores (_). Itcannot start with pgor a digit, and mustbe different from RDSfor PostgreSQLtemplate librarynames and existingschema names.RDS for PostgreSQLtemplate librariesinclude postgres,template0, andtemplate1.Existing schemasinclude public andinformation_schema.
owner Yes String Specifies thedatabase owner.The value contains 1to 63 characters. Itcannot start with pgor a digit, and mustbe different fromsystem usernames.System users includerdsAdmin, rdsMetric,rdsBackup, rdsRepl,rdsProxy, andrdsDdm.
● Request example
{ "db_name": "rds_test", "schemas": [ { "schema_name": "teste123", "owner": "teste123" } ]}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 289
Response● Normal response
Table 5-283 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response
{ "resp": "successful"}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.11.4 Authorizing a Database Account
Function
This API is used to grant permissions to a database account in a specified DBinstance.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be created when the DB instance is in any of the following
statuses: creating, changing instance class, changing port, frozen, orabnormal.
● By default, read-only users have the create and usage permissions on thepublic schema.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_privilege● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 290
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_privilege
● Parameter description
Table 5-284 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-285 Parameter description
Name Mandatory
Type Description
db_name Yes String Specifies thedatabase name.The database namecontains 1 to 63characters, includingletters, digits, andunderscores (_). Itcannot start with pgor a digit, and mustbe different from RDSfor PostgreSQLtemplate librarynames.RDS for PostgreSQLtemplate librariesinclude postgres,template0, andtemplate1.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 291
Name Mandatory
Type Description
users Yes Array of objects Specifies the accountthat associated withthe database. Asingle requestsupports a maximumof 50 elements.For details on theelement structure,see Table 5-286.
Table 5-286 users field data structure description
Name Mandatory
Type Description
name Yes String Specifies theusername of thedatabase account.The database accountname contains 1 to63 characters,including letters,digits, andunderscores (_). Itcannot start with pgor a digit and mustbe different fromsystem user names.System users includerdsAdmin, rdsMetric,rdsBackup, rdsRepl,rdsProxy, andrdsDdm.
readonly Yes Boolean Specifies thedatabase accountrights.● true: Read only● false: Read and
write
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 292
Name Mandatory
Type Description
schema_name
Yes String Specifies the schemaname.The value cannot beempty and contains 1to 63 characters,including letters,digits, andunderscores (_). Itcannot start with pgor a digit, and mustbe different from RDSfor PostgreSQLtemplate librarynames and existingschema names. Thisparameter ismandatory.RDS for PostgreSQLtemplate librariesinclude postgres,template0, andtemplate1.
● Request example
{"db_name": "rds_test", "users": [ { "name": "rds", "readonly ": false, "schema_name": "teste123" }, { "name": "rds001", "readonly": true, "schema_name":" teste123" }, { "name": "rds002", "readonly ": false, " schema_name": " teste123" } ] }
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 293
Table 5-287 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response{ "resp": "successful"}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.11.5 Resetting a Password for a Database Account
Function
This API is used to reset a password for a database account.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints
The password of a database account cannot be reset if the DB instance is in any ofthe following statuses: creating, changing instance class, changing port, rebooting,frozen, or abnormal.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/resetpwd
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/resetpwd
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 294
Table 5-288 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
Request● Parameter description
Table 5-289 Parameter description
Name Mandatory
Type Description
name Yes String Specifies the username of thedatabase account.
password Yes String Specifies the password of thedatabase account.Valid value:The value cannot be empty andmust be 8-32 characters inlength. It contains at least threetypes of the following characters:uppercase letters, lowercaseletters, digits, and specialcharacters (~!@#%^*-_=+?). Thevalue must be different from thename value and the value spelledbackwards.You are advised to enter a strongpassword to improve security,preventing security risks such asbrute force cracking.
● Request example{ "name": "rds", "password": "Test@12345678"}
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 295
Table 5-290 Parameter description
Name Type Description
resp String Returns successful ifthe invoking issuccessful.
● Example normal response{ "resp": "successful"}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.11.6 Querying Details About Databases
Function
This API is used to query details about databases of a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.
● The details about databases of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/database/detail?page={page}&limit={limit}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/database/detail?page=1&limit=10
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 296
Table 5-291 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
page Yes Specifies the page number. The value startsfrom 1.
limit Yes Specifies the number of records on each page.The value ranges from 1 (inclusive) to 100(inclusive).
RequestNone
Response● Normal response
Table 5-292 Parameter description
Name Type Description
databases Array of objects Each element in the listindicates a database.For details, see Table5-293.
total_count Integer Indicates the totalnumber of databases.
Table 5-293 databases element structure description
Name Type Description
name String Indicates the databasename.
owner String Indicates the databaseowner.
character_set String Indicates the characterset used by thedatabase, such asUTF8.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 297
Name Type Description
collate_set String Indicates the databasecollation, such asen_US.UTF-8.
size Integer Indicates the databasesize, in bytes.
● Example normal response
{ "databases": [ { "name": "rds_test", "owner": "root", "character_set": "UTF8", "collate_set":"en_US.UTF-8", "size":10777247 }, { "name": "rds_test2", "owner":"root", "character_set": "UTF8" "collate_set":"en_US.UTF-8", "size":1055623
}, { "name": "rds_test3", "owner":"root", "character_set": "UTF8" "collate_set":"en_US.UTF-8", "size":107772488 } ], "total_count": 3}
● Abnormal responseFor details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.11.7 Querying Details About Database Users
Function
This API is used to query details about database users for a specified DB instance.
● Before calling an API, you need to understand the API in Authentication.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 298
● Before calling this API, obtain the required region and endpoint.
ConstraintsDatabases cannot be created when the DB instance is in any of the followingstatuses: creating, changing instance class, changing port, frozen, or abnormal.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/db_user/detail?page={page}&limit={limit}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/db_user/detail?page=1&limit=10
● Parameter description
Table 5-294 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
page Yes Specifies the page number. The value startsfrom 1.
limit Yes Specifies the number of records on each page.The value ranges from 1 (inclusive) to 100(inclusive).
RequestNone
Response● Normal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 299
Table 5-295 Parameter description
Name Type Description
users Array of objects Each element in the listindicates a databaseaccount.For details, see Table5-296.
total_count Integer Indicates the totalnumber of databaseusers.
Table 5-296 users element structure description
Name Type Description
name String Indicates the accountname.
attributes Object Indicates permissionattributes of a user.For details, see Table5-297.
memberof Array of strings Indicates default rightsof a user.
Table 5-297 attributes element structure description
Name Type Description
rolsuper Boolean Indicates whether auser has the super userpermission. The valuecan be true or false.
rolinherit Boolean Indicates whether auser automaticallyinherits the permissionsof the role to which theuser belongs. The valuecan be true or false.
rolcreaterole Boolean Indicates whether auser can create othersub-users. The valuecan be true or false.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 300
Name Type Description
rolcreatedb Boolean Indicates whether auser can create adatabase. The valuecan be true or false.
rolcanlogin Boolean Indicates whether auser can log in to thedatabase. The valuecan be true or false.
rolconnlimit Integer Indicates the maximumnumber of concurrentconnections to a DBinstance. The value -1indicates that there areno limitations on thenumber of concurrentconnections.
rolreplication Boolean Indicates whether theuser is a replicationrole. The value can betrue or false.
rolbypassrls Boolean Indicates whether auser bypasses eachrow-level securitypolicy. The value can betrue or false.
● Example normal response
{"users": [{ "name": "rdsuser", "attributes": { "rolsuper": false, "rolinherit": true, "rolcreaterole": true, "rolcreatedb": true, "rolcanlogin": true, "rolconnlimit": -1, "rolreplication": true, "rolbypassrls": false }, "memberof": ["pg_monitor", "pg_read_all_stats", "pg_stat_scan_tables", "pg_signal_backend"]}, { "name": "rdsuser1", "attributes": { "rolsuper": false, "rolinherit": true, "rolcreaterole": true, "rolcreatedb": true,
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 301
"rolcanlogin": true, "rolconnlimit": -1, "rolreplication": true, "rolbypassrls": false}, "memberof": []}],"total_count": 2}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.11.8 Querying Details About Database Schemas
Function
This API is used to query details about database schemas of a specified DBinstance.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● Databases cannot be queried when the DB instance is in the abnormal or
frozen state.
● The database schemas of read replicas cannot be queried.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/schema/detail?db_name={name}&page={page}&limit={limit}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/schema/detail?db_name=rds_test&page=1&limit=10
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 302
Table 5-298 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
db_name Yes Specifies the database name.Database names must be different from RDSfor PostgreSQL template libraries.RDS for PostgreSQL template libraries includepostgres, template0, and template1.
page Yes Specifies the page number. The value startsfrom 1.
limit Yes Specifies the number of records on each page.The value ranges from 1 (inclusive) to 100(inclusive).
RequestNone
Response● Normal response
Table 5-299 Parameter description
Name Type Description
database_schemas Array of objects Each element in the listindicates a databaseschema.For details, see Table5-300.
total_count Integer Indicates the totalnumber of databaseschemas.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 303
Table 5-300 users element structure description
Name Type Description
schema_name String Indicates a schemaname.
owner String Indicates a schemaowner.
– Example normal response{ "database_schemas": [{ "schema_name": "rds_user1", "owner": "root" }],"total_count": 1}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.12 Recycling a DB Instance
5.12.1 Modify Recycling Policy
FunctionThis API is used to modify the recycling policy for the recycle bin.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
PUT https://{Endpoint}/v3/{project_id}/instances/recycle-policy● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/054ea741f700d4a32f1bc00f5c80dd4c/instances/recycle-policy
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 304
Table 5-301 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
Request● Parameter description
Table 5-302 Parameter description
Name Mandatory Type Description
recycle_policy
Yes Object Each element is associated withthe recycle bin.For details on the elementstructure, see Table 5-303.
Table 5-303 recycle_policy elements
Name Mandatory Type Description
is_open_recycle_policy
Yes Boolean Indicates whether to enable therecycling policy. The value canbe true or false.
retention_period_in_days
No String Indicates the period of retainingdeleted DB instances from 1 dayto 7 days.When is_open_recycle_policy isset to true andretention_period_in_days is leftblank, deleted DB instances areretained for 7 days by default.
● Request example
{ "recycle_policy": { "retention_period_in_days":"1", "is_open_recycle_policy":false }}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 305
Response● Normal response
Table 5-304 Parameter description
Name Type Description
result String Returns success if theinvoking is successful.
● Example normal response{ "result": "success"}
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.13 Tag Management
5.13.1 Adding Tags in Batches
Function
This API is used to add tags in batches.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags/action
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/tags/action
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 306
Table 5-305 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
Request● Parameter description
Table 5-306 Parameter description
Name Mandatory Type Description
action Yes String Specifies the operationidentifier (case sensitive),which is create during thecreation operation.
tags Yes Array ofobjects
Specifies the tag list. Amaximum of 10 tags can beadded for each DB instance.For details, see Table 5-307.
Table 5-307 tags field data structure description
Name Mandatory Type Description
key Yes String Specifies the tag key, whichcontains a maximum of 36Unicode characters.The key cannot be leftblank or an empty string. Itcan be any of Unicodecharacters (\u4E00-\u9FFF)or the following characterset: A-Z, a-z, 0-9, hyphens(-), and underscores (_).
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 307
Name Mandatory Type Description
value Yes String Specifies the tag value,which contains a maximumof 43 Unicode characters.The value can be an emptycharacter string. It can beany of Unicode characters(\u4E00-\u9FFF) or thefollowing character set: A-Z,a-z, 0-9, periods (.),hyphens (-), andunderscores (_).
● Request example{ "action": "create", "tags": [{ "key": "key1", "value": "value1" }, { "key": "key2", "value": "value2" }]}
Response● Normal response
None
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.13.2 Deleting Tags in Batches
Function
This API is used to delete tags in batches.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 308
URI● URI format
POST https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tags/action● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/cee5265e1e5845649e354841234567dfin01/tags/action
● Parameter description
Table 5-308 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
instance_id Yes Specifies the DBinstance ID.
Request● Parameter description
Table 5-309 Parameter description
Name Mandatory Type Description
action Yes String Specifies the operationidentifier (case sensitive),which is delete during thedeletion operation.
tags Yes Array ofobjects
Specifies the tag list.For details, see Table 5-310.
Table 5-310 tags field data structure description
Name Mandatory Type Description
key Yes String Specifies the tag key, whichcontains a maximum of 127Unicode characters.The key cannot be left blankor an empty string.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 309
Name Mandatory Type Description
value No String Specifies the tag value, whichcontains a maximum of 255Unicode characters.Deletion remarks:● If value is not empty, delete
tags by key/value.● If value is empty, delete
tags by key.
● Request example
{ "action": "delete", "tags": [{ "key": "key1" }, { "key": "key2", "value": "value2" }]}
Response● Normal response
None● Abnormal response
For details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.13.3 Querying Project Tags
FunctionThis API is used to query project tags.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/tags● Example
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 310
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/tags
● Parameter description
Table 5-311 Parameter description
Name Mandatory Description
project_id Yes Specifies the project IDof a tenant in a region.For details about howto obtain the project ID,see Obtaining aProject ID.
Request
None
Response● Normal response
Table 5-312 Parameter description
Name Type Description
tags Array of objects Specifies the tag list. If there isno tag in the list, an empty arrayis returned.For details, see Table 5-313.
Table 5-313 tags field data structure description
Name Type Description
key String Specifies the tag key.
values List<String> Specifies the lists the tag values.
● Example normal response
{ "tags": [{ "key": "key1", "values": ["value1"] }, { "key": "key2", "values": ["value2"] }]}
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 311
● Abnormal response
For details, see Abnormal Request Results.
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
5.14 Obtaining Task Information
5.14.1 Obtaining Information About a Task with a Specified ID
Function
This API is used to obtain information about a task with a specified ID in the taskcenter.
● Before calling an API, you need to understand the API in Authentication.
● Before calling this API, obtain the required region and endpoint.
Constraints● This API is used to query only asynchronous tasks of the last one month in the
task center.
● Information of the following asynchronous tasks can be obtained: creatingsingle or primary/standby DB instances, creating read replicas, changing singleDB instances to primary/standby instances, switching primary/standby DBinstances, scaling up storage space, restoring to a new DB instance, migratinga standby MySQL DB instance, upgrading a MySQL DB instance minor version,restoring table-level data to a specified time point for a MySQL DB instance,and binding or unbinding EIPs.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/jobs?id={id}
● Example
https://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/jobs?id=a9767ede-fe0f-4888-9003-e843a4c90514
● Parameter description
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 312
Table 5-314 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
id Yes Specifies the task ID.
RequestNone
Response● Normal response
Table 5-315 Parameter description
Name Type Description
job Object Indicates the task information.For details, see Table 5-316.
Table 5-316 job field data structure description
Name Type Description
id String Indicates the task ID.
name String Indicates the task name.
status String Indicates the task executionstatus.Value:● Running: The task is being
executed.● Completed: The task is
successfully executed.● Failed: The task fails to be
executed.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 313
Name Type Description
created String Indicates the creation time inthe "yyyy-mm-ddThh:mm:ssZ"format.T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
ended String Indicates the end time in the"yyyy-mm-ddThh:mm:ssZ"format.T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
process String Indicates the task executionprogress.NOTE
The execution progress (such as60%) is displayed only when thetask is being executed. Otherwise,"" is returned.
instance Object Indicates information of the DBinstance on which the task isexecuted.For details, see Table 5-317.
entities Object The displayed information variesdepending on the tasks.For details, see the following:● Table 5-318● Table 5-321● Table 5-323● Table 5-324NOTE
For asynchronous tasks without theentities field description, {} isreturned.
fail_reason String Indicates the error informationdisplayed when a task failed.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 314
Table 5-317 instances field data structure description
Name Type Description
id String Indicates the DB instance ID.
name String Indicates the DB instance name.
Table 5-318 entities field data structure description (creating DB instances,changing single DB instances to primary/standby, or creating read replicas)
Name Type Description
instance Object Indicates the information aboutthe queried DB instance.For details, see Table 5-319.
resource_ids List<String> Indicates the queried resourceID.
Table 5-319 entities.instance field data structure description
Name Type Description
endpoint String Indicates the DB instanceconnection address.
type String The value is Single, Ha, orReplica, indicating the single DBinstance, primary/standby DBinstances, and read replica,respectively.
datastore Object Indicates the databaseinformation. For details, see Table5-320.
replica_of String Indicates the primary DB instanceID. This parameter is returnedonly when a read replica iscreated.
Table 5-320 datastore field data structure description
Name Type Description
type String Indicates the DB engine.
version String Indicates the database version.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 315
Table 5-321 entities field data structure description (resizing a DB instance)
Name Type Description
volume Object Indicates the information aboutthe resized disk.For details, see Table 5-322.
resource_ids List<String> Indicates the queried resourceID.
Table 5-322 volume field data structure description
Name Type Description
type String Indicates the volume type.
original_size String Indicates the original disk sizeof the DB instance.
target_size String Indicates the target disk size ofthe DB instance.
Table 5-323 entities field data structure description (binding/unbinding EIPsor enabling/disabling remote access)
Name Type Description
public_ip String Indicates the EIP bound to theDB instance.
Table 5-324 entities field data structure description (primary/standbyswitchover)
Name Type Description
switch_strategy String Indicates the primary/standbyswitchover policy.
NO TE
In the response example, some tasks in the task center are used as examples.
● Example normal responseCreating a DB instance:{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": "CreateMysqlSingleHAInstance",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 316
"status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "instance": { "endpoint": "192.168.1.203:3306", "type": "Single", "datastore": { "type": "mysql", "version": "5.7" } }, "resource_id": ["a48e43ff268f4c0e879652d65e63d0fbin01.vm", "a48e43ff268f4c0e879652d65e63d0fbin01.volume"] } }}
Creating a read replica:{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": " CreateMysqlReplicaInstance", "status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "288caaa9d05f4ec1a1f58de2e0945685in01", "name": "mysql-replica" }, "entities": { "instance": { "endpoint": "192.168.1.203:3306", "type": "replica", "datastore": { "type": "mysql", "version": "5.7" }, "replica_of": "a48e43ff268f4c0e879652d65e63d0fbin01" }, "resource_ids": ["288caaa9d05f4ec1a1f58de2e0945685in01.vm", "288caaa9d05f4ec1a1f58de2e0945685in01.volume"] } }}
Binding an EIP:{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": "MysqlBindEIP", "status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01",
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 317
"name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "public_ip": "10.154.218.254" } }}
Rebooting a DB instance:{ "job": { "id": "31b8ae23-c687-4d80-b7b4-42a66c9bb886", "name": " RestartMysqlInstance", "status": "Completed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": {} }}
Task being executed:{ "job": { "id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886", "name": "CreateMysqlSingleHAInstance"," status": "Running", "created": "2018-08-06T10:41:14+0000", "process": "60 % ", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "instance": { "type": "Single", "datastore": { "type": "mysql", "version": "5.7" } } } }}
Task fails to be executed:{ "job": { "id": "31 b8ae23 - c687 - 4 d80 - b7b4 - 42 a66c9bb886", "name": "CreateMysqlSingleHAInstance", "status": "Failed", "created": "2018-08-06T10:41:14+0000", "ended": "2018-08-06T16:41:14+0000", "process": "", "instance": { "id": "a48e43ff268f4c0e879652d65e63d0fbin01", "name": "DO-NOT-TOUCH-mgr2-mysql-single" }, "entities": { "instance": {
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 318
"type": "Single", "datastore": { "type": "mysql", "version": "5.7" } } }, "fail_reason": "createVM failed." }}
● Abnormal responseFor details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
5.14.2 Obtaining Task Information of a Specified SQL ServerDB Instance in a Specified Time Range
FunctionThis API is used to obtain the task information list of a specified SQL Server DBinstance ID within a specified time range.
● Before calling an API, you need to understand the API in Authentication.● Before calling this API, obtain the required region and endpoint.
Constraints● This API is used to query asynchronous tasks of the last one month in the task
center.● Information of the following asynchronous tasks can be obtained: creating
single or primary/standby DB instances, creating read replicas, changing singleDB instances to primary/standby instances, switching primary/standby DBinstances, scaling up storage space, creating automated or manual backups,restoring data to original, existing, or new DB instances.
URI● URI format
GET https://{Endpoint}/v3/{project_id}/instances/{instance_id}/tasklist/detail?start_time={start_time}&end_time={end_time}
● Examplehttps://rds.ap-southeast-1.myhuaweicloud.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/a48e43ff268f4c0e879652d65e63d0fbin01/tasklist/detail?start_time=1533423274000&end_time=1533823274000
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 319
● Parameter description
Table 5-325 Parameter description
Name Mandatory
Description
project_id Yes Specifies the project ID of a tenant in a region.For details about how to obtain the project ID,see Obtaining a Project ID.
instance_id Yes Specifies the DB instance ID.
start_time Yes Specifies the start time in the UTC timestampformat.
end_time No Specifies the end time in the UTC timestampformat.
RequestNone
Response● Normal response
Table 5-326 Parameter description
Name Type Description
jobs Object Indicates the task information.For details, see Table 5-327.
Table 5-327 jobs field data structure description
Name Type Description
id String Indicates the task ID.
name String Indicates the task name.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 320
Name Type Description
status String Indicates the task executionstatus.Value:● Running: The task is being
executed.● Completed: The task is
successfully executed.● Failed: The task fails to be
executed.
created String Indicates the creation time inthe "yyyy-mm-ddThh:mm:ssZ"format.T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
ended String Indicates the end time in the"yyyy-mm-ddThh:mm:ssZ"format.T is the separator between thecalendar and the hourlynotation of time. Z indicates thetime zone offset. For example, inthe Beijing time zone, the timezone offset is shown as +0800.
process String Indicates the task executionprogress.NOTE
The execution progress (such as60%) is displayed only when thetask is being executed. Otherwise,"" is returned.
instance Object Indicates information of the DBinstance on which the task isexecuted.For details, see Table 5-328.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 321
Name Type Description
task_detail Object The displayed information variesdepending on the tasks.For details, see the following:● Table 5-329● Table 5-330NOTE
This field is not displayed forasynchronous tasks that do notcontain the task_detail field.
fail_reason String Indicates the error informationdisplayed when a task failed.
Table 5-328 instance field data structure description
Name Type Description
id String Indicates the DB instance ID.
name String Indicates the DB instance name.
Table 5-329 task_detail field data structure description (restoring data tooriginal, existing, or new DB instances, or restoring table-level data to aspecified time point)
Name Type Description
sourceInstanceId
String Indicates the ID of the original DBinstance to which backup data isrestored.
targetInstanceId String Indicates the ID of the target DBinstance to which backup data isrestored.
backupId String Indicates the backup file ID.
restoreTime String Indicates the time point to whichtable-level data is restored.
type String Indicates the task type.
dbNames List<String> Indicates the database name.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 322
Table 5-330 task_detail field data structure description (creating automatedor manual backups)
Name Type Description
instanceId String Indicates the ID of the DBinstance to be backed up.
name String Indicates the task name.
description String Indicates the task description.
dbNames String Indicates the name of the datato be backed up.
NO TE
In the response example, some returned task details are used as examples.
● Example normal responseCreating automated or manual backups:{ "jobs": [ { "id": "aa4e3386-af27-436e-99f5-7cfefa21c37a", "name": "BackupDbSqlserverInInstance", "status": "Completed", "created": "2020-07-20T16:10:07+0000", "ended": "2020-07-20T16:14:39+0000", "process": "", "instance": { "id": "9a09052dfa824caea36f583bc3e5684ein04", "name": "rds-8d43-0004" }, "task_detail": "{\"instanceId\":\"9a09052dfa824caea36f583bc3e5684ein04\",\"name\":\"sqlserver-rds-8d43-0004-20200719161130675\"}" } ], "count":1}
Restoring data to original, existing, or new DB instances, or restoring table-level data to a specified time point:{ "jobs": [ { "id": "11bef2cb-2924-4727-a9c2-b6fec61fc03a", "name": "SingleDbRestoreSqlserverInInstance", "status": "Failed", "created": "2020-07-21T01:38:00+0000", "ended": "2020-07-21T01:39:59+0000", "process": "", "instance": { "id": "9a09052dfa824caea36f583bc3e5684ein04", "name": "rds-8d43-0004" }, "task_detail": "{\"backupId\":\"83c76e6852c145779dc153d8299ee0e1br04\",\"dbNames\":\"backeeeeee\",\"sourceInstanceId\":\"9a09052dfa824caea36f583bc3e5684ein04\",\"targetInstanceId\":
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 323
\"9a09052dfa824caea36f583bc3e5684ein04\"}" } ], "count":1}
Other task types:{ "jobs":[ { "id":"11bef2cb-2924-4727-a9c2-b6fec61fc03a", "name":"SingleDbRestoreSqlserverInInstance", "status":"Complete", "created":"2020-07-21T01:38:00+0000", "ended":"2020-07-21T01:39:59+0000", "process":"", "instance":{ "id":"9a09052dfa824caea36f583bc3e5684ein04", "name":"rds-8d43-0004" } ], "count":1}
Task being executed:{ "jobs":[ { "id": "32291a2e-882b-4266-b7c0-89dae34d2a9d", "name": "CreateSqlserverSingleHAInstance", "status": "Running", "created": "2020-07-14T15:02:29+0000", "ended": "2020-07-14T15:16:18+0000", "process": "50", "instance": { "id": "9a09052dfa824caea36f583bc3e5684ein04", "name": "rds-8d43-0004" } } ], "count":1}
Task fails to be executed:{ "jobs":[ { "id": "32291a2e-882b-4266-b7c0-89dae34d2a9d", "name": "CreateSqlserverSingleHAInstance", "status": "Failed", "created": "2020-07-14T15:02:29+0000", "ended": "2020-07-14T15:16:18+0000", "process": "50", "instance": { "id": "9a09052dfa824caea36f583bc3e5684ein04", "name": "rds-8d43-0004" } } ], "fail_reason": "createVM failed.", "count":1}
● Abnormal response
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 324
For details, see Abnormal Request Results.
Status CodeFor details, see Status Codes.
Error CodeFor details, see Error Codes.
Relational Database ServiceAPI Reference 5 API v3 (Recommended)
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 325
6 Appendix
6.1 Abnormal Request Results
v3 APIsAbnormal response description
Table 6-1 Abnormal response description
Name Type Description
error_code String Specifies the error returned when a tasksubmission exception occurs.
error_msg String Specifies the description of the errorreturned when a task submission exceptionoccurs.
Response example{ "error_code": "DBS.200022", "error_msg": "The DB instance name already exists."}
6.2 Status CodesTable 6-2 describes status codes.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 326
Table 6-2 Status codes
StatusCode
Message Description
100 Continue The client should continue with its request.This interim response is used to inform the clientthat the initial part of the request has beenreceived and has not yet been rejected by theserver.
101 SwitchingProtocols
The protocol should be switched. The protocolcan only be switched to a more advancedprotocol.For example, the current HTTP protocol isswitched to a later version.
200 OK Request succeeded.
201 Created The request for creating a resource or task hasbeen fulfilled.
202 Accepted The request has been accepted, but theprocessing has not been completed.
203 Non-AuthoritativeInformation
Unauthorized information. The request issuccessful.
204 NoContent The server has successfully processed therequest, but has not returned any content.The status code is returned in response to anHTTP OPTIONS request.
205 Reset Content The server has fulfilled the request, but therequester is required to reset the content.
206 Partial Content The server has processed certain GET requests.
300 Multiple Choices There are multiple options for the location ofthe requested resource. The response contains alist of resource characteristics and addressesfrom which the user or user agent (such as abrowser) can choose the most appropriate one.
301 MovedPermanently
The requested resource has been assigned a newpermanent URI, and the new URI is contained inthe response.
302 Found The requested resource was temporarily moved.
303 See Other The response to the request can be found undera different URI and should be retrieved using aGET or POST method.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 327
StatusCode
Message Description
304 Not Modified The requested resource has not been modified.In such a case, there is no need to retransmitthe resource since the client still has apreviously-downloaded copy.
305 Use Proxy The requested resource must be accessedthrough a proxy.
306 Unused The HTTP status code is no longer used.
400 BadRequest Invalid request.The client should not repeat the request withoutmodifications.
401 Unauthorized The status code is returned after the clientprovides the authentication information,indicating that the authentication information isincorrect or invalid.
402 PaymentRequired
This status code is reserved for future use.
403 Forbidden The server understood the request, but isrefusing to fulfill it.The client should not repeat the request withoutmodifications.
404 NotFound The requested resource cannot be found.The client should not repeat the request withoutmodifications.
405 MethodNotAllowed
The method specified in the request is notsupported for the requested resource.The client should not repeat the request withoutmodifications.
406 Not Acceptable The server cannot fulfill the request according tothe content characteristics of the request.
407 ProxyAuthenticationRequired
This status code is similar to 401, but indicatesthat the client must first authenticate itself withthe proxy.
408 Request Time-out The server timed out waiting for the request.The client may repeat the request withoutmodifications at any later time.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 328
StatusCode
Message Description
409 Conflict The request could not be processed due to aconflict.This status code indicates that the resource thatthe client attempts to create already exits, or therequest fails to be processed because of theupdate of the conflict request.
410 Gone The requested resource is no longer available.The requested resource has been deletedpermanently.
411 Length Required The server refuses to process the requestwithout a defined Content-Length.
412 PreconditionFailed
The server does not meet one of thepreconditions that the requester puts on therequest.
413 Request EntityToo Large
The request is larger than that a server is ableto process. The server may close the connectionto prevent the client from continuing therequest. If the server temporarily cannot processthe request, the response will contain a Retry-After header field.
414 Request-URI TooLarge
The URI provided was too long for the server toprocess.
415 UnsupportedMedia Type
The server is unable to process the mediaformat in the request.
416 Requested rangenot satisfied
The requested range is invalid.
417 ExpectationFailed
The server fails to meet the requirements of theExpect request-header field.
422 UnprocessableEn-tity
The request is well-formed but is unable to beprocessed due to semantic errors.
429 TooManyRequests
The client has sent more requests than its ratelimit is allowed within a given amount of time,or the server has received more requests than itis able to process within a given amount oftime. In this case, it is advisable for the client tore-initiate requests after the time specified inthe Retry-After header of the response expires.
500 InternalServerEr-ror
The server is able to receive the request but itcould not understand the request.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 329
StatusCode
Message Description
501 Not Implemented The server does not support the requestedfunction.
502 Bad Gateway The server acting as a gateway or proxy receivesan invalid response from a remote server.
503 ServiceUnavaila-ble
The requested service is invalid.The client should not repeat the request withoutmodifications.
504 ServerTimeout The request cannot be fulfilled within a giventime. The response will reach the client only ifthe request carries a timeout parameter.
505 HTTP Version notsupported
The server does not support the HTTP protocolversion used in the request.
6.3 Error CodesIf an error code starting with APIGW is returned after you call an API, rectify thefault by referring to the instructions provided in API Gateway Error Codes.
The following table describes error codes.
Table 6-3 V3 error codes
Error Code ResponseCode
Description
DBS.108000 500 Server failure.
DBS.108002 500 Server failure.
DBS.108005 500 Server failure.
DBS.200001 400 Parameter error.
DBS.200002 404 The DB instance does not exist.
DBS.200004 400 Parameter error.
DBS.200005 500 Server failure.
DBS.200006 400 The request is null. Enter a request parameter.
DBS.200008 404 The ECS information of the DB instancecannot be found.
DBS.200010 403 The DB instance ID or user ID may be null, orthe operation is not authorized.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 330
Error Code ResponseCode
Description
DBS.200011 409 Another operation is being performed on theDB instance or the DB instance is faulty.
DBS.200013 404 The original DB instance does not exist.
DBS.200019 409 Another operation is being performed on theDB instance or the DB instance is faulty.
DBS.200021 400 Invalid DB instance name.
DBS.200022 409 The DB instance name already exists.
DBS.200023 400 Storage space is out of range.
DBS.200024 400 Invalid region.
DBS.200025 400 Invalid AZ.
DBS.200026 400 Invalid storage type.
DBS.200027 400 Storage space must be a multiple of 10.
DBS.200040 400 The DB engine or version is not supported.
DBS.200041 400 Invalid database version.
DBS.200042 400 The DB engine does not exist.
DBS.200043 400 Invalid synchronize model.
DBS.200044 403 Resource not found or permission denied.
DBS.200045 404 The DB instance does not exist.
DBS.200046 413 The number of DB instances has reached thequota.
DBS.200047 409 Another operation is being performed on theDB instance or the DB instance is faulty.
DBS.200048 400 Invalid VPC ID.
DBS.200049 400 Invalid network ID.
DBS.200050 404 The security group does not exist or does notbelong to the VPC.
DBS.200051 400 Invalid HA mode.
DBS.200052 400 Invalid database root password.
DBS.200053 400 The selected specifications do not exist.
DBS.200054 400 Invalid specifications.
DBS.200055 400 Invalid replica_of_id.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 331
Error Code ResponseCode
Description
DBS.200056 400 The maximum number of nodes has beenreached.
DBS.200063 400 Invalid cluster mode.
DBS.200086 400 This operation is not allowed by the DBinstance status.
DBS.200087 400 The number of tags added for the DBinstance has reached the quota.
DBS.200098 400 The tag already exists.
DBS.200203 400 Failed to query the DB instance.
DBS.200208 500 Server failure.
DBS.200302 400 Storage space must be a multiple of 10.
DBS.200303 400 The scale-up times have reached themaximum value.
DBS.200306 400 The new storage space must be greater thanor equal to the original storage space.
DBS.200308 400 The new storage space after scaling upcannot be greater than that of the primaryDB instance.
DBS.200316 409 This operation cannot be performed becausethe DB instance status is Storage full.
DBS.200402 409 Invalid operation.
DBS.200405 400 Parameter error.
DBS.200408 404 The DB instance does not exist.
DBS.200461 400 The parameter value is out of range.
DBS.200470 404 The region or AZ does not exist.
DBS.200501 404 The subnet does not exist or does not belongto the VPC.
DBS.200503 404 The VPC does not exist or does not belong tothe user.
DBS.200504 400 Invalid database version.
DBS.200506 400 Invalid KMS.
DBS.200507 400 The KMS key is invalid or has been deleted.
DBS.200543 400 The job does not exist.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 332
Error Code ResponseCode
Description
DBS.200602 404 The DB instance does not exist.
DBS.200604 403 The DB instance ID or user ID may be null, orthe operation is not authorized.
DBS.200810 403 You are not allowed to create databases onread replicas.
DBS.200819 403 You are not allowed to delete database userson read replicas.
DBS.200821 500 Failed to modify database user permissions.
DBS.200823 400 The database does not exist.
DBS.200824 400 The database account does not exist.
DBS.200825 400 Modifying permission is not allowed on readreplicas.
DBS.200826 409 The database name already exists.
DBS.200827 409 The database user already exists.
DBS.200828 409 You are not allowed to create a databasebuilt-in account.
DBS.200811 500 Failed to create the database.
DBS.201003 403 Resource not found or permission denied.
DBS.201010 404 The backup information does not exist.
DBS.201014 400 This operation is not allowed by the DBinstance status.
DBS.201028 404 The DB instance does not exist.
DBS.201035 400 The database name must be different fromthe original and target database names.
DBS.201101 400 Invalid backup cycle.
DBS.201103 400 Invalid backup start time.
DBS.201106 400 Invalid retention days.
DBS.201201 409 The object already exists.
DBS.201202 409 Another operation is being performed on theDB instance or the DB instance is faulty.
DBS.201203 400 The backup file does not exist.
DBS.201205 409 Backup is in progress, please wait.
DBS.201207 400 The DB engine or version is not supported.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 333
Error Code ResponseCode
Description
DBS.201208 400 The operation is not allowed by the backupstatus.
DBS.212001 404 The parameter template does not exist.
DBS.212002 400 Incorrect parameter template quota.
DBS.212003 400 Operation not allowed.
DBS.212004 400 Parameter template update error.
DBS.212005 400 The node does not belong to the group.
DBS.212006 409 Another operation is being performed on theDB instance or the DB instance is faulty.
DBS.212007 400 The DB engine does not exist.
DBS.212008 400 The DB engine is not supported.
DBS.212009 400 Task processing failed.
DBS.212010 400 The parameter template is being applied.
DBS.212011 400 Application failed.
DBS.212012 400 The parameter does not exist.
DBS.212013 404 The object does not exist.
DBS.212014 400 The node does not have a default parametertemplate.
DBS.212015 400 Partial success
DBS.212016 400 Parameter update failed.
DBS.212017 400 Invalid parameter.
DBS.212019 422 The parameter cannot be processed.
DBS.212025 400 Update failed.
DBS.212030 400 Parameter error
DBS.212032 400 The parameter template has been applied.
DBS.212037 400 Parameters are incorrectly set.
DBS.213002 500 Failed to process the request.
DBS.213004 500 Failed to process the request.
DBS.216028 400 Insufficient internal resource quota.
DBS.280001 400 Parameter error.
DBS.280015 403 Resource not found or permission denied.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 334
Error Code ResponseCode
Description
DBS.280056 403 Invalid token.
DBS.280127 400 Invalid backup description.
DBS.280128 400 The database name does not exist.
DBS.280204 400 Invalid parameter.
DBS.280214 400 The backup does not exist.
DBS.280216 400 Invalid backup start time.
DBS.280235 400 Invalid database type.
DBS.280238 400 The DB engine or version is not supported.
DBS.280239 400 Invalid specifications.
DBS.280241 400 Invalid storage type.
DBS.280246 400 Invalid database root password.
DBS.280250 400 Invalid backup retention days.
DBS.280251 400 Invalid backup cycle.
DBS.280253 400 Invalid backup start time.
DBS.280270 400 The parameter does not exist.
DBS.280271 400 The parameter value is out of range.
DBS.280272 400 The tag key must be unique.
DBS.280277 400 Invalid object name.
DBS.280285 400 Invalid AZ.
DBS.280342 400 Invalid cluster mode.
DBS.280404 400 Invalid DB instance ID or node ID format.
DBS.280406 409 Operation not allowed by the DB instancetype or status.
DBS.280434 400 Invalid specification code.
DBS.280448 400 The storage type is sold out.
DBS.280449 400 Operation not allowed on frozen objects.
DBS.280450 400 The DB instance specifications are sold out.
DBS.280489 400 RDS DB instance associated with DDMinstance. Delete the associated schema fromthe DDM instance first.
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 335
Error Code ResponseCode
Description
DBS.280490 400 RDS DB backup associated with a DDMbackup. Delete the associated schema fromthe DDM backup first.
DBS.290000 400 Parameter error.
DBS.290001 400 Invalid parameter letter case.
DBS.290002 404 The selected specifications do not exist.
DBS.290003 413 The number of DB instances has reached thequota.
DBS.290005 404 The DB instance does not exist.
DBS.290006 500 Failed to process the request.
DBS.290011 404 The DB instance does not exist.
DBS.290013 404 Resource not found.
DBS.290015 500 Failed to process the request.
6.4 Obtaining a Project ID
ScenariosWhen calling APIs, you need to specify the project ID in some URLs. To do so, youneed to obtain the project ID first. Two methods are available:
● Obtaining the Project ID by Calling an API● Obtain a Project ID from the Console
Obtaining the Project ID by Calling an APIYou can obtain the project ID by calling the API used to query projectinformation based on the specified criteria.
The API used to obtain a project ID is GET https://{Endpoint}/v3/projects.{Endpoint} is the IAM endpoint and can be obtained from Regions andEndpoints. For details about API authentication, see Authentication.
The following is an example response. The value of id is the project ID.
{ "projects": [ { "domain_id": "65382450e8f64ac0870cd180d14e684b", "is_domain": false, "parent_id": "65382450e8f64ac0870cd180d14e684b", "name": "project_name", "description": "", "links": {
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 336
"next": null, "previous": null, "self": "https://www.example.com/v3/projects/a4a5d4098fb4474fa22cd05f897d6b99" }, "id": "a4a5d4098fb4474fa22cd05f897d6b99", "enabled": true } ], "links": { "next": null, "previous": null, "self": "https://www.example.com/v3/projects" }}
Obtain a Project ID from the Console
Step 1 Register yourself on the management console and log in to it.
Step 2 Hover the mouse over the username in the upper right corner and select MyCredentials from the drop-down list.
On the API Credentials page, view the project ID in the project list.
Figure 6-1 Viewing project IDs
----End
6.5 Replication Mode TableReplication mode table
Replication Mode Description Remarks
async Asynchronous N/A
semisync Semi-synchronous N/A
sync Synchronous N/A
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 337
6.6 RDS Monitoring Metrics Description
Function DescriptionThis section describes namespaces, descriptions, and dimensions of monitoringmetrics reported to Cloud Eye. You can query monitoring metrics and alarminformation reported to Cloud Eye over its API.
NamespaceSYS.RDS
Monitoring Metrics
Table 6-4 RDS performance metrics
Metric Name Description Value Range Remarks
rds001_cpu_util
CPU Usage CPU usage ofthemonitoredobject
0%–100% Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds002_mem_util
MemoryUsage
Memoryusage of themonitoredobject
0%–100% Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds003_iops
IOPS Averagenumber ofI/O requestsprocessed bythe system ina specifiedperiod
≥ 0 counts/s Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 338
Metric Name Description Value Range Remarks
rds004_bytes_in
NetworkInputThroughput
Incomingtraffic inbytes persecond
≥ 0 bytes/s Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds005_bytes_out
NetworkOutputThroughput
Outgoingtraffic inbytes persecond
≥ 0 bytes/s Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds006_conn_count
TotalConnections
Total numberofconnectionsthat attemptto connect tothe MySQLserver
≥ 0 counts Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds007_conn_active_count
CurrentActiveConnections
Number ofcurrent activeconnections
≥ 0 counts Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds008_qps
QPS Query timesof SQLstatements(includingstorageprocedures)per second
≥ 0 times/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds009_tps
TPS Executiontimes ofsubmittedand rollbacktransactionsper second
≥ 0 times/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 339
Metric Name Description Value Range Remarks
rds010_innodb_buf_usage
BufferPoolUsage
Ratio of dirtydata to alldata in theInnoDBbuffer
0-1 Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds011_innodb_buf_hit
BufferPool HitRate
Ratio of readhits to readrequests inthe InnoDBbuffer
0-1 Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds012_innodb_buf_dirty
BufferPool DirtyBlock Rate
Ratio of usedpages tototal pages inthe InnoDBbuffer
0-1 Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds013_innodb_reads
InnoDBReadThroughput
Number ofread bytesper second inthe InnoDBbuffer
≥ 0 bytes/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds014_innodb_writes
InnoDBWriteThroughput
Number ofwrite bytesper second inthe InnoDBbuffer
≥ 0 bytes/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds015_innodb_read_count
InnoDBFile ReadFrequency
Number oftimes thatInnoDB readsdata fromfiles persecond
≥ 0 times/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds016_innodb_write_count
InnoDBFile WriteFrequency
Number oftimes thatInnoDBwrites datato files persecond
≥ 0 times/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 340
Metric Name Description Value Range Remarks
rds017_innodb_log_write_req_count
InnoDBLog WriteRequestsper Second
Number ofInnoDB logwriterequests persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds018_innodb_log_write_count
InnoDBLogPhysicalWriteFrequency
Number ofInnoDBphysical writetimes to logfiles persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds019_innodb_log_fsync_count
InnoDBLogfsync()WriteFrequency
Number ofcompletedfsync() writetimes toInnoDB logfiles persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds020_temp_tbl_count
TemporaryTables
Number oftemporarytablesautomaticallycreated onhard diskswhen MySQLstatementsare executed
≥ 0 counts Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds021_myisam_buf_usage
Key BufferUsage
MyISAM keybuffer usage
0-1 Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds022_myisam_buf_write_hit
Key BufferWrite HitRatio
MyISAM keybuffer writehit ratio
0-1 Monitoredobject: databaseMonitoredinstance type:MySQLinstances
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 341
Metric Name Description Value Range Remarks
rds023_myisam_buf_read_hit
Key BufferRead HitRatio
MyISAM keybuffer readhit ratio
0-1 Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds024_myisam_disk_write_count
MyISAMDisk WriteFrequency
Number oftimes thatindexes arewritten todisks persecond
≥ 0 times/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds025_myisam_disk_read_count
MyISAMDisk ReadFrequency
Number oftimes thatindexes areread fromdisks persecond
≥ 0 times/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds026_myisam_buf_write_count
MyISAMBufferPool WriteRequestsper Second
Number ofrequests forwritingindexes intothe MyISAMbuffer poolper second
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds027_myisam_buf_read_count
MyISAMBufferPool ReadRequestsper Second
Number ofrequests forreadingindexes fromthe MyISAMbuffer poolper second
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds028_comdml_del_count
DELETEStatements perSecond
Number ofDELETEstatementsexecuted persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds029_comdml_ins_count
INSERTStatements perSecond
Number ofINSERTstatementsexecuted persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 342
Metric Name Description Value Range Remarks
rds030_comdml_ins_sel_count
INSERT_SELECTStatements perSecond
Number ofINSERT_SELECTstatementsexecuted persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds031_comdml_rep_count
REPLACEStatements perSecond
Number ofREPLACEstatementsexecuted persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds032_comdml_rep_sel_count
REPLACE_SELECTIONStatements perSecond
Number ofREPLACE_SELECTIONstatementsexecuted persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds033_comdml_sel_count
SELECTStatements perSecond
Number ofSELECTstatementsexecuted persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds034_comdml_upd_count
UPDATEStatements perSecond
Number ofUPDATEstatementsexecuted persecond
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds035_innodb_del_row_count
RowDeleteFrequency
Number ofrows deletedfrom theInnoDB tableper second
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds036_innodb_ins_row_count
Row InsertFrequency
Number ofrows insertedinto theInnoDB tableper second
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 343
Metric Name Description Value Range Remarks
rds037_innodb_read_row_count
Row ReadFrequency
Number ofrows readfrom theInnoDB tableper second
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds038_innodb_upd_row_count
RowUpdateFrequency
Number ofrows updatedinto theInnoDB tableper second
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:MySQLinstances
rds039_disk_util
StorageSpaceUsage
Storagespace usageof themonitoredobject
0%–100% Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds040_transaction_logs_usage
Transaction LogsUsage
Storagespace usageoftransactionlogs
≥ 0 MB Monitoredobject: databaseMonitoredinstance type:PostgreSQLinstances
rds041_replication_slot_usage
ReplicationSlot Usage
Storagespace usageof replicationslot files
≥ 0 MB Monitoredobject: databaseMonitoredinstance type:PostgreSQLinstances
rds042_database_connections
DatabaseConnections in Use
Number ofdatabaseconnectionsin use
≥ 0 counts Monitoredobject: databaseMonitoredinstance type:PostgreSQLinstances
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 344
Metric Name Description Value Range Remarks
rds043_maximum_used_transaction_ids
MaximumUsedTransaction IDs
Maximumnumber oftransactionIDs that havebeen used
≥ 0 counts Monitoredobject: databaseMonitoredinstance type:PostgreSQLinstances
rds044_transaction_logs_generations
Transaction LogsGeneration
Size oftransactionlogsgeneratedper second
≥ 0 MB/s Monitoredobject: databaseMonitoredinstance type:PostgreSQLinstances
rds045_oldest_replication_slot_lag
OldestReplicationSlot Lag
Lagging sizeof the mostlaggingreplica interms of WALdata received
≥ 0 MB Monitoredobject: databaseMonitoredinstance type:PostgreSQLinstances
rds046_replication_lag
ReplicationLag
Replicationlag delay
≥ 0 ms Monitoredobject: databaseMonitoredinstance type:PostgreSQLinstances
rds047_disk_total_size
TotalStorageSpace
Total storagespace of themonitoredobject
40–4000 GBFor some users,storage spaceranges from 40 GBto 10,000 GB. Ifyou want to createa DB instance withstorage space upto 6000 GB or scaleup to 10,000 GB,contact customerservice to apply forthe permission.
Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 345
Metric Name Description Value Range Remarks
rds048_disk_used_size
UsedStorageSpace
Used storagespace of themonitoredobject
0–4000 GBFor some users,storage spaceranges from 0 GBto 10,000 GB. Ifyou want to createa DB instance withstorage space upto 6000 GB or scaleup to 10,000 GB,contact customerservice to apply forthe permission.
Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds049_disk_read_throughput
Disk ReadThroughput
Number ofbytes readfrom the diskper second
≥ 0 bytes/s Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds050_disk_write_throughput
Disk WriteThroughput
Number ofbytes writteninto the diskper second
≥ 0 bytes/s Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds051_avg_disk_sec_per_read
Disk ReadTime
Average timerequired foreach diskread in aspecifiedperiod
≥ 0 ms Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 346
Metric Name Description Value Range Remarks
rds052_avg_disk_sec_per_write
Disk WriteTime
Average timerequired foreach diskwrite in aspecifiedperiod
> 0 ms Monitoredobject: ECS.Monitored DBinstance type:● MySQL● PostgreSQL● Microsoft
SQL Server
rds053_avg_disk_queue_length
AverageDiskQueueLength
Number ofprocesses tobe writteninto themonitoredobject
≥ 0 Monitoredobject: ECS.Monitored DBinstance type:● MySQL● Microsoft
SQL Server
rds054_db_connections_in_use
DatabaseConnections in Use
Number ofdatabaseconnectionsin use
≥ 0 counts Monitoredobject: databaseMonitoredinstance type:Microsoft SQLServer instances
rds077_buff_write_rate
BufferPool WriteFrequency
Writefrequency ofthe databasebuffer pool
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:
rds078_buff_read_rate
BufferPool ReadFrequency
Readfrequency ofthe databasebuffer pool
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:
rds079_disk_write_rate
Disk WriteFrequency
Writefrequency ofthe databasedisk
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:
rds080_disk_read_rate
Disk ReadFrequency
Readfrequency ofthe databasedisk
≥ 0 counts/s Monitoredobject: databaseMonitoredinstance type:
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 347
Dimension
Key Value
rds_instance_id Specifies the MySQL DB instance ID.
postgresql_instance_id Specifies the PostgreSQL DB instanceID.
rds_instance_sqlserver_id Specifies the Microsoft SQL Server DBinstance ID.
API Calling
Use APIs to search for RDS monitoring metrics. For details about calling methodsand parameter description, see section "Querying Monitoring Data" in the CloudEye API Reference.
Examples:
● Request/V1.0/{project_id}/metric-data?namespace=SYS.RDS&metric_name=rds001_cpu_usage&dim.0=rds_instance_id,5ea170ad-cc6b-49cd-9020-e94fdbeea391&from=1484123686000&to=1568188853000&period=300&filter=average
● Response:{ "datapoints": [ { "average": 0.35, "timestamp": 1484123400000, "unit": "Ratio" }, { "average": 0.11, "timestamp": 1484123700000, "unit": "Ratio" } ], "metric_name": "rds001_cpu_usage", "httpcode" : 200, "header" : { "Transfer-Encoding" : "chunked", "Server" : "Web Server", "X-Request-Id" : "te-I-CES-APISVR25.id-0418d62a-1e76-46ff-9a5f-9ce40b336e29.ts-1484123744291.c-15046", "X-Content-Type-Options" : "nosniff", "Connection" : "keep-alive", "X-Download-Options" : "noopen", "Date" : "Wed, 11 Jan 2017 08:35:44 GMT", "X-Frame-Options" : "DENY", "Strict-Transport-Security" : "max-age=31536000; includeSubdomains;", "Cache-Control" : "no-cache", "X-XSS-Protection" : "1; mode=block;", "Content-Length" : "165", "Content-Type" : "application/json"
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 348
}}
Relational Database ServiceAPI Reference 6 Appendix
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 349
A Change History
ReleaseDate
Description
2021-01-18 This issue is the twenty-fifth official release, which incorporatesthe following changes:● Added Applying for a Private Domain Name.● Added Modifying a Private Domain Name.● Added Setting a Cross-Region Backup Policy.● Added Querying Information About a Cross-Region Backup
Policy.● Added Querying Information About a Cross-Region Backup
List.● Added Querying Information About DB Instances for
Which Cross-Region Backups Are Created .● Added Querying the Restoration Time Range of a Cross-
Region Backup .● Added the collation parameter to the request and response
in Creating a DB Instance.● Supported dollar signs ($) in the password parameter when a
Microsoft SQL Server DB instance is created.● Added the collation and charge_info parameters to the
request and response in Restoring Data to a New DBInstance.
● Supported instance class changes and storage scale-up forPostgreSQL and Microsoft SQL Server DB instances billed on ayearly/monthly basis.
Relational Database ServiceAPI Reference A Change History
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 350
ReleaseDate
Description
2020-12-15 This issue is the twenty-fourth official release, whichincorporates the following changes:● Added Changing a DB Instance Name.● Added Modify Recycling Policy.● Added Querying Details About Databases.● Added Querying Details About Database Users.● Added Querying Details About Database Schemas.● Added the ha_mode parameter to Querying the Storage
Type of a Database.● Added the template, character_set, and lc_collate
parameters to the request in Creating a Database.● Added the associated_with_ddm parameter to the response
in Querying Details About DB Instances and ObtainingDetails About Backups.
2020-11-16 This issue is the twenty-third official release, which incorporatesthe following changes:● Added the data_vip field to the request in Creating a DB
Instance.● Added the following error codes: DBS.280489 and DBS.
280490.● Added Creating a Database.● Added Creating a Database Account.● Added Creating a Database Schema.● Added Authorizing a Database Account.
2020-10-15 This issue is the twenty-second official release, whichincorporates the following changes:● Added Querying Details About Database Users.● Added Querying Authorized Users of a Specified Database.● Supported instance specification changes for yearly/monthly
DB instances.
Relational Database ServiceAPI Reference A Change History
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 351
ReleaseDate
Description
2020-09-15 This issue is the twenty-first official release, which incorporatesthe following changes: which incorporates the followingchanges:● Added Creating a Database Account.● Added Deleting a Database Account.● Added Authorizing a Database Account.● Added Revoking Permissions of a Database Account.● Added Resetting a Password for a Database Account.● Added the order_id field to the response in Querying Details
About DB Instances.● Added the tags field to the request in Creating a DB
Instance.
2020-08-15 This issue is the twentieth official release, which incorporates thefollowing change:Added Obtaining Task Information of a Specified SQL ServerDB Instance in a Specified Time Range.
2020-07-17 This issue is the nineteenth official release, which incorporatesthe following changes:● Added Creating a Database.● Added Querying Details About Databases.● Added Deleting a Database.
2020-05-30 This issue is the eighteenth official release. Modified thefollowing content:● Added Configuring the Maintenance Window.● Added Changing a Security Group.● Added Obtaining Links for Downloading Slow Query Logs.
2020-05-13 This issue is the seventeenth official release. Modified thefollowing content:● Added Configuring SSL.● Added Changing a Database Port.● Added Changing a Private IP Address.
Relational Database ServiceAPI Reference A Change History
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 352
ReleaseDate
Description
2020-03-31 This issue is the sixteenth official release, which incorporates thefollowing changes:● Brought v1 API documentation offline.● Added Changing the Failover Priority.● Added Manually Switching Primary/Standby DB Instances.● Added Changing the Data Synchronize Model of Primary/
Standby DB Instances.● Added Migrating a Standby DB Instance.● Added Restoring Tables to a Specified Point in Time
(MySQL).● Added Obtaining Slow Query Log Statistics.
2020-03-06 This issue is the fifteenth official release, which incorporates thefollowing changes:● Added Binding and Unbinding an EIP.● Added Resetting a Database Password.
2019-12-17 This issue is the fourteenth official release, which incorporatesthe following changes:● Added backup_used_space and storage_used_space in the
response message in "Querying Details About DB Instances".● Added Querying the Available SQL Server Character Set.
2019-11-30 This issue is the thirteenth official release, which incorporatesthe following changes:● Added tag search criteria in the request in Querying Details
About DB Instances.● Added Adding Tags in Batches.● Added Deleting Tags in Batches.● Added Querying Project Tags.
2019-10-15 This issue is the twelfth official release, which incorporates thefollowing changes:● Added start_time and client_ip in the response message in
Querying Database Slow Logs.● Added Setting SQL Audit.● Added Querying the Policy for SQL Audit Logs.● Added Obtaining an Audit Log List.● Added Obtaining the Link for Downloading an Audit Log.
Relational Database ServiceAPI Reference A Change History
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 353
ReleaseDate
Description
2019-09-20 This issue is the eleventh official release, which incorporates thefollowing changes:● Added az_status in the response message in Querying
Database Specifications.● Added Querying the Storage Type of a Database.
2019-08-31 This issue is the tenth official release. Modified the followingcontent:● Optimized the URI format of v3 APIs and added URI
examples.● Added "API Calling", "Endpoints", "Constraints", and
"Selecting an API Type" to "Before You Start."● Added "Making an API Request", "Authentication", and
"Response" to "Calling APIs."● Changed "parameter group" to "parameter template".● Changed the maximum space capacity to 6000 GB and the
maximum scaling space capacity to 10,000 GB for whitelistedusers when they create MySQL primary DB instances and readreplicas.
2019-08-13 This issue is the ninth official release, which incorporates thefollowing change:Added three v1 APIs for adding, querying, and deleting tags,respectively.
2019-07-03 This issue is the eighth official release, which incorporates thefollowing change:Added the date field in Querying the Restoration Time Range.
2019-05-06 This issue is the seventh official release, which incorporates thefollowing change:Added the precautions that should be taken during themodification of sensitive MySQL parameters.
2019-03-30 This issue is the sixth official release, which incorporates thefollowing change:● Added the STORAGE FULL state in Obtaining Task
Information.
2019-02-15 This issue is the fifth official release, which incorporates thefollowing changes:● Added Rebooting a DB Instance.● Added Querying Database Error Logs.● Added Querying Database Slow Logs.● Described v1 and v3 APIs in separated chapters.
Relational Database ServiceAPI Reference A Change History
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 354
ReleaseDate
Description
2018-11-20 This issue is the fourth official release, which incorporates thefollowing changes:● Added Obtaining a Parameter Template List.● Added Obtaining the Parameter Template of a Specified
DB Instance.● Added Obtaining Parameters in a Specified Parameter
Template.● Added Creating a Parameter Template.● Added Applying a Parameter Template.● Added Modifying a Parameter Template.● Added Modifying Parameters of a Specified DB Instance.● Added Deleting a Parameter Template.● Added Querying the Restoration Time Range.● Modified Restoring Data to a New DB Instance.● Modified Restoring Data to an Existing DB Instance.● Modified Creating a DB Instance.● Added the AK/SK authentication.● Added the following error codes: DBS.200203, DBS.200506,
and DBS.212032.
2018-09-30 This issue is the third official release, which incorporates thefollowing changes:● Added Creating a DB Instance.● Added Deleting a DB Instance.● Added Querying Details About DB Instances.● Added Obtaining Task Information.● Added Setting an Automated Backup Policy.● Added Obtaining an Automated Backup Policy.● Added Creating a Manual Backup.● Added Creating a Manual Backup.● Added Obtaining Details About Backups.● Added Deleting a Manual Backup.● Added Restoring Data to a New DB Instance.● Added Restoring Data to an Existing DB Instance.● Added v3 error codes.● Added v3 abnormal responses.
Relational Database ServiceAPI Reference A Change History
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 355
ReleaseDate
Description
2018-06-15 This issue is the second official release, which incorporates thefollowing changes:● Modified the value range of keepDays in sections Creating a
DB Instance, Obtaining a DB Instance List, Obtaining DetailedInformation of a Specified DB Instance, and Restoring Data toa New DB Instance.
● Modified the value range of keepday in sections Setting anAutomated Backup Policy and Obtaining an AutomatedBackup Policy.
2018-05-04 This issue is the first official release.
Relational Database ServiceAPI Reference A Change History
Issue 25 (2021-01-18) Copyright © Huawei Technologies Co., Ltd. 356