k8s_client.views.users.images

This module contains all the endpoints needed to access to the user images.

Module Contents

Functions

get_user_image_tags([username, image_id])

Get user image tags list from the Docker registry

get_user_images([username, id])

Get user images list from the DB

post_user_image([username])

Create a new user image

put_user_image([username, image_id])

Updates an existing user image

delete_user_image([username, image_id])

Delete Image for user

k8s_client.views.users.images.get_user_image_tags(username=None, image_id=None)

Get user image tags list from the Docker registry

Parameters

"username": string

Name of the owner user for which to get the associated list

"image_id": int

Id of the image

Returns

  • [code: 404] Error message if:
    • username is NOT inside the DB

    • image_id is NOT inside the DB

  • [code: 200] dict [ string, list ], otherwise

    The dict contains: - "name" : string

    Full path of the image, composed by docker hub server/group/image

    • "tags"list [ string ]

      Each item contains a semver string representing an image version

k8s_client.views.users.images.get_user_images(username=None, id=None)

Get user images list from the DB

Parameters

"username": string

Name of the owner user for which to get the associated images list

Returns

  • [code: 404] Error message if:
    • username is NOT inside the DB

  • [code: 200] otherwise
    format:
    • list [dict]

      if id is None

    • dict

      if id is not None

    Each dict items contains:
    • "full_path"string

      Full path of the image, composed by docker hub server/group/image

    • "id"int

      Id of the record

    • "tags_list" : list [ semver ]

    • "wide_tags_list" : list [ dict [ id: int, image_id: int, tag: semver ] ]

k8s_client.views.users.images.post_user_image(username=None)

Create a new user image

Parameters

"username": string

Name of the owner user of the inserted image

Request Bodyjson
JSON containing data for the data:
"full_path": string

Full path of the image containing the docker registry, the group and the name itself

"tag": semver

String representing the version of the image

Returns

  • [code: 401] Error message if:

    The Bearer token is not correctly provided or it is expired

  • [code: 404] Error message if:
    • username is NOT inside the DB

  • [code: 409] Error message if:
    • The couple (full_path, tag) are already inside the DB

  • [code: 200] otherwise
    A dict contains:
    • "full_path"string

      Full path of the image, composed by docker hub server/group/image

    • "id"int

      Id of the record

    • "tag"semver

      Tag of the image

k8s_client.views.users.images.put_user_image(username=None, image_id=None)

Updates an existing user image

Parameters

"username": string

Name of the owner user of the image

"image_id": int, optional

Id of the image. Optional if the id is contained inside the request json body

Request Bodyjson
JSON containing data for the data:
"image_id": int, optional

Id of the image. If it is None, the provided parameter is used instead

"full_path": string

Full path of the image containing the docker registry, the group and the name itself

Returns

  • [code: 401] Error message if:

    The Bearer token is not correctly provided or it is expired

  • [code: 404] Error message if:
    • username is NOT inside the DB

    • image_id is NOT inside the DB

  • [code: 406] Error message if:
    • image_id not provided

  • [code: 200] otherwise
    A dict contains:
    • "full_path"string

      Full path of the image, composed by docker hub server/group/image

    • "id"int

      Id of the record

k8s_client.views.users.images.delete_user_image(username=None, image_id=None)

Delete Image for user

Parameters

"username": string

Name of the owner user of the image

Returns

  • [code: 404] Error message if:
    • username is NOT inside the DB

  • [code: 406] Error message if:
    • image_id not provided

  • [code: 200] dict [ image_id: int ] otherwise