firebolt.service package

firebolt.service.database module

class firebolt.service.database.DatabaseService(resource_manager: firebolt.service.manager.ResourceManager)

Bases: firebolt.service.base.BaseService

create(name: str, region: Optional[str] = None, description: Optional[str] = None) firebolt.model.database.Database

Create a new Database on Firebolt.

Parameters
  • name – Name of the database.

  • region – Region name in which to create the database.

Returns

The newly created Database.

get(id_: str) firebolt.model.database.Database

Get a Database from Firebolt by its id.

get_by_name(name: str) firebolt.model.database.Database

Get a Database from Firebolt by its name.

get_id_by_name(name: str) str

Get a Database id from Firebolt by its name.

get_many(name_contains: Optional[str] = None, attached_engine_name_eq: Optional[str] = None, attached_engine_name_contains: Optional[str] = None, order_by: Optional[Union[str, firebolt.service.types.DatabaseOrder]] = None) List[firebolt.model.database.Database]

Get a list of databases on Firebolt.

Parameters
  • name_contains – Filter for databases with a name containing this substring.

  • attached_engine_name_eq – Filter for databases by an exact engine name.

  • attached_engine_name_contains – Filter for databases by engines with a name containing this substring.

  • order_by – Method by which to order the results.

:param See firebolt.service.types.DatabaseOrder.:

Returns

A list of databases matching the filters.

firebolt.service.engine module

class firebolt.service.engine.EngineService(resource_manager: firebolt.service.manager.ResourceManager)

Bases: firebolt.service.base.BaseService

create(name: str, region: Optional[Union[str, firebolt.model.region.Region]] = None, engine_type: Union[str, firebolt.service.types.EngineType] = EngineType.GENERAL_PURPOSE, scale: int = 2, spec: str = 'i3.4xlarge', auto_stop: int = 20, warmup: Union[str, firebolt.service.types.WarmupMethod] = WarmupMethod.PRELOAD_INDEXES, description: str = '') firebolt.model.engine.Engine

Create a new Engine.

Parameters
  • name – An identifier that specifies the name of the engine.

  • region – The AWS region in which the engine runs.

  • engine_type – The engine type. GENERAL_PURPOSE or DATA_ANALYTICS

  • scale – The number of compute instances on the engine. The scale can be any int from 1 to 128.

  • spec – The AWS EC2 instance type.

  • auto_stop – The amount of time (in minutes)

  • stops. (after which the engine automatically) –

  • warmup

    The warmup method that should be used.

    MINIMAL - On-demand loading (both indexes and tables’ data).

    PRELOAD_INDEXES - Load indexes only.

    PRELOAD_ALL_DATA - Full data auto-load (both indexes and table data - full warmup).

  • description – A short description of the engine’s purpose.

Returns

Engine with the specified settings.

get(id_: str) firebolt.model.engine.Engine

Get an Engine from Firebolt by its id.

get_by_ids(ids: List[str]) List[firebolt.model.engine.Engine]

Get multiple Engines from Firebolt by their ids.

get_by_name(name: str) firebolt.model.engine.Engine

Get an Engine from Firebolt by its name.

get_many(name_contains: str, current_status_eq: str, current_status_not_eq: str, region_eq: str, order_by: Union[str, firebolt.service.types.EngineOrder]) List[firebolt.model.engine.Engine]

Get a list of engines on Firebolt.

Parameters
  • name_contains – Filter for engines with a name containing this substring.

  • current_status_eq – Filter for engines with this status.

  • current_status_not_eq – Filter for engines that do not have this status.

  • region_eq – Filter for engines by region.

  • order_by – Method by which to order the results. See [EngineOrder].

Returns

A list of engines matching the filters.

firebolt.service.instance_type module

class firebolt.service.instance_type.InstanceTypeService(resource_manager: firebolt.service.manager.ResourceManager)

Bases: firebolt.service.base.BaseService

get_by_key(instance_type_key: firebolt.model.instance_type.InstanceTypeKey) firebolt.model.instance_type.InstanceType

Get an instance type by key.

get_by_name(instance_type_name: str, region_name: Optional[str] = None) firebolt.model.instance_type.InstanceType

Get an instance type by name.

Parameters
  • instance_type_name – Name of the instance (eg. “i3.4xlarge”).

  • region_name – Name of the AWS region from which to get the instance. If not provided, use the default region name from the client.

Returns

The requested instance type.

property instance_types: List[firebolt.model.instance_type.InstanceType]

List of instance types available on Firebolt.

property instance_types_by_key: Dict[firebolt.model.instance_type.InstanceTypeKey, firebolt.model.instance_type.InstanceType]

Dict of {InstanceTypeKey to InstanceType}

property instance_types_by_name: Dict[firebolt.service.instance_type.InstanceTypeLookup, firebolt.model.instance_type.InstanceType]

