Utils

class jelastic.api.utils.Utils(session: Session, token: str, debug: bool = False, ruk: str | None = None)[source]

Bases: ClientAbstract

>>> from jelastic import Jelastic
>>> jelastic = Jelastic('https://app.xapp.cloudmydc.com', token='d6f4e314a5b5fefd164995169f28ae32d987704f')
>>> jelastic.utils

Ref: https://docs.jelastic.com/api/private/#!/api/utils

property Batch: _Batch

Used to perform several actions in one request to the server.

>>> from jelastic import Jelastic
>>> jelastic = Jelastic('https://app.xapp.cloudmydc.com', token='d6f4e314a5b5fefd164995169f28ae32d987704f')
>>> jelastic.utils.Batch

Ref: https://docs.jelastic.com/api/private/#!/api/utils.Batch

property Scheduler: _Scheduler

This service manages custom operations on the platform (tasks) that are performed based on the configured triggers. A task can be associated with the account or specific environment (automatically removed alongside it) and executed based on the specific conditions - cron, date, after the platform start, etc.

>>> from jelastic import Jelastic
>>> jelastic = Jelastic('https://app.xapp.cloudmydc.com', token='d6f4e314a5b5fefd164995169f28ae32d987704f')
>>> jelastic.utils.Scheduler

Ref: https://docs.jelastic.com/api/private/#!/api/utils.Scheduler

class jelastic.api.utils._Batch(session: Session, token: str, debug: bool = False, ruk: str | None = None)[source]

Bases: Utils

Used to perform several actions in one request to the server.

Ref: https://docs.jelastic.com/api/private/#!/api/utils.Batch

Call(request: dict, sync: bool = False, ruk: str | None = None)[source]

Multiply call the functions of platforms in a single query.

:param request - batch query format JSON :param sync - sync call

class jelastic.api.utils._Scheduler(session: Session, token: str, debug: bool = False, ruk: str | None = None)[source]

Bases: Utils

This service manages custom operations on the platform (tasks) that are performed based on the configured triggers. A task can be associated with the account or specific environment (automatically removed alongside it) and executed based on the specific conditions - cron, date, after the platform start, etc.

Ref: https://docs.jelastic.com/api/private/#!/api/utils.Scheduler

CreateAccountTask(script: str, trigger: dict[Literal['cron', 'rate', 'date', 'oninit', 'once_delay'], str | int], description: str | None = None, params: dict | None = None, ruk: str | None = None)[source]

Creates a task that executes a specified script based on the configured trigger.

Parameters:
  • script – custom script name to be executed by the task.

  • trigger – condition or frequency of the script execution (in the format: “trigger_type:value”, supported

  • description – custom description for the task.

  • params – JSON object with additional trigger parameters.

CreateEnvTask(script: str, trigger: dict[Literal['cron', 'rate', 'date', 'oninit', 'once_delay'], str | int], env_name: str, description: str | None = None, params: dict | None = None, ruk: str | None = None)[source]

Creates a task that executes a specified script based on the configured trigger. The task is automatically removed when the corresponding environment is deleted.

Parameters:
  • script – custom script name to be executed by the task.

  • trigger – condition or frequency of the script execution (in the format: “trigger_type:value”, supported

  • env_name – target environment name.

  • description – custom description for the task.

  • params – JSON object with additional trigger parameters.

DeleteTasks(ids: list[str], ruk: str | None = None)[source]

Deletes specified tasks.

Parameters:

ids – list of task IDs to remove.

EditTask(script: str, trigger: dict[Literal['cron', 'rate', 'date', 'oninit', 'once_delay'], str | int], id: int, description: str | None = None, params: dict | None = None, ruk: str | None = None)[source]

Changes the existing task according to the provided new values.

Parameters:
  • script – custom script name to be executed by the task.

  • trigger – condition or frequency of the script execution (in the format: “trigger_type:value”, supported

  • id – unique identifier of the target task.

  • description – custom description for the task.

  • params – JSON object with additional trigger parameters.

GetTasks(ids: list[str] | None = None, ruk: str | None = None)[source]

Returns information on the specified tasks.

Parameters:

ids – list of IDs to retrieve

RescheduleTasks(ruk: str | None = None)[source]
UnscheduleTasks(ruk: str | None = None)[source]

Unschedules all the tasks assigned for regular execution.