alibabacloud-sls-index-config-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAlibaba Cloud SLS Index Configuration Manager
阿里云SLS索引配置管理器
Scenario Description
场景描述
Use this skill for SLS Logstore index configuration.
This file only covers trigger-time setup, routing, and cross-scenario safety. Read only the
reference document needed for the user's request.
本Skill用于SLS Logstore索引配置。
本文档仅涵盖触发时的设置、路由以及跨场景安全相关内容。仅阅读用户请求所需的参考文档即可。
Prerequisites
前置条件
Install Aliyun CLI
安装Aliyun CLI
Run to verify the version is . If not installed or outdated, follow references/cli-installation-guide.md to install or update.
aliyun version>= 3.3.8运行验证版本是否。若未安装或版本过时,请按照references/cli-installation-guide.md进行安装或更新。
aliyun version>= 3.3.8Ensure AI Mode Enabled
确保AI模式已启用
Before executing any SLS API commands, enable AI-Mode, set User-Agent, and update plugins:
bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-sls-index-config-management"
aliyun plugin update执行任何SLS API命令前,需启用AI模式、设置User-Agent并更新插件:
bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-sls-index-config-management"
aliyun plugin updateCheck Alibaba Cloud credentials configured
检查阿里云凭证配置
Run to check if credentials are configured.
If no valid profile is shown, STOP here and ask the user to run outside of this session.
aliyun configure listaliyun configureSecurity rules:
- NEVER read, echo, or print AK/SK values
- NEVER ask the user to paste AK/SK into the conversation
- ONLY use to check credential status
aliyun configure list
运行检查凭证是否已配置。若未显示有效配置文件,请立即停止并告知用户在本次会话外运行。
aliyun configure listaliyun configure安全规则:
- 绝对禁止读取、回显或打印AK/SK值
- 绝对禁止要求用户将AK/SK粘贴到对话中
- 仅可使用检查凭证状态
aliyun configure list
RAM Permission Requirements
RAM权限要求
On error, surface references/ram-policies.md to the user. Do not retry with a different account without explicit confirmation.
Unauthorized若出现错误,请向用户提供references/ram-policies.md。未经明确确认,请勿使用其他账号重试。
UnauthorizedRouting the Request
请求路由
After environment and credential checks, classify the user's request and follow the matching reference:
| If the user wants to … | Go to |
|---|---|
View / create / update / delete an index, or change a single field, TTL, | references/manage-index-config.md |
| Build an index for a Logstore that has none, or rebuild from scratch using user-provided structured log samples | references/generate-index-from-logs.md |
| Adjust an existing index to support a new query / SQL, reduce cost, or improve write throughput | references/optimize-index-config.md |
Mixed requests are common (e.g. "generate an index for these logs and then update it on Logstore X"). Read the relevant scenario docs in order.
完成环境和凭证检查后,对用户请求进行分类并遵循对应的参考文档:
| 用户需求 | 跳转至 |
|---|---|
查看/创建/更新/删除索引,或修改单个字段、TTL、 | references/manage-index-config.md |
| 为无索引的Logstore创建索引,或根据用户提供的结构化日志样本重新构建索引 | references/generate-index-from-logs.md |
| 调整现有索引以支持新的查询/SQL、降低成本或提升写入吞吐量 | references/optimize-index-config.md |
混合请求较为常见(例如:"为这些日志生成索引并更新到Logstore X")。请按顺序阅读相关场景文档。
Global Rules
全局规则
- No writes without the scenario reference. Before any write operation, read the relevant reference document and follow its confirmation, full-body, rollback, and timing rules.
- Use exact SLS CLI names. Product is ; subcommands and flags are kebab-case. Use references/acceptance-criteria.md only when validating command shape or debugging CLI invocation issues.
sls
- 无场景参考则禁止写入操作。执行任何写入操作前,需阅读相关参考文档并遵循其确认、全量操作、回滚和时序规则。
- 使用准确的SLS CLI名称。产品名为;子命令和参数采用短横线命名法(kebab-case)。仅在验证命令格式或调试CLI调用问题时使用references/acceptance-criteria.md。
sls
Output Format
输出格式
Every time you present an index configuration to the user — whether from a read (), after a
write ( / ), or during generation/optimization — output both:
get-indexcreate-indexupdate-index- Complete JSON — the full JSON response (or the equivalent JSON body you are about to submit for a write). Wrap it in a fenced
get-indexcode block so the user can copy-paste it directly.json - Human-readable summary
Put the Complete JSON first, then the summary. The summary helps the user understand the config at a glance;
the JSON is the authoritative, machine-readable reference they can use for scripting, version control,
or future calls.
update-index每次向用户展示索引配置时——无论是读取操作()的结果、写入操作( / )后的结果,还是生成/优化过程中的配置——都需同时输出以下两项:
get-indexcreate-indexupdate-index- 完整JSON——完整的JSON响应(或即将提交的写入操作对应的JSON主体)。将其包裹在带围栏的
get-index代码块中,方便用户直接复制粘贴。json - 易读摘要
先展示完整JSON,再展示摘要。摘要帮助用户快速理解配置内容;JSON则是权威的机器可读参考,可用于脚本编写、版本控制或后续的调用。
update-indexCleanup
清理操作
Whether operations succeed or fail, you MUST disable AI-Mode before ending the session:
bash
aliyun configure ai-mode disable无论操作成功与否,会话结束前必须禁用AI模式:
bash
aliyun configure ai-mode disableReference Documents
参考文档
| Document | Description |
|---|---|
| references/manage-index-config.md | Index config format and get / create / update / delete command examples |
| references/generate-index-from-logs.md | Infer a complete index configuration from user-provided structured log samples |
| references/optimize-index-config.md | Optimize an existing index for query/SQL workload, cost, and write throughput |
| references/related-apis.md | |
| related_apis.yaml | Machine-readable dependent API metadata for this skill |
| references/ram-policies.md | Minimum and complete RAM policies for index management |
| references/acceptance-criteria.md | CLI invocation acceptance tests |
| references/cli-installation-guide.md | Aliyun CLI install, auth modes, profiles |
| 文档 | 描述 |
|---|---|
| references/manage-index-config.md | 索引配置格式及查看/创建/更新/删除命令示例 |
| references/generate-index-from-logs.md | 根据用户提供的结构化日志样本推导完整的索引配置 |
| references/optimize-index-config.md | 针对查询/SQL工作负载、成本和写入吞吐量优化现有索引 |
| references/related-apis.md | |
| related_apis.yaml | 本Skill的机器可读依赖API元数据 |
| references/ram-policies.md | 索引管理所需的最小及完整RAM策略 |
| references/acceptance-criteria.md | CLI调用验收测试 |
| references/cli-installation-guide.md | Aliyun CLI安装、认证模式及配置文件说明 |