Dict of {InstanceTypeLookup to InstanceType}

firebolt.service.manager module

class firebolt.service.manager.ResourceManager(settings: Optional[firebolt.common.settings.Settings] = None, account_name: Optional[str] = None)

Bases: object

ResourceManager to access various Firebolt resources:

  • databases

  • engines

  • bindings (the bindings between an engine and a database)

  • engine revisions (versions of an engine)

Also provides listings of:

  • regions (AWS regions in which engines can run)

  • instance types (AWS instance types which engines can use)

firebolt.service.provider module

firebolt.service.provider.get_provider_id(client: firebolt.client.client.Client) str

Get the AWS provider_id.

firebolt.service.region module

class firebolt.service.region.RegionService(resource_manager: firebolt.service.manager.ResourceManager)

Bases: firebolt.service.base.BaseService

property default_region: firebolt.model.region.Region

Default AWS Region, could be provided from environment.

get_by_id(id_: str) firebolt.model.region.Region

Get an AWS Region by region_id.

get_by_key(key: firebolt.model.region.RegionKey) firebolt.model.region.Region

Get an AWS Region by its key.

get_by_name(name: str) firebolt.model.region.Region

Get an AWS region by its name (eg. us-east-1).

property regions: List[firebolt.model.region.Region]

List of available AWS Regions on Firebolt.

property regions_by_key: Dict[firebolt.model.region.RegionKey, firebolt.model.region.Region]

Dict of {RegionKey to Region}

property regions_by_name: Dict[str, firebolt.model.region.Region]

Dict of {RegionLookup to Region}

firebolt.service.types module

class firebolt.service.types.DatabaseOrder(value)

Bases: enum.Enum

An enumeration.

DATABASE_ORDER_COMPUTE_REGION_ID_ASC = 'DATABASE_ORDER_COMPUTE_REGION_ID_ASC'
DATABASE_ORDER_COMPUTE_REGION_ID_DESC = 'DATABASE_ORDER_COMPUTE_REGION_ID_DESC'
DATABASE_ORDER_CREATE_ACTOR_ASC = 'DATABASE_ORDER_CREATE_ACTOR_ASC'
DATABASE_ORDER_CREATE_ACTOR_DESC = 'DATABASE_ORDER_CREATE_ACTOR_DESC'
DATABASE_ORDER_CREATE_TIME_ASC = 'DATABASE_ORDER_CREATE_TIME_ASC'
DATABASE_ORDER_CREATE_TIME_DESC = 'DATABASE_ORDER_CREATE_TIME_DESC'
DATABASE_ORDER_DATA_SIZE_COMPRESSED_ASC = 'DATABASE_ORDER_DATA_SIZE_COMPRESSED_ASC'
DATABASE_ORDER_DATA_SIZE_COMPRESSED_DESC = 'DATABASE_ORDER_DATA_SIZE_COMPRESSED_DESC'
DATABASE_ORDER_DATA_SIZE_FULL_ASC = 'DATABASE_ORDER_DATA_SIZE_FULL_ASC'
DATABASE_ORDER_DATA_SIZE_FULL_DESC = 'DATABASE_ORDER_DATA_SIZE_FULL_DESC'
DATABASE_ORDER_LAST_UPDATE_ACTOR_ASC = 'DATABASE_ORDER_LAST_UPDATE_ACTOR_ASC'
DATABASE_ORDER_LAST_UPDATE_ACTOR_DESC = 'DATABASE_ORDER_LAST_UPDATE_ACTOR_DESC'
DATABASE_ORDER_LAST_UPDATE_TIME_ASC = 'DATABASE_ORDER_LAST_UPDATE_TIME_ASC'
DATABASE_ORDER_LAST_UPDATE_TIME_DESC = 'DATABASE_ORDER_LAST_UPDATE_TIME_DESC'
DATABASE_ORDER_NAME_ASC = 'DATABASE_ORDER_NAME_ASC'
DATABASE_ORDER_NAME_DESC = 'DATABASE_ORDER_NAME_DESC'
DATABASE_ORDER_UNSPECIFIED = 'DATABASE_ORDER_UNSPECIFIED'
class firebolt.service.types.EngineOrder(value)

Bases: enum.Enum

An enumeration.

