GetConnection

更新时间:
复制 MD 格式

Queries the configuration information of a single connection.

Operation description

Queries the configuration information of a single connection.

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:GetConnection

get

*Connection

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

None None

Request parameters

Parameter

Type

Required

Description

Example

ConnectionName

string

Yes

The name of the connection.

connection-name

Response elements

Element

Type

Description

Example

object

RequestId

string

The returned request ID.

34AD682D-5B91-5773-8132-AA38C130****

Message

string

The information returned by the API request.

success

Code

string

The API status or POP error code. Valid values: Success: The request was successful.

Success

HttpCode

integer

The HTTP status code.

200

Data

object

The returned result.

Connections

array<object>

The list of connection configuration information.

array<object>

The data structure of the connection configuration information.

ConnectionName

string

The name of the connection configuration.

demo

Id

integer

The data source ID.

5668

Description

string

The description of the connection configuration.

demo

Type

string

The connection type. Valid values: Http, MySQL, PostgreSQL, Elasticsearch.

Http

Parameters

any

The data source connection parameters (JSON object). This parameter is returned only for data source type connections, and is empty for the Http type. For field definitions, refer to ParamsSchema returned by GetConnectionType.

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

GmtCreate

integer

The creation time.

1669648905

NetworkParameters

object

The data structure of the network configuration.

NetworkType

string

  • Public network: PublicNetwork

  • Virtual private cloud (VPC): PrivateNetwork

PublicNetwork

VpcId

string

The ID of the virtual private cloud (VPC).

eb-test/vpc-bp1symadadwnwg****

VswitcheId

string

The vSwitch ID.

vsw-bp1iu4x7aeradadown****,vsw-bp193sqmadadlaszpeq****

SecurityGroupId

string

The security group ID.

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

AuthParameters

object

The data structure of the authorization.

AuthorizationType

string

The authorization type. Valid values:

  • BASIC: BASIC_AUTH

  • API KEY: API_KEY_AUTH

  • OAUTH: OAUTH_AUTH

BASIC_AUTH

ApiKeyAuthParameters

object

The data structure of the API key.

ApiKeyName

string

The key of the API key.

key

ApiKeyValue

string

The value of the API key.

value

BasicAuthParameters

object

The data structure of basic authentication.

Password

string

The password for basic authentication.

********

Username

string

The username for basic authentication.

admin

OAuthParameters

object

The data structure of the OAuth request parameters.

AuthorizationEndpoint

string

The endpoint for OAuth to obtain the token.

http://localhost:8080/oauth/token

HttpMethod

string

The HTTP request method. Valid values:

  • GET

  • POST

  • HEAD

POST

ClientParameters

object

The data structure of the client parameters.

ClientID

string

The client ID.

ClientID

ClientSecret

string

The client secret of the application.

Qo57Q~F249~S74GmNPA36pZJoJK4f4****

OAuthHttpParameters

object

The request parameters for OAuth authentication.

BodyParameters

array<object>

The list of request parameter data structures.

object

The list of request parameter data structures.

IsValueSecret

string

Specifies whether it is used for authentication.

false

Key

string

The key of the body request parameter.

keyDemo

Value

string

The value of the body request parameter.

valueDemo

HeaderParameters

array<object>

The list of request header parameters.

object

The list of request header parameters.

IsValueSecret

string

Specifies whether it is used for authentication.

false

Key

string

The key of the request header parameter.

keyDemo

Value

string

The value of the request header parameter.

keyDemo

QueryStringParameters

array<object>

The data structure of the request path parameters.

object

The data structure of the request path parameters.

IsValueSecret

string

Specifies whether it is used for authentication.

false

Key

string

The key of the request path parameter.

keyDemo

Value

string

The value of the request path parameter.

valueDemo

Examples

Success response

JSON format

{
  "RequestId": "34AD682D-5B91-5773-8132-AA38C130****",
  "Message": "success",
  "Code": "Success",
  "HttpCode": 200,
  "Data": {
    "Connections": [
      {
        "ConnectionName": "demo",
        "Id": 5668,
        "Description": "demo",
        "Type": "Http",
        "Parameters": "{\"HostName\":\"xxx.mysql.rds.aliyuncs.com\",\"Port\":\"3306\",\"User\":\"root\",\"Password\":\"xxx\",\"DatabaseName\":\"demo_db\"}",
        "GmtCreate": 1669648905,
        "NetworkParameters": {
          "NetworkType": "PublicNetwork",
          "VpcId": "eb-test/vpc-bp1symadadwnwg****",
          "VswitcheId": "vsw-bp1iu4x7aeradadown****,vsw-bp193sqmadadlaszpeq****",
          "SecurityGroupId": "eb-167adad548759-security_grop/sg-bp1addad26peuh9qh9****"
        },
        "AuthParameters": {
          "AuthorizationType": "BASIC_AUTH",
          "ApiKeyAuthParameters": {
            "ApiKeyName": "key",
            "ApiKeyValue": "value"
          },
          "BasicAuthParameters": {
            "Password": "********",
            "Username": "admin"
          },
          "OAuthParameters": {
            "AuthorizationEndpoint": "http://localhost:8080/oauth/token",
            "HttpMethod": "POST",
            "ClientParameters": {
              "ClientID": "ClientID",
              "ClientSecret": "Qo57Q~F249~S74GmNPA36pZJoJK4f4****"
            },
            "OAuthHttpParameters": {
              "BodyParameters": [
                {
                  "IsValueSecret": "false",
                  "Key": "keyDemo",
                  "Value": "valueDemo"
                }
              ],
              "HeaderParameters": [
                {
                  "IsValueSecret": "false",
                  "Key": "keyDemo",
                  "Value": "keyDemo"
                }
              ],
              "QueryStringParameters": [
                {
                  "IsValueSecret": "false",
                  "Key": "keyDemo",
                  "Value": "valueDemo"
                }
              ]
            }
          }
        }
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

500 InternalError InternalError
409 RequestParameterException Request parameter exception
409 ConnectionNotExist The Connection name not existed!

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.