aicore-admin-resources

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Rules

规则

  1. Always run
    check_setup.py
    first when credentials are unknown or when any script fails with an auth error.
  2. AICORE_BASE_URL
    must end in
    /v2
    — this is the single most common misconfiguration.
  3. Never display or log the client secret or token value in clear text. Print only what the user needs (e.g. the resource group, not the full config).
  4. X.509 certificate auth is an alternative to client secret — both are supported.

  1. 当凭据未知或任何脚本因认证错误而失败时,始终先运行
    check_setup.py
    。
  2. AICORE_BASE_URL
    必须以
    /v2
    结尾——这是最常见的配置错误。
  3. 切勿以明文显示或记录 client secret 或 token 值。仅打印用户所需的信息(例如 resource group,而非完整配置)。
  4. X.509 certificate auth 是 client secret 的替代方案——两种方式均受支持。

Check Setup

检查设置

Verifies credentials and prints the active resource group:
bash
uv run scripts/check_setup.py
Expected output on success:
json
{
  "status": "ok",
  "resource_group": "<your-resource-group>",
  "base_url": "https://api.ai.<region>...",
  "auth_url": "https://..."
}
If this fails, read
references/SETUP.md
for step-by-step credential configuration.

验证凭据并打印当前活动的 resource group:
bash
uv run scripts/check_setup.py
成功时的预期输出:
json
{
  "status": "ok",
  "resource_group": "<your-resource-group>",
  "base_url": "https://api.ai.<region>...",
  "auth_url": "https://..."
}
如果检查失败,请阅读
references/SETUP.md
,了解分步配置凭据的详细说明。

Get Auth Token

获取 Auth Token

Prints a raw Bearer token to stdout — useful for curl testing:
bash
export TOKEN=$(uv run scripts/get_token.py)
Always capture the token into a variable. Never run
get_token.py
standalone or with
2>&1
— that prints the raw JWT into the conversation. The success message already goes to stderr cleanly;
$()
capture gives only the bare token.

将原始 Bearer token 打印到 stdout——这对于 curl 测试很有用:
bash
export TOKEN=$(uv run scripts/get_token.py)
始终将 token 捕获到变量中。切勿单独运行
get_token.py
,也不要与
2>&1
一起运行——否则会将原始 JWT 打印到对话中。成功消息会简洁地输出到 stderr;使用
$()
捕获只会得到纯 token。

Configure Credentials

配置凭据

Three options — see
references/SETUP.md
for the full guide:
OptionCommand / Action
Interactive CLI (recommended)
aicore configure
Environment variablesSet
AICORE_AUTH_URL
,
AICORE_CLIENT_ID
,
AICORE_CLIENT_SECRET
,
AICORE_BASE_URL
,
AICORE_RESOURCE_GROUP
Profile config fileCreate
~/.aicore/config.json

共有三种选项——有关完整指南,请参阅
references/SETUP.md
:
选项命令 / 操作
交互式 CLI(推荐)
aicore configure
环境变量设置
AICORE_AUTH_URL
、
AICORE_CLIENT_ID
、
AICORE_CLIENT_SECRET
、
AICORE_BASE_URL
、
AICORE_RESOURCE_GROUP
Profile 配置文件创建
~/.aicore/config.json

Common Errors

常见错误

ErrorFix
401 Unauthorized
Re-run
aicore configure
— wrong client_id or secret
404 Not Found
Append
/v2
to
AICORE_BASE_URL
Resource group not found
Create it in AI Core Launchpad or contact admin
No credentials found
Set the required env vars or run
aicore configure

错误修复方式
401 Unauthorized重新运行
aicore configure
——client_id 或 secret 错误
404 Not Found将
/v2
追加到
AICORE_BASE_URL
Resource group not found在 AI Core Launchpad 中创建,或联系管理员
No credentials found设置必需的环境变量,或运行
aicore configure

Switch Profiles (Multi-Landscape)

切换 Profile(多 Landscape)

