Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
29 KiB
Testing Connections in Batches (Cluster Mode)
Function
- This API is used to test connections in cluster mode.
Constraints
After the task is created, you can test the connection only when the task status is CONFIGURATION.
URI
POST /v3/{project_id}/jobs/cluster/batch-connection
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
Yes |
String |
The content type. The default value is application/json. |
X-Auth-Token |
Yes |
String |
User token obtained from IAM. |
X-Language |
No |
String |
Request language type Default value: en-us Values:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
jobs |
Yes |
Array of BatchJobActionReq objects |
Requests for testing cluster connections in batches. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
Yes |
String |
Specific operation to be performed. |
job_id |
Yes |
String |
Task ID. (In cluster mode, the value is the ID of the parent task.). |
property |
Yes |
String |
The parameter that corresponds to the operation. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
dbtype |
Yes |
String |
Database type. |
dbport |
Yes |
Integer |
Database port. The value is 0 for the MongoDB engine. |
ssllink |
Yes |
boolean |
Whether the connection is an SSL connection. Valid values:
|
nettype |
Yes |
String |
Network type. Valid values:
|
endpointtype |
Yes |
String |
Endpoint type. Valid values:
|
ip |
Yes |
String |
Database IP address. |
dbName |
Yes |
String |
Database name. |
dbuser |
Yes |
String |
Database username. |
dbpassword |
Yes |
String |
Database password. |
sslcertkey |
No |
String |
Content of the SSL certificate. This parameter is required for SSL connection. |
sslcertname |
No |
String |
Name of the SSL certificate. This parameter is required for SSL connection. |
sslcertchecksum |
No |
String |
Checksum value of the SSL certificate content, which is required for SSL connections. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
results |
Array of CheckJobResp objects |
Response body set for the batch test connection. |
count |
Integer |
Total number of records. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
status |
String |
Test result. Value:
|
error_code |
String |
Error code, which is optional and indicates the returned information about the failure status. |
error_msg |
String |
Error message, which is optional and indicates the returned information about the failure status. |
success |
Boolean |
Whether the request is successful. |
Example Request
- Example of testing the connection to the source DDS cluster.
https://{EndPoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/cluster/batch-connection
{ "jobs" : [ { "action" : "testConnection", "job_id" : "35d0d60b-4605-4686-b35d-3a3d059fjb15", "property" : "[{\"dbtype\":\"mongodb\",\"dbport\":0,\"ssllink\":false,\"nettype\":\"eip\",\"endpointtype\":\"so\",\"encrypt\":{\"elementId\":\"encrypt_switch\",\"offLabel\":\"OFF\",\"onLabel\":\"ON\",\"disable\":false,\"ip\":\"192.168.7.217:8635\",\"dbName\":\"admin\",\"dbuser\":\"rwuser\",\"dbpassword\":\"xxxx\"},{\"dbtype\":\"mongodb\",\"dbport\":0,\"ssllink\":false,\"nettype\":\"eip\",\"endpointtype\":\"so\",\"encrypt\":{\"elementId\":\"encrypt_switch\",\"offLabel\":\"OFF\",\"onLabel\":\"ON\",\"disable\":false,\"ip\":\"192.168.7.72:8635\",\"dbName\":\"admin\",\"dbuser\":\"rwuser\",\"dbpassword\":\"xxxx\"},{\"ip\":\"192.168.7.37:8635\",\"nettype\":\"eip\",\"dbtype\":\"mongodb\",\"dbport\":0,\"dbuser\":\"rwuser\",\"dbpassword\":\"xxxx\",\"ssllink\":false,\"sslcertkey\":\"\",\"sslcertname\":\"\",\"sslcertchecksum\":\"\",\"endpointtype\":\"ls\",\"dbName\":\"admin\"}]" } ] }
Example Response
Status code: 200
OK
{ "results" : [ { "id" : "0eb704d0-5a1c-4cbd-b675-91152f06jb11", "status" : "true" } ], "count" : 1 }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Code
For details, see Error Code.