Workspace - Query Index Information List¶
GET /api/v1/workspace/{workspace_uuid}/index_list_info
Overview¶
Read the storage engine, default index template, and Log Index configuration of the specified workspace.
Before You Call and Usage Steps¶
Obtain the UUID from the workspace list. First use datastore to determine the engine used by each data type, then check durationSet, storagePolicy, and esIndexSettings. Configuration keys vary by workspace, engine, and version. otherLogIndexSettings includes only Log Indexes that are not deleted and are not bound to custom storage.
Set DF_EXTERNAL_API_URL, DF_EXTERNAL_ACCESS_KEY, and DF_EXTERNAL_SECRET_KEY, then run the example. Replace the example workspace UUID, brand, and configuration values with actual values. The signature version is v20240417.
Route Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| workspace_uuid | string | Y | You must use a valid workspace UUID for the target site. Null allowed: False Example: wksp_exampleHow to obtain or enter: Get content.data[].uuid from the workspace list. |
Request Headers¶
| Parameter | Type | Required | Description |
|---|---|---|---|
| X-Df-SVersion | string | Signature version; the following example uses v20240417. Example: v20240417How to obtain or enter: Enter as-is according to the example; it corresponds to the signature algorithm. |
|
| X-Df-Access-Key | string | Y | AK information for the request Example: <access-key>How to obtain or enter: Assigned by the External API administrator. |
| X-Df-Signature | string | Y | Signature information Example: <hex-signature>How to obtain or enter: Calculate HMAC-SHA256 over the method, nonce, path, timestamp, and empty string as shown in the example. |
| X-Df-Timestamp | string | Y | Timestamp at request time Example: 1785456000How to obtain or enter: Enter the current Unix time in seconds at call time, for example, run date +%s. |
| X-Df-Nonce | string | Y | Nonce generated at request time Example: b53b47e12e514616ad8cb1f17cb66dceHow to obtain or enter: Generate a new random value for each request, for example, uuid.uuid4().hex. |
Additional Parameter Notes¶
The example below excerpts log-related configuration. Template content may vary by engine.
Request Example¶
import hmac
import json
import os
import time
import uuid
import requests
server = os.environ["DF_EXTERNAL_API_URL"].rstrip("/")
path = "/api/v1/workspace/wksp_example/index_list_info"
method = "GET"
body = b''
timestamp = str(int(time.time()))
nonce = uuid.uuid4().hex
payload = f"{method} {nonce} {path} {timestamp} ".encode("utf-8") + body
signature = hmac.digest(os.environ["DF_EXTERNAL_SECRET_KEY"].encode(), payload, "sha256").hex()
headers = {
"X-Df-Access-Key": os.environ["DF_EXTERNAL_ACCESS_KEY"],
"X-Df-Timestamp": timestamp,
"X-Df-Nonce": nonce,
"X-Df-SVersion": "v20240417",
"X-Df-Signature": signature,
}
try:
response = requests.request(method, server + path, headers=headers, data=body, timeout=15)
except requests.RequestException:
print('Read failed. Back off, re-sign, and retry; retain traceId and query conditions.')
raise SystemExit(1)
if not 200 <= response.status_code < 300:
print("HTTP", response.status_code, response.text) # Retain errorCode, content, and traceId; do not output AK/SK.
raise SystemExit(1)
data = response.json()["content"]
Response¶
HTTP 200, application/json.
| Field | Type | Description |
|---|---|---|
| content.datastore | object | Storage engine organized by data type, for example, logging: doris. |
| content.durationSet | object | Retention duration organized by type; the common format is a number of days followed by d, for example, 7d. |
| content.storagePolicy | object | Workspace-level storage policy configuration organized by data type. |
| content.esIndexSettings | object | Index template configuration for each data type; custom settings in the workspace override the default template. |
| content.esIndexMerged | integer | Whether engines such as ES merge indexes by workspace; 1 means merged, 0 means not merged. |
| content.otherLogIndexSettings | array<object> |
Log Index information configured independently in the workspace. It is an empty array when no indexes meet the criteria. |
| content.otherLogIndexSettings[].uuid | string | Log Index identifier. |
| content.otherLogIndexSettings[].name | string | Log Index name. |
| content.otherLogIndexSettings[].setting | object or null | Configuration of the independent index; the default template can be used when no explicit configuration is provided. |
| content.otherLogIndexSettings[].duration | string | Retention duration of the Log Index. |
| content.otherLogIndexSettings[].storagePolicy | object | Separate storage policy for the Log Index; {} when not configured. |
{
"code": 200,
"content": {
"datastore": {
"logging": "sls"
},
"durationSet": {
"logging": "7d",
"resource_map": "7d"
},
"storagePolicy": {},
"esIndexSettings": {
"logging": {
"storagePolicy": {}
}
},
"esIndexMerged": 0,
"otherLogIndexSettings": [
{
"uuid": "lgim_example",
"name": "application",
"setting": {},
"duration": "7d",
"storagePolicy": {}
}
]
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 406 | ft.NotFoundWorkspace | The workspace does not exist or its status is not valid | The specified workspace was not found. | Check the target site and workspace UUID. |
| 404 | ft.NamespaceDatastoreNotFound | No storage engine is configured for the data type associated with the index template | The storage type for the corresponding data type was not found. | Ask the administrator to check the data storage configuration for the workspace. |