GetArtifact - 查看单个制品信息

更新时间:
复制 MD 格式

通过 OpenAPI 查询单个制品信息。

适用版本

中心版、Region

服务接入点与授权信息

产品

资源

所需权限

制品仓库

制品

只读

请求语法

中心版

GET https://{domain}/oapi/v1/packages/organizations/{organizationId}/repositories/{repoId}/artifacts/{id}

Region

GET https://{domain}/oapi/v1/packages/repositories/{repoId}/artifacts/{id}

请求头

参数

类型

是否必填

描述

示例值

x-yunxiao-token

string

个人访问令牌。

pt-0fh3****0fbG_35af****0484

请求参数

参数

类型

位置

是否必填

描述

示例值

organizationId

string

path

  • 是:中心版

  • 否:Region

企业 Id。

xxxxxxxx

repoId

string

path

仓库 Id。

my-repo

id

integer

path

制品 Id,参考来源:ListArtifacts - 查询制品信息 api。

123456

repoType

string

query

仓库类型,可选值 GENERIC/DOCKER/MAVEN/NPM/NUGET/PYPI。

MAVEN

请求示例

中心版

curl -X 'GET' \
  'https://{domain}/oapi/v1/packages/organizations/xxxxxxxx/repositories/my-repo/artifacts/123456?repoType=MAVEN' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region

curl -X 'GET' \
  'https://{domain}/oapi/v1/packages/repositories/my-repo/artifacts/123456?repoType=MAVEN' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

返回参数

参数

类型

描述

示例值

-

object

模块信息。

downloadCount

integer

下载次数。

100

gmtDownload

integer

最近下载时间。

1728557118000

id

integer

制品 id。

123456

latestUpdate

integer

最近更新时间。

1728557118000

module

string

模块名。

mypackage

organization

string

组织信息。

com.aliyun

repositoryId

string

仓库 id。

my_repo

versions

array

版本列表。

-

object

createTime

integer

创建时间。

1728557118000

creator

string

创建人。

xxxx

gmtDownload

integer

最新下载时间。

1728557118000

id

integer

制品版本 id。

123456

modifier

string

修改人。

xxx

updateTime

integer

修改时间。

1728557118000

version

string

版本号。

1.4

返回示例

{
    "downloadCount": 100,
    "gmtDownload": 1728557118000,
    "id": 123456,
    "latestUpdate": 1728557118000,
    "module": "mypackage",
    "organization": "com.aliyun",
    "repositoryId": "my_repo",
    "versions": [
        {
            "createTime": 1728557118000,
            "creator": "xxxx",
            "gmtDownload": 1728557118000,
            "id": 123456,
            "modifier": "xxx",
            "updateTime": 1728557118000,
            "version": "1.4"
        }
    ]
}

错误码

访问错误码中心查看 API 相关错误码。