Skip to main content
Astra Automation
简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。

检索软件包

GET /accounts/{account_id}/core/v1/packages/{package_id}

返回 JSON 响应正文中存储的 Package API 资源。

参数

名称 Type Required Description

account_id

string

path

True

包含帐户资源的 ID

  • 示例:{{.Account}}

package_id

string

path

True

要列出的包集合的 ID

响应

Status: 200, Returns the stored Package API resource in the JSON response body.
名称 Type Required Description

type

string

True

资源的媒体类型。定义的值为:

  • "application/astra-package"

version

string

True

资源的版本。定义的值为:

  • "1.0"

id

string

True

资源的全局唯一标识符。定义的值为:

  • 符合 UUIDv4 架构

packageName

string

True

包含包名称的 JSON 字符串。定义的值为:

  • 最小长度:1

  • 最大长度:31 示例值为:

  • "acc"

  • "acs"

  • “trident”

packageVersion

string

True

包含包的 SemVer 的 JSON 字符串。定义的值为:

  • 符合 SemVer 架构

packageType

string

True

包含程序包类型的 JSON 字符串,指示这是完整的安装程序包还是修补程序。定义的值是:

  • "安装"

  • “补丁”

bundleName

数组[string]

False

包含软件包所在捆绑包名称的 JSON 字符串的 JSON 数组。

severityLevel

string

True

描述此修补程序或安装的严重级别的 JSON 字符串。定义的值为:

  • "recommended" - 建议安装 - 默认值

  • "critical" - 强烈建议安装以解决关键错误修复和/或安全修补程序

packageState

string

True

包含指示包操作状态的值的 JSON 字符串。在包验证和导入后,状态将显示为"complete"。否则,状态将显示为"incomplete"。定义的值是:

  • "verifying" - 正在验证包

  • "corrupt" - 包已损坏

  • "incomplete" - 包缺少元素

  • "available" - 与包关联的所有元素都可用,并且包已准备好使用

packageStateTransitions

数组["type_astra_stateTransition"]

True

JSON 对象的 JSON 数组,每个表示从给定定义状态的允许状态转换集。每个 JSON 对象都包含字段"from"和"to",其中"from"值是状态的名称,"to"值是允许的目标状态数组。定义的值为:

  • 符合状态转换架构

packageStateDetails

数组["type_astra_stateDetail"]

True

JSON 对象的 JSON 数组,列出有关当前"状态"的其他详细信息。如果没有可用的详细信息,此数组将为空。

  • 最小项目数:0

镜像

数组["镜像"]

False

JSON 对象的 JSON 数组,每个对象都包含作为包一部分的 Docker 镜像。

制品

数组["制品"]

False

描述与此包关联的其他工件(二进制文件和其他)的 JSON 对象的 JSON 数组。

文件

数组["文件"]

False

JSON 对象的 JSON 数组,每个表示与此包关联的非图像制品。

upgradableVersions

"upgradableVersions"

False

JSON 对象包含可以升级到包版本的最低和最高版本。

依赖项

数组["依赖项"]

False

描述安装此包所需的给定依赖项最低版本的 JSON 对象的 JSON 数组

元数据

"type_astra_metadata"

True

与资源关联的客户端和服务指定的元数据。定义的值为:

  • 符合 Astra 元数据架构如果在创建时未指定,则将创建没有标签的元数据对象。

响应示例
{
  "type": "application/astra-package",
  "version": "1.0",
  "id": "54edc2b3-18c5-5371-904b-ebcd04d88bdc",
  "packageName": "acc",
  "packageVersion": "22.09.1",
  "packageType": "patch",
  "packageState": "available",
  "packageStateTransitions": [
    {
      "from": "verifying",
      "to": [
        "corrupt",
        "incomplete",
        "available"
      ]
    },
    {
      "from": "corrupt",
      "to": [
        "incomplete",
        "available"
      ]
    },
    {
      "from": "incomplete",
      "to": [
        "corrupt",
        "available"
      ]
    },
    {
      "from": "available",
      "to": [
        "corrupt",
        "available"
      ]
    }
  ],
  "packageStateDetails": [],
  "severityLevel": "recommended",
  "images": [
    {
      "imagePath": "/globalcicd/acc",
      "imageName": "storage-provider",
      "imageTag": "1.3.116",
      "imageDigest": "sha256:2e04d178815537b0ad8c3224e8754e33642da781a161f1be239853dae33deafc"
    },
    {
      "imagePath": "/globalcicd/acc",
      "imageName": "storage-backend-metrics",
      "imageTag": "1.3.45",
      "imageDigest": "sha256:2e04d178815537b0ad8c3224e8754e33642da781a161f1be239853dae33deafc"
    },
    {
      "imagePath": "/globalcicd/acc",
      "imageName": "credentials",
      "imageTag": "1.3.45",
      "imageDigest": "sha256:2e04d178815537b0ad8c3224e8754e33642da781a161f1be239853dae33deafc"
    }
  ],
  "files": [
    {
      "fileName": "astra_control_center_min.yaml",
      "fileIdentifier": "astra_min",
      "fileMediaType": "application/x-yaml",
      "fileContents": "VGhpcyBpcyBzdXBwb3NlZCB0byBiZSBhIGNvbXByZXNzZWQgZmlsZSBjb250ZW50"
    }
  ],
  "dependencies": [
    {
      "componentName": "acc",
      "componentMinVersion": "22.04.29"
    },
    {
      "componentName": "kubernetes",
      "componentMinVersion": "v1.19.7",
      "componentMaxVersion": "v1.20"
    },
    {
      "componentName": "trident",
      "componentMinVersion": "v21.01.1"
    }
  ],
  "metadata": {
    "labels": [],
    "creationTimestamp": "2022-10-06T20:58:16.305662Z",
    "modificationTimestamp": "2022-10-06T20:58:16.305662Z",
    "createdBy": "8f84cf09-8036-51e4-b579-bd30cb07b269"
  }
}

响应

Status: 401, Unauthorized
名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

状态

string

True

correlationID

string

False

响应示例
{
  "type": "https://astra.netapp.io/problems/3",
  "title": "Missing bearer token",
  "detail": "The request is missing the required bearer token.",
  "status": "401"
}

响应

Status: 400, Bad request
名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

状态

string

True

correlationID

string

False

invalidParams

数组["invalidParams"]

False

无效查询参数列表

响应示例
{
  "type": "https://astra.netapp.io/problems/5",
  "title": "Invalid query parameters",
  "detail": "The supplied query parameters are invalid.",
  "status": "400"
}

响应

Status: 403, Forbidden
名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

状态

string

True

correlationID

string

False

响应示例
{
  "type": "https://astra.netapp.io/problems/11",
  "title": "Operation not permitted",
  "detail": "The requested operation isn't permitted.",
  "status": "403"
}

错误

Status: 404, Not found
名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

状态

string

True

correlationID

string

False

错误响应示例
{
  "type": "https://astra.netapp.io/problems/2",
  "title": "Collection not found",
  "detail": "The collection specified in the request URI wasn't found.",
  "status": "404"
}

定义

查看定义

type_astra_stateTransition

名称 Type Required Description

string

True

to

数组[string]

True

additionalDetails

type_astra_stateDetail

名称 Type Required Description

type

string

True

标题

string

True

详细信息

string

True

additionalDetails

"additionalDetails"

False

dependsOnImages

名称 Type Required Description

imagePath

string

True

包含此 Docker 镜像路径的 JSON 字符串。它不能包含注册表的名称,只能包含从根到镜像的绝对路径。示例:/globalcicd/acc 定义的值为:

  • 最小长度:1

  • 最大长度:1023

imageName

string

True

包含 Docker 镜像名称的 JSON 字符串。定义的值为:

  • 最小长度:1

  • 最大长度:63

imageTag

string

True

表示此图像的标签/版本的 JSON 字符串。定义的值是:

  • 最小长度:1

  • 最大长度:31

镜像

名称 Type Required Description

imageName

string

True

包含 Docker 镜像名称的 JSON 字符串。定义的值为:

  • 最小长度:1

  • 最大长度:63

imagePath

string

True