ENGINE_ORDER_COMPUTE_REGION_ID_ASC = 'ENGINE_ORDER_COMPUTE_REGION_ID_ASC'
ENGINE_ORDER_COMPUTE_REGION_ID_DESC = 'ENGINE_ORDER_COMPUTE_REGION_ID_DESC'
ENGINE_ORDER_CREATE_ACTOR_ASC = 'ENGINE_ORDER_CREATE_ACTOR_ASC'
ENGINE_ORDER_CREATE_ACTOR_DESC = 'ENGINE_ORDER_CREATE_ACTOR_DESC'
ENGINE_ORDER_CREATE_TIME_ASC = 'ENGINE_ORDER_CREATE_TIME_ASC'
ENGINE_ORDER_CREATE_TIME_DESC = 'ENGINE_ORDER_CREATE_TIME_DESC'
ENGINE_ORDER_CURRENT_STATUS_ASC = 'ENGINE_ORDER_CURRENT_STATUS_ASC'
ENGINE_ORDER_CURRENT_STATUS_DESC = 'ENGINE_ORDER_CURRENT_STATUS_DESC'
ENGINE_ORDER_LAST_UPDATE_ACTOR_ASC = 'ENGINE_ORDER_LAST_UPDATE_ACTOR_ASC'
ENGINE_ORDER_LAST_UPDATE_ACTOR_DESC = 'ENGINE_ORDER_LAST_UPDATE_ACTOR_DESC'
ENGINE_ORDER_LAST_UPDATE_TIME_ASC = 'ENGINE_ORDER_LAST_UPDATE_TIME_ASC'
ENGINE_ORDER_LAST_UPDATE_TIME_DESC = 'ENGINE_ORDER_LAST_UPDATE_TIME_DESC'
ENGINE_ORDER_LATEST_REVISION_CURRENT_STATUS_ASC = 'ENGINE_ORDER_LATEST_REVISION_CURRENT_STATUS_ASC'
ENGINE_ORDER_LATEST_REVISION_CURRENT_STATUS_DESC = 'ENGINE_ORDER_LATEST_REVISION_CURRENT_STATUS_DESC'
ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_COUNT_ASC = 'ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_COUNT_ASC'
ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_COUNT_DESC = 'ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_COUNT_DESC'
ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_TYPE_ID_ASC = 'ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_TYPE_ID_ASC'
ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_TYPE_ID_DESC = 'ENGINE_ORDER_LATEST_REVISION_SPECIFICATION_DB_COMPUTE_INSTANCES_TYPE_ID_DESC'
ENGINE_ORDER_NAME_ASC = 'ENGINE_ORDER_NAME_ASC'
ENGINE_ORDER_NAME_DESC = 'ENGINE_ORDER_NAME_DESC'
ENGINE_ORDER_UNSPECIFIED = 'ENGINE_ORDER_UNSPECIFIED'
class firebolt.service.types.EngineStatus(value)

Bases: enum.Enum

Detailed engine status.

See: https://api.dev.firebolt.io/devDocs#operation/coreV1GetEngine

ENGINE_STATUS_CREATED = 'ENGINE_STATUS_CREATED'

Engine status was created.

ENGINE_STATUS_DELETED = 'ENGINE_STATUS_DELETED'

Engine is soft-deleted.

ENGINE_STATUS_PROVISIONING_FAILED = 'ENGINE_STATUS_PROVISIONING_FAILED'

Engine initialization failed due to error.

ENGINE_STATUS_PROVISIONING_FINISHED = 'ENGINE_STATUS_PROVISIONING_FINISHED'

Engine initialization was finished successfully.

ENGINE_STATUS_PROVISIONING_PENDING = 'ENGINE_STATUS_PROVISIONING_PENDING'

Engine initialization request was sent.

ENGINE_STATUS_PROVISIONING_STARTED = 'ENGINE_STATUS_PROVISIONING_STARTED'

Engine initialization request was received and initialization process started.

ENGINE_STATUS_RUNNING_IDLE = 'ENGINE_STATUS_RUNNING_IDLE'

Engine is initialized, but there are no running or starting engine revisions.

ENGINE_STATUS_RUNNING_REVISIONS_TERMINATING = 'ENGINE_STATUS_RUNNING_REVISIONS_TERMINATING'

Engine is initialized, all child revisions are being terminated.

ENGINE_STATUS_RUNNING_REVISION_CHANGE_FAILED = 'ENGINE_STATUS_RUNNING_REVISION_CHANGE_FAILED'

Engine is ready (serves an engine revision), replacement revision failed to provision or start.

ENGINE_STATUS_RUNNING_REVISION_CHANGING = 'ENGINE_STATUS_RUNNING_REVISION_CHANGING'

Engine is ready (serves an engine revision), zero-downtime replacement revision is starting.

ENGINE_STATUS_RUNNING_REVISION_RESTARTING = 'ENGINE_STATUS_RUNNING_REVISION_RESTARTING'

Engine is initialized, replacement of the revision with a downtime is in progress.

ENGINE_STATUS_RUNNING_REVISION_RESTART_FAILED = 'ENGINE_STATUS_RUNNING_REVISION_RESTART_FAILED'

Engine is initialized, replacement revision failed to provision or start.

ENGINE_STATUS_RUNNING_REVISION_SERVING = 'ENGINE_STATUS_RUNNING_REVISION_SERVING'

Engine is ready (serves an engine revision).

