Querying Remote Databases
Function
This API is used to query remote databases when subscribing to remote SQL Server instances.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about request header parameters.
Authorization Information
- If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
rds:instance:update |
write |
- |
- |
rds:instance:modify |
- |
URI
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID of a tenant in a region.
To obtain the value, see Obtaining a Project ID.
Constraints
The value cannot be empty.
Range
N/A
Default Value
N/A
instance_id
Yes
Definition
Instance ID.
Constraints
The value cannot be empty.
Range
N/A
Default Value
N/A
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
server_ip |
Yes |
String |
Definition IP address of the remote database. Constraints N/A Range The value must be in the IP address format. Default Value N/A |
|
server_port |
Yes |
String |
Definition Port of the remote database. Constraints N/A Range N/A Default Value N/A |
|
login_user_name |
Yes |
String |
Definition User for logging in to the remote database. Constraints N/A Range N/A Default Value N/A |
|
login_user_password |
Yes |
String |
Definition Password for the database user. Constraints N/A Range N/A Default Value N/A |
|
offset |
No |
int |
Definition Index offset. The query starts from the next piece of data indexed by this parameter. Constraints N/A Range The value must be a non-negative number. Default Value 0: The query starts from the first data record. |
|
limit |
No |
int |
Definition Number of records returned by a query. Constraints N/A Range 1–100 Default Value 10 |
Example Request
POST https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/72ee4cc4607347049df9ad50f615bbd8in04/replication/remote-databases
{
"server_ip": "xx.x.x.x",
"server_port": "1433",
"login_user_name": "user1",
"login_user_password": "passs1",
}
Response
- Normal response
Table 3 Parameters Parameter
Type
Description
databases
Array of objects
Definition
Each element in the list indicates a database.
For details, see Table 4.
total_count
Integer
Definition
Total number of databases.
Range
N/A
Table 4 databases parameters Parameter
Type
Description
name
String
Definition
Database name.
Range
N/A
character_set
String
Definition
Character set used by the database.
Range
For details about the character sets supported by SQL Server, see Table 2.
Example value: Chinese_PRC_CI_AS
state
String
Definition
Database status.
Range
- Creating: The database is being created.
- Running: The database is running.
- Deleting: The database is being deleted.
- NotExists: The database does not exist.
- 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" } ], "total_count": 6 }
- Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot