创建新包
POST /accounts/{account_id}/core/v1/packages
指示要创建的 Package API 资源的所需值。
参数
| 名称 | Type | 在 | Required | Description |
|---|---|---|---|---|
account_id |
string |
path |
True |
包含帐户资源的 ID
|
请求正文
指示要创建的 Package API 资源的所需值。
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
资源的媒体类型。定义的值为:
|
version |
string |
True |
资源的版本。定义的值为:
|
packageName |
string |
True |
包含包名称的 JSON 字符串。定义的值为:
|
packageVersion |
string |
True |
包含包的 SemVer 的 JSON 字符串。定义的值为:
|
packageType |
string |
True |
包含程序包类型的 JSON 字符串,指示这是完整的安装程序包还是修补程序。定义的值为:
|
bundleName |
数组[string] |
False |
包含软件包所在捆绑包名称的 JSON 字符串的 JSON 数组。 |
severityLevel |
string |
True |
描述此修补程序或安装的严重级别的 JSON 字符串。定义的值为:
|
镜像 |
数组["镜像"] |
False |
JSON 对象的 JSON 数组,每个对象都包含作为包一部分的 Docker 镜像。 |
制品 |
数组["制品"] |
False |
描述与此包关联的其他工件(二进制文件和其他)的 JSON 对象的 JSON 数组。 |
文件 |
数组["文件"] |
False |
JSON 对象的 JSON 数组,每个表示与此包关联的非图像制品。 |
upgradableVersions |
False |
JSON 对象包含可以升级到包版本的最低和最高版本。 |
|
依赖项 |
数组["依赖项"] |
False |
描述安装此包所需的给定依赖项最低版本的 JSON 对象的 JSON 数组 |
元数据 |
False |
与资源关联的客户端和服务指定的元数据。定义的值为:
|
请求示例
{
"type": "application/astra-package",
"version": "1.0",
"packageName": "acc",
"packageVersion": "22.09.1",
"packageType": "patch",
"severityLevel": "recommended",
"images": [
{
"imagePath": "/globalcicd/acc",
"imageName": "storage-provider",
"imageTag": "1.3.116",
"imageDigest": "sha256:2e04d178815537b0ad8c3224e8754e3364456781a161f1be239853dae33deafc"
},
{
"imagePath": "/globalcicd/acc",
"imageName": "storage-backend-metrics",
"imageTag": "1.3.45",
"imageDigest": "sha256:2e04d178815537b0ad8c3224e8754e3364456781a161f1be239853dae33deafc"
},
{
"imagePath": "/globalcicd/acc",
"imageName": "credentials",
"imageTag": "1.3.45",
"imageDigest": "sha256:2e04d178815537b0ad8c322445654e33642da781a161f1be239853dae33deafc"
}
],
"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.22"
},
{
"componentName": "trident",
"componentMinVersion": "v21.01.1"
}
]
}
响应
Status: 201, Returns the newly created package resource in the JSON response body.
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
资源的媒体类型。定义的值为:
|
version |
string |
True |
资源的版本。定义的值为:
|
id |
string |
True |
资源的全局唯一标识符。定义的值为:
|
packageName |
string |
True |
包含包名称的 JSON 字符串。定义的值为:
|
packageVersion |
string |
True |
包含包的 SemVer 的 JSON 字符串。定义的值为:
|
packageType |
string |
True |
包含程序包类型的 JSON 字符串,指示这是完整的安装程序包还是修补程序。定义的值为:
|
bundleName |
数组[string] |
False |
包含软件包所在捆绑包名称的 JSON 字符串的 JSON 数组。 |
severityLevel |
string |
True |
描述此修补程序或安装的严重级别的 JSON 字符串。定义的值为:
|
packageState |
string |
True |
包含指示包操作状态的值的 JSON 字符串。在包验证和导入后,状态将显示为"complete"。否则,状态将显示为"incomplete"。定义的值为:
|
packageStateTransitions |
True |
JSON 对象的 JSON 数组,每个表示从给定定义状态的允许状态转换集。每个 JSON 对象都包含字段"from"和"to",其中"from"值是状态的名称,"to"值是允许的目标状态数组。定义的值为:
|
|
packageStateDetails |
True |
列出有关当前"状态"的其他详细信息的 JSON 对象的 JSON 数组。如果没有可用的详细信息,此数组将为空。
|
|
镜像 |
数组["镜像"] |
False |
JSON 对象的 JSON 数组,每个对象都包含作为包一部分的 Docker 镜像。 |
制品 |
数组["制品"] |
False |
描述与此包关联的其他工件(二进制文件和其他)的 JSON 对象的 JSON 数组。 |
文件 |
数组["文件"] |
False |
JSON 对象的 JSON 数组,每个表示与此包关联的非图像制品。 |
upgradableVersions |
False |
JSON 对象包含可以升级到包版本的最低和最高版本。 |
|
依赖项 |
数组["依赖项"] |
False |
描述安装此包所需的给定依赖项最低版本的 JSON 对象的 JSON 数组 |
元数据 |
True |
与资源关联的客户端和服务指定的元数据。定义的值为:
|
响应示例
{
"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 |
|
invalidFields |
数组["invalidFields"] |
False |
无效请求正文字段列表 |
响应示例
{
"type": "https://astra.netapp.io/problems/5",
"title": "Invalid query parameters",
"detail": "The supplied query parameters are invalid.",
"status": "400"
}
响应
Status: 409, Conflict
| 名称 | Type | Required | Description |
|---|---|---|---|
type |
string |
True |
|
标题 |
string |
True |
|
详细信息 |
string |
True |
|
状态 |
string |
True |
|
correlationID |
string |
False |
|
invalidFields |
数组["invalidFields"] |
False |
无效请求正文字段列表 |
响应示例
{
"type": "https://astra.netapp.io/problems/10",
"title": "JSON resource conflict",
"detail": "The request body JSON contains a field that conflicts with an idempotent value.",
"status": "409"
}
响应
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"
}
定义
查看定义
dependsOnImages
| 名称 | Type | Required | Description |
|---|---|---|---|
imagePath |
string |
True |
包含此 Docker 镜像路径的 JSON 字符串。它不能包含注册表的名称,只能包含从根到镜像的绝对路径。示例:/globalcicd/acc 定义的值为:
|
imageName |
string |
True |
包含 Docker 镜像名称的 JSON 字符串。定义的值为:
|
imageTag |
string |
True |
表示此图像的标签/版本的 JSON 字符串。定义的值为:
|
镜像
| 名称 | Type | Required | Description |
|---|---|---|---|
imageName |
string |
True |
包含 Docker 镜像名称的 JSON 字符串。定义的值为:
|
imagePath |
string |
True |
包含此 Docker 镜像路径的 JSON 字符串。它不能包含注册表的名称,只能包含从根到镜像的绝对路径。示例:/globalcicd/acc 定义的值为:
|
imageTag |
string |
True |
表示此图像的标签/版本的 JSON 字符串。定义的值为:
|
imageDigest |
string |
True |
表示此图像摘要的 JSON 字符串。定义的值为:
|
dependsOnImages |
False |
JSON 对象的 JSON 数组,描述安装或升级当前映像所需的映像。 |
dependsOnComponents
| 名称 | Type | Required | Description |
|---|---|---|---|
componentName |
string |
True |
描述组件名称的 JSON 字符串。定义的值为:
|
版本 |
数组[string] |
True |
JSON 字符串的 JSON 数组,定义安装当前映像所需的组件版本。 |
制品
| 名称 | Type | Required | Description |
|---|---|---|---|
artifactName |
string |
True |
包含文件名的 JSON 字符串。定义的值为:
|
artifactIdentifier |
string |
True |
包含此文件标识符的 JSON 字符串。在相同包类型的版本之间,文件名可能会更改,但标识符通常保持不变。定义的值为:
|
artifactPath |
string |
True |
JSON 字符串,包含从已知 Astra Control Center 数据存储/位置的根目录到此项目的路径。示例:/vmware/1.0/ 定义的值为:
|
artifactVersion |
string |
False |
包含该项目版本的 JSON 字符串(如果提供)。定义的值为:
|
dependsOnComponents |
False |
JSON 对象的 JSON 数组,描述安装/升级当前映像所需的已安装组件。 |
文件
| 名称 | Type | Required | Description |
|---|---|---|---|
fileName |
string |
True |
包含文件名的 JSON 字符串。定义的值为:
|
fileIdentifier |
string |
True |
包含此文件标识符的 JSON 字符串。在相同包类型的版本之间,文件名可能会更改,但标识符通常保持不变。定义的值为:
|
fileMediaType |
string |
True |
包含文件媒体类型的 JSON 字符串。定义的值是由 "IANA"定义的任何媒体类型。此外,还支持 yaml 文件的 application/x-yaml 或 application/x-yaml。
|
fileContents |
string |
True |
包含文件内容的 JSON 字符串。定义的值为:
|
upgradableVersions
JSON 对象包含可以升级到包版本的最低和最高版本。
| 名称 | Type | Required | Description |
|---|---|---|---|
minVersion |
string |
False |
JSON 字符串,描述可以升级到包版本的最低版本。定义的值为:
|
maxVersion |
string |
False |
JSON 字符串,描述可以升级到包版本的最高版本。定义的值为:
|
依赖项
| 名称 | Type | Required | Description |
|---|---|---|---|
componentName |
string |
True |
描述组件名称的 JSON 字符串。定义的值为:
|
componentMinVersion |
string |
False |
描述该组件所需的最低版本的 JSON 字符串。定义的值为:
|
componentMaxVersion |
string |
False |
描述该组件所需的最高版本的 JSON 字符串。定义的值为:
|
类型 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 |
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 |
False |
invalidParams
| 名称 | Type | Required | Description |
|---|---|---|---|
name |
string |
True |
无效查询参数的名称 |
原因 |
string |
True |
查询参数无效的原因 |
invalidFields
| 名称 | Type | Required | Description |
|---|---|---|---|
name |
string |
True |
无效请求正文字段的名称 |
原因 |
string |
True |
请求正文字段无效的原因 |