huawei-cloud-swr-enterprise-instance

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Huawei Cloud SWR Enterprise Instance Management

Huawei Cloud SWR企业实例管理

Overview

概述

This skill provides lifecycle management capabilities for Huawei Cloud SWR (Software Repository for Container) enterprise instances using the
hcloud
CLI. Enterprise instances provide dedicated, isolated container registry environments with advanced features like security scanning, replication policies, and custom domain support.
Note: Some features mentioned above (e.g., replication policies) are managed via the SWR enterprise instance console, not through this skill's CLI commands. See the Unsupported Operations section below for details.
Architecture: hcloud CLI → SWR Service API → Instance/Namespace/Registry/Repository/Artifact/Credential/Endpoint/Domain resources
Related Skills:
  • huawei-cloud-swr-image-management
    - Image lifecycle management (basic SWR namespaces, repos, tags, auth, quotas)
  • huawei-cloud-swr-image-governance
    - Image governance (permissions, retention, sharing, tags, immutable rules)
  • huawei-cloud-swr-image-automation
    - Image automation ops (sync, triggers, domains)
  • Create and manage SWR enterprise instances
  • Manage instance namespaces with security scanning and vulnerability blocking
  • Configure instance registries for cross-instance image sync
  • Query and manage instance repositories and artifacts
  • Obtain instance access credentials (long-term and temporary)
  • Configure instance network access (internal VPC endpoints, public access with whitelist)
  • Manage custom domains for instance access
  • Monitor instance statistics and job status
Typical Use Cases:
  • "Create an SWR enterprise instance for my organization"
  • "List all enterprise instances in my project"
  • "Create a namespace with auto-scan and vulnerability blocking"
  • "Configure a registry for syncing images to another instance"
  • "List repositories and artifacts in my instance"
  • "Get docker login credentials for my instance"
  • "Add a VPC internal endpoint for my instance"
  • "Enable public access with IP whitelist"
  • "Add a custom domain to my instance"
  • "Check instance statistics and resource usage"
本技能通过
hcloud
CLI为华为云SWR(容器软件仓库)企业实例提供生命周期管理能力。企业实例提供专用、隔离的容器注册表环境,具备安全扫描、复制策略、自定义域名支持等高级功能。
注意:上述部分功能(如复制策略)通过SWR企业实例控制台管理,而非本技能的CLI命令。详情请见下文的不支持的操作部分。
架构:hcloud CLI → SWR服务API → 实例/命名空间/注册表/仓库/制品/凭证/端点/域名资源
相关技能
  • huawei-cloud-swr-image-management
    - 镜像生命周期管理(基础SWR命名空间、仓库、标签、认证、配额)
  • huawei-cloud-swr-image-governance
    - 镜像治理(权限、保留、共享、标签、不可变规则)
  • huawei-cloud-swr-image-automation
    - 镜像自动化操作(同步、触发器、域名)
  • 创建并管理SWR企业实例
  • 管理带有安全扫描和漏洞拦截功能的实例命名空间
  • 配置实例注册表以实现跨实例镜像同步
  • 查询并管理实例仓库和制品
  • 获取实例访问凭证(长期和临时)
  • 配置实例网络访问(内部VPC端点、带白名单的公网访问)
  • 管理实例访问的自定义域名
  • 监控实例统计信息和任务状态
典型用例
  • "为我的组织创建一个SWR企业实例"
  • "列出我的项目中的所有企业实例"
  • "创建一个带有自动扫描和漏洞拦截功能的命名空间"
  • "配置注册表以将镜像同步到另一个实例"
  • "列出我的实例中的仓库和制品"
  • "获取我的实例的docker登录凭证"
  • "为我的实例添加一个VPC内部端点"
  • "启用带IP白名单的公网访问"
  • "为我的实例添加一个自定义域名"
  • "查看实例统计信息和资源使用情况"

Prerequisites

前提条件

1. hcloud CLI Requirements (MANDATORY)

1. hcloud CLI要求(必填)

  • hcloud CLI installed (version >= 7.2.2)
  • Run
    hcloud version
    to verify installation
  • First-time usage:
    printf "y\n" | hcloud version
    to accept privacy statement
  • 已安装hcloud CLI(版本 >= 7.2.2)
  • 运行
    hcloud version
    验证安装
  • 首次使用:运行
    printf "y\n" | hcloud version
    以接受隐私声明

2. Credential Configuration

2. 凭证配置

hcloud CLI supports two credential modes. See references/credential-configuration.md for full details.
Quick setup (choose one):
bash
undefined
hcloud CLI支持两种凭证模式。详情请见references/credential-configuration.md
快速设置(选择其一):
bash
undefined

Mode A — Long-term AK/SK

Mode A — 长期AK/SK

export HUAWEI_CLOUD_AK=<your-ak> export HUAWEI_CLOUD_SK=<your-sk> export HUAWEI_CLOUD_REGION=cn-north-4
export HUAWEI_CLOUD_AK=<your-ak> export HUAWEI_CLOUD_SK=<your-sk> export HUAWEI_CLOUD_REGION=cn-north-4

Mode B — Temporary AK/SK + SecurityToken

Mode B — 临时AK/SK + SecurityToken

export HUAWEI_CLOUD_AK=<your-temp-ak> export HUAWEI_CLOUD_SK=<your-temp-sk> export HUAWEI_CLOUD_SECURITY_TOKEN=<your-security-token> export HUAWEI_CLOUD_REGION=cn-north-4

- **Security rules**: Never expose AK/SK/SecurityToken values. Use `hcloud configure list` to check presence only.
export HUAWEI_CLOUD_AK=<your-temp-ak> export HUAWEI_CLOUD_SK=<your-temp-sk> export HUAWEI_CLOUD_SECURITY_TOKEN=<your-security-token> export HUAWEI_CLOUD_REGION=cn-north-4

- **安全规则**:切勿暴露AK/SK/SecurityToken值。仅使用`hcloud configure list`检查是否存在。

3. SWR Enterprise Service Activation (MANDATORY)

3. SWR企业服务激活(必填)

Before creating SWR enterprise instances, the user must first activate the SWR enterprise service in the Huawei Cloud console. This is a one-time enablement step per account/region.
Activation Steps:
  1. Access the SWR enterprise instance console via direct URL:
    https://console.huaweicloud.com/swr-instance
    • Important: The SWR enterprise instance console is not available from the main console navigation menu. Users must use this direct URL to access it.
  2. If prompted, review and accept the SWR enterprise service terms
  3. Confirm the service is activated by verifying the console loads successfully
  4. If activation is not available in the target region, the console will display an error or the service will not be listed
