Creating a Data Connection
Function
This API is used to create a data connection.
URI
POST /v2/{project_id}/data-connectors
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Explanation Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. Constraints N/A Value range The value must consist of 1 to 64 characters. Only letters and digits are allowed. Default value N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
data_connector |
Yes |
object |
Explanation Data connection. For details, see Table 3. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
connector_name |
Yes |
String |
Explanation Data connection name. Value range N/A |
source_type |
Yes |
String |
Explanation Data connection type. Value range
|
source_info |
Yes |
String |
Explanation Data source information, which is in JSON format. Value range N/A |
Response Parameters
Status code: 201
Parameter |
Type |
Description |
---|---|---|
connector_id |
String |
Explanation Data connection ID returned after a data connection is created. Value range N/A |
Example Request
Create a MySQL data connection.
/v2/ac66f1a5-e8f4-4399-8ec6-2c8cb1aefda7/data-connector { "data_connector" : { "connector_name" : "mrs-mysql-connector", "source_type" : "RDS_MYSQL", "source_info" : "{\"db_name\":\"default\",\"user_name\":\"mrs\",\"password\":\"*****\",\"rds_instance_id\":\"3aa55f1cb4c3491686936130f21e9f16in01\"}" } }
Example Response
Status code: 201
Data connection created successfully.
{ "connector_id" : "0822239c1e80d4502f82c008937da9b5" }
Status Codes
See Status Codes.
Error Codes
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