Modify Index Acceleration Field Configuration¶
POST /api/v1/workspace/index_speed_field/modify
Overview¶
Add or remove field acceleration in sequence. Stop on the first failure and retain completed items.
Before Calling and Usage Steps¶
Use a Key that has log index management permissions in the target workspace. Call this API on a storage engine/data category that supports field acceleration, typically ScopeDB logs. First, determine the index name from the Log Index List, then obtain the actual field name and the required acceleration type. This API differs from the key field display configuration and does not modify extendFields.
Explicitly submit namespace=logging, the complete fieldSpeedConfig, and enable. When namespace has no valid mapping, the success envelope contains content=false. Callers must check the boolean value and cannot determine that execution occurred based only on HTTP 200. When namespace is valid and the array is empty, true also does not mean any field was changed. All indexTypes are checked first, then fields are executed in sequence one by one. Execution stops immediately on the first failure, successfully processed fields are retained, subsequent fields are not executed, and no batch rollback or in-program automatic retry is performed.
Pay special attention to deletion: indexType=search deletes only the inverted index; omitted/null/empty string/materialized all map to an empty type and delete all acceleration index types. Confirm the scope before sending a deletion. After a failure, you can retry existing idempotent operations after fixing the issue based on the actual error, but first verify the successfully processed items and the quantity limit; there is no per-item status/task ID, so you cannot assert that the entire batch was not executed.
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace. |
Body Request Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| fieldSpeedConfig | array | Optional array. When namespace is valid, omitting it/[] returns true without any field operation. All indexTypes are prechecked first, then executed item by item in the original order; no deduplication is performed. Allowed null: False Example: [{"index": "default", "field": "host", "enable": true, "indexType": "search"}]How to obtain or enter: Get name from the index list, and get the actual field from a log field query. |
|
| fieldSpeedConfig[*] | object | The client must provide the complete object structure; do not pass null or a non-object. Example: {"index": "default", "field": "host", "enable": true, "indexType": "search"}How to obtain or enter: Each item specifies one acceleration field operation. |
|
| fieldSpeedConfig[*].index | string | Index name, not a UUID. Studio does not look up the index configuration first here; final validity is determined downstream. Allowed null: False Example: defaultHow to obtain or enter: Take name from the Log Index List; use default when omitted. |
|
| fieldSpeedConfig[*].field | string | Conditionally Required | Actual field name to accelerate, not an alias. Allowed null: False Example: hostHow to obtain or enter: Use queries such as SHOW_LOGGING_FIELD(index=...) to obtain the actual field name. |
| fieldSpeedConfig[*].enable | boolean | Conditionally Required | Each item must explicitly submit a boolean value; missing values/type mismatches are rejected first with 406 by the public parameter layer, not relying on the controller's internal default of false. Allowed null: False Example: trueHow to obtain or enter: Fill true to create acceleration and false to delete. |
| fieldSpeedConfig[*].indexType | string | Only empty string/materialized/search are supported; null is treated as empty. For addition, pass the regular type for empty/materialized; for deletion, empty/materialized deletes all acceleration index types! To delete only the inverted index, explicitly use search. Allowed null: True Allowed empty string: True Example: searchHow to obtain or enter: Fill in search only when inverted index acceleration is needed; for regular/materialized, fill in materialized or omit it. |
|
| namespace | string | Optional, but when missing/unknown mapping, HTTP 200 with content=false is returned and no operation is performed. Studio converts it according to the site mapping here and does not uniformly reject it merely because it is not logging. Support for specific data categories/engines is checked downstream; the current typical case is ScopeDB logs. Allowed null: False Example: loggingHow to obtain or enter: For log field acceleration, logging is recommended; use the full name in lowercase, not L. |
|
| source | string | Optional. The original value is forwarded downstream; if omitted, no source filter is passed. This is not an index name. Allowed null: False Example: nginxHow to obtain or enter: Fill in the actual source when source restriction is required; omit it when not required. |
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/workspace/index_speed_field/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"namespace":"logging","fieldSpeedConfig":[{"index":"default","field":"host","enable":true,"indexType":"search"}]}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | boolean | false when namespace is not mapped; true when a valid mapping completes the loop, including for an empty batch. This is not a per-field report. |
{
"code": 200,
"content": true,
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
Other downstream errors, such as index not found, engine capability, or permission errors, may be passed through with their actual HTTP/errorCode/message; uncontrolled 5xx errors are wrapped as 500 by common errors, without fabricating fixed dynamic codes. Reaching the quantity limit usually returns 406. This API does not swallow this creation error, unlike background synchronization for key field configuration.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Request field is missing, or the field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Invalid request JSON syntax | Request JSON format error | Correct the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | The top level of the request JSON is not an object | Partial JSON file format error | Submit an object as shown in the example. |
| 406 | ft.InvalidParameter | namespace mapping is valid and any indexType is not empty/materialized/search | Parameter {} is invalid |
Select a valid type for the target operation; the batch indexType precheck rejects the request first. |
| 406 | ft.KodoFieldIndexLimitReached | The downstream reaches the quantity limit when creating acceleration indexes | The number of acceleration fields for the current index has reached the upper limit, with a maximum of {} allowed. Delete unnecessary acceleration fields and try again. | Based on the limit given in message, delete acceleration fields that are no longer needed, then retry the unfinished items. |
| 500 | ft.InternalServerError | An uncontrolled exception occurs during configuration reading, storage, caching, or downstream processing | Internal error | Retain traceId; for write requests, first read/verify the completed items, then decide whether to retry. |