Verification: After activation, run
hcloud SWR ListInstance --cli-region=<region>
— if the service is activated, this returns an empty list (or existing instances). If not activated, an error will be returned.
Console Access:
  • SWR Enterprise Instance Console:
    https://console.huaweicloud.com/swr-instance
  • This URL provides access to instance management, namespace configuration, repository browsing, and replication policy setup
  • The console is region-aware — select the target region in the top-right corner after opening the URL
在创建SWR企业实例之前,用户必须先在华为云控制台激活SWR企业服务。这是每个账号/区域的一次性启用步骤。
激活步骤
  1. 通过直接URL访问SWR企业实例控制台:
    https://console.huaweicloud.com/swr-instance
    • 重要提示:SWR企业实例控制台无法从主控制台导航菜单进入。用户必须使用此直接URL访问。
  2. 如有提示,查看并接受SWR企业服务条款
  3. 通过验证控制台是否成功加载,确认服务已激活
  4. 如果目标区域无法激活,控制台会显示错误或服务未列出
验证:激活后,运行
hcloud SWR ListInstance --cli-region=<region>
——如果服务已激活,将返回空列表(或现有实例);如果未激活,将返回错误。
控制台访问
  • SWR企业实例控制台:
    https://console.huaweicloud.com/swr-instance
  • 此URL提供实例管理、命名空间配置、仓库浏览和复制策略设置的访问权限
  • 控制台支持区域切换——打开URL后,在右上角选择目标区域

4. IAM Permission Requirements

4. IAM权限要求

This skill requires SWR enterprise instance permissions (instance, namespace, registry, repository, artifact, credential, endpoint, domain, job, statistic operations). See IAM Permission Policies for the complete permission table and policy JSON.
Permission Failure Handling:
  1. When any command fails due to permission errors, read
    references/iam-policies.md
  2. Display the required permission list and policy JSON to the user
  3. Guide the user to create a custom policy in the IAM console and grant authorization
  4. Pause execution and wait for user confirmation that permissions have been granted
本技能需要SWR企业实例权限(实例、命名空间、注册表、仓库、制品、凭证、端点、域名、任务、统计操作)。完整权限表和策略JSON请见IAM Permission Policies
权限失败处理
  1. 当任何命令因权限错误失败时,查看
    references/iam-policies.md
  2. 向用户显示所需权限列表和策略JSON
  3. 指导用户在IAM控制台创建自定义策略并授予权限
  4. 暂停执行,等待用户确认权限已授予

Core Commands

核心命令

1. Instance Lifecycle

1. 实例生命周期

See Task: Instance Lifecycle for detailed workflows.
bash
undefined
详细工作流请见Task: Instance Lifecycle
bash
undefined

Create an enterprise instance

创建企业实例

hcloud SWR CreateInstance --name=my-instance --spec=swr.ee.professional --charge_mode=postPaid --vpc_id=<vpc-id> --subnet_id=<subnet-id> --enterprise_project_id=0 --cli-region=cn-north-4
hcloud SWR CreateInstance --name=my-instance --spec=swr.ee.professional --charge_mode=postPaid --vpc_id=<vpc-id> --subnet_id=<subnet-id> --enterprise_project_id=0 --cli-region=cn-north-4

List all instances

列出所有实例

hcloud SWR ListInstance --cli-region=cn-north-4
hcloud SWR ListInstance --cli-region=cn-north-4

List instances with status filter

按状态过滤列出实例

hcloud SWR ListInstance --status=Running --cli-region=cn-north-4
hcloud SWR ListInstance --status=Running --cli-region=cn-north-4

Show instance details

查看实例详情

Show instance details

hcloud SWR ShowInstance --instance_id=<instance-id> --cli-region=cn-north-4
Note:
ShowInstance
does not return endpoint information. To view network access endpoints, use:
  • hcloud SWR ListInstanceInternalEndpoints --instance_id=<instance-id> --cli-region=cn-north-4
    for internal VPC endpoints
  • hcloud SWR ShowInstanceEndpointPolicy --instance_id=<instance-id> --cli-region=cn-north-4
    for public access status and whitelist
hcloud SWR ShowInstance --instance_id=<instance-id> --cli-region=cn-north-4
注意
ShowInstance
不返回端点信息。要查看网络访问端点,请使用:
  • hcloud SWR ListInstanceInternalEndpoints --instance_id=<instance-id> --cli-region=cn-north-4
    查看内部VPC端点
  • hcloud SWR ShowInstanceEndpointPolicy --instance_id=<instance-id> --cli-region=cn-north-4
    查看公网访问状态和白名单

View instance configuration

查看实例配置

hcloud SWR ShowInstanceConfiguration --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ShowInstanceConfiguration --instance_id=<instance-id> --cli-region=cn-north-4

Update instance configuration (anonymous access)

更新实例配置(匿名访问)

Update instance configuration (anonymous access)

hcloud SWR UpdateInstanceConfiguration --instance_id=<instance-id> --anonymous_access=false --cli-region=cn-north-4
Configuration Scope:
UpdateInstanceConfiguration
only supports the
--anonymous_access
parameter (boolean). This is the sole instance-level configuration option available via API. Other settings (spec, VPC, encryption) are set at creation time and cannot be modified afterward.
hcloud SWR UpdateInstanceConfiguration --instance_id=<instance-id> --anonymous_access=false --cli-region=cn-north-4
配置范围
UpdateInstanceConfiguration
仅支持
--anonymous_access
参数(布尔值)。这是API支持的唯一实例级配置选项。其他设置(规格、VPC、加密)在创建时设置,之后无法修改。

Delete instance (CAUTION: removes all data permanently)

删除实例(注意:永久删除所有数据)

hcloud SWR DeleteInstance --instance_id=<instance-id> --cli-region=cn-north-4

**Instance Naming Rules**:
- Start with lowercase letter
- Followed by lowercase letters, digits, or hyphens (`-`)
- No consecutive hyphens
- Cannot end with hyphen
- Length: 3-48 characters

**Instance Spec Options**: `swr.ee.basic` (basic edition), `swr.ee.professional` (professional edition)

**Spec and Region Availability**:
- Not all specs (flavors) are available in all regions. Before creating an instance, verify that the desired spec is supported in the target region.
- Use `hcloud SWR ListInstance --cli-region=<region>` to check if the SWR enterprise service is available in a region. If the API returns an error, the service may not be available in that region.
- Use `hcloud SWR ListSyncRegions --cli-region=<region>` to list regions where SWR service is available for cross-region sync.
- Common regions with SWR enterprise support include: `cn-north-4`, `cn-north-1`, `cn-east-3`, `cn-south-1`, `cn-east-2`, `cn-southwest-2`, `cn-north-9`, `ap-southeast-1`, `ap-southeast-2`, `ap-southeast-3`.
- If instance creation fails with spec/region errors, try a different spec or region. The error message will indicate if the spec is not supported in the target region.

