Skip to content

Tags


Description of the JSON object structure describing a tag

Field Type Description
name String Tag name
fullName String Full tag name
objectId String Object ID (for lightweight tags matches the commit hash)
shortMessage String Short message (absent for lightweight tags)
fullMessage String Full message (absent for lightweight tags)
commitId String Commit hash referenced by the tag
personIdent Object personIdent Information about the tag author
lightWeight Boolean Lightweight tag true or annotated false

Description of the JSON object structure describing the tag author

Field Type Description
name String Author's name
avatar String Author's avatar
emailAddress String Email address
when DateTime Tag creation time

Description of the JSON object structure describing tag protection rule

Learn more about tag protection rules here.

Field Type Description
tagTemplate String Protected tag name template
allowToCreate String Minimum participant role allowed to create protected tags. Possible values: NO_ONE - nobody, DEVELOPER - developers and above, ADMINS - admins and above
ownerType String Tag protection rule owner type
uuid String Tag protection rule UUID

Method to get the list of project tags

GET /project/{ownerAlias}/{projectAlias}/tag

The request returns a list of all tags, with the ability to configure number of objects per page.

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias

Responses

STATUS 200 - Tag list returned.

Example response
    
{
    "_embedded": {
        "tagList": [
           {
                "name": "3.2.1",
                "fullName": "refs/tags/3.2.1",
                "objectId": "1a4cca6e2a5badaaaaaaaaaaaaf34aeeda3b4312",
                "shortMessage": "",
                "fullMessage": "",
                "commitId": "334894f08068f3aaaaaaaaaaaa6c4d11ab291901",
                "personIdent": {
                    "name": "user",
                    "avatar": "/static/image/avatar.jpg",
                    "emailAddress": "user@email.ru",
                    "when": "2024-05-14T08:57:19Z"
                },
                "lightWeight": false
            },
            {
                "name": "v1.4",
                "fullName": "refs/tags/v1.4",
                "objectId": "767824e6b49d65aaaaaaaaaaaad4d6b38667242e",
                "shortMessage": "",
                "fullMessage": "",
                "commitId": "b7a6c142f2a9b5aaaaaaaaaaaa4d7dd4f314f328",
                "personIdent": {
                   "name": "user",
                   "avatar": "/static/image/avatar.jpg",
                   "emailAddress": "user@email.ru",
                   "when": "2022-04-26T13:44:45Z"
                },
                "lightWeight": false
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 2,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to get a tag by name

GET /project/{ownerAlias}/{projectAlias}/tag/{tagName}

The request returns a tag.

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias
tagName String Tag name

Responses

STATUS 200 - Tag returned.

Example response
    
{
    "name": "3.2.1",
    "fullName": "refs/tags/3.2.1",
    "objectId": "1a4cca6e2a5badaaaaaaaaaaaaf34aeeda3b4312",
    "shortMessage": "",
    "fullMessage": "",
    "commitId": "334894f08068f3aaaaaaaaaaaa6c4d11ab291901",
    "personIdent": {
        "name": "user",
        "avatar": "/static/image/avatar.jpg",
        "emailAddress": "user@email.ru",
        "when": "2024-05-14T08:57:19Z"
    },
    "lightWeight": false
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to create a tag

POST /project/{ownerAlias}/{projectAlias}/tag/create

The request creates a tag and returns its information. A tag can be created on a branch or a commit.

Path variable Type Description
ownerAlias String Project owner's alias
projectAlias String Project alias

Request

Supported JSON format

POST request body structure:

JSON variable Type Description
tagName String Tag name
branchName String Project branch name
commitId String Commit hash
message String Tag description

Example JSON object

{
    "tagName": "3.2.1",
    "commitId": "334894f08068f3aaaaaaaaaaaa6c4d11ab291901",
    "message": "Example message",
}

Responses

STATUS 200 - Tag created successfully.

Example response
    
{
    "name": "3.2.1",
    "fullName": "refs/tags/3.2.1",
    "objectId": "1a4cca6e2a5badaaaaaaaaaaaaf34aeeda3b4312",
    "shortMessage": "",
    "fullMessage": "",
    "commitId": "334894f08068f3aaaaaaaaaaaa6c4d11ab291901",
    "personIdent": {
        "name": "user",
        "avatar": "/static/image/avatar.jpg",
        "emailAddress": "user@email.ru",
        "when": "2024-05-14T08:57:19Z"
    },
    "lightWeight": false
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Methods for tag protection rules

Method to get the list of tag protection rules

Companies: GET /company/{companyAlias}/tag-protection

Teams: GET /team/{teamAlias}/tag-protection

The request returns a list of tag protection rules for the specified entity with the given alias, with the ability to configure number of objects per page.

Path variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 200 - Tag protection rules returned:

Example response
    
{
    "_embedded": {
        "restTagProtectionModelList": [
            {
                "tagTemplate": "**",
                "allowToCreate": "NO_ONE",
                "ownerType": "COMPANY",
                "uuid": "af7fdf35-aaaa-aaaa-aaaa-6faa00b5ba19"
            },
            {
                "tagTemplate": "Release-*",
                "allowToCreate": "ADMINS",
                "ownerType": "COMPANY",
                "uuid": "df4f3dc7-aaaa-aaaa-aaaa-7009324ead56"
            }
        ]
    },
    "page": {
        "size": 10,
        "totalElements": 2,
        "totalPages": 1,
        "number": 0
    }
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to get tag protection rule by UUID

Companies: GET /company/{companyAlias}/tag-protection/{tagProtectionUuid}

Teams: GET /team/{teamAlias}/tag-protection/{tagProtectionUuid}

The request returns a tag protection rule for the specified entity with the given alias.

Path variable Type Description
companyAlias String Company alias
teamAlias String Team alias
tagProtectionUuid String Tag protection rule UUID

Responses

STATUS 200 - Tag protection rule returned:

Example response
    
{
    "tagTemplate": "**",
    "allowToCreate": "NO_ONE",
    "ownerType": "COMPANY",
    "uuid": "af7fdf35-aaaa-aaaa-aaaa-6faa00b5ba19"
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to create tag protection rule

Companies: POST /company/{companyAlias}/tag-protection/create

Teams: POST /team/{teamAlias}/tag-protection/create

The request creates and returns a tag protection rule for the specified entity with the given alias.

Path variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported JSON format

POST request body structure:

Field Type Description
tagTemplate String Protected tag name template
allowToCreate String Minimum participant role allowed to create protected tags. Possible values: NO_ONE - nobody, DEVELOPER - developers and above, ADMINS - admins and above

Example JSON object

{
    "tagTemplate": "**",
    "allowToCreate": "ADMINS"
}

Responses

STATUS 200 - Tag protection rule created:

Example response
    
{
    "tagTemplate": "**",
    "allowToCreate": "NO_ONE",
    "ownerType": "COMPANY",
    "uuid": "af7fdf35-aaaa-aaaa-aaaa-6faa00b5ba19"
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.

STATUS 422 - Required field missing in request body.


Method to edit tag protection rule

Companies: PATCH /company/{companyAlias}/tag-protection/edit

Teams: PATCH /team/{teamAlias}/tag-protection/edit

The request edits and returns a tag protection rule for the specified entity with the given alias.

Path variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Request

Supported JSON format

PATCH request body structure:

Field Type Description
uuid String Tag protection rule UUID
allowToCreate String Minimum participant role allowed to create protected tags. Possible values: NO_ONE - nobody, DEVELOPER - developers and above, ADMINS - admins and above

Example JSON object

{
    "uuid": "af7fdf35-aaaa-aaaa-aaaa-6faa00b5ba19",
    "allowToCreate": "ADMINS"
}

Responses

STATUS 200 - Tag protection rule edited:

Example response
    
{
    "tagTemplate": "**",
    "allowToCreate": "NO_ONE",
    "ownerType": "COMPANY",
    "uuid": "af7fdf35-aaaa-aaaa-aaaa-6faa00b5ba19"
}
    
  

STATUS 403 - No access rights.

STATUS 404 - Data not found.

STATUS 422 - Required field missing in request body.


Method to delete tag protection rule

Companies: DELETE /company/{companyAlias}/tag-protection/{tagProtectionUuid}

Teams: DELETE /team/{teamAlias}/tag-protection/{tagProtectionUuid}

The request deletes a tag protection rule for the specified entity with the given alias by the specified UUID.

Path variable Type Description
companyAlias String Company alias
teamAlias String Team alias
tagProtectionUuid String Tag protection rule UUID

Responses

STATUS 204 - Tag protection rule deleted.

STATUS 403 - No access rights.

STATUS 404 - Data not found.


Method to apply tag protection rules to projects

Companies: POST /company/{companyAlias}/tag-protection/apply-settings-to-projects

Teams: POST /team/{teamAlias}/tag-protection/apply-settings-to-projects

The request applies tag protection rules to all projects of the specified entity with the given alias.

Path variable Type Description
companyAlias String Company alias
teamAlias String Team alias

Responses

STATUS 204 - Tag protection rules applied to all child projects.

STATUS 403 - No access rights.

STATUS 404 - Data not found.

Automated translation!

This page was translated using automatic translation tools. The text may contain inaccuracies.