Modify Default Type Index Configuration¶
POST /api/v1/log_index_cfg/{cfg_uuid}/modify
Overview¶
Modify default storage type index configuration
Route Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| cfg_uuid | string | Y | Configuration uuid |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| desc | string | Index description Example: xxx Allow null: False Allow empty string: True Max length: 1024 |
|
| extend | json | Frontend custom data Allow null: True |
|
| duration | string | Data retention duration Allow null: False Example: 7d |
|
| storagePolicy | json | Long-term storage policy, only workspaces with scopedb storage for logs are allowed to enable, unlimited version does not support; enterprise version supports custom long-term storage duration, logging max 1800d, rp max 3600d; includes longStorageEnabled and longStorageDuration Example: {'longStorageEnabled': True, 'longStorageDuration': '180d'} Allow null: False |
|
| isFullLineIndex | int | Whether it is a full-line index; 0/false means keep message field index, 1/true means full-line index, default 0; only workspaces with scopedb storage for logs are allowed to set to 1 Allow null: False |
|
| setting | json | Related configuration information Allow null: False |
|
| setting.hot_retention | int | Volcengine storage, Standard storage - hot storage Allow null: False |
|
| setting.cold_retention | int | Volcengine storage, Infrequent access storage - cold data Allow null: False |
|
| setting.archive_retention | int | Volcengine storage, Archive storage - archived data Allow null: False |
Parameter Supplementary Description¶
Matching condition description in extend
| Parameter Name | type | Required | Description |
|---|---|---|---|
| matchMode | String | Matching mode, optional values: basic, advanced; defaults to basic if omitted |
|
| filters | Array[dict] | Basic matching filter condition list, recommended to pass empty array in advanced mode |
|
| advancedFilter | Dict | Advanced matching condition tree, effective when matchMode=advanced |
The root node of advancedFilter is fixed as group, group.filters can nest rule or group. rule.operation optional values: =, !=, in, not_in, match, not_match, wildcard, not_wildcard, regexp, not_regexp, >, <, >=, <=, exist, not_exist. value is uniformly an array, use empty array for exist / not_exist. When matchMode=advanced, the backend will generate conditions in DQL where style; basic filters still maintain the historical generation format.
Request Example¶
curl 'https://openapi.guance.com/api/v1/log_index_cfg/lgim_xxxx32/modify' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: zh' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"duration":"7d","isFullLineIndex":1,"extend":{"filters":[{"condition":"and","name":"host","operation":"in","value":["guance"]}]}}' \
--compressed
Response¶
{
"code": 200,
"content": {
"conditions": "{ `host` in [ 'guance' ] }",
"createAt": 1698751853,
"creator": "xxx",
"deleteAt": -1,
"duration": "7d",
"extend": {
"filters": [
{
"condition": "and",
"name": "host",
"operation": "in",
"value": [
"guance"
]
}
]
},
"exterStoreName": "",
"exterStoreProject": "",
"externalResourceAccessCfgUUID": "",
"id": 1376,
"isBindCustomStore": 0,
"isFullLineIndex": III,
"isPublicNetworkAccess": 0,
"name": "test_index",
"queryType": "logging",
"region": "",
"setting": {},
"sortNo": 3,
"status": 0,
"storeType": "",
"updateAt": 1698752013.27368,
"updator": "xx",
"uuid": "lgim_xxxx32",
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-09F7E56D-1DE5-48C9-A77A-108A53462A75"
}