**Billing Details**:
- **WARNING: Creating an SWR enterprise instance incurs hourly costs.** The user must be informed of this before proceeding.
- `--charge_mode`: Only `postPaid` (on-demand/pay-as-you-go) is supported. No prepaid or annual/monthly billing available.
- `--spec=swr.ee.basic`: Basic edition — suitable for small teams, limited features. Lower hourly cost.
- `--spec=swr.ee.professional`: Professional edition — full features including security scanning, replication, custom domains. Higher hourly cost.
- Costs are incurred per hour based on instance spec. No upfront payment required. Billing starts when the instance enters `Running` status.
- To stop billing: delete the instance with `hcloud SWR DeleteInstance`. Billing stops immediately after deletion.
- Use `--enterprise_project_id` to associate the instance with an enterprise project for cost tracking and attribution.
- For detailed pricing information, refer to the Huawei Cloud SWR pricing page or consult the SWR enterprise instance console at `https://console.huaweicloud.com/swr-instance`.

**Instance Status Values**: `Initial`, `Creating`, `Running`, `Unavailable`
hcloud SWR DeleteInstance --instance_id=<instance-id> --cli-region=cn-north-4

**实例命名规则**:
- 以小写字母开头
- 后跟小写字母、数字或连字符(`-`)
- 无连续连字符
- 不能以连字符结尾
- 长度:3-48个字符

**实例规格选项**:`swr.ee.basic`(基础版)、`swr.ee.professional`(专业版)

**规格与区域可用性**:
- 并非所有规格(实例类型)在所有区域都可用。创建实例前,请验证目标区域是否支持所需规格。
- 使用`hcloud SWR ListInstance --cli-region=<region>`检查SWR企业服务在该区域是否可用。如果API返回错误,说明该区域可能不支持该服务。
- 使用`hcloud SWR ListSyncRegions --cli-region=<region>`列出支持跨区域同步的SWR服务可用区域。
- 支持SWR企业版的常见区域包括:`cn-north-4`、`cn-north-1`、`cn-east-3`、`cn-south-1`、`cn-east-2`、`cn-southwest-2`、`cn-north-9`、`ap-southeast-1`、`ap-southeast-2`、`ap-southeast-3`。
- 如果实例创建因规格/区域错误失败,请尝试其他规格或区域。错误消息会指明该规格在目标区域是否不受支持。

**计费详情**:
- **警告:创建SWR企业实例会产生小时费用**。在操作前必须告知用户这一点。
- `--charge_mode`:仅支持`postPaid`(按需付费)。不支持预付费或包年包月计费。
- `--spec=swr.ee.basic`:基础版——适合小型团队,功能有限,小时费用较低。
- `--spec=swr.ee.professional`:专业版——包含安全扫描、复制、自定义域名等完整功能,小时费用较高。
- 根据实例规格按小时计费,无需预付款。实例进入`Running`状态时开始计费。
- 停止计费:使用`hcloud SWR DeleteInstance`删除实例。删除后立即停止计费。
- 使用`--enterprise_project_id`将实例关联到企业项目,以便进行成本跟踪和归属。
- 详细定价信息,请参考华为云SWR定价页面或访问SWR企业实例控制台`https://console.huaweicloud.com/swr-instance`咨询。

**实例状态值**:`Initial`、`Creating`、`Running`、`Unavailable`

2. Instance Namespaces

2. 实例命名空间

See Task: Instance Namespaces for detailed workflows.
bash
undefined
详细工作流请见Task: Instance Namespaces
bash
undefined

Create a namespace with auto-scan and vulnerability blocking

创建带有自动扫描和漏洞拦截功能的命名空间

hcloud SWR CreateInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --metadata.public=false --metadata.auto_scan=true --metadata.prevent_vul=true --metadata.severity=high --cli-region=cn-north-4
hcloud SWR CreateInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --metadata.public=false --metadata.auto_scan=true --metadata.prevent_vul=true --metadata.severity=high --cli-region=cn-north-4

List namespaces

列出命名空间

hcloud SWR ListInstanceNamespaces --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ListInstanceNamespaces --instance_id=<instance-id> --cli-region=cn-north-4

List namespaces with filter

按条件过滤列出命名空间

hcloud SWR ListInstanceNamespaces --instance_id=<instance-id> --public=false --limit=20 --offset=0 --cli-region=cn-north-4
hcloud SWR ListInstanceNamespaces --instance_id=<instance-id> --public=false --limit=20 --offset=0 --cli-region=cn-north-4

Show namespace details

查看命名空间详情

hcloud SWR ShowInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --cli-region=cn-north-4
hcloud SWR ShowInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --cli-region=cn-north-4

Update namespace (change visibility, scan settings)

更新命名空间(修改可见性、扫描设置)

hcloud SWR UpdateInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --metadata.public=true --metadata.prevent_vul=false --cli-region=cn-north-4
hcloud SWR UpdateInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --metadata.public=true --metadata.prevent_vul=false --cli-region=cn-north-4

Delete namespace (CAUTION: removes all repositories under it)

删除命名空间(注意:删除其下所有仓库)

hcloud SWR DeleteInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --cli-region=cn-north-4

**Namespace Naming Rules**:
- Start with lowercase letter or digit
- Followed by lowercase letters, digits, dots, underscores, or hyphens
- Dots, underscores, hyphens cannot be directly connected
- End with lowercase letter or digit
- Length: 1-64 characters

**Vulnerability Severity Levels**: `none`, `low`, `medium`, `high`, `critical`
hcloud SWR DeleteInstanceNamespace --instance_id=<instance-id> --namespace_name=group-dev --cli-region=cn-north-4

**命名空间命名规则**:
- 以小写字母或数字开头
- 后跟小写字母、数字、点、下划线或连字符
- 点、下划线、连字符不能直接相连
- 以小写字母或数字结尾
- 长度:1-64个字符

**漏洞严重级别**:`none`、`low`、`medium`、`high`、`critical`

3. Instance Registries (Sync Targets)

3. 实例注册表(同步目标)

See Task: Instance Registries for detailed workflows.
bash
undefined
详细工作流请见Task: Instance Registries
bash
undefined

Create a registry (sync target for another SWR enterprise instance)

创建注册表(同步到另一个SWR企业实例的目标)

