CreateConnection

更新时间:
复制 MD 格式

Creates a connection configuration.

Operation description

用于创建连接配置信息。

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eventbridge:CreateConnection

create

*Connection

acs:eventbridge:{#regionId}:{#accountId}:connection/*

None None

Request parameters

Parameter

Type

Required

Description

Example

ConnectionName

string

Yes

The name of the connection configuration. The name must be 2 to 127 characters in length.

connection-name

Description

string

No

The description of the connection configuration. The description can be up to 255 characters in length.

demo

NetworkParameters

object

Yes

The network configuration.

NetworkType

string

Yes

  • 公网 :PublicNetwork

  • 专有网络 :PrivateNetwork

Important 选择专有网络时,VpcId、VswitcheId 和 SecurityGroupId 必填。

PublicNetwork

VpcId

string

No

专有网络 VPC 的 ID。

eb-test/vpc-bp1symadadwnwg****

VswitcheId

string

No

交换机 ID。

vsw-bp1iu4x7aeradadown1og8,vsw-bp193sqmadadlaszpeq****

SecurityGroupId

string

No

安全组 ID。

eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9****

Type

string

No

The connection type. Valid values: MySQL, PostgreSQL, Elasticsearch, and Http. This parameter is required for data source connections. If you do not specify this parameter, the default value Http is used. The Http type is used for HTTP-based targets such as API destinations. Data source types are used for data connections in the integration marketplace.

Http

Parameters

any

No

The data source connection parameters in a JSON object. This parameter is required when Type is a data source type. This parameter is not required for the Http type. For field definitions, call the GetConnectionType operation and refer to ParamsSchema in the response.

{"HostName":"xxx.mysql.rds.aliyuncs.com","Port":"3306","User":"root","Password":"xxx","DatabaseName":"demo_db"}

AuthParameters

object

No

The authentication configuration.

AuthorizationType

string

No

鉴权类型 :

  • BASIC:BASIC_AUTH。这种授权方式是浏览器遵守 HTTP 协议实现的基本授权方式,HTTP 协议进行通信的过程中,HTTP 协议定义了基本认证允许 HTTP 服务器对客户端进行用户身份证的方法。在请求头中添加 Authorization :Basic 空一格 Base64 加密(用户名:密码)固定格式。Username 和 Password 是必填的。

  • API KEY :API_KEY_AUTH。固定的格式在请求头中添加 Token :Token 值。ApiKeyName 和 ApiKeyValue 是必填的。

  • OAUTH :OAUTH_AUTH。OAuth2.0 是一种授权机制,正常情况,不使用 OAuth2.0 等授权机制的系统,客户端是可以直接访问资源服务器的资源的,为了用户安全访问数据,在访问中间添加了 Access Token 机制。客户端需要携带 Access Token 去访问受到保护的资源。所以 OAuth2.0 确保了资源不被恶意客户端访问,从而提高了系统的安全性。AuthorizationEndpoint、OAuthHttpParameters 和 HttpMethod 是必填的。

BASIC_AUTH

ApiKeyAuthParameters

object

No

API KEY 的数据结构。

ApiKeyName

string

No

Api key 的 key 值。

Token

ApiKeyValue

string

No

Api key 的 value 值。

adkjnakddh****

BasicAuthParameters

object

No

Basic 鉴权的数据结构。

Password

string

No

basic 鉴权的密码。

*******

Username

string

No

basic 鉴权的用户名。

admin

OAuthParameters

object

No

OAuth 鉴权参数数据结构。

AuthorizationEndpoint

string

No

授权的终端节点地址。最大长度 127 个字符。

http://localhost:8080/oauth/token

ClientParameters

object

No

客户参数数据结构。

ClientID

string

No

The client ID.

ClientID

ClientSecret

string

No

The client secret of the application.

Qo57Q~F249~S74GmNPA36pZJoJK4f4LY****

HttpMethod

string

No

探测类型的方法。取值:

  • GET

  • POST

  • HEAD

  • DELETE

  • PUT

  • PATCH

POST

OAuthHttpParameters

object

No

Oauth 鉴权的请求参数。

BodyParameters

array<object>

No

The list of data structures for body request parameters.

object

No

The data structure of a body request parameter.

IsValueSecret

string

No

Whether it is used for authentication.

false

Key

string

No

The key of the body request parameter.

keyDemo

Value

string

No

The value of the body request parameter.

keyValue

HeaderParameters

array<object>

No

The list of header parameters.

object

No

The data structure of a header parameter.

IsValueSecret

string

No

Whether it is used for authentication.

false

Key

string

No

The key of the header parameter.

keyDemo

Value

string

No

The value of the header parameter.

keyValue

QueryStringParameters

array<object>

No

The data structure of query string parameters.

object

No

The data structure of a query string parameter.

IsValueSecret

string

No

Whether it is used for authentication.

false

Key

string

No

The key of the query string parameter.

keyDemo

Value

string

No

The value of the query string parameter.

valueDemo

Response elements

Element

Type

Description

Example

object

RequestId

string

阿里云为该请求生成的唯一标识符。

7DA60DED-CD36-5837-B848-C01A23D2****

Message

string

附加信息。取值说明如下:请求正常,返回 success。 请求异常,返回具体异常错误码。

success

Code

string

接口状态或 POP 错误码。取值说明如下:Success:成功。

Success

Data

object

返回结果。

ConnectionName

string

连接配置名称。

connection-demo

Examples

Success response

JSON format

{
  "RequestId": "7DA60DED-CD36-5837-B848-C01A23D2****",
  "Message": "success",
  "Code": "Success",
  "Data": {
    "ConnectionName": "connection-demo"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

500 InternalError InternalError
409 RequestParameterException Request parameter exception
409 ConnectionAlreadyExist The Connection already existed!
409 ConnectionCountExceedLimit The current count of connection, which will exceed the limit quota.
409 BasicRequiredParameterIsEmpty Basic required parameters are empty, the required parameters are username and password!
409 BasicUserNameLengthExceed Basic username length cannot exceed 127!
409 BasicPassWordLengthExceed Basic password length cannot exceed 127!
409 ApiKeyRequiredParameterIsEmpty Api Key required parameters are empty, the required parameters are apiKeyName and apiKeyValue!
409 ApiKeyNameLengthExceed Api key name length cannot exceed 127!
409 ApiKeyValueLengthExceed Api key value length cannot exceed 127!
409 OAuthRequiredParameterIsEmpty OAuth required parameters are empty, the required parameters are authorizationEndpoint and httpMethod!
409 AuthorizationEndpointLengthExceed Authorization endpoint length cannot exceed 127!
409 ClientIDLengthExceed ClientID length cannot exceed 127!
409 ClientSecretLengthExceed ClientSecret length cannot exceed 127!
409 OauthHttpParametersEmpty OauthHttpParameters is Empty.
409 SecretManagerAPICreateSecretNameFailed Create secret manager api secret name failed

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.