Skip to content

Latest commit

 

History

History
392 lines (356 loc) · 14.8 KB

community.missing_collection.docker_hub_info_module.rst

File metadata and controls

392 lines (356 loc) · 14.8 KB

community.missing_collection.docker_hub_info

Get information about docker namespaces/repositories/images.

Version added: 0.4.0

The below requirements are needed on the host that executes this module.

  • requests
Parameter Choices/Defaults Comments
active_from
string
Sets the time from which an image must have been pushed or pulled to be counted as active.
Defaults to 1 month before the current time.
currently_tagged
boolean
    Choices:
  • no
  • yes ←
Filters to only show images with
get_repository_images
boolean
    Choices:
  • no
  • yes
Gets details on the images in a repository.
for given namespace and repository.
get_repository_summary
boolean
    Choices:
  • no
  • yes
Gets the number of images in a repository and the number of images counted as active and inactive.
for given namespace and repository.
list_namespaces
boolean
    Choices:
  • no
  • yes
get list of all namespaces.
list_repositories
boolean
    Choices:
  • no
  • yes
get list of all repository for given username.
namespace
string
Namespace of the repository.
ordering
string
    Choices:
  • last_activity ←
  • -last_activity
  • digest
  • -digest
Orders the results by this property.
Prefixing with - sorts by descending order.
page
integer
Default:
1
page number of record retrieve call.
page_size
integer
Default:
100
number of records retrieved in one call.
repository
string
Name of the repository.
status
string
    Choices:
  • active ←
  • inactive
Filters to only show images of this status.
token
string / required
jwt/Bearer token for docker hub api.
url
string
Default:
docker hub api.
username
string
username for docker hub for which you want to list repository.

- name: get jwt token from docker hub
  community.missing_collection.docker_hub_token:
    username: 'testUser'
    password: 'aDL0xxxxxxxxxxoQt6'
  register: '__'

- name: get all namespaces from docker hub
  community.missing_collection.docker_hub_info:
    token: '{{ __.token }}'
    list_namespaces: true
  register: '__ns'

- name: get all repositories for given username
  community.missing_collection.docker_hub_info:
    token: '{{ __.token }}'
    list_repositories: true
    username: 'testUser'

- name: get repository summary
  community.missing_collection.docker_hub_info:
    token: '{{ __.token }}'
    get_repository_summary: true
    namespace: 'testUser'
    repository: 'test'

- name: get repository images (required Pro license)
  community.missing_collection.docker_hub_info:
    token: '{{ __.token }}'
    get_repository_images: true
    namespace: 'testUser'
    repository: 'test'

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
result
dictionary
when success.
result of docker hub api.

Sample:
{'namespaces': ['testUser']}


Authors