hcloud SWR CreateInstanceRegistry --instance_id=<instance-id> --name=target-instance --type=swr-pro-internal --url=<target-url> --credential.type=basic --credential.access_key=<ak> --credential.access_secret=<sk> --insecure=false --instance_id=<target-instance-id> --project_id=<target-project-id> --region_id=cn-east-3 --cli-region=cn-north-4
hcloud SWR CreateInstanceRegistry --instance_id=<instance-id> --name=target-instance --type=swr-pro-internal --url=<target-url> --credential.type=basic --credential.access_key=<ak> --credential.access_secret=<sk> --insecure=false --instance_id=<target-instance-id> --project_id=<target-project-id> --region_id=cn-east-3 --cli-region=cn-north-4

Create a registry for open-source Harbor

创建开源Harbor的注册表

hcloud SWR CreateInstanceRegistry --instance_id=<instance-id> --name=harbor-target --type=swr-pro --url=https://harbor.example.com --credential.type=basic --credential.access_key=<username> --credential.access_secret=<password> --insecure=false --cli-region=cn-north-4
hcloud SWR CreateInstanceRegistry --instance_id=<instance-id> --name=harbor-target --type=swr-pro --url=https://harbor.example.com --credential.type=basic --credential.access_key=<username> --credential.access_secret=<password> --insecure=false --cli-region=cn-north-4

List registries

列出注册表

hcloud SWR ListInstanceRegistries --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ListInstanceRegistries --instance_id=<instance-id> --cli-region=cn-north-4

Show registry details

查看注册表详情

hcloud SWR ShowInstanceRegistry --instance_id=<instance-id> --registry_id=<registry-id> --cli-region=cn-north-4
hcloud SWR ShowInstanceRegistry --instance_id=<instance-id> --registry_id=<registry-id> --cli-region=cn-north-4

Update registry

更新注册表

hcloud SWR UpdateInstanceRegistry --instance_id=<instance-id> --registry_id=<registry-id> --name=new-name --url=<new-url> --credential.type=basic --credential.access_key=<new-ak> --credential.access_secret=<new-sk> --insecure=false --type=swr-pro --cli-region=cn-north-4
hcloud SWR UpdateInstanceRegistry --instance_id=<instance-id> --registry_id=<registry-id> --name=new-name --url=<new-url> --credential.type=basic --credential.access_key=<new-ak> --credential.access_secret=<new-sk> --insecure=false --type=swr-pro --cli-region=cn-north-4

Delete registry

删除注册表

hcloud SWR DeleteInstanceRegistry --instance_id=<instance-id> --registry_id=<registry-id> --cli-region=cn-north-4

**Registry Types**: `swr-pro` (open-source Harbor), `swr-pro-internal` (another SWR enterprise instance), `huawei-SWR` (basic SWR)

**Credential Acquisition for Target Registries**:
- For `swr-pro-internal` (another SWR enterprise instance): Use `CreateInstanceLtCredential` on the target instance to obtain `access_key` (credential name) and `access_secret` (credential password).
- For `huawei-SWR` (basic SWR): Use `CreateInstanceTempCredential` or basic SWR `CreateAuthorizationToken` to get temporary credentials.
- For `swr-pro` (Harbor): Use the Harbor account username and password.
- Credentials are stored securely by the instance and used for replication operations only.
hcloud SWR DeleteInstanceRegistry --instance_id=<instance-id> --registry_id=<registry-id> --cli-region=cn-north-4

**注册表类型**:`swr-pro`(开源Harbor)、`swr-pro-internal`(另一个SWR企业实例)、`huawei-SWR`(基础版SWR)

**目标注册表凭证获取**:
- 对于`swr-pro-internal`(另一个SWR企业实例):在目标实例上使用`CreateInstanceLtCredential`获取`access_key`(凭证名称)和`access_secret`(凭证密码)。
- 对于`huawei-SWR`(基础版SWR):使用`CreateInstanceTempCredential`或基础版SWR的`CreateAuthorizationToken`获取临时凭证。
- 对于`swr-pro`(Harbor):使用Harbor账号的用户名和密码。
- 凭证由实例安全存储,仅用于复制操作。

4. Instance Repositories

4. 实例仓库

See Task: Instance Registries for repository section.
bash
undefined
仓库部分的详细内容请见Task: Instance Registries
bash
undefined

List repositories in instance

列出实例中的仓库

hcloud SWR ListInstanceRepositories --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ListInstanceRepositories --instance_id=<instance-id> --cli-region=cn-north-4

List repositories with filter

按条件过滤列出仓库

hcloud SWR ListInstanceRepositories --instance_id=<instance-id> --namespace_id=<ns-id> --limit=20 --offset=0 --order_column=updated_at --order_type=desc --cli-region=cn-north-4
hcloud SWR ListInstanceRepositories --instance_id=<instance-id> --namespace_id=<ns-id> --limit=20 --offset=0 --order_column=updated_at --order_type=desc --cli-region=cn-north-4

Show repository details

查看仓库详情

hcloud SWR ShowInstanceRepository --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --cli-region=cn-north-4
hcloud SWR ShowInstanceRepository --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --cli-region=cn-north-4

Update repository description

更新仓库描述

hcloud SWR UpdateInstanceRepository --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --description="Updated description" --cli-region=cn-north-4
hcloud SWR UpdateInstanceRepository --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --description="Updated description" --cli-region=cn-north-4

Delete repository (CAUTION: removes all artifacts)

删除仓库(注意:删除所有制品)

hcloud SWR DeleteInstanceRepository --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --cli-region=cn-north-4
undefined
hcloud SWR DeleteInstanceRepository --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --cli-region=cn-north-4
undefined

5. Instance Artifacts (Image Versions)

5. 实例制品(镜像版本)

See Task: Instance Artifacts for detailed workflows.
bash
undefined
详细工作流请见Task: Instance Artifacts
bash
undefined

List artifacts in a repository

列出仓库中的制品

hcloud SWR ListInstanceArtifacts --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --cli-region=cn-north-4
hcloud SWR ListInstanceArtifacts --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --cli-region=cn-north-4

List artifacts with filter

按条件过滤列出制品

hcloud SWR ListInstanceArtifacts --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --type=IMAGE --limit=20 --offset=0 --cli-region=cn-north-4
hcloud SWR ListInstanceArtifacts --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --type=IMAGE --limit=20 --offset=0 --cli-region=cn-north-4

Show artifact details

查看制品详情

hcloud SWR ShowInstanceArtifact --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4
hcloud SWR ShowInstanceArtifact --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4

Show artifact with scan overview

查看包含扫描概览的制品

hcloud SWR ShowInstanceArtifact --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --with_scan_overview=true --cli-region=cn-north-4
hcloud SWR ShowInstanceArtifact --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --with_scan_overview=true --cli-region=cn-north-4

Get artifact build history

获取制品构建历史

