Skip to content
Cloud & Infrastructure
Skill

/manage-resource-file

管理 Dataphin 资源文件(上传 JAR/配置文件等 UDF 资源并创建/更新/查询/删除 Dataphin 资源)。 当用户场景涉及上传资源文件、创建资源、UDF 所需 JAR、更新资源、查询资源版本、删除资源时进入。 触发场景: - 上传 JAR/配置文件作为 Dataphin 资源(UDF 依赖的 JAR 包等) - 创建资源(create-resource) - 查询资源最新版本或指定版本 - 更新资源(先 get-resource 再 update-resource) - 删除资源 触发词:上传资源、资源文件、UDF 资源、JAR

From plugin
alibabacloud-aiops-skills
249200 skills
Install
$ npx -y skills add aliyun/alibabacloud-aiops-skills --skill manage-resource-file --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/manage-resource-file

Context preview

The summary Claude sees to decide when to auto-load this skill.

管理 Dataphin 资源文件(上传 JAR/配置文件等 UDF 资源并创建/更新/查询/删除 Dataphin 资源)。 当用户场景涉及上传资源文件、创建资源、UDF 所需 JAR、更新资源、查询资源版本、删除资源时进入。 触发场景: - 上传 JAR/配置文件作为 Dataphin 资源(UDF 依赖的 JAR 包等) - 创建资源(create-resource) - 查询资源最新版本或指定版本 - 更新资源(先 get-resource 再 update-resource) - 删除资源 触发词:上传资源、资源文件、UDF 资源、JAR

SKILL.md

manage-resource-file.SKILL.md
name: manage-resource-file
description: |-
  管理 Dataphin 资源文件(上传 JAR/配置文件等 UDF 资源并创建/更新/查询/删除 Dataphin 资源)。
  当用户场景涉及上传资源文件、创建资源、UDF 所需 JAR、更新资源、查询资源版本、删除资源时进入。

  触发场景:
  - 上传 JAR/配置文件作为 Dataphin 资源(UDF 依赖的 JAR 包等)
  - 创建资源(create-resource)
  - 查询资源最新版本或指定版本
  - 更新资源(先 get-resource 再 update-resource)
  - 删除资源

  触发词:上传资源、资源文件、UDF 资源、JAR 资源、创建资源、create-resource、get-resource、get-resource-by-version、update-resource、delete-resource、get-file-storage-credential、ossutil、minio mc、ceph。

  关键限制:StorageType 决定上传工具(oss 用 ossutil,ceph 用 minio mc);oss 凭证带临时 SecurityToken(sts-token),ceph 无;create-resource 的 compute-engine-type 仅 UDF 资源需指定引擎,非 UDF 用 NONE;19 位 ID 一律字符串传参。

资源文件管理 Skill

1. Scenario Description

场景:需要把本地文件(JAR 包、配置文件等)上传为 Dataphin 资源,供 UDF 或其他任务引用;以及对已有资源的查询、更新、删除。

Architecture

用户请求 → 确认参数
  1) get-file-storage-credential 获取对象存储凭证(StorageType=oss/ceph)
  2) 按存储类型上传本地文件
     - oss:ossutil cp(带 sts-token)
     - ceph:minio mc 配置 alias 后 cp
  3) create-resource / update-resource / get-resource / delete-resource

涉及 Dataphin OpenAPI

  • `GetFileStorageCredential` — 获取对象存储上传凭证
  • `CreateResource` — 创建资源
  • `GetResource` — 获取资源最新版本
  • `GetResourceByVersion` — 获取资源指定版本
  • `UpdateResource` — 更新资源
  • `DeleteResource` — 删除资源

2. Installation

# 安装 aliyun CLI(>= 3.4.8)
# 各操作系统一键安装脚本见 ./references/cli-installation-guide.md

# 安装 dataphin-public 插件
aliyun plugin install --names aliyun-cli-dataphin-public

# 验证
aliyun dataphin-public --help

详见 [CLI 安装指南](./references/cli-installation-guide.md)。

3. Environment Variables

> 凭证与环境变量由父 skill `alibabacloud-dataphin-skills` 统一声明并预检(父 §3 + §4 Authentication + §8 Step 0,先于路由到本 skill 执行);本 skill 不重复声明。

4. Authentication

Pre-check: Credentials Required