包含此 Docker 镜像路径的 JSON 字符串。它不能包含注册表的名称,只能包含从根到镜像的绝对路径。示例:/globalcicd/acc 定义的值为:

  • 最小长度:1

  • 最大长度:1023

imageTag

string

True

表示此图像的标签/版本的 JSON 字符串。定义的值是:

  • 最小长度:1

  • 最大长度:31

imageDigest

string

True

表示此图像摘要的 JSON 字符串。定义的值是:

  • 定义的正则表达式为:"^(sha256:)[0-9a-f]{64}$"

dependsOnImages

数组["dependsOnImages"]

False

JSON 对象的 JSON 数组,描述安装或升级当前映像所需的映像。

dependsOnComponents

名称 Type Required Description

componentName

string

True

描述组件名称的 JSON 字符串。定义的值是:

  • "acc"

  • "acs"

  • “trident”

  • “kubernetes”

版本

数组[string]

True

JSON 字符串的 JSON 数组,定义安装当前映像所需的组件版本。

制品

名称 Type Required Description

artifactName

string

True

包含文件名的 JSON 字符串。定义的值是:

  • 最小长度:1

  • 最大长度:63

artifactIdentifier

string

True

包含此文件标识符的 JSON 字符串。在相同包类型的版本之间,文件名可能会更改,但标识符通常保持不变。定义的值是:

  • 最小长度:1

  • 最大长度:511

artifactPath

string

True

JSON 字符串,包含从已知 Astra Control Center 数据存储/位置的根目录到此项目的路径。示例:/vmware/1.0/ 定义的值为:

  • 最小长度:1

  • 最大长度:1023

artifactVersion

string

False

包含该项目版本的 JSON 字符串(如果提供)。定义的值为:

  • 符合 SemVer 架构

  • 最小长度:1

  • 最大长度:31

dependsOnComponents

数组["dependsOnComponents"]

False

JSON 对象的 JSON 数组,描述安装/升级当前映像所需的已安装组件。

文件

名称 Type Required Description

fileName

string

True

包含文件名的 JSON 字符串。定义的值是:

  • 最小长度:1

  • 最大长度:63

fileIdentifier

string

True

包含此文件标识符的 JSON 字符串。在相同包类型的版本之间,文件名可能会更改,但标识符通常保持不变。定义的值是:

  • 最小长度:1

  • 最大长度:511

fileMediaType

string

True

包含文件媒体类型的 JSON 字符串。定义的值是由 "IANA"定义的任何媒体类型。此外,还支持 yaml 文件的 application/x-yaml 或 application/x-yaml。

  • 最小长度:1

  • 最大长度:211

fileContents

string

True

包含文件内容的 JSON 字符串。定义的值为:

  • 符合 Base64 Schema FIXME - 我们如何指定这是压缩的?什么算法等?

upgradableVersions

JSON 对象包含可以升级到包版本的最低和最高版本。

名称 Type Required Description

minVersion

string

False

JSON 字符串,描述可以升级到包版本的最低版本。定义的值为:

  • 符合 SemVer 架构

maxVersion

string

False

JSON 字符串,描述可以升级到包版本的最高版本。定义的值为:

  • 符合 SemVer 架构

依赖项

名称 Type Required Description

componentName

string

True

描述组件名称的 JSON 字符串。定义的值是:

  • "acc"

  • "acs"

  • “trident”

  • “kubernetes”

componentMinVersion

string

False

描述该组件所需的最低版本的 JSON 字符串。定义的值为:

  • 符合 SemVer 架构

componentMaxVersion

string

False

描述该组件所需的最高版本的 JSON 字符串。定义的值为:

  • 符合 SemVer 架构

类型 Astra 标签

名称 Type Required Description

name

string

True

value

string

True

type_astra_metadata

与资源关联的客户端和服务指定的元数据。定义的值为:

  • 符合 Astra 元数据架构如果在创建时未指定,则将创建没有标签的元数据对象。

名称 Type Required Description

labels

数组["类型 Astra 标签"]

True

creationTimestamp

string

True

modificationTimestamp

string

True

已创建

string

True

modifiedBy

string

False

invalidParams

名称 Type Required Description

name

string

True

无效查询参数的名称

原因

string

True

查询参数无效的原因