hcloud SWR ShowInstanceArtifactAddition --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --addition=build_history --cli-region=cn-north-4
hcloud SWR ShowInstanceArtifactAddition --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --addition=build_history --cli-region=cn-north-4

List artifact vulnerabilities

列出制品漏洞

hcloud SWR ListInstanceArtifactVulnerabilities --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4
hcloud SWR ListInstanceArtifactVulnerabilities --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4

Start manual vulnerability scan

启动手动漏洞扫描

hcloud SWR StartManualScanning --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4
hcloud SWR StartManualScanning --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4

Delete artifact (CAUTION: removes the image version permanently)

删除制品(注意:永久删除镜像版本)

hcloud SWR DeleteInstanceArtifact --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4

**Artifact Types**: `IMAGE` (container image), `CHART` (Helm chart)

> ⚠️ **Image Vulnerability Scanning Limitation**: Image vulnerability scanning depends on Huawei Cloud HSS (Host Security Service). The current skill does not support HSS configuration or management. To use scanning features:
> - **Basic edition (`swr.ee.basic`)**: Scanning is not supported. Upgrade to professional edition.
> - **Professional edition (`swr.ee.professional`)**: Scanning requires HSS to be enabled. Please activate HSS in the Huawei Cloud console first, then use the SWR enterprise instance console (`https://console.huaweicloud.com/swr-instance`) to verify scanning is functional before relying on it in automation workflows.
> - If scanning fails on a professional edition instance, check HSS service status and ensure HSS is properly activated for the target region.
hcloud SWR DeleteInstanceArtifact --instance_id=<instance-id> --namespace_name=group-dev --repository_name=my-app --reference=<digest> --cli-region=cn-north-4

**制品类型**:`IMAGE`(容器镜像)、`CHART`(Helm图表)

> ⚠️ **镜像漏洞扫描限制**:镜像漏洞扫描依赖华为云HSS(主机安全服务)。当前技能不支持HSS配置或管理。要使用扫描功能:
> - **基础版(`swr.ee.basic`)**:不支持扫描。请升级到专业版。
> - **专业版(`swr.ee.professional`)**:扫描需要启用HSS。请先在华为云控制台激活HSS,然后使用SWR企业实例控制台(`https://console.huaweicloud.com/swr-instance`)验证扫描功能正常后,再在自动化工作流中使用。
> - 如果专业版实例扫描失败,请检查HSS服务状态,确保目标区域已正确激活HSS。

6. Instance Credentials

6. 实例凭证

See Task: Instance Credentials for detailed workflows.
bash
undefined
详细工作流请见Task: Instance Credentials
bash
undefined

Create a long-term access credential

创建长期访问凭证

hcloud SWR CreateInstanceLtCredential --instance_id=<instance-id> --name=my-credential --cli-region=cn-north-4
hcloud SWR CreateInstanceLtCredential --instance_id=<instance-id> --name=my-credential --cli-region=cn-north-4

Create a temporary access credential

创建临时访问凭证

hcloud SWR CreateInstanceTempCredential --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR CreateInstanceTempCredential --instance_id=<instance-id> --cli-region=cn-north-4

List long-term credentials

列出长期凭证

hcloud SWR ListInstanceLtCredentials --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ListInstanceLtCredentials --instance_id=<instance-id> --cli-region=cn-north-4

Enable/disable a long-term credential

启用/禁用长期凭证

hcloud SWR UpdateInstanceLtCredential --instance_id=<instance-id> --credential_id=<cred-id> --enable=false --cli-region=cn-north-4
hcloud SWR UpdateInstanceLtCredential --instance_id=<instance-id> --credential_id=<cred-id> --enable=false --cli-region=cn-north-4

Delete a long-term credential

删除长期凭证

hcloud SWR DeleteInstanceLtCredential --instance_id=<instance-id> --credential_id=<cred-id> --cli-region=cn-north-4

**Credential Naming Rules** (same as namespace): lowercase/digit start, 1-64 chars
hcloud SWR DeleteInstanceLtCredential --instance_id=<instance-id> --credential_id=<cred-id> --cli-region=cn-north-4

**凭证命名规则**(与命名空间相同):以小写字母/数字开头,长度1-64个字符

7. Instance Endpoints (Network Access)

7. 实例端点(网络访问)

See Task: Instance Endpoints for detailed workflows.
bash
undefined
详细工作流请见Task: Instance Endpoints
bash
undefined

Create internal VPC endpoint

创建内部VPC端点

hcloud SWR CreateInstanceInternalEndpoint --instance_id=<instance-id> --vpc_id=<vpc-id> --subnet_id=<subnet-id> --project_id=<vpc-project-id> --cli-region=cn-north-4
hcloud SWR CreateInstanceInternalEndpoint --instance_id=<instance-id> --vpc_id=<vpc-id> --subnet_id=<subnet-id> --project_id=<vpc-project-id> --cli-region=cn-north-4

List internal endpoints

列出内部端点

hcloud SWR ListInstanceInternalEndpoints --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ListInstanceInternalEndpoints --instance_id=<instance-id> --cli-region=cn-north-4

Show internal endpoint details

查看内部端点详情

hcloud SWR ShowInstanceInternalEndpoint --instance_id=<instance-id> --internal_endpoints_id=<endpoint-id> --cli-region=cn-north-4
hcloud SWR ShowInstanceInternalEndpoint --instance_id=<instance-id> --internal_endpoints_id=<endpoint-id> --cli-region=cn-north-4

Delete internal endpoint

删除内部端点

hcloud SWR DeleteInstanceInternalEndpoint --instance_id=<instance-id> --internal_endpoints_id=<endpoint-id> --cli-region=cn-north-4
hcloud SWR DeleteInstanceInternalEndpoint --instance_id=<instance-id> --internal_endpoints_id=<endpoint-id> --cli-region=cn-north-4

Enable public access

启用公网访问

hcloud SWR CreateInstanceEndpointPolicy --instance_id=<instance-id> --enable=true --cli-region=cn-north-4
hcloud SWR CreateInstanceEndpointPolicy --instance_id=<instance-id> --enable=true --cli-region=cn-north-4

Disable public access

禁用公网访问

hcloud SWR CreateInstanceEndpointPolicy --instance_id=<instance-id> --enable=false --cli-region=cn-north-4
hcloud SWR CreateInstanceEndpointPolicy --instance_id=<instance-id> --enable=false --cli-region=cn-north-4

View public access status and whitelist

查看公网访问状态和白名单

hcloud SWR ShowInstanceEndpointPolicy --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ShowInstanceEndpointPolicy --instance_id=<instance-id> --cli-region=cn-north-4

Update public access whitelist (full replacement)

