DeleteArtifactVersion - Delete a single artifact version

更新时间:
复制 MD 格式

Deletes a single artifact version through the OpenAPI.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.

  • Get a personal access token.

  • Get organizationId: Required for Central edition only. Go to the Basic Information page in the Organization Management console to obtain your organization ID.

Product

Resource

Required permission

Artifact repository

Artifact

Read and write

Request syntax

Central edition

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

Region edition

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

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

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

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

xxxxxxxx

repoId

string

path

Yes

Repository ID.

my-repo

id

integer

path

Yes

Artifact ID. You can obtain this value by calling the ListArtifacts API.

123456

versionId

integer

path

Yes

Artifact version ID. You can obtain this value by calling the GetArtifact API.

123456

repoType

string

query

Yes

Repository type. Valid values: GENERIC, DOCKER, MAVEN, NPM, NUGET, PYPI.

MAVEN

Request examples

Central edition

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

Region edition

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

Response parameters

Parameter

Type

Description

Example value

-

boolean

Whether the deletion succeeded.

true

Response example

true

Error codes

For API error codes, see Error Code Center.