Menu
Introduction
Getting Started
Developer guide
Release
Architecture
CLI
Technical documentations
Version
Publication date

Mar 9, 2022

Confidentiality
Public
Reactions
1
Share

DockerService

Attributes
AUTH_API_KEY_HEADER_PREFIX: strAUTH_HEADER_KEY: strUSER_ID_HEADER_KEY: str
Functions
__init__

Constructor of the SpaceService

access_token : str | None
if access token is provided, it is used to authenticate. Otherwise the current user is used for authentication
get_all_composes

Get all docker composes

Return type : SubComposeListDTO
get_basic_credentials

Get basic credentials using the brick_name_unique_name format as the credential name.

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
Return type : gws_core.credentials.credentials.Credentials | None
get_basic_credentials_name

Get the name of the basic credentials using the brick_name_unique_name format.

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
Return type : str
get_compose_status

Get the status of a docker compose

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
Return type : SubComposeStatusDTO
get_or_create_basic_credentials

Get or create basic credentials using the brick_name_unique_name format as the credential name.

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
username : str | None
Username for the credential. If not provided, set to 'brick_name_unique_name'
password : str | None
Password for the credential. If not provided, a random 30-character password will be generated
url : str | None
Optional URL for the credential
Return type : CredentialsDataBasic
get_sub_compose_service_status

Get the status of a specific service within a docker compose

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
service_name : str
Name of the service within the compose
Return type : DockerContainerInspectDTO
register_and_start_compose

Start a docker compose from string content

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
compose_yaml_content : str
Content of the docker-compose YAML file
options : RegisterComposeOptionsRequestDTO
Options for the compose registration
register_sqldb_compose

Register and start a SQL database docker compose. The username and password for the database will be created as basic credentials.

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
database_name : str
options : RegisterSQLDBComposeRequestOptionsDTO
Options for the compose registration
Return type : RegisterSQLDBComposeResponseDTO
register_sub_compose_from_folder

Register a docker compose from a folder by zipping it and uploading

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
folder_path : str
Path to the folder containing the compose files
options : RegisterComposeOptionsRequestDTO
Options for the compose registration
stop_compose

Stop a docker compose without unregistering it

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
unregister_compose

Stop and unregister a docker compose

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
Return type : SubComposeStatusDTO
wait_for_compose_status

Wait for the compose status to stabilize (not STARTING or STOPPING)

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
interval_seconds : float - 5.0
Time in seconds between status checks (default: 5.0). 0 means no limit.
max_attempts : int - 0
Maximum number of attempts to check the status (default: 12)
message_dispatcher : gws_core.core.classes.observer.message_dispatcher.MessageDispatcher | None
Return type : SubComposeStatusDTO
wait_for_service_healthy

Wait for a service to be up and healthy

brick_name : str
Name of the brick
unique_name : str
Unique name for the compose
service_name : str
Name of the service within the compose
interval_seconds : float - 5.0
Time in seconds between status checks (default: 5.0)
max_attempts : int - 0
Maximum number of attempts to check the status (default: 0 means no limit)
message_dispatcher : gws_core.core.classes.observer.message_dispatcher.MessageDispatcher | None
Optional message dispatcher for progress updates
Return type : DockerContainerInspectDTO
get_instance @classmethod

Return a new instance of the SpaceService that use the current user for authentication

Return type : LabManagerServiceBaseType
Shine Logo
Technical bricks to reuse or customize

Have you developed a brick?

Share it to accelerate projects for the entire community.