AddConnector
Creates a connector. This API currently supports only file connectors.
Usage notes
- A RAM user (sub-account) must first obtain the API permissions for Alibaba Cloud Model Studio (requires
AliyunBailianDataFullAccess, which includes the sfm:AddCategory permission point) and join a business space before calling this operation. An Alibaba Cloud account (primary account) can call this operation directly without authorization. We recommend that you call this operation by using the latest Alibaba Cloud Model Studio SDK. - This operation is not idempotent.
Throttling: This operation is throttled if called too frequently. Do not exceed 5 calls per second. If a request is throttled, try again later.
Try it out
You can run this operation directly in OpenAPI Explorer without calculating a signature. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
Authorization information
The following table describes the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. Details are as follows:
-
Action: the specific permission point.
-
Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization for the operation. Details are as follows:
- For required resource types, an asterisk (*) is added as a prefix.
- For operations that do not support resource-level authorization,
All resourcesis used.
-
Condition key: the condition keys defined by the cloud service itself.
-
Related action: other permissions required to successfully perform the action. The caller must also have the permissions of the related actions for the operation to succeed.
Action | Access level | Resource type | Condition key | Related action |
|---|---|---|---|---|
sfm:AddConnector | create | *All resources
| None | None |
Request syntax
POST /{WorkspaceId}/datacenter/connector HTTP/1.1
Path parameters
Name | Type | Required | Description | Example |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The ID of the workspace that contains the knowledge base. | llm-3shx2gu255oxxxx |
Request parameters
Name | Type | Required | Description | Example |
|---|---|---|---|---|
| ConnectorName | string | Yes | The name of the connector. | test-connector |
| ConnectorType | string | Yes | The type of the connector. | FILE |
| Description | string | Yes | The description. | File connector |
| FileConnectorConfig | object | No | The parameters for the file connector. | |
| RegionId | string | No | The region of the storage bucket. | cn-hangzhou |
| BucketName | string | No | The name of the storage bucket. | zyb-docker-registry-jn |
| StorageType | string | No | The file storage location. OSS_CUSTOM: uses your own OSS storage. OSS_PLATFORM: uses the platform OSS storage. | OSS_CUSTOM |
Response parameters
Name | Type | Description | Example |
|---|---|---|---|
object | Schema of Response | ||
| Code | string | The error status code. | Success |
| Data | object | The business data fields of the operation. | |
| ConnectorId | string | The connector ID. | conn_file_e0c9db4030b2465a9478028f7d76cd92_1234 |
| Message | string | The error message. | Current file status does not support delete. |
| RequestId | string | Id of the request | 35A267BF-FBFA-54DB-8394-AA3B0742D833 |
| Status | string | The status code returned by the operation. | 200 |
| Success | boolean | Indicates whether the operation call is successful. Valid values:
| true |
Examples
Success response
JSON format
{
"Code": "Success",
"Data": {
"ConnectorId": "conn_file_e0c9db4030b2465a9478028f7d76cd92_1234"
},
"Message": "Current file status does not support delete.",
"RequestId": "35A267BF-FBFA-54DB-8394-AA3B0742D833",
"Status": "200",
"Success": true
}
Error codes
Visit the Error Center to view more error codes.
Change history
For more information, see Change details.