AddConnector
Creates a connector. This API currently supports only file connectors.
Operation description
To call this operation, a RAM user (sub-account) must first have the required API permissions for Model Studio and be a member of a business space. This requires the
AliyunBailianDataFullAccesspolicy, which includes the sfm:AddCategory permission. A primary account can call this operation directly without authorization. We recommend using the latest Model Studio SDK to call this operation.This operation is not idempotent.
Throttling: Do not call this operation more than 5 times per second. If a request is throttled, try again later.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sfm:AddConnector |
create |
*All Resource
|
None | None |
Request syntax
POST /{WorkspaceId}/datacenter/connector HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| WorkspaceId |
string |
Yes |
The ID of the workspace that contains the knowledge base. |
llm-3shx2gu255oxxxx |
Request parameters
|
Parameter |
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 for the connector. |
文件连接器 |
| FileConnectorConfig |
object |
No |
The parameters for the file connector. |
|
| RegionId |
string |
No |
The region of the bucket. |
cn-hangzhou |
| BucketName |
string |
No |
The name of the bucket. |
zyb-docker-registry-jn |
| StorageType |
string |
No |
The file storage location. Valid values: |
OSS_CUSTOM |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response object. |
||
| Code |
string |
The error code. A value of |
Success |
| Data |
object |
The data returned by the operation. |
|
| ConnectorId |
string |
The ID of the connector. |
conn_file_e0c9db4030b2465a9478028f7d76cd92_1234 |
| Message |
string |
The error message. |
Current file status does not support delete. |
| RequestId |
string |
The request ID. |
35A267BF-FBFA-54DB-8394-AA3B0742D833 |
| Status |
string |
The HTTP status code. |
200 |
| Success |
boolean |
Indicates whether the request succeeded. 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
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.