> **Security Rules:** > - **NEVER** 读取、回显或打印凭证环境变量(禁止对 AccessKey ID / Secret 做任何输出或日志) > - **NEVER** 要求用户在本会话或命令行直接输入 AK/SK > - **NEVER** 使用 `aliyun configure set` 写入字面量凭证 > - **ONLY** 使用 `aliyun configure list` 检查凭证状态 > > ```bash > aliyun configure list > ``` > 检查输出中是否存在有效 profile(AK、STS 或 OAuth 身份)。 > > **如果没有有效 profile,请在此停止。** > 1. 从 [Alibaba Cloud Console](https://ram.console.aliyun.com/manage/ak) 获取凭证 > 2. 在会话外配置(终端执行 `aliyun configure`,或在 shell profile 中设置环境变量) > 3. 重新运行 `aliyun configure list` 确认有效后再继续

Pre-check: Aliyun CLI plugin update required

> [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation. > [MUST] run `aliyun plugin update` to ensure that any existing plugins are always up-to-date. > > 执行前确认 CLI 与插件版本: > ```bash > aliyun version > aliyun plugin list > ```

5. RAM Policy

> **[MUST] Permission Failure Handling:** When any command or API call fails due to permission errors at any point during execution, follow this process: > 1. Read `../../ram-policies.md` to get the full list of permissions required by this SKILL > 2. Use `ram-permission-diagnose` skill to guide the user through requesting the necessary permissions > 3. Pause and wait until the user confirms that the required permissions have been granted

本 skill 最小权限见 [../../ram-policies.md](../../ram-policies.md)。

6. IMPORTANT: Parameter Confirmation

创建/更新资源前,**任何未由用户显式提供的参数都必须主动询问用户**,禁止猜测或假设默认值(除 `--directory` 可默认 `/`、`--description`/`--comment` 未明确时可填 resource-name、非 UDF 资源 `--compute-engine-type` 可默认 NONE 外)。

必须获取的参数

| 参数 | 说明 | 是否必须询问 | |------|------|-------------| | `--tenant-id` | 租户 ID;优先从 profile 读取,未配置则必须询问 | 条件必须 | | `--project-id` | 项目 ID;优先从 profile 读取,未配置则必须询问 | 条件必须 | | `--resource-name` | 资源名称 | **必须** | | `--resource-type` | 资源类型 | **必须** | | `--directory` | 资源目录;未明确时默认 `/` | 可选确认 | | `--storage-address` | 上传后的对象存储目标文件名(来自 get-file-storage-credential 的 ObjectName) | 由上传流程产出 | | `--description` | 资源描述;未明确时默认填 resource-name | 可选确认 | | `--comment` | 资源注释;未明确时默认填 resource-name | 可选确认 | | `--compute-engine-type` | 计算引擎类型;仅 UDF 所需资源需指定,非 UDF 用 `NONE` | 条件必须 |

询问模板

当用户说"上传资源/创建资源"但未给出具体信息时,按以下顺序追问:

1. **环境确认**:"请在 DEV 还是 PROD 环境执行?(默认 PROD)" 2. **项目确认**:"请提供项目 ID 或项目名。" 3. **资源名称**:"请提供资源名称。" 4. **资源类型**:"请指定资源类型(如 Archive/Java/Python 等)。是否为 UDF 所需资源?" 5. **本地文件**:"请提供要上传的本地文件路径。" 6. **目录**:"资源存放目录?(默认 `/`)" 7. **描述/注释**:"资源描述和注释?(未明确将默认填资源名)" 8. **引擎类型**(仅 UDF):"UDF 所需资源请指定计算引擎类型;非 UDF 将使用 `NONE`。"

> **在所有必填参数确认完整之前,禁止调用 `create-resource` / `update-resource`。**

7. Observability

版本 `{version}`(Shell 变量 `SKILL_VERSION`)来自套件 `references/manifest.json` 的 `version` 字段,与 session-id 一同继承[父技能 §7](../../../SKILL.md#7-observability)。直接加载本子技能时先完成父层初始化;所有 CLI / SDK 调用使用父技能名称与同一版本,跨 Shell 调用须重新注入这些值。

本 Skill 属于 `alibabacloud-dataphin-skills` 套件,**继承父 Skill `alibabacloud-dataphin-skills` 的 session-id**,子 Skill 不再重新生成。

所有调用 Alibaba Cloud API 的 `aliyun dataphin-public` 命令必须携带:

--user-agent "AlibabaCloud-Agent-Skills/alibabacloud-dataphin-skills/{session-id} skill-version/{version}"

其中 `{session-id}` 替换为父 Skill 生成的 32 位小写十六进制字符串。

> 本地工具命令(`ossutil`、`mc`)不携带 `--user-agent`。

8. Core Workflow

步骤 0:会话级预检

由父 skill 完成 CLI/凭证预检(§4 + §8 Step 0)。

步骤 1:获取对象存储凭证

TENANT_ID="<tenant-id>"
PROJECT_ID="<project-id>"
ENV=PROD
USER_AGENT="AlibabaCloud-Agent-Skills/alibabacloud-dataphin-skills/{session-id} skill-version/{version}"

aliyun dataphin-public get-file-storage-credential \
  --dataphin-profile <p> --env $ENV \
  --project-id "$PROJECT_ID" --tenant-id "$TENANT_ID" \
  --purpose RESOURCE \
  --user-agent "$USER_AGENT" --format json \
  | jq '.StorageCredential | {
       StorageType, AccessId, AccessKey, Endpoint, Bucket, ObjectName, SecurityToken
     }'

> **SecurityToken 字段仅 oss 存在**,ceph 无该字段。**禁止回显 AccessId / AccessKey / SecurityToken 明文**,仅用变量承接。

步骤 2:按存储类型上传本地文件

> **工具安装**:ossutil / minio mc 的分平台(macOS / Linux / Windows)详细安装步骤见 [./references/ossutil-mc-install.md](./references/ossutil-mc-install.md)。

a. StorageType = oss

1. 检查 ossutil 是否安装(`ossutil version`),未安装则按 [ossutil-mc-install.md §一](./references/ossutil-mc-install.md) 安装(使用 v1,支持 `--sts-token`)。 2. 上传:

Read more
Ships withalibabacloud-aiops-skills

Official Alibaba Cloud Agent Skills collection, providing AI agents with rich Alibaba Cloud product capabilities and general-purpose tooling.

Get the whole plugin

Other skills on alibabacloud-aiops-skills.