SubmitIndexJob
Submits a specified CreateIndex task to complete knowledge base creation.
Operation description
- RAM users (sub-accounts) must first obtain the API permissions for Alibaba Cloud Model Studio (requiring AliyunBailianDataFullAccess, which already includes the sfm:SubmitIndexJob permission) and join a workspace before they can call this operation. Alibaba Cloud accounts (primary accounts) can call this operation directly without authorization. We recommend that you call this operation with the latest version of the Alibaba Cloud Model Studio SDK.
- Before calling this operation, you must call the CreateIndex operation in advance and obtain the corresponding IndexId.
- After you call this operation, the task takes some time to execute and may take several hours during peak periods. Do not submit duplicate requests before the task completes. To query the task execution status, call the GetIndexJobStatus operation.
- After the knowledge base is created, you can associate it with your agent application in the same workspace through Application Management (or pass the IndexID through rag_options when calling an application), so as to supplement your Alibaba Cloud Model Studio application with private knowledge and up-to-date information. You can also choose not to use an Alibaba Cloud Model Studio application and directly query the knowledge base by calling the Retrieve operation.
- This operation does not support idempotency.
Rate limit: This operation is throttled if called too frequently. Do not exceed 10 calls per second. If throttled, retry later.
Debug
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
RAM authorization
The following table describes the authorization information corresponding to the API. You can use it in the Action element of RAM policy statements to grant RAM users or RAM roles the permission to call this API. Details are as follows:
-
Action: refers to the specific permission.
-
Access level: refers to the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: refers to the resource types that support authorization for the operation. Details are as follows:
- For required resource types, an asterisk (*) is prefixed.
- For operations that do not support resource-level authorization,
All Resourcesis used.
-
Condition key: refers to the condition keys defined by the cloud service itself.
-
Dependent action: refers to other permissions required to successfully perform the operation. The caller must also have the permissions of the dependent actions for the operation to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| sfm:SubmitIndexJob | create | *All Resources * |
| None |
Request syntax
POST /{WorkspaceId}/index/submit_index_job HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The workspace ID to which the knowledge base belongs. For how to obtain it, see How to use a workspace. | llm-3shx2gu255oqxxxx |
| IndexId | string | Yes | The knowledge base ID, that is, the | 79c0alxxxx |
Response elements
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| Code | string | The error code. | Index.InvalidParameter |
| Data | object | The business data returned by the operation. | |
| Id | string | The task ID, that is, the | eFDr2fGRzP9gdDZWAdo3xxxx |
| IndexId | string | The knowledge base ID. | 79c0alxxxx |
| Message | string | The error message. | Required parameter(%s) missing or invalid, please check the request parameters. |
| RequestId | string | The request ID. | 17204B98-xxxx-4F9A-8464-2446A84821CA |
| 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": "Index.InvalidParameter",
"Data": {
"Id": "eFDr2fGRzP9gdDZWAdo3xxxx",
"IndexId": "79c0alxxxx"
},
"Message": "Required parameter(%s) missing or invalid, please check the request parameters.",
"RequestId": "17204B98-xxxx-4F9A-8464-2446A84821CA",
"Status": 200,
"Success": true
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | RagIndex.IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. | This request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. |
See Error Center for more error codes.
Release notes
| Change time | Change summary | Operation |
|---|
No release notes yet