Updated on 2022-09-15 GMT+08:00

Creating a Link

Function

This API is used to create a link.

URI

POST /v1.1/{project_id}/clusters/{cluster_id}/cdm/link

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

cluster_id

Yes

String

Cluster ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

validate

No

String

When the parameter is set to true, the API only validates whether the parameters are correctly configured, but does not create any link.

Request Parameters

Response Parameters

Status code: 200

Status code: 400

Status code: 500

Example Requests

POST /v1.1/1551c7f6c808414d8e9f3c514a170f2e/clusters/6ec9a0a4-76be-4262-8697-e7af1fac7920/cdm/link

{
  "links" : [ {
    "link-config-values" : {
      "configs" : [ {
        "inputs" : [ {
          "name" : "linkConfig.databaseType",
          "value" : "MYSQL"
        }, {
          "name" : "linkConfig.host",
          "value" : "100.94.8.163"
        }, {
          "name" : "linkConfig.port",
          "value" : "3306"
        }, {
          "name" : "linkConfig.database",
          "value" : "DB_name"
        }, {
          "name" : "linkConfig.username",
          "value" : "username"
        }, {
          "name" : "linkConfig.password",
          "value" : "DB_password"
        }, {
          "name" : "linkConfig.fetchSize",
          "value" : "100000"
        }, {
          "name" : "linkConfig.usingNative",
          "value" : false
        } ],
        "name" : "linkConfig"
      } ]
    },
    "name" : "mysql_link",
    "creation-date" : 1496654788622,
    "connector-name" : "generic-jdbc-connector",
    "update-date" : 1496654788622,
    "enabled" : true
  } ]
}

Example Responses

Status code: 200

OK

{
  "name" : "rdb_link",
  "validation-result" : [ { } ]
}

Status code: 400

Request error.

{
  "code" : "Cdm.0315",
  "errCode" : "Cdm.0315",
  "message" : "Link name [ftp_link] already exist or created by other user.",
  "externalMessage" : "Link name [ftp_link] already exist or created by other user."
}

Status code: 500

An internal service error occurred. For details, see error codes.

{
  "validation-result" : [ {
    "linkConfig" : [ {
      "message" : "Can't connect to the database with given credentials: The authentication type 12 is not supported. Check that you have configured the pg_hba.conf file to include the client's IP address or subnet, and that it is using an authentication scheme supported by the driver.",
      "status" : "ERROR"
    } ]
  } ]
}

Status Codes

Error Codes

See Error Codes.