Testing Connections in Batches
Function
This API is used to test connections in batches.
Constraints
- After the task is created, you can test the connection only when the task status is CONFIGURATION.
URI
POST /v3/{project_id}/jobs/batch-connection
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID of a tenant in a region For details about how to obtain the project ID, see Obtaining a Project ID. |
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 objects |
List of requests for testing connections in batches. For details, see Table 4. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
Yes |
String |
DRS task ID, which can be obtained from the task list or task details page. |
net_type |
Yes |
String |
Network type. Value:
|
db_type |
Yes |
String |
Database type. Value:
|
ip |
Yes |
String |
Database IP address. |
db_port |
No |
Integer |
Database port number. This parameter must be set to 0 for the Mongo and DDS databases. |
inst_id |
No |
String |
DB instance ID. This parameter is mandatory when the database is a cloud instance, for example, an RDS instance. |
db_user |
Yes |
String |
Database account. |
db_password |
Yes |
String |
Database password. |
ssl_link |
No |
Boolean |
Whether SSL is enabled. If this parameter is set to true, you need to set parameters related to the SSL certificate. |
ssl_cert_key |
No |
String |
SSL certificate content, which is a character string encrypted using BASE64 after the SSL certificate is obtained. This parameter is mandatory when ssl_link is set to true. |
ssl_cert_name |
No |
String |
SSL certificate name. This parameter is mandatory when ssl_link is set to true. |
ssl_cert_check_sum |
No |
String |
The checksum value of the SSL certificate content encrypted using SHA256 after the SSL certificate is obtained, which is used for backend verification. This parameter is mandatory when ssl_link is set to true. |
ssl_cert_password |
No |
String |
The SSL certificate password. The certificate file name extension is .p12 and requires a password. |
vpc_id |
No |
String |
ID of the VPC where the database is located. This parameter is mandatory when the network type is set to VPC. |
subnet_id |
No |
String |
ID of the subnet where the database is located. This parameter is mandatory when the network type is set to VPC. |
end_point_type |
Yes |
String |
Source database: so. Destination database: ta. Default value: so Values:
|
region |
No |
String |
Region where the DB instance is located. This parameter is mandatory when the database is a cloud instance, for example, an RDS instance. |
project_id |
No |
String |
Project ID of the region where the user is located. |
db_name |
No |
String |
Database user name, which is the DDS authentication database. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
results |
Array of objects |
Response body set for the batch test connection. For details, see Table 6. |
count |
Integer |
Total number of records. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Task ID. |
status |
String |
Test result. Value:
|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
success |
Boolean |
Whether the request is successful. |
Example Request
- Testing connections for a DDS real-time migration task in which the destination database is DDS
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-connection { "jobs" : [ { "id" : "140b5236-88ad-43c8-811c-1268453jb101", "ip" : "192.168.4.66:8635,192.168.4.83:8635", "net_type" : "eip", "db_type" : "mongodb", "db_port" : 0, "db_user" : "root", "db_password" : "********", "inst_id" : "3cadd5a0ef724f55ac7fa5bcb5f4fc5fin02", "project_id" : "0549a6a31000d4e82fd1c00c3d6f2d76", "region" : "region-1", "end_point_type" : "ta" } ] }
- Testing connections for an RDS for MySQL real-time migration task in which the destination database is RDS for MySQL
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-connection { "jobs" : [ { "id" : "140b5236-88ad-43c8-811c-1268453jb101", "ip" : "192.168.0.131", "net_type" : "eip", "db_type" : "mysql", "db_port" : 3306, "db_user" : "root", "db_password" : "********", "inst_id" : "e05a3679efe241d8b5dee80b17c1a863in01", "project_id" : "054ba152d480d55b2f5dc0069e7ddef0", "region" : "region-1", "end_point_type" : "ta" } ] }
- Testing connections for a MySQL real-time migration task in which the source database is not RDS
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-connection { "jobs" : [ { "id" : "140b5236-88ad-43c8-811c-1268453jb101", "ip" : "192.168.0.27", "net_type" : "eip", "db_type" : "mysql", "db_port" : 3306, "db_user" : "root", "db_password" : "********", "ssl_link" : false, "end_point_type" : "so" } ] }
- Creating a real-time synchronization task from MySQL to Kafka and setting the Kafka authentication mode to PLAINTEXT
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-connection { "jobs": [ { "id": "3bc38fe4-da50-4aad-903e-5db76d8jb20i", "ip": "xxxxxxx:xxxx", "net_type": "eip", "db_type": "kafka", "project_id": "5237e10fe9aa4ad5b16b6a5245248314", "end_point_type": "ta", "kafka_security_config": { "type": "PLAINTEXT" } } ] }
- Creating a real-time synchronization task from MySQL to Kafka and setting the Kafka authentication mode to SASL_PLAINTEXT
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-connection { "jobs": [ { "id": "3bc38fe4-da50-4aad-903e-5db76d8jb20i", "ip": "xxxxxxx:xxxx", "net_type": "eip", "db_type": "kafka", "db_user": "xxxxxxx", "db_password": "xxxxxxx", "project_id": "5237e10fe9aa4ad5b16b6a5245248314", "end_point_type": "ta", "kafka_security_config": { "type": "SASL_PLAINTEXT", "sasl_mechanism": "PLAIN" } } ] }
- Creating a real-time synchronization task from MySQL to Kafka and setting the Kafka authentication mode to SSL
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-connection { "jobs": [ { "id": "3bc38fe4-da50-4aad-903e-5db76d8jb20i", "ip": "xxxxxxx:xxxx", "net_type": "eip", "db_type": "kafka", "project_id": "5237e10fe9aa4ad5b16b6a5245248314", "end_point_type": "ta", "kafka_security_config": { "type": "SSL", "trust_store_key_name": "client.truststore.jks", "trust_store_key": "xxxxxx", "trust_store_password": "xxxxxx", "endpoint_algorithm": "", "enable_key_store": false } } ] }
- Creating a real-time synchronization task from MySQL to Kafka and setting the Kafka authentication mode to SASL_SSL
https://{endpoint}/v3/054ba152d480d55b2f5dc0069e7ddef0/jobs/batch-connection { "jobs": [ { "id": "3bc38fe4-da50-4aad-903e-5db76d8jb20i", "ip": "xxxxxxx:xxxx", "net_type": "eip", "db_type": "kafka", "db_user": "xxxxxxx", "db_password": "xxxxxxx", "project_id": "5237e10fe9aa4ad5b16b6a5245248314", "end_point_type": "ta", "kafka_security_config": { "type": "SSL", "trust_store_key_name": "client.truststore.jks", "trust_store_key": "xxxxxx", "trust_store_password": "xxxxxx", "endpoint_algorithm": "", "enable_key_store": false } } ] }
Example Response
Status code: 200
OK
{ "results" : [ { "success" : true, "id" : "140b5236-88ad-43c8-811c-1268453jb101", "status" : "success" } ], "count" : 1 }
Status Code
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
Error Code
For details, see Error Code.
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