graviti.manager.tag
#
The implementation of the Tag and TagManager.
Module Contents#
Classes#
This class defines the structure of the tag of a commit. |
|
This class defines the operations on the tag in Graviti. |
- class graviti.manager.tag.Tag(dataset, name, commit_id, parent_commit_id, title, description, committer, committed_at)[source]#
Bases:
graviti.manager.commit.NamedCommit
This class defines the structure of the tag of a commit.
- Parameters
dataset (graviti.manager.dataset.Dataset) – Class
Dataset
instance.name (str) – The name of the tag.
commit_id (str) – The commit id.
parent_commit_id (str) – The parent commit id.
title (str) – The commit title.
description (str) – The commit description.
committer (str) – The commit user.
committed_at (str) – The time when the draft is committed.
- class graviti.manager.tag.TagManager(dataset)[source]#
This class defines the operations on the tag in Graviti.
- Parameters
dataset (graviti.manager.dataset.Dataset) –
Dataset
instance.
- create(self, name, revision=None)[source]#
Create a tag for a commit.
- Parameters
name (str) – The tag name to be created for the specific commit.
revision (Optional[str]) – The information to locate the specific commit, which can be the commit id, the branch name, or the tag name. If the revision is not given, create the tag for the current commit.
- Returns
The
Tag
instance with the given name.- Return type
- get(self, name)[source]#
Get the certain tag with the given name.
- Parameters
name (str) – The required tag name.
- Raises
ResourceNotExistError – When the name is an empty string.
- Returns
The
Tag
instance with the given name.- Return type
- list(self)[source]#
List the information of tags.
- Returns
The LazyPagingList of
tags
instances.- Return type
- delete(self, name)[source]#
Delete a tag.
- Parameters
name (str) – The tag name to be deleted for the specific commit.
- Raises
ResourceNotExistError – When the name is an empty string.
- Return type
None