Importing a Connection
Function
This API is used to import one or more connection files from OBS to the Data Development module. Before using this API, store connection files in OBS buckets.
- Parameter description
Table 1 URI parameter description Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.
Request Message
The parameters are described as follows:
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| path | Yes | String | With OBS deployed: OBS path for storing the connection definition file. For details about the format of the job definition file, see the response message of the exported connection. Without OBS deployed deployed: local path for storing the connection definition file. |
| params | No | List<Params> | Connection parameter. By default, this parameter is left blank. |
| sameNamePolicy | No | String | Policy for specifying how to handle duplicate names. The options are as follows:
|
Params connection parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Name of the connection. |
| type | Yes | String | Connection type. |
| params | No | Map<String,Stri ng> | Connection parameter. For details about parameter names, see the description of each type of connection configuration item. By default, this parameter is left blank. |
Response Message
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| taskId | Yes | String | ID of the task. Used to call the API for querying system tasks to obtain the import status. |
Example
Import a connection.
- Request
POST /v1/b384b9e9ab9b4ee8994c8633aabc9505/connections/import
{ "path":"obs://00zyx/2019-07-02/DLF_All_DataConnections.zip", "sameNamePolicy":"OVERWRITE", "params":[ { "name":"cloudTable", "type":"CloudTable", "params":{ "clusterName":"cluster1" } }, { "name":"hive", "type":"HIVE", "params":{ "clusterName":"mrs_ymcc", "connectionMethod":"agent", "userName":"admin", "agentName":"cdm-donotdelete", "kmsKey":"KMS-42ab" } } ] }
- Success response
{ "taskId":"008aae2e675933c7016759418e870000" } - Failure response
{ "error_code":"DLF.0815", "error_msg":"Fail to read OBS file." }
Status Codes
For details about status codes, see Status Codes.
Last Article: Exporting a Connection
Next Article: Script Development APIs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.