package-usage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

API Reference

API 参考

Get the latest version of a package

获取包的最新版本

GET /api/registry/packages?name={package_name}&orgLogin={orgName}
You must include the
orgLogin
parameter with the user's organization name. The response contains a
packages
array. Each entry has a
version
field (the latest version), plus
name
,
publisher
,
source
, and
packageStatus
.
GET /api/registry/packages?name={package_name}&orgLogin={orgName}
你必须传入携带用户组织名称的
orgLogin
参数。响应包含一个
packages
数组,每个条目都有
version
字段(即最新版本),以及
name
publisher
source
packageStatus
字段。

Get stack usage for a package

获取包的堆栈使用情况

GET /api/orgs/{orgName}/packages/usage?packageName={package_name}
Replace
{orgName}
with the organization name from context or the
PULUMI_ORG
environment variable.
Response fields:
  • packageName
    : The queried package
  • stacks
    : Array of
    {stackName, projectName, version, lastUpdate}
  • totalStacks
    : Total count
GET /api/orgs/{orgName}/packages/usage?packageName={package_name}
{orgName}
替换为上下文里的组织名称或
PULUMI_ORG
环境变量的值。
响应字段:
  • packageName
    :被查询的包
  • stacks
    :由
    {stackName, projectName, version, lastUpdate}
    组成的数组
  • totalStacks
    :总计数

Workflow: Find outdated stacks

工作流:查找过时堆栈

Use when the user wants to know which stacks are using an outdated version of a package.
  1. Get the latest version of the package
  2. Get stack usage for the package
  3. Compare each stack's
    version
    against the latest to identify outdated stacks
当用户想要了解哪些堆栈正在使用过时版本的包时使用。
  1. 获取该包的最新版本
  2. 获取该包的堆栈使用情况
  3. 将每个堆栈的
    version
    与最新版本对比,找出过时的堆栈

Workflow: Upgrade a package in a stack

工作流:升级堆栈中的包

Use when the user wants to upgrade a specific stack/project to the latest version of a package.
  1. Get the latest version of the package
  2. Clone the stack's project repository. If the repository cannot be cloned or the agent lacks filesystem/git access, surface the required change as a diff or instruction set for the user to apply manually.
  3. Detect the project language from the
    runtime
    field in
    Pulumi.yaml
    , then update the correct dependency file:
    • nodejs
      package.json
    • python
      requirements.txt
      or
      pyproject.toml
    • go
      go.mod
    • yaml
      Pulumi.yaml
  4. Run
    pulumi preview
    to catch any breaking changes introduced by the version bump before merging.
  5. Open a pull request with the change
当用户想要将特定堆栈/项目升级到某个包的最新版本时使用。
  1. 获取该包的最新版本
  2. 克隆堆栈对应的项目仓库。如果无法克隆仓库,或者Agent没有文件系统/git访问权限,则将所需的变更以差异或指令集的形式呈现给用户手动应用。
  3. Pulumi.yaml
    runtime
    字段检测项目语言,然后更新对应的依赖文件:
    • nodejs
      package.json
    • python
      requirements.txt
      pyproject.toml
    • go
      go.mod
    • yaml
      Pulumi.yaml
  4. 运行
    pulumi preview
    命令,在合并前捕获版本升级引入的所有破坏性变更。
  5. 提交包含该变更的拉取请求