graviti.openapi.tag#

Interfaces about the tag.

Module Contents#

Functions#

create_tag(access_key, url, workspace, dataset, *, name, revision)

Execute the OpenAPI POST /v2/datasets/{workspace}/{dataset}/tags.

list_tags(access_key, url, workspace, dataset, *, offset = None, limit = None)

Execute the OpenAPI GET /v2/datasets/{workspace}/{dataset}/tags.

get_tag(access_key, url, workspace, dataset, *, tag)

Execute the OpenAPI GET /v2/datasets/{workspace}/{dataset}/tags/{tag}.

delete_tag(access_key, url, workspace, dataset, *, tag)

Execute the OpenAPI DELETE /v2/datasets/{workspace}/{dataset}/tags/{tag}.

graviti.openapi.tag.create_tag(access_key, url, workspace, dataset, *, name, revision)[source]#

Execute the OpenAPI POST /v2/datasets/{workspace}/{dataset}/tags.

Parameters
  • access_key (str) – User’s access key.

  • url (str) – The URL of the graviti website.

  • workspace (str) – The workspace of the dataset.

  • dataset (str) – Name of the dataset, unique for a user.

  • name (str) – The tag name to be created for the specific commit.

  • revision (str) – The information to locate the specific commit, which can be the commit id, the branch name, or the tag name.

Returns

The response of OpenAPI.

Return type

Dict[str, Any]

Examples

>>> create_tag(
...     "ACCESSKEY-********",
...     "https://api.graviti.com",
...     "graviti-example",
...     "MNIST",
...     name="tag-2",
...     revision="986d8ea00da842ed85dd5d5cd14b5aef"
... )
{
   "name": "tag-2",
   "commit_id": "986d8ea00da842ed85dd5d5cd14b5aef",
   "parent_commit_id": "a0d4065872f245e4ad1d0d1186e3d397",
   "title": "commit-1",
   "description": "",
   "committer": "graviti-example",
   "committed_at": "2021-03-03T18:58:10Z"
}
graviti.openapi.tag.list_tags(access_key, url, workspace, dataset, *, offset=None, limit=None)[source]#

Execute the OpenAPI GET /v2/datasets/{workspace}/{dataset}/tags.

Parameters
  • access_key (str) – User’s access key.

  • url (str) – The URL of the graviti website.

  • workspace (str) – The workspace of the dataset.

  • dataset (str) – Name of the dataset, unique for a user.

  • offset (Optional[int]) – The offset of the page. The default value of this param in OpenAPIv2 is 0.

  • limit (Optional[int]) – The limit of the page. The default value of this param in OpenAPIv2 is 128.

Returns

The response of OpenAPI.

Return type

Dict[str, Any]

Examples

>>> list_tags(
...     "ACCESSKEY-********",
...     "https://api.graviti.com",
...     "graviti-example",
...     "MNIST"
... )
{
   "tags": [
       {
           "name": "tag-2",
           "commit_id": "986d8ea00da842ed85dd5d5cd14b5aef",
           "parent_commit_id": "a0d4065872f245e4ad1d0d1186e3d397",
           "title": "commit-1",
           "description": "",
           "committer": "graviti-example",
           "committed_at": "2021-03-03T18:58:10Z"
       }
   ],
   "offset": 0,
   "record_size": 1,
   "total_count": 1
}
graviti.openapi.tag.get_tag(access_key, url, workspace, dataset, *, tag)[source]#

Execute the OpenAPI GET /v2/datasets/{workspace}/{dataset}/tags/{tag}.

Parameters
  • access_key (str) – User’s access key.

  • url (str) – The URL of the graviti website.

  • workspace (str) – The workspace of the dataset.

  • dataset (str) – Name of the dataset, unique for a user.

  • tag (str) – The name of the tag to be got.

Returns

The response of OpenAPI.

Return type

Dict[str, Any]

Examples

>>> get_tag(
...     "ACCESSKEY-********",
...     "https://api.graviti.com",
...     "graviti-example",
...     "MNIST",
...     tag="tag-2"
... )
{
   "name": "tag-2",
   "commit_id": "986d8ea00da842ed85dd5d5cd14b5aef",
   "parent_commit_id": "a0d4065872f245e4ad1d0d1186e3d397",
   "title": "commit-1",
   "description": "",
   "committer": "graviti-example",
   "committed_at": "2021-03-03T18:58:10Z"
}
graviti.openapi.tag.delete_tag(access_key, url, workspace, dataset, *, tag)[source]#

Execute the OpenAPI DELETE /v2/datasets/{workspace}/{dataset}/tags/{tag}.

Parameters
  • access_key (str) – User’s access key.

  • url (str) – The URL of the graviti website.

  • workspace (str) – The workspace of the dataset.

  • dataset (str) – Name of the dataset, unique for a user.

  • tag (str) – The name of the tag to be deleted.

Return type

None

Examples

>>> delete_tag(
...     "ACCESSKEY-********",
...     "https://api.graviti.com",
...     "graviti-example",
...     "MNIST",
...     tag="tag-2"
... )