CreateTag

Updated at:

Tag a code repository.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /repository/{repositoryId}/tags/create HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

repositoryId

integer

Yes

The ID of the repository.

2080972

Request parameters

Parameter

Type

Required

Description

Example

organizationId

string

Yes

The organization ID. You can find this ID in your Alibaba Cloud DevOps URL, for example: https://devops.aliyun.com/organization/{organizationId}.

60de7a6852743a5162b5f957

accessToken

string

No

The personal access token. This is not required when authenticating with an Alibaba Cloud AccessKey pair (AK/SK) or temporary credentials from the Security Token Service (STS).

f0b1e61db5961df5975a93f9129d2513

body

object

Yes

The request body.

tagName

string

Yes

The tag name.

v1.0

ref

string

Yes

The reference from which the tag is created. This can be a branch name, another tag, or a commit SHA.

master

message

string

No

The message for the tag.

描述信息

Response elements

Element

Type

Description

Example

object

Response schema

requestId

string

The request ID.

F7B85D1B-D1C2-140F-A039-341859F130B9

errorCode

string

The error code.

SYSTEM_UNKNOWN_ERROR

errorMessage

string

The error message.

""

success

boolean

Indicates whether the request was successful.

true

result

object

The details of the created tag.

id

string

The tag ID.

0e3b6aa5eab2b086b59fde74766b28d4e5faab0d

name

string

The tag name.

v1.0

message

string

The tag message.

描述内容

commit

object

Details of the commit that the tag points to.

id

string

The commit ID.

e0297d8fb0393c833a8531e7cc8832739e3cba6d

shortId

string

The short commit ID.

e0297d8f

title

string

The commit title, which is the first line of the commit message.

提交标题

message

string

The body of the commit message.

具体的提交内容

createdAt

string

The creation time of the commit.

2022-03-18 10:00:00

authorName

string

The author name.

阿里云云效

authorEmail

string

The author's email address.

username@example.com

authoredDate

string

The time when the commit was authored.

2022-03-18 10:00:00

committerName

string

The committer name.

阿里云云效committer

committerEmail

string

The committer's email address.

username@example.com

committedDate

string

The time when the commit was committed.

2022-03-18 09:00:00

parentIds

array

The parent commit IDs.

string

A parent commit ID.

34d2c47c7ce46a5c4639c5ffe208a66dda975a05

Examples

Success response

JSON format

{
  "requestId": "F7B85D1B-D1C2-140F-A039-341859F130B9",
  "errorCode": "SYSTEM_UNKNOWN_ERROR",
  "errorMessage": "\"\"",
  "success": true,
  "result": {
    "id": "0e3b6aa5eab2b086b59fde74766b28d4e5faab0d",
    "name": "v1.0",
    "message": "描述内容",
    "commit": {
      "id": "e0297d8fb0393c833a8531e7cc8832739e3cba6d",
      "shortId": "e0297d8f",
      "title": "提交标题\n",
      "message": "具体的提交内容\n",
      "createdAt": "2022-03-18 10:00:00",
      "authorName": "阿里云云效",
      "authorEmail": "username@example.com",
      "authoredDate": "2022-03-18 10:00:00",
      "committerName": "阿里云云效committer",
      "committerEmail": "username@example.com",
      "committedDate": "2022-03-18 09:00:00",
      "parentIds": [
        "34d2c47c7ce46a5c4639c5ffe208a66dda975a05"
      ]
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

403 Forbidden.AccessDenied The user is not authorized to perform the operation. The user is not authorized to perform the operation.
403 Forbidden.UserNotInCurrentOrganization The user is not in the organization and is not authorized to perform the operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.