更新公网访问白名单(完全替换)

hcloud SWR UpdateInstanceEndpointPolicy --instance_id=<instance-id> --ip_list.1.ip=10.0.0.0/8 --ip_list.1.description="Internal network" --ip_list.2.ip=192.168.0.0/16 --ip_list.2.description="VPN network" --cli-region=cn-north-4
undefined
hcloud SWR UpdateInstanceEndpointPolicy --instance_id=<instance-id> --ip_list.1.ip=10.0.0.0/8 --ip_list.1.description="Internal network" --ip_list.2.ip=192.168.0.0/16 --ip_list.2.description="VPN network" --cli-region=cn-north-4
undefined

8. Instance Domains

8. 实例域名

See Task: Instance Domains for detailed workflows.
bash
undefined
详细工作流请见Task: Instance Domains
bash
undefined

Add a custom domain

添加自定义域名

hcloud SWR AddDomainName --instance_id=<instance-id> --domain_name=registry.example.com --certificate_id=<scm-cert-id> --cli-region=cn-north-4
hcloud SWR AddDomainName --instance_id=<instance-id> --domain_name=registry.example.com --certificate_id=<scm-cert-id> --cli-region=cn-north-4

List all domains

列出所有域名

hcloud SWR ListDomainNames --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ListDomainNames --instance_id=<instance-id> --cli-region=cn-north-4

Get domain overview

获取域名概览

hcloud SWR ShowDomainOverview --cli-region=cn-north-4
hcloud SWR ShowDomainOverview --cli-region=cn-north-4

Delete a domain (default domain cannot be deleted)

删除域名(默认域名无法删除)

hcloud SWR DeleteDomainName --instance_id=<instance-id> --domainname_id=<domain-id> --cli-region=cn-north-4
hcloud SWR DeleteDomainName --instance_id=<instance-id> --domainname_id=<domain-id> --cli-region=cn-north-4

Update domain certificate

更新域名证书

hcloud SWR UpdateDomainName --instance_id=<instance-id> --domainname_id=<domain-id> --certificate_id=<new-cert-id> --cli-region=cn-north-4
undefined
hcloud SWR UpdateDomainName --instance_id=<instance-id> --domainname_id=<domain-id> --certificate_id=<new-cert-id> --cli-region=cn-north-4
undefined

9. Instance Statistics and Jobs

9. 实例统计信息和任务

bash
undefined
bash
undefined

Get instance statistics

获取实例统计信息

hcloud SWR ListInstanceStatistics --instance_id=<instance-id> --cli-region=cn-north-4
hcloud SWR ListInstanceStatistics --instance_id=<instance-id> --cli-region=cn-north-4

List instance jobs (async operations)

列出实例任务(异步操作)

hcloud SWR ListInstanceJobs --cli-region=cn-north-4
hcloud SWR ListInstanceJobs --cli-region=cn-north-4

Show job details

查看任务详情

hcloud SWR ShowInstanceJob --job_id=<job-id> --cli-region=cn-north-4
hcloud SWR ShowInstanceJob --job_id=<job-id> --cli-region=cn-north-4

Delete a job record

删除任务记录

hcloud SWR DeleteInstanceJob --job_id=<job-id> --cli-region=cn-north-4
undefined
hcloud SWR DeleteInstanceJob --job_id=<job-id> --cli-region=cn-north-4
undefined

10. Instance Audit Logs

10. 实例审计日志

SWR enterprise instances provide built-in audit logging via
ListAuditLogs
API (pull/delete/create operations). No dependency on CTS required.
bash
hcloud SWR ListAuditLogs --instance_id=<instance-id> --project_id=<project-id> --operation=pull --cli-region=cn-north-4
SWR企业实例通过
ListAuditLogs
API提供内置审计日志(拉取/删除/创建操作)。无需依赖CTS。
bash
hcloud SWR ListAuditLogs --instance_id=<instance-id> --project_id=<project-id> --operation=pull --cli-region=cn-north-4

--operation: pull, delete, or create; --limit/--offset for pagination

--operation: pull, delete, or create; --limit/--offset用于分页


