GetConnection

Updated at:

Retrieves the details of a 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

paiworkspace:GetConnection

get

*All Resource

*

None None

Request syntax

GET /api/v1/connections/{ConnectionId} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

ConnectionId

string

Yes

The connection ID. For more information about how to obtain a connection ID, see ListConnections.

conn-pai9m***mi47

Request parameters

Parameter

Type

Required

Description

Example

EncryptOption

string

No

The encryption setting. Valid values:

  • PlainText: The value is in plaintext.

  • Secret: The value is in ciphertext.

PlainText

Response elements

Element

Type

Description

Example

object

The response.

RequestId

string

The unique ID of the request.

5A14FA81-DD4E-******-6343FE44B941

WorkspaceId

string

The workspace ID.

11**43

Accessibility

string

The visibility of the resource. Valid values:

  • PUBLIC: All members in the current workspace can access the resource.

  • PRIVATE: Only the creator can access the resource.

PRIVATE

ConnectionId

string

The connection ID.

conn-pai9m***mi47

ConnectionType

string

The type of the connection. Valid values:

  • DashScopeConnection: A connection to a Model Studio service.

  • OpenLLMConnection: A connection to an open-source model.

  • MilvusConnection: A connection to Milvus.

  • OpenSearchConnection: A connection to OpenSearch.

  • LindormConnection: A connection to Lindorm.

  • ElasticsearchConnection: A connection to Elasticsearch.

  • HologresConnection: A connection to Hologres.

  • RDSConnection: A connection to RDS.

  • CustomConnection: A custom connection.

OpenSearchConnection

ConnectionName

string

The name of the connection.

数据库连接

Description

string

The description of the connection.

用于数据集检索。

Configs

object

The configuration information of the connection.

string

The value of a connection configuration.

12345

Secrets

object

The key-value pairs that need to be encrypted. Examples include the logon password for a database and the key for a model connection.

string

The value of an encrypted connection configuration.

Dsjk***hsl01

GmtCreateTime

string

The UTC time when the connection was created. The time is in the ISO 8601 format.

2025-03-07T07:54:56Z

GmtModifiedTime

string

The UTC time when the connection was last modified. The time is in the ISO 8601 format.

2025-03-07T07:54:56Z

Creator

string

The creator of the connection.

28632***898231

ResourceMeta

object

The instance resource information of the connection. This parameter is typically used for database connections.

InstanceId

string

The instance ID.

ld-2vc1***v1zaqgzol

InstanceName

string

The instance name.

测试实例。

Extra

string

Additional configuration information.

{"vpcId":"vpc-xxxx"}

Models

array<object>

The list of models. This parameter is applicable to connections of the model service type.

object

The model information.

Model

string

The model identifier.

model_001

DisplayName

string

The display name of the model.

测试语言模型。

ModelType

string

The model type. Valid values:

  • LLM: A large language model (LLM).

  • Embedding: An embedding model.

  • ReRank: A reranking model.

LLM

ToolCall

boolean

Indicates whether tool calling is supported. Valid values:

  • true: Tool calling is supported.

  • false: Tool calling is not supported.

true

Examples

Success response

JSON format

{
  "RequestId": "5A14FA81-DD4E-******-6343FE44B941",
  "WorkspaceId": "11**43",
  "Accessibility": "PRIVATE",
  "ConnectionId": "conn-pai9m***mi47",
  "ConnectionType": "OpenSearchConnection",
  "ConnectionName": "数据库连接",
  "Description": "用于数据集检索。",
  "Configs": {
    "key": "12345"
  },
  "Secrets": {
    "key": "Dsjk***hsl01"
  },
  "GmtCreateTime": "2025-03-07T07:54:56Z",
  "GmtModifiedTime": "2025-03-07T07:54:56Z",
  "Creator": "28632***898231",
  "ResourceMeta": {
    "InstanceId": "ld-2vc1***v1zaqgzol",
    "InstanceName": "测试实例。",
    "Extra": "{\"vpcId\":\"vpc-xxxx\"}"
  },
  "Models": [
    {
      "Model": "model_001",
      "DisplayName": "测试语言模型。",
      "ModelType": "LLM",
      "ToolCall": true
    }
  ]
}

Error codes

See for a complete list.

Release notes

See Release Notes for a complete list.