cloud-manage-project
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseManage Serverless Project
管理Serverless项目
Perform day-2 operations on Elastic Cloud Serverless projects using the Serverless REST API.
使用Serverless REST API对Elastic Cloud Serverless项目执行日常运维(Day-2)操作。
Prerequisites and permissions
前提条件与权限
- Ensure is configured. If not, run
EC_API_KEYskill first.cloud-setup - Updating project settings requires Admin or Editor role on the target project.
- This skill does not perform a separate role pre-check. Attempt the requested operation and let the API enforce
authorization. If the API returns an authorization error (for example, ), stop and ask the user to verify the provided API key permissions.
403 Forbidden
- 确保已配置。如果未配置,请先运行
EC_API_KEY技能。cloud-setup - 更新项目设置需要目标项目的管理员或编辑者角色。
- 本技能不会单独进行角色预检查。直接尝试请求的操作,由API强制执行授权。如果API返回授权错误(例如),请停止操作并告知用户验证其提供的API密钥权限。
403 Forbidden
Manual setup fallback (when cloud-setup
is unavailable)
cloud-setup手动设置备选方案(当cloud-setup
不可用时)
cloud-setupIf this skill is installed standalone and is not available, instruct the user to configure Cloud
environment variables manually before running commands. Never ask the user to paste API keys in chat.
cloud-setup| Variable | Required | Description |
|---|---|---|
| Yes | Elastic Cloud API key used for project management operations. |
| No | Cloud API base URL (default: |
Note: Ifis missing, or the user does not have a Cloud API key yet, direct the user to generate one at Elastic Cloud API keys, then configure it locally using the steps below.EC_API_KEY
Preferred method (agent-friendly): create a file in the project root:
.envbash
EC_API_KEY=your-api-key
EC_BASE_URL=https://api.elastic-cloud.comAll scripts auto-load from the working directory.
cloud/*.envAlternative: export directly in the terminal:
bash
export EC_API_KEY="<your-cloud-api-key>"
export EC_BASE_URL="https://api.elastic-cloud.com"Terminal exports may not be visible to sandboxed agents running in separate shell sessions, so prefer when using
an agent.
.env如果本技能是独立安装且不可用,请指导用户在运行命令前手动配置Cloud环境变量。切勿要求用户在聊天中粘贴API密钥。
cloud-setup| 变量名称 | 是否必填 | 说明 |
|---|---|---|
| 是 | 用于项目管理操作的Elastic Cloud API密钥。 |
| 否 | Cloud API基础URL(默认值: |
注意: 如果缺少,或者用户还没有Cloud API密钥,请引导用户前往Elastic Cloud API keys生成,然后按照以下步骤在本地配置。EC_API_KEY
推荐方式(适配Agent):在项目根目录创建文件:
.envbash
EC_API_KEY=your-api-key
EC_BASE_URL=https://api.elastic-cloud.com所有脚本会自动从工作目录加载文件。
cloud/*.env备选方式:在终端直接导出:
bash
export EC_API_KEY="<your-cloud-api-key>"
export EC_BASE_URL="https://api.elastic-cloud.com"终端导出的变量可能无法被运行在独立Shell会话中的沙箱Agent识别,因此使用Agent时优先选择方式。
.envCritical principles
核心原则
- Never display secrets in chat. Do not echo, log, or repeat API keys, passwords, or credentials in conversation
messages or agent thinking. Direct the user to the file instead. The admin password must never appear in chat history, thinking traces, or agent output — even when using it to create an API key, pass it directly via shell variable substitution without echoing.
.elastic-credentials - Confirm before destructive actions. Always ask the user to confirm before deleting a project or resetting credentials.
- Credentials are saved to file. After a credential reset, the script writes the new password to
automatically. The password is redacted from stdout. Never read or display the contents of
.elastic-credentialsin chat..elastic-credentials - Admin credentials are for API key creation only. The password saved by
adminandcreate-projectexists solely to bootstrap a scoped API key — never use it for direct Elasticsearch operations.reset-credentialsexcludes admin credentials by default; passload-credentialsonly for key creation.--include-admin - Always prefer API keys. Do not proceed with Elasticsearch operations until an is set. If only admin credentials are available, create a scoped API key via
ELASTICSEARCH_API_KEY. If that skill is not installed, ask the user to install it or create the key manually in Kibana > Stack Management > API keys.elasticsearch-authn - Identify projects by type and ID. Every command requires both and
--type(except--id, which only needslist).--type - Two kinds of API keys. This skill uses the Cloud API key () for project management operations (list, get, update, delete). Elasticsearch operations require a separate Elasticsearch API key (
EC_API_KEY) that authenticates against the project's Elasticsearch endpoint. Do not confuse the two.ELASTICSEARCH_API_KEY
- 切勿在聊天中显示机密信息。不要在对话消息或Agent的思考过程中回显、记录或重复API密钥、密码或凭证。请引导用户查看文件。管理员密码绝对不能出现在聊天记录、思考轨迹或Agent输出中——即使在创建API密钥时使用它,也要通过Shell变量替换直接传递,切勿回显。
.elastic-credentials - 执行破坏性操作前需确认。在删除项目或重置凭证前,务必先征得用户确认。
- 凭证保存至文件。重置凭证后,脚本会自动将新密码写入文件。密码会在标准输出中被脱敏处理。切勿在聊天中读取或显示
.elastic-credentials的内容。.elastic-credentials - 管理员凭证仅用于创建API密钥。和
create-project保存的reset-credentials密码仅用于引导生成范围限定的API密钥——切勿将其用于直接的Elasticsearch操作。admin默认会排除管理员凭证;仅在创建密钥时使用load-credentials参数。--include-admin - 优先使用API密钥。在设置好前,不要进行Elasticsearch操作。如果只有管理员凭证可用,请通过
ELASTICSEARCH_API_KEY创建范围限定的API密钥。如果该技能未安装,请告知用户安装它,或在Kibana > Stack Management > API keys中手动创建密钥。elasticsearch-authn - 通过类型和ID识别项目。除命令仅需
list外,所有命令都需要同时指定--type和--type。--id - 两种不同的API密钥。本技能使用Cloud API密钥()执行项目管理操作(列出、获取、更新、删除)。Elasticsearch操作需要单独的Elasticsearch API密钥(
EC_API_KEY),用于对项目的Elasticsearch端点进行身份验证。请勿混淆这两种密钥。ELASTICSEARCH_API_KEY
Workflow: Connect to an existing project
工作流:连接现有项目
Use this workflow when the user asks to query or manage a project the agent did not create in the current session. It
resolves the project, saves its endpoints, and ensures working Elasticsearch credentials before proceeding.
This workflow only applies to Elastic Cloud Serverless projects. If the user's Elasticsearch instance is
self-managed or Elastic Cloud Hosted, this skill does not apply — skip it and proceed with the relevant skill directly.
If unsure, ask the user: "Is your Elasticsearch instance an Elastic Cloud Serverless project?"
text
Connect to Existing Project:
- [ ] Step 1: Resolve the project
- [ ] Step 2: Get project details and load credentials
- [ ] Step 3: Acquire Elasticsearch credentials当用户要求查询或管理Agent在当前会话中未创建的项目时,使用此工作流。它会解析项目、保存其端点,并确保Elasticsearch凭证可用。
本工作流仅适用于Elastic Cloud Serverless项目。如果用户的Elasticsearch实例是自托管或Elastic Cloud托管版,本技能不适用——请跳过并直接使用相关技能。如有疑问,请询问用户:"您的Elasticsearch实例是Elastic Cloud Serverless项目吗?"
text
连接现有项目:
- [ ] 步骤1:解析项目
- [ ] 步骤2:获取项目详情并加载凭证
- [ ] 步骤3:获取Elasticsearch凭证Step 1: Resolve the project
步骤1:解析项目
Ask the user for the project name if not already provided. Infer the project type from the user's request:
| User says | |
|---|---|
| "search project", "elasticsearch project", vector search | |
| "observability project", "o11y", logs, metrics, traces, APM | |
| "security project", "SIEM", detections, endpoint protection | |
If the type is ambiguous, list all three types to find the project.
bash
python3 skills/cloud/manage-project/scripts/manage-project.py list \
--type elasticsearchMatch the user's reference (name, partial name, or alias) against the list results. If multiple projects match or none
match, present the candidates and ask the user to pick.
如果用户未提供项目名称,请询问用户。根据用户的请求推断项目类型:
| 用户表述 | |
|---|---|
| "搜索项目"、"elasticsearch项目"、向量搜索 | |
| "可观测性项目"、"o11y"、日志、指标、链路、APM | |
| "安全项目"、"SIEM"、检测、终端防护 | |
如果类型不明确,请列出所有三种类型以查找项目。
bash
python3 skills/cloud/manage-project/scripts/manage-project.py list \
--type elasticsearch将用户提及的内容(名称、部分名称或别名)与列表结果匹配。如果有多个项目匹配或无匹配项,请展示候选项目并让用户选择。
Step 2: Get project details and load credentials
步骤2:获取项目详情并加载凭证
Once a single project is identified, check whether already has entries for this project (from a
previous session). If so, load them with :
.elastic-credentialsload-credentialsbash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--name "<project-name>")This sets all saved environment variables for the project — endpoints and any previously created Elasticsearch API keys
— in a single command. Admin credentials (/) are intentionally excluded.
Later sections for the same project automatically overwrite earlier values, so the most recent credentials always win.
ELASTICSEARCH_USERNAMEELASTICSEARCH_PASSWORDIf reports no matching entries, fetch the project details from the API and export endpoints manually:
load-credentialsbash
python3 skills/cloud/manage-project/scripts/manage-project.py get \
--type elasticsearch \
--id <project-id>Then export the endpoint URLs from the response. The available endpoints depend on the project type.
All project types:
bash
export ELASTICSEARCH_URL="<elasticsearch_endpoint>"
export KIBANA_URL="<kibana_endpoint>"Observability projects (additional):
bash
export APM_URL="<apm_endpoint>"
export INGEST_URL="<ingest_endpoint>"Security projects (additional):
bash
export INGEST_URL="<ingest_endpoint>"一旦确定单个项目,请检查中是否已有该项目的条目(来自之前的会话)。如果有,使用加载:
.elastic-credentialsload-credentialsbash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--name "<project-name>")此命令会一次性设置该项目的所有已保存环境变量——包括端点和之前创建的任何Elasticsearch API密钥。管理员凭证(/)会被有意排除。同一项目的后续操作会自动覆盖之前的值,因此始终使用最新的凭证。
ELASTICSEARCH_USERNAMEELASTICSEARCH_PASSWORD如果报告无匹配条目,请从API获取项目详情并手动导出端点:
load-credentialsbash
python3 skills/cloud/manage-project/scripts/manage-project.py get \
--type elasticsearch \
--id <project-id>然后从响应中导出端点URL。可用端点取决于项目类型。
所有项目类型:
bash
export ELASTICSEARCH_URL="<elasticsearch_endpoint>"
export KIBANA_URL="<kibana_endpoint>"可观测性项目(额外端点):
bash
export APM_URL="<apm_endpoint>"
export INGEST_URL="<ingest_endpoint>"安全项目(额外端点):
bash
export INGEST_URL="<ingest_endpoint>"Step 3: Acquire Elasticsearch credentials
步骤3:获取Elasticsearch凭证
If set , verify the credentials work:
load-credentialsELASTICSEARCH_API_KEYbash
curl -H "Authorization: ApiKey ${ELASTICSEARCH_API_KEY}" \
"${ELASTICSEARCH_URL}/_security/_authenticate"Confirm the response contains a valid and before proceeding. If
verification succeeds, skip the rest of this step.
username"authentication_type": "api_key"If no credentials were loaded, or verification fails, ask the user: "Do you have an existing Elasticsearch API key for
this project?"
If yes — have the user add it to (see "Credential file format"). Do not accept keys in chat.
Reload and verify:
.elastic-credentialsbash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--name "<project-name>")
curl -H "Authorization: ApiKey ${ELASTICSEARCH_API_KEY}" \
"${ELASTICSEARCH_URL}/_security/_authenticate"If no — follow this recovery path:
-
Confirm with the user, then reset the admin bootstrap credentials:bash
python3 skills/cloud/manage-project/scripts/manage-project.py reset-credentials \ --type elasticsearch \ --id <project-id>The new password is saved towith the project name in the header. Direct the user to that file — do not display its contents..elastic-credentials -
Load credentials withso the admin password is available for API key creation:
--include-adminbasheval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \ --name "<project-name>" --include-admin)Use the admin credentials to create a scoped Elasticsearch API key viaif available. If that skill is not installed, ask the user to install it or create the key manually in Kibana > Stack Management > API keys. Scope the key to only the privileges the user needs.elasticsearch-authn -
After creating the API key, save it tousing the project-specific header format (see "Credential file format" below). Then reload without
.elastic-credentialsto drop admin credentials from the environment and verify:--include-adminbasheval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \ --name "<project-name>") curl -H "Authorization: ApiKey ${ELASTICSEARCH_API_KEY}" \ "${ELASTICSEARCH_URL}/_security/_authenticate"Confirm the response shows a validandusernamebefore proceeding."authentication_type": "api_key"
如果已设置,请验证凭证是否可用:
load-credentialsELASTICSEARCH_API_KEYbash
curl -H "Authorization: ApiKey ${ELASTICSEARCH_API_KEY}" \
"${ELASTICSEARCH_URL}/_security/_authenticate"在继续操作前,请确认响应中包含有效的和。如果验证成功,请跳过此步骤的剩余部分。
username"authentication_type": "api_key"如果未加载任何凭证,或验证失败,请询问用户:"您是否有此项目的现有Elasticsearch API密钥?"
如果有 — 让用户将密钥添加到中(请参阅"凭证文件格式")。请勿在聊天中接收密钥。重新加载并验证:
.elastic-credentialsbash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--name "<project-name>")
curl -H "Authorization: ApiKey ${ELASTICSEARCH_API_KEY}" \
"${ELASTICSEARCH_URL}/_security/_authenticate"如果没有 — 按照以下恢复流程操作:
-
征得用户确认后,重置管理员引导凭证:bash
python3 skills/cloud/manage-project/scripts/manage-project.py reset-credentials \ --type elasticsearch \ --id <project-id>新密码会自动保存到中,并带有项目名称的头部。引导用户查看该文件——不要显示其内容。.elastic-credentials -
使用参数加载凭证,以便管理员密码可用于创建API密钥:
--include-adminbasheval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \ --name "<project-name>" --include-admin)如果可用,请使用管理员凭证通过该技能创建范围限定的Elasticsearch API密钥。如果该技能未安装,请告知用户安装它,或在Kibana > Stack Management > API keys中手动创建密钥。将密钥的权限范围限定为用户所需的最小权限。elasticsearch-authn -
创建API密钥后,将其保存到中(使用项目特定的头部格式,请参阅"凭证文件格式")。然后不使用
.elastic-credentials参数重新加载,以从环境中移除管理员凭证并验证:--include-adminbasheval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \ --name "<project-name>") curl -H "Authorization: ApiKey ${ELASTICSEARCH_API_KEY}" \ "${ELASTICSEARCH_URL}/_security/_authenticate"在继续操作前,请确认响应中显示有效的和username。"authentication_type": "api_key"
Credential file format
凭证文件格式
See references/credential-file-format.md for the full format specification.
请参阅references/credential-file-format.md获取完整的格式规范。
Workflow: Load project credentials
工作流:加载项目凭证
bash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--name "<project-name>")Or by project ID:
bash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--id <project-id>)Parses , merges all sections for the matching project, and prints statements. Admin
credentials (/) are excluded by default — only endpoints and API keys
are exported. Add when you need admin credentials to create an API key.
.elastic-credentialsexportELASTICSEARCH_USERNAMEELASTICSEARCH_PASSWORD--include-adminbash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--name "<project-name>")或通过项目ID加载:
bash
eval $(python3 skills/cloud/manage-project/scripts/manage-project.py load-credentials \
--id <project-id>)解析,合并匹配项目的所有部分,并打印语句。默认会排除管理员凭证(/)——仅导出端点和API密钥。在需要管理员凭证创建API密钥时,添加参数。
.elastic-credentialsexportELASTICSEARCH_USERNAMEELASTICSEARCH_PASSWORD--include-adminWorkflow: List projects
工作流:列出项目
bash
python3 skills/cloud/manage-project/scripts/manage-project.py list \
--type elasticsearchUse or to list other project types.
--type observability--type securitybash
python3 skills/cloud/manage-project/scripts/manage-project.py list \
--type elasticsearch使用或列出其他类型的项目。
--type observability--type securityWorkflow: Get project details
工作流:获取项目详情
bash
python3 skills/cloud/manage-project/scripts/manage-project.py get \
--type elasticsearch \
--id <project-id>bash
python3 skills/cloud/manage-project/scripts/manage-project.py get \
--type elasticsearch \
--id <project-id>Workflow: Update a project
工作流:更新项目
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id <project-id> \
--name "new-project-name"Only the fields provided are updated (PATCH semantics). Supported fields: , , ,
, , , .
--name--alias--tag--search-power--boost-window--max-retention-days--default-retention-daysbash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id <project-id> \
--name "new-project-name"仅更新提供的字段(PATCH语义)。支持的字段:、、、、、、。
--name--alias--tag--search-power--boost-window--max-retention-days--default-retention-daysAlias
别名
The alias is an RFC-1035 domain label (lowercase alphanumeric and hyphens, max 50 chars) that becomes part of the
project's endpoint URLs. Changing the alias changes all endpoint URLs, which breaks existing clients pointing to the
old URLs. Warn the user about this before applying.
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id <project-id> \
--alias "prod-search"别名是符合RFC-1035的域名标签(小写字母、数字和连字符,最多50个字符),会成为项目端点URL的一部分。更改别名会更改所有端点URL,这会导致指向旧URL的现有客户端无法正常工作。在应用更改前,请提醒用户这一点。
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id <project-id> \
--alias "prod-search"Tags
标签
Tags are key-value metadata pairs for team tracking, cost attribution, and organization. Pass for each
tag. Multiple tags can be set in a single update.
--tag KEY:VALUEbash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id <project-id> \
--tag env:prod \
--tag team:searchTags are sent as in the API request. Setting tags replaces all existing tags on the project — include
any existing tags the user wants to keep.
metadata.tags标签是用于团队跟踪、成本归属和组织的键值元数据对。每个标签使用传递。可以在一次更新中设置多个标签。
--tag KEY:VALUEbash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id <project-id> \
--tag env:prod \
--tag team:search标签会作为在API请求中发送。设置标签会替换项目上的所有现有标签——请包含用户希望保留的任何现有标签。
metadata.tagsElasticsearch search_lake settings
Elasticsearch search_lake设置
For Elasticsearch projects, two fields control query performance and data caching in the Search AI Lake. Ingested data
is stored in cost-efficient general storage. A cache layer on top provides faster search speed for recent and frequently
queried data — this cached data is considered search-ready.
| Flag | Range | Description |
|---|---|---|
| 28–3000 | Query performance level. Higher values improve performance but increase cost |
| 1–180 | Days of data eligible for boosted caching (default: 7) |
对于Elasticsearch项目,有两个字段控制Search AI Lake中的查询性能和数据缓存。摄入的数据会存储在成本效益高的通用存储中。顶部的缓存层可为最近和频繁查询的数据提供更快的搜索速度——这些缓存数据被视为搜索就绪。
| 标志 | 范围 | 说明 |
|---|---|---|
| 28–3000 | 查询性能级别。值越高,性能越好,但成本也越高 |
| 1–180 | 符合增强缓存条件的数据天数(默认值:7) |
Search Power
搜索性能(Search Power)
Search Power controls the speed of searches by provisioning more or fewer query resources. Common presets (matching the
Cloud UI):
| Value | Preset | Behavior |
|---|---|---|
| 28 | On-demand | Autoscales with lower baseline. More variable latency, reduced max throughput |
| 100 | Performant | Consistently low latency, autoscales for moderately high throughput |
| 250 | High availability | Optimized for high-throughput scenarios, maintains low latency at high volumes |
When the user asks for a preset by name, map it to the corresponding value. Custom values within 28–3000 are also valid.
Warn the user about cost implications before updating . Higher values increase VCU consumption and may
result in higher bills. Confirm the new value with the user before applying.
search_power搜索性能通过配置更多或更少的查询资源来控制搜索速度。常见预设(与Cloud UI匹配):
| 值 | 预设名称 | 行为描述 |
|---|---|---|
| 28 | 按需(On-demand) | 自动扩缩容,基线较低。延迟变化较大,最大吞吐量降低 |
| 100 | 高性能(Performant) | 持续低延迟,针对中等高吞吐量自动扩缩容 |
| 250 | 高可用(High availability) | 针对高吞吐量场景优化,在高负载下保持低延迟 |
当用户按名称请求预设时,将其映射到对应的值。28–3000范围内的自定义值也有效。
在更新前,请提醒用户注意成本影响。 值越高,VCU消耗越多,可能导致账单金额增加。在应用前,请与用户确认新值。
search_powerSearch Boost Window
搜索增强窗口(Search Boost Window)
Non-time-series data is always search-ready. The boost window determines how much time-series data (documents with a
field) is also kept in the fast cache layer. Increasing the window means a larger portion of time-series
data becomes search-ready, which improves query speed for recent data but increases the search-ready data volume.
@timestamp非时间序列数据始终是搜索就绪的。增强窗口决定了有多少时间序列数据(带有字段的文档)也会被保存在快速缓存层中。增大窗口意味着更大比例的时间序列数据变为搜索就绪,这会提高近期数据的查询速度,但会增加搜索就绪数据的体积。
@timestampSecurity data retention settings
安全项目的数据保留设置
For security projects, two fields control how long data is retained in the Search AI Lake. Retention is configured per
data stream, but these project-level settings enforce global boundaries.
| Flag | Unit | Description |
|---|---|---|
| days | Maximum retention period for any data stream in the project |
| days | Default retention applied to data streams without a custom one |
- Maximum retention — enforces an upper bound across all data streams. When lowered, it replaces the retention for any stream that currently has a longer period. Data older than the new maximum is permanently deleted.
- Default retention — automatically applied to data streams that do not have a custom retention period set. Does not affect streams with an existing custom retention.
Warn the user before reducing . Lowering the maximum permanently deletes data older than the new
limit. Confirm the new value with the user before applying.
max-retention-days对于安全项目,有两个字段控制Search AI Lake中数据的保留时间。保留时间是按数据流配置的,但这些项目级设置会强制执行全局限制。
| 标志 | 单位 | 说明 |
|---|---|---|
| 天 | 项目中任何数据流的最大保留周期 |
| 天 | 应用于未设置自定义保留周期的数据流的默认保留周期 |
- 最大保留周期 — 对所有数据流强制执行上限。当降低此值时,会替换当前保留周期较长的数据流的设置。超过新最大保留周期的数据会被永久删除。
- 默认保留周期 — 自动应用于未设置自定义保留周期的数据流。不会影响已有自定义保留周期的数据流。
在降低前,请提醒用户。 降低最大值会永久删除超过新限制的旧数据。在应用前,请与用户确认新值。
max-retention-daysWorkflow: Reset project credentials
工作流:重置项目凭证
Always confirm with the user before resetting.
bash
python3 skills/cloud/manage-project/scripts/manage-project.py reset-credentials \
--type elasticsearch \
--id <project-id>The new password is saved to automatically. Tell the user to open that file — do not display its
contents in chat.
.elastic-credentials重置前务必征得用户确认。
bash
python3 skills/cloud/manage-project/scripts/manage-project.py reset-credentials \
--type elasticsearch \
--id <project-id>新密码会自动保存到中。告知用户打开该文件——不要在聊天中显示其内容。
.elastic-credentialsWorkflow: Delete a project
工作流:删除项目
Always confirm with the user before deleting.
bash
python3 skills/cloud/manage-project/scripts/manage-project.py delete \
--type elasticsearch \
--id <project-id>删除前务必征得用户确认。
bash
python3 skills/cloud/manage-project/scripts/manage-project.py delete \
--type elasticsearch \
--id <project-id>Workflow: Resume a suspended project
工作流:恢复暂停的项目
Projects can be automatically suspended after their trial period expires. Resume with:
bash
python3 skills/cloud/manage-project/scripts/manage-project.py resume \
--type elasticsearch \
--id <project-id>After resuming, poll the project status until the phase changes from to .
initializinginitialized项目在试用期满后可能会自动暂停。使用以下命令恢复:
bash
python3 skills/cloud/manage-project/scripts/manage-project.py resume \
--type elasticsearch \
--id <project-id>恢复后,请轮询项目状态,直到阶段从变为。
initializinginitializedExamples
示例
List all security projects
列出所有安全项目
bash
python3 skills/cloud/manage-project/scripts/manage-project.py list --type securitybash
python3 skills/cloud/manage-project/scripts/manage-project.py list --type securityUpdate search power on an Elasticsearch project
更新Elasticsearch项目的搜索性能
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id abc123def456abc123def456abc12345 \
--search-power 500bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id abc123def456abc123def456abc12345 \
--search-power 500Set data retention on a security project
设置安全项目的数据保留周期
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type security \
--id abc123def456abc123def456abc12345 \
--max-retention-days 396 \
--default-retention-days 396bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type security \
--id abc123def456abc123def456abc12345 \
--max-retention-days 396 \
--default-retention-days 396Change project alias
更改项目别名
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id abc123def456abc123def456abc12345 \
--alias "prod-search"bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type elasticsearch \
--id abc123def456abc123def456abc12345 \
--alias "prod-search"Tag a project for cost tracking
为项目添加成本跟踪标签
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type observability \
--id abc123def456abc123def456abc12345 \
--tag env:prod \
--tag team:platformbash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type observability \
--id abc123def456abc123def456abc12345 \
--tag env:prod \
--tag team:platformRename an observability project
重命名可观测性项目
bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type observability \
--id abc123def456abc123def456abc12345 \
--name "production-logs"bash
python3 skills/cloud/manage-project/scripts/manage-project.py update \
--type observability \
--id abc123def456abc123def456abc12345 \
--name "production-logs"Connect to an existing project (credentials on file)
连接现有项目(凭证已保存)
text
User: I want to run a query against my search project "prod-search"
Agent: Let me find that project.
[runs: list --type elasticsearch]
I found "prod-search" (ID: abc123...). Loading saved credentials...
[runs: eval $(load-credentials --name prod-search)]
Credentials loaded. Verifying...
[runs: curl -H "Authorization: ApiKey ..." "${ELASTICSEARCH_URL}/_security/_authenticate"]
Verified — authenticated as user "my-service" via API key. You're all set.text
用户:我想对我的搜索项目"prod-search"运行查询
Agent:让我查找该项目。
[运行:list --type elasticsearch]
我找到了"prod-search"(ID:abc123...)。正在加载已保存的凭证...
[运行:eval $(load-credentials --name prod-search)]
凭证已加载。正在验证...
[运行:curl -H "Authorization: ApiKey ..." "${ELASTICSEARCH_URL}/_security/_authenticate"]
验证通过——已通过API密钥以用户"my-service"身份验证。一切准备就绪。Connect to a project (no saved credentials)
连接项目(无保存的凭证)
text
User: let's ingest some logs into my o11y project "siem-prod"
Agent: Let me find that project.
[runs: list --type observability]
Found "siem-prod" (ID: def456...). No saved credentials found for this project.
[runs: get --type observability --id def456...]
Endpoints set. Since there are no Elasticsearch credentials on file, I can reset the
admin bootstrap password to get initial access. Shall I proceed?
User: yes
Agent: [runs: reset-credentials --type observability --id def456...]
Credentials saved to .elastic-credentials — open that file to retrieve the password.
[runs: eval $(load-credentials --name siem-prod --include-admin)]
Admin credentials loaded for API key creation. Creating a scoped Elasticsearch API key
now — what access does it need?
User: read-only on logs-*
Agent: [creates scoped API key via elasticsearch-authn using admin credentials]
[appends API key to .elastic-credentials with project header]
[runs: eval $(load-credentials --name siem-prod)]
[verifies against ELASTICSEARCH_URL]
API key created and verified. Admin credentials removed from environment.text
用户:让我把一些日志摄入到我的可观测性项目"siem-prod"中
Agent:让我查找该项目。
[运行:list --type observability]
找到了"siem-prod"(ID:def456...)。未找到该项目的已保存凭证。
[运行:get --type observability --id def456...]
端点已设置。由于没有已保存的Elasticsearch凭证,我可以重置管理员引导密码以获取初始访问权限。是否继续?
用户:是
Agent:[运行:reset-credentials --type observability --id def456...]
凭证已保存到.elastic-credentials中——请打开该文件获取密码。
[运行:eval $(load-credentials --name siem-prod --include-admin)]
已加载管理员凭证用于创建API密钥。现在将创建范围限定的Elasticsearch API密钥——它需要哪些权限?
用户:对logs-*的只读权限
Agent:[使用管理员凭证通过elasticsearch-authn创建范围限定的API密钥]
[将API密钥添加到.elastic-credentials中,带有项目头部]
[运行:eval $(load-credentials --name siem-prod)]
[针对ELASTICSEARCH_URL进行验证]
API密钥已创建并验证。管理员凭证已从环境中移除。Delete a project after confirmation
确认后删除项目
text
User: delete my elasticsearch project abc123...
Agent: Are you sure you want to delete project abc123...? This cannot be undone.
User: yesbash
python3 skills/cloud/manage-project/scripts/manage-project.py delete \
--type elasticsearch \
--id abc123def456abc123def456abc12345text
用户:删除我的elasticsearch项目abc123...
Agent:您确定要删除项目abc123...吗?此操作无法撤销。
用户:是bash
python3 skills/cloud/manage-project/scripts/manage-project.py delete \
--type elasticsearch \
--id abc123def456abc123def456abc12345Guidelines
指南
- Run the skill first if
cloud-setupis not set.EC_API_KEY - Use the skill to create new projects — this skill handles existing projects only.
cloud-create-project - When the user refers to a project the agent did not create, follow the "Connect to an existing project" workflow.
- Deletion is permanent. Always confirm with the user before proceeding.
- After resetting credentials, remind the user to update any stored passwords or environment variables.
- Warn about cost implications before increasing . Confirm the new value with the user first.
search_power - Warn about data loss before reducing . Data older than the new maximum is permanently deleted.
max-retention-days - Warn users that changing a project alias changes all endpoint URLs, which breaks existing clients.
- Setting tags replaces all existing tags. Retrieve current tags with first and include any the user wants to keep.
get
- 如果未设置,请先运行
EC_API_KEY技能。cloud-setup - 使用技能创建新项目——本技能仅处理现有项目。
cloud-create-project - 当用户提及Agent未创建的项目时,请遵循"连接现有项目"工作流。
- 删除操作是永久性的。在继续前务必征得用户确认。
- 重置凭证后,请提醒用户更新所有已保存的密码或环境变量。
- 在提高前,提醒用户注意成本影响。请先与用户确认新值。
search_power - 在降低前,提醒用户注意数据丢失风险。超过新最大值的旧数据会被永久删除。
max-retention-days - 提醒用户更改项目别名会更改所有端点URL,这会导致现有客户端无法正常工作。
- 设置标签会替换所有现有标签。请先使用命令获取当前标签,并包含用户希望保留的标签。
get
Script reference
脚本参考
| Command | Description |
|---|---|
| List projects by type |
| Get project details by ID |
| Update project name, alias, tags, or search_lake settings |
| Reset project credentials (new password) |
| Delete a project |
| Resume a suspended project |
| Load a project's saved credentials from |
| Flag | Commands | Description |
|---|---|---|
| list, get, update, reset-credentials, delete, resume | Project type: |
| get, update, reset-credentials, delete, resume, load-credentials | Project ID |
| update, load-credentials | Project name (update: new name; load-credentials: lookup) |
| update | New project alias |
| update | Tag as KEY:VALUE (repeatable, replaces all tags) |
| update | Search power 28–3000 (elasticsearch only) |
| update | Boost window 1–180 days (elasticsearch only) |
| update | Max data retention in days (security only) |
| update | Default data retention in days (security only) |
| load-credentials | Include admin username/password (API key bootstrapping only) |
| reset-credentials | Seconds to wait for credential propagation (0 to skip) |
| 命令 | 说明 |
|---|---|
| 按类型列出项目 |
| 通过ID获取项目详情 |
| 更新项目名称、别名、标签或search_lake设置 |
| 重置项目凭证(生成新密码) |
| 删除项目 |
| 恢复暂停的项目 |
| 从 |
| 标志 | 适用命令 | 说明 |
|---|---|---|
| list, get, update, reset-credentials, delete, resume | 项目类型: |
| get, update, reset-credentials, delete, resume, load-credentials | 项目ID |
| update, load-credentials | 项目名称(update:新名称;load-credentials:用于查找) |
| update | 新项目别名 |
| update | 标签,格式为KEY:VALUE(可重复,会替换所有现有标签) |
| update | 搜索性能,范围28–3000(仅适用于elasticsearch项目) |
| update | 增强窗口,范围1–180天(仅适用于elasticsearch项目) |
| update | 最大数据保留天数(仅适用于security项目) |
| update | 默认数据保留天数(仅适用于security项目) |
| load-credentials | 包含管理员用户名/密码(仅用于引导创建API密钥) |
| reset-credentials | 等待凭证传播的秒数(0表示跳过) |
Environment variables
环境变量
| Variable | Required | Description |
|---|---|---|
| Yes | Elastic Cloud API key (project management operations) |
| No | Cloud API base URL (default: |
| Output | Elasticsearch URL (set after resolving a project for downstream skills) |
| Output | Kibana URL (set after resolving a project for downstream skills) |
| Output | APM endpoint (observability projects only) |
| Output | OTLP ingest endpoint (observability and security projects) |
| Output | Elasticsearch API key (for stack-level operations) |
| 变量名称 | 是否必填 | 说明 |
|---|---|---|
| 是 | Elastic Cloud API密钥(用于项目管理操作) |
| 否 | Cloud API基础URL(默认值: |
| 输出项 | Elasticsearch URL(解析项目后设置,供下游技能使用) |
| 输出项 | Kibana URL(解析项目后设置,供下游技能使用) |
| 输出项 | APM端点(仅适用于observability项目) |
| 输出项 | OTLP摄入端点(适用于observability和security项目) |
| 输出项 | Elasticsearch API密钥(用于栈级操作) |
Additional resources
额外资源
- For full API details, request/response schemas, and project-type options, see the Serverless Projects API
- For official documentation on Search AI Lake settings, data retention, and project features, see Project settings
- 有关完整的API详情、请求/响应架构和项目类型选项,请参阅Serverless Projects API
- 有关Search AI Lake设置、数据保留和项目功能的官方文档,请参阅Project settings