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 list from the Docker registry |
|
Get user images list from the DB |
|
Create a new user image |
|
Updates an existing user image |
|
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": stringName of the owner user for which to get the associated list
"image_id": intId of the image
Returns¶
[code: 404]Error message if:usernameis NOT inside the DBimage_idis NOT inside the DB
[code: 200]dict [ string, list ], otherwiseThe dict contains: -
"name": stringFull 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": stringName of the owner user for which to get the associated images list
Returns¶
[code: 404]Error message if:usernameis 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"stringFull path of the image, composed by docker hub server/group/image
"id"intId 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": stringName of the owner user of the inserted image
- Request Bodyjson
- JSON containing data for the data:
"full_path": stringFull path of the image containing the docker registry, the group and the name itself
"tag": semverString 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:usernameis 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"stringFull path of the image, composed by docker hub server/group/image
"id"intId of the record
"tag"semverTag of the image
- k8s_client.views.users.images.put_user_image(username=None, image_id=None)¶
Updates an existing user image
Parameters¶
"username": stringName of the owner user of the image
"image_id": int, optionalId 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, optionalId of the image. If it is None, the provided parameter is used instead
"full_path": stringFull 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:usernameis NOT inside the DBimage_idis NOT inside the DB
[code: 406]Error message if:image_id not provided
[code: 200]otherwise- A dict contains:
"full_path"stringFull path of the image, composed by docker hub server/group/image
"id"intId of the record
- k8s_client.views.users.images.delete_user_image(username=None, image_id=None)¶
Delete Image for user
Parameters¶
"username": stringName of the owner user of the image
Returns¶
[code: 404]Error message if:usernameis NOT inside the DB
[code: 406]Error message if:image_id not provided
[code: 200]dict [ image_id: int ] otherwise