ENGINE_STATUS_RUNNING_REVISION_STARTING = 'ENGINE_STATUS_RUNNING_REVISION_STARTING'

Engine is initialized, there are no running engine revision but it’s starting.

ENGINE_STATUS_RUNNING_REVISION_STARTUP_FAILED = 'ENGINE_STATUS_RUNNING_REVISION_STARTUP_FAILED'

Engine is initialized, initial revision is failed to provision or start.

ENGINE_STATUS_TERMINATION_F = 'ENGINE_STATUS_TERMINATION_FAILED'

Engine termination failed.

ENGINE_STATUS_TERMINATION_FIN = 'ENGINE_STATUS_TERMINATION_FINISHED'

Engine termination finished.

ENGINE_STATUS_TERMINATION_PENDING = 'ENGINE_STATUS_TERMINATION_PENDING'

Engine termination request was sent.

ENGINE_STATUS_TERMINATION_ST = 'ENGINE_STATUS_TERMINATION_STARTED'

Engine termination started.

ENGINE_STATUS_UNSPECIFIED = 'ENGINE_STATUS_UNSPECIFIED'

Logical record is created, however underlying infrastructure is not initialized. In other words this means that engine is stopped.

class firebolt.service.types.EngineStatusSummary(value)

Bases: enum.Enum

Engine summary status.

See: https://api.dev.firebolt.io/devDocs#operation/coreV1GetEngine

ENGINE_STATUS_SUMMARY_DELETED = 'ENGINE_STATUS_SUMMARY_DELETED'

Infrastructure is terminated, engine data is deleted.

ENGINE_STATUS_SUMMARY_DELETING = 'ENGINE_STATUS_SUMMARY_DELETING'

Termination is in progress. All infrastructure that belongs to this engine will be completely destroyed.

ENGINE_STATUS_SUMMARY_FAILED = 'ENGINE_STATUS_SUMMARY_FAILED'

Failed to start or stop. This status only indicates that there were issues during provisioning operations. If engine enters this status, all infrastructure should be stopped/terminated already.

ENGINE_STATUS_SUMMARY_REPAIRING = 'ENGINE_STATUS_SUMMARY_REPAIRING'

Underlying infrastructure has issues and is being repaired. Engine is still running, but it’s not fully healthy and some queries may fail.

ENGINE_STATUS_SUMMARY_RESTARTING = 'ENGINE_STATUS_SUMMARY_RESTARTING'

Hard restart (full stop/start cycle) is in progress. Underlying infrastructure is being recreated.

ENGINE_STATUS_SUMMARY_RESTARTING_INITIALIZING = 'ENGINE_STATUS_SUMMARY_RESTARTING_INITIALIZING'

Hard restart (full stop/start cycle) is in progress. Underlying infrastructure is ready, waiting for PackDB cluster to initialize and start. This status is logically the same as ENGINE_STATUS_SUMMARY_STARTING_INITIALIZING, but used during restart cycle.

ENGINE_STATUS_SUMMARY_RUNNING = 'ENGINE_STATUS_SUMMARY_RUNNING'

Fully started. Engine is ready to serve requests.

ENGINE_STATUS_SUMMARY_STARTING = 'ENGINE_STATUS_SUMMARY_STARTING'

Provisioning process is in progress. We are creating cloud infra for this engine.

ENGINE_STATUS_SUMMARY_STARTING_INITIALIZING = 'ENGINE_STATUS_SUMMARY_STARTING_INITIALIZING'

Provisioning process is complete. We are now waiting for PackDB cluster to initialize and start.

ENGINE_STATUS_SUMMARY_STOPPED = 'ENGINE_STATUS_SUMMARY_STOPPED'

Fully stopped.

ENGINE_STATUS_SUMMARY_STOPPING = 'ENGINE_STATUS_SUMMARY_STOPPING'

Stop is in progress.

ENGINE_STATUS_SUMMARY_UNSPECIFIED = 'ENGINE_STATUS_SUMMARY_UNSPECIFIED'

Status unspecified

ENGINE_STATUS_SUMMARY_UPGRADING = 'ENGINE_STATUS_SUMMARY_UPGRADING'

Version of the PackDB is changing. This is zero downtime operation that does not affect engine work. This status is reserved for future use (not used fow now).

class firebolt.service.types.EngineType(value)

Bases: enum.Enum

An enumeration.

DATA_ANALYTICS = 'DATA_ANALYTICS'
GENERAL_PURPOSE = 'GENERAL_PURPOSE'
api_settings_preset_name
class firebolt.service.types.WarmupMethod(value)

Bases: enum.Enum

An enumeration.

MINIMAL = 'MINIMAL'
PRELOAD_ALL_DATA = 'PRELOAD_ALL_DATA'
PRELOAD_INDEXES = 'PRELOAD_INDEXES'
api_name