See [API Guide](references/swr-instance-api-guide.md#instance-audit-log-operations) for full details.

详情请见[API Guide](references/swr-instance-api-guide.md#instance-audit-log-operations)。

Parameter Reference

参数参考

See Parameter Reference for complete parameter tables including: common parameters, instance creation (name, spec, VPC, subnet, encryption), namespace (public, auto_scan, prevent_vul, severity), registry (type, url, credential), and endpoint whitelist parameters.
完整参数表请见Parameter Reference,包括:通用参数、实例创建(名称、规格、VPC、子网、加密)、命名空间(公开、自动扫描、漏洞拦截、严重级别)、注册表(类型、URL、凭证)和端点白名单参数。

Output Format

输出格式

See Output Format for detailed response format examples (Instance List, Instance Details, Namespace List, Internal Endpoint List, Domain Name List, Long-term Credential).
响应格式示例请见Output Format(实例列表、实例详情、命名空间列表、内部端点列表、域名列表、长期凭证)。

Verification

验证

See Verification Method for step-by-step verification.
分步验证方法请见Verification Method

Best Practices

最佳实践

  1. Instance naming & VPC: Use descriptive names (
    prod-instance
    ,
    dev-instance
    ); choose VPC/subnet matching your workload environment
  2. Namespace security: Enable
    auto_scan=true
    and
    prevent_vul=true
    for production; set
    severity=high
    /
    critical
    for prod,
    none
    /
    low
    for dev
  3. Credentials: Store registry credentials securely and rotate periodically; use
    CreateInstanceLtCredential
    for CI/CD,
    CreateInstanceTempCredential
    for temp access
  4. Public access: Always configure IP whitelist when enabling public access via
    UpdateInstanceEndpointPolicy
    ; use SCM certificates for custom domain HTTPS
  5. Delete with caution: Deleting an instance removes ALL data permanently; deleting a namespace removes ALL repositories
  6. Instance spec: Use
    swr.ee.basic
    for small teams;
    swr.ee.professional
    for enterprise with advanced features
  1. 实例命名与VPC:使用描述性名称(如
    prod-instance
    dev-instance
    );选择与工作负载环境匹配的VPC/子网
  2. 命名空间安全:生产环境启用
    auto_scan=true
    prevent_vul=true
    ;生产环境设置
    severity=high
    /
    critical
    ,开发环境设置
    none
    /
    low
  3. 凭证管理:安全存储注册表凭证并定期轮换;CI/CD使用
    CreateInstanceLtCredential
    ,临时访问使用
    CreateInstanceTempCredential
  4. 公网访问:启用公网访问时,始终通过
    UpdateInstanceEndpointPolicy
    配置IP白名单;自定义域名HTTPS使用SCM证书
  5. 谨慎删除:删除实例会永久删除所有数据;删除命名空间会删除所有仓库
  6. 实例规格选择:小型团队使用
    swr.ee.basic
    ;企业级使用高级功能选择
    swr.ee.professional

参数确认

参数确认

OperationCLI CommandRisk LevelConfirmation Required
CreateInstance
hcloud SWR CreateInstance
HighCreating a paid instance incurs costs. Confirm instance spec (
swr.ee.basic
or
swr.ee.professional
), VPC/subnet configuration, and enterprise project before proceeding.
UpdateInstanceConfiguration
hcloud SWR UpdateInstanceConfiguration --anonymous_access=true
HighEnabling anonymous access allows unauthenticated users to pull images, reducing security. Confirm this is intended before proceeding.
CreateInstanceEndpointPolicy
hcloud SWR CreateInstanceEndpointPolicy --enable=true
MediumEnabling public access exposes the instance to the internet. Must configure IP whitelist via
UpdateInstanceEndpointPolicy
to restrict access. Confirm before proceeding.
DeleteInstanceLtCredential
hcloud SWR DeleteInstanceLtCredential
MediumDeleting a credential immediately revokes access for CI/CD pipelines using it. Recommend disabling the credential first (
UpdateInstanceLtCredential --enable=false
), verifying no active pipelines, then deleting.
CreateInstanceRegistry
hcloud SWR CreateInstanceRegistry
MediumCreating a sync target registry stores the target registry authentication credentials (
access_key
/
access_secret
). Confirm the target registry URL and credential information before proceeding.
操作CLI命令风险级别是否需要确认
CreateInstance
hcloud SWR CreateInstance
创建付费实例会产生费用。确认实例规格(
swr.ee.basic
swr.ee.professional
)、VPC/子网配置和企业项目后再继续。
UpdateInstanceConfiguration
hcloud SWR UpdateInstanceConfiguration --anonymous_access=true
启用匿名访问允许未认证用户拉取镜像,降低安全性。确认此操作是预期的后再继续。
CreateInstanceEndpointPolicy
hcloud SWR CreateInstanceEndpointPolicy --enable=true
启用公网访问会将实例暴露到互联网。必须通过
UpdateInstanceEndpointPolicy
配置IP白名单以限制访问。确认后再继续。
DeleteInstanceLtCredential
hcloud SWR DeleteInstanceLtCredential
删除凭证会立即撤销使用该凭证的CI/CD流水线的访问权限。建议先禁用凭证(
UpdateInstanceLtCredential --enable=false
),验证无活跃流水线后再删除。
CreateInstanceRegistry
hcloud SWR CreateInstanceRegistry
创建同步目标注册表会存储目标注册表的认证凭证(
access_key
/
access_secret
)。确认目标注册表URL和凭证信息后再继续。

Unsupported Operations

不支持的操作

The following operations are not supported by the SWR enterprise instance API and require alternative approaches:
Unsupported OperationReasonAlternative Approach
Push images to instanceDocker CLI operation, not an API callUse
CreateInstanceTempCredential
or
CreateInstanceLtCredential
to get credentials, then
docker login
and
docker push
Pull images from instanceDocker CLI operation, not an API callUse
CreateInstanceTempCredential
or
CreateInstanceLtCredential
to get credentials, then
docker login
and
docker pull
Build imagesSWR is a registry, not a build serviceUse CodeArts Build, CCE, or local Docker build, then push to SWR
Image replication/sync policiesCLI available but not documented in this skillUse
hcloud SWR CreateInstanceReplicationPolicy
/
ListInstanceReplicationPolicies
etc., or SWR enterprise instance console (
https://console.huaweicloud.com/swr-instance
)
Instance backup/restoreNo backup API availableUse OBS bucket backup for data persistence, or migrate namespaces/repositories manually
Image retention/aging policiesCLI available but not documented in this skillUse
hcloud SWR CreateInstanceRetentionPolicy
/
ListInstanceRetentionPolicies
etc., or SWR enterprise instance console
Webhook notification configurationCLI available but not documented in this skillUse
hcloud SWR CreateInstanceWebhook
/
ListInstanceWebhooks
etc., or SWR enterprise instance console
Image signing policiesCLI available but not documented in this skillUse
hcloud SWR CreateInstanceSignPolicy
/
ListInstanceSignPolicies
etc., or SWR enterprise instance console
Resource tag managementCLI available but not documented in this skillUse
hcloud SWR CreateInstanceResourceTags
/
ListInstanceResourceTags
etc., or TMS console
IAM delegation managementNot supported by this skillUse IAM console to configure delegation.
CheckAgency
/
CreateAgency
in hcloud are for SWR→CCE/CCI direction, not enterprise instance delegation
以下操作不被SWR企业实例API支持,需要使用替代方法:
不支持的操作原因替代方法
向实例推送镜像Docker CLI操作,非API调用使用
CreateInstanceTempCredential
CreateInstanceLtCredential
获取凭证,然后执行
docker login
docker push
从实例拉取镜像Docker CLI操作,非API调用使用
CreateInstanceTempCredential
CreateInstanceLtCredential
获取凭证,然后执行
docker login
docker pull
构建镜像SWR是注册表,不是构建服务使用CodeArts Build、CCE或本地Docker构建,然后推送到SWR
镜像复制/同步策略CLI可用但未在本技能中记录使用
hcloud SWR CreateInstanceReplicationPolicy
/
ListInstanceReplicationPolicies
等命令,或SWR企业实例控制台(
https://console.huaweicloud.com/swr-instance
实例备份/恢复无备份API使用OBS桶备份实现数据持久化,或手动迁移命名空间/仓库
镜像保留/老化策略CLI可用但未在本技能中记录使用
hcloud SWR CreateInstanceRetentionPolicy
/
ListInstanceRetentionPolicies
等命令,或SWR企业实例控制台
Webhook通知配置CLI可用但未在本技能中记录使用
hcloud SWR CreateInstanceWebhook
/
ListInstanceWebhooks
等命令,或SWR企业实例控制台
镜像签名策略CLI可用但未在本技能中记录使用
hcloud SWR CreateInstanceSignPolicy
/
ListInstanceSignPolicies
等命令,或SWR企业实例控制台
资源标签管理CLI可用但未在本技能中记录使用
hcloud SWR CreateInstanceResourceTags
/
ListInstanceResourceTags
等命令,或TMS控制台
IAM委托管理本技能不支持使用IAM控制台配置委托。hcloud中的
CheckAgency
/
CreateAgency
用于SWR→CCE/CCI方向,不支持企业实例委托

工作流

工作流

This skill follows a standard workflow for SWR enterprise instance management:
  1. Prerequisites Check — Verify hcloud CLI installation and credential configuration
  2. Instance Identification — List or show existing instances to obtain
    instance_id
  3. Operation Execution — Execute the requested operation (create/update/delete/query)
  4. Result Verification — Confirm the operation succeeded by querying the resulting state
  5. Credential Management — For write operations, obtain and securely store any returned credentials
  6. Cleanup Confirmation — For destructive operations, confirm with the user before proceeding
本技能遵循SWR企业实例管理的标准工作流:
  1. 前提条件检查 — 验证hcloud CLI安装和凭证配置
  2. 实例识别 — 列出或查看现有实例以获取
    instance_id
  3. 操作执行 — 执行请求的操作(创建/更新/删除/查询)
  4. 结果验证 — 通过查询结果状态确认操作成功
  5. 凭证管理 — 对于写入操作,获取并安全存储返回的凭证
  6. 清理确认 — 对于破坏性操作,执行前需用户确认

KooCLI命令格式标准

KooCLI命令格式标准

All CLI commands use
hcloud SWR <Operation> --param1=value1 --cli-region=<region>
format.
Key rules: Use
--key=value
format, always specify
--cli-region
, never expose AK/SK, confirm before write operations, use
--cli-output=json
for structured output.
Known CLI Limitation: Some commands (CreateInstance, CreateInstanceInternalEndpoint, CreateInstanceRegistry) have same-name parameter conflicts between path and body. Use
--cli-jsonInput
with
path
/
body
sections to resolve. See CLI Format Guide for full details and examples.
所有CLI命令使用
hcloud SWR <Operation> --param1=value1 --cli-region=<region>
格式。
核心规则:使用
--key=value
格式,始终指定
--cli-region
,切勿暴露AK/SK,写入操作前确认,使用
--cli-output=json
获取结构化输出。
已知CLI限制:部分命令(CreateInstance、CreateInstanceInternalEndpoint、CreateInstanceRegistry)存在路径和体参数同名冲突。使用
--cli-jsonInput
并包含
path
/
body
部分解决。详情和示例请见CLI Format Guide

Reference Documents

参考文档

DocumentDescription
SWR Instance API Guidehcloud SWR instance API reference
Output FormatResponse format examples (Instance, Namespace, Endpoint, Domain, Credential)
Credential ConfigurationCredential setup (long-term AK/SK & temporary AK/SK+SecurityToken)
IAM Permission PoliciesRequired permissions and policy JSON
Verification MethodStep-by-step verification
Common PitfallsTroubleshooting guides
Task: Instance LifecycleInstance create, list, show, update config
Task: Instance NamespacesNamespace CRUD workflows
Task: Instance RegistriesRegistry CRUD and repositories
Task: Instance ArtifactsArtifact management and scanning
Task: Instance CredentialsCredential management workflows
Task: Instance EndpointsInternal and public access configuration
Task: Instance DomainsCustom domain management
CLI Installation Guidehcloud CLI installation and configuration
Acceptance CriteriaSuccess criteria for all operations
文档描述
SWR Instance API Guidehcloud SWR实例API参考
Output Format响应格式示例(实例、命名空间、端点、域名、凭证)
Credential Configuration凭证设置(长期AK/SK和临时AK/SK+SecurityToken)
IAM Permission Policies所需权限和策略JSON
Verification Method分步验证方法
Common Pitfalls故障排除指南
Task: Instance Lifecycle实例创建、列出、查看、更新配置工作流
Task: Instance Namespaces命名空间CRUD工作流
Task: Instance Registries注册表CRUD和仓库管理
Task: Instance Artifacts制品管理和扫描
Task: Instance Credentials凭证管理工作流
Task: Instance Endpoints内部和公网访问配置
Task: Instance Domains自定义域名管理
CLI Installation Guidehcloud CLI安装和配置
Acceptance Criteria所有操作的成功标准

Notes

注意事项

  • Instance deletion is irreversible — removes ALL namespaces, repositories, artifacts, and data permanently
  • Namespace deletion is irreversible — removes all repositories and artifacts under it
  • Artifact deletion is irreversible — the image version cannot be recovered
  • Default domain cannot be deleted — only custom domains can be removed
  • AK/SK must never be hardcoded — credentials should only be obtained via environment variables
  • hcloud CLI is the only supported method — all operations use
    hcloud SWR <Operation>
    format
  • Pagination offset must be multiple of limit
    offset
    must be 0 or a multiple of
    limit
  • Registry credential.access_secret is sensitive — never expose or log access secrets
  • SWR enterprise service must be activated first — access
    https://console.huaweicloud.com/swr-instance
    to activate before creating instances
  • Console access requires direct URL — the SWR enterprise instance console is not in the main navigation menu; use
    https://console.huaweicloud.com/swr-instance
  • Spec availability varies by region — not all specs are available in all regions; verify before creating instances
  • Instance creation incurs hourly costs — inform the user of billing implications before creating an instance
  • 实例删除不可撤销 — 永久删除所有命名空间、仓库、制品和数据
  • 命名空间删除不可撤销 — 删除其下所有仓库和制品
  • 制品删除不可撤销 — 镜像版本无法恢复
  • 默认域名无法删除 — 仅可删除自定义域名
  • AK/SK切勿硬编码 — 凭证仅通过环境变量获取
  • 仅支持hcloud CLI — 所有操作使用
    hcloud SWR <Operation>
    格式
  • 分页偏移量必须是限制值的倍数
    offset
    必须为0或
    limit
    的倍数
  • Registry credential.access_secret是敏感信息 — 切勿暴露或记录访问密钥
  • 必须先激活SWR企业服务 — 创建实例前访问
    https://console.huaweicloud.com/swr-instance
    激活
  • 控制台访问需要直接URL — SWR企业实例控制台不在主导航菜单中;使用
    https://console.huaweicloud.com/swr-instance
  • 规格可用性因区域而异 — 并非所有规格在所有区域都可用;创建前验证
  • 实例创建会产生小时费用 — 创建前告知用户计费影响

Common Pitfalls

常见问题

See Common Pitfalls & Solutions for detailed troubleshooting guides covering: invalid instance names, VPC/subnet errors, instance creation state, pagination offset rules, registry credential issues, domain certificate problems, public access whitelist format, SWR service activation, and spec availability.
详细故障排除指南请见Common Pitfalls & Solutions,涵盖:无效实例名称、VPC/子网错误、实例创建状态、分页偏移量规则、注册表凭证问题、域名证书问题、公网访问白名单格式、SWR服务激活、规格可用性。