ValidateConnection

Updated at:

Validates 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:ValidateConnection

none

*All Resource

*

None None

Request syntax

POST /api/v1/connections/validate HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

Configs

object

No

The configuration information of the connection. The information is configured in key-value pairs. The keys in the configuration vary based on the connection type. For more information, see the supplementary description of request parameters for the CreateConnection operation.

string

No

The configuration information of the connection. The information is configured in key-value pairs. The keys in the configuration vary based on the connection type. For more information, see the supplementary description of request parameters.

https://dashscope.aliyuncs.com/compatible-mode/v1

ConnectionId

string

No

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

conn-x2wz5zvvbyf2420fi9

ConnectionType

string

No

The type of the connection. You can specify a connection type that supports public network access. Valid values:

  • DashScopeConnection: The Model Studio connection.

  • DeepSeekConnection: The DeepSeek connection.

  • FunctionAIMCPConnection: The Function AI MCP connection.

  • CustomMCPConnection: The custom MCP connection.

DashScopeConnection

Secrets

object

No

The key-value configurations that require encryption, such as the database logon password and the key for the model connection.

string

No

The connection configuration information that requires encryption, such as the database account and password, and the key for the model service.

ZGJiZWQ2ZDY3MTMyYjJk****************NjE2NDg1NzM0YzlkZg==

ValidateType

string

No

The validation type. Valid values:

  • Connectivity: The connectivity test.

Connectivity

WorkspaceId

string

Yes

The workspace ID. You can obtain the workspace ID by calling the ListWorkspaces operation.

1234

Response elements

Element

Type

Description

Example

object

Schema of Response

Status

string

The status of the validation result. Valid values:

  • success: The validation succeeded.

  • failed: The validation failed.

success

RequestId

string

The request ID.

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

Message

string

The description of the validation result.

The connection is reachable.

Code

string

The error code returned when the request fails.

403

Details

object

The details of the validation result.

string

The detailed information of the validation result. For example, LatencyMs indicates the test latency in milliseconds.

100

Examples

Success response

JSON format

{
  "Status": "success",
  "RequestId": "5A14FA81-DD4E-******-6343FE44B941",
  "Message": "The connection is reachable.",
  "Code": "403",
  "Details": {
    "key": "100"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.