Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoralsky committed May 2, 2019
1 parent 3cede7b commit 4d31b9c
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/api-objects.rst
Expand Up @@ -34,6 +34,8 @@ API examples
gl_objects/pagesdomains
gl_objects/projects
gl_objects/runners
gl_objects/repositories
gl_objects/repository_tags
gl_objects/search
gl_objects/settings
gl_objects/snippets
Expand Down
28 changes: 28 additions & 0 deletions docs/gl_objects/repositories.rst
@@ -0,0 +1,28 @@
#####################
Registry Repositories
#####################

References
----------

* v4 API:

+ :class:`gitlab.v4.objects.ProjectRegistryRepository`
+ :class:`gitlab.v4.objects.ProjectRegistryRepositoryManager`
+ :attr:`gitlab.v4.objects.Project.registries`

* Gitlab API: https://docs.gitlab.com/ce/api/container_registry.html

Examples
--------

Get the list of container registry repositories associated with the project::

registries = project.registries.list()

Delete repository::

project.registries.delete(id=x)
# or
registry = registries.pop()
registry.delete()
47 changes: 47 additions & 0 deletions docs/gl_objects/repository_tags.rst
@@ -0,0 +1,47 @@
########################
Registry Repository Tags
########################

References
----------

* v4 API:

+ :class:`gitlab.v4.objects.ProjectRegistryTag`
+ :class:`gitlab.v4.objects.ProjectRegistryTagManager`
+ :attr:`gitlab.v4.objects.Repository.tags`

* Gitlab API: https://docs.gitlab.com/ce/api/container_registry.html

Examples
--------

Get the list of repository tags in given registry::

registries = project.registries.list()
registry = registries.pop()
tags = registry.tags.list()

Get specific tag::
registry.tags.get(id=tag_name)

Delete tag::

registry.tags.delete(id=tag_name)
# or
tag = registry.tags.get(id=tag_name)
tag.delete()

Delete tag in bulk::

registry.tags.delete_in_bulk(keep_n=1)
# or
registry.tags.delete_in_bulk(older_than="1m")
# or
registry.tags.delete_in_bulk(name_regex="v.+", keep_n=2)

.. note::

Delete in bulk is asnychronous operation and may take a while.
Refer to: https://docs.gitlab.com/ce/api/container_registry.html#delete-repository-tags-in-bulk

0 comments on commit 4d31b9c

Please sign in to comment.