When working across multiple landscapes, credentials live as
config_<profile>.json
files under
AICORE_HOME
(default:
~/.aicore
). Because the shell environment is clean on each agent run, the profile must be set before the agent starts or inline with each command.
Option 1 — set in your shell before starting the agent:
bash
export AICORE_HOME=/path/to/credentials  # only needed if not ~/.aicore
export AICORE_PROFILE=<profile>
在多个 landscape 之间工作时,凭据以
config_<profile>.json
文件的形式存放在
AICORE_HOME
(默认:
~/.aicore
)下。由于每次 Agent 运行时 shell 环境都是干净的,因此必须在 Agent 启动前设置 profile,或在每条命令中内联设置。
选项 1 — 在启动 Agent 前于 shell 中设置:
bash
export AICORE_HOME=/path/to/credentials  # only needed if not ~/.aicore
export AICORE_PROFILE=<profile>

then start the agent — it inherits the env vars

then start the agent — it inherits the env vars


**Option 2 — source and run in one shell (for agent use):**
```bash
source scripts/set_profile.sh <profile> && uv run scripts/check_setup.py
Option 3 — inline per command:
bash
AICORE_PROFILE=<profile> uv run scripts/check_setup.py
To list available profiles:
bash
source scripts/set_profile.sh


**选项 2 — 在同一个 shell 中加载并运行(供 Agent 使用):**
```bash
source scripts/set_profile.sh <profile> && uv run scripts/check_setup.py
选项 3 — 对每条命令内联设置:
bash
AICORE_PROFILE=<profile> uv run scripts/check_setup.py
要列出可用的 profile:
bash
source scripts/set_profile.sh

Manage Resource Groups

管理 Resource Groups

bash
undefined
bash
undefined

List all resource groups:

List all resource groups:

uv run scripts/list_resource_groups.py
uv run scripts/list_resource_groups.py

Show detailed view (includes labels):

Show detailed view (includes labels):

uv run scripts/list_resource_groups.py --response-format detailed
uv run scripts/list_resource_groups.py --response-format detailed

JSON output:

JSON output:

uv run scripts/list_resource_groups.py --json
uv run scripts/list_resource_groups.py --json

Inspect a single resource group:

Inspect a single resource group:

uv run scripts/list_resource_groups.py --resource-group-id <id>
uv run scripts/list_resource_groups.py --resource-group-id <id>

Create a resource group:

Create a resource group:

uv run scripts/create_resource_group.py --id <id>
uv run scripts/create_resource_group.py --id <id>

Create with labels (keys must be prefixed ext.ai.sap.com/ or scenarios.ai.sap.com/):

Create with labels (keys must be prefixed ext.ai.sap.com/ or scenarios.ai.sap.com/):

uv run scripts/create_resource_group.py --id <id> --label ext.ai.sap.com/team=data --label ext.ai.sap.com/env=prod
uv run scripts/create_resource_group.py --id <id> --label ext.ai.sap.com/team=data --label ext.ai.sap.com/env=prod

Update labels (replaces the full label set):

Update labels (replaces the full label set):

uv run scripts/patch_resource_group.py --id <id> --label ext.ai.sap.com/team=data
uv run scripts/patch_resource_group.py --id <id> --label ext.ai.sap.com/team=data

Delete a resource group (--confirm is required):

Delete a resource group (--confirm is required):

uv run scripts/delete_resource_group.py --id <id> --confirm

Note: Resource group IDs must be 3–10 lowercase alphanumeric characters (hyphens allowed, not at start/end). Label keys must use the prefix `ext.ai.sap.com/` or `scenarios.ai.sap.com/` — bare keys like `team=data` will be rejected with a 400 error. Deletion may return 409 ("Conflicting ongoing action") immediately after creation while provisioning completes — retry after a short wait.

---
uv run scripts/delete_resource_group.py --id <id> --confirm

注意:Resource group ID 必须为 3–10 个小写字母数字字符(允许使用连字符,但不能位于开头或结尾)。Label key 必须使用前缀 `ext.ai.sap.com/` 或 `scenarios.ai.sap.com/`——诸如 `team=data` 这样的裸 key 将被拒绝并返回 400 错误。创建后,在预配完成之前立即删除可能会返回 409("Conflicting ongoing action")——请稍等片刻后重试。

---

Handoffs

任务移交

  • Ready to manage deployments? → invoke
    aicore-lifecycle-management
  • Need to list available models? → invoke
    genai-hub-foundation-models

  • 准备管理 deployments? → 调用
    aicore-lifecycle-management
  • 需要列出可用 models? → 调用
    genai-hub-foundation-models

When to Load Reference Files

何时加载参考文件

TriggerLoad
Any credential/auth error or setup question
references/SETUP.md
触发条件加载
任何凭据或认证错误、设置问题
references/SETUP.md