Service
The service package enables launching and cataloging Firebolt engines and databases.
Database
- class firebolt.service.database.DatabaseService(resource_manager: ResourceManager)
Bases:
BaseService
- create(name: str, region: str | None = None, description: str | None = None) 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_by_name(name: str) str
Get a database ID from Firebolt by its name.
- get_many(name_contains: str | None = None, attached_engine_name_eq: str | None = None, attached_engine_name_contains: str | None = None, order_by: str | DatabaseOrder | None = None) List[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. See
firebolt.service.types.DatabaseOrder
- Returns:
A list of databases matching the filters
Engine
- class firebolt.service.engine.EngineService(resource_manager: ResourceManager)
Bases:
BaseService
- create(name: str, region: str | Region | None = None, engine_type: str | EngineType = EngineType.GENERAL_PURPOSE, scale: int = 2, spec: str | None = None, auto_stop: int = 20, warmup: str | WarmupMethod = WarmupMethod.PRELOAD_INDEXES, description: str = '', engine_settings_kwargs: Dict[str, Any] = {}, revision_spec_kwargs: Dict[str, Any] = {}) 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 – Firebolt instance type. If not set, will default to the cheapest instance.
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_many(name_contains: str | None = None, current_status_eq: str | None = None, current_status_not_eq: str | None = None, region_eq: str | None = None, order_by: str | EngineOrder | None = None) List[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
Instance type
- class firebolt.service.instance_type.InstanceTypeService(resource_manager: ResourceManager)
Bases:
BaseService
- cheapest_instance_in_region(region: Region) InstanceType | None
- get_by_key(instance_type_key: InstanceTypeKey) InstanceType
Get an instance type by key.
- get_by_name(instance_type_name: str, region_name: str | None = None) 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
- get_instance_types_per_region(region: Region) List[InstanceType]
List of instance types available on Firebolt in specified region.
- property instance_types: List[InstanceType]
List of instance types available on Firebolt.
- property instance_types_by_key: Dict[InstanceTypeKey, InstanceType]
Dict of {InstanceTypeKey to InstanceType}
- property instance_types_by_name: Dict[InstanceTypeLookup, InstanceType]
Dict of {InstanceTypeLookup to InstanceType}
Manager
- class firebolt.service.manager.ResourceManager(settings: Settings | None = 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)
provider
Region
- class firebolt.service.region.RegionService(resource_manager: ResourceManager)
Bases:
BaseService
Types
- class firebolt.service.types.DatabaseOrder(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
- 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, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
- 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, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
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 revisions, but it’s starting.
- ENGINE_STATUS_RUNNING_REVISION_STARTUP_FAILED = 'ENGINE_STATUS_RUNNING_REVISION_STARTUP_FAILED'
Engine is initialized; initial revision 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, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
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; creating cloud infra for this engine.
- ENGINE_STATUS_SUMMARY_STARTING_INITIALIZING = 'ENGINE_STATUS_SUMMARY_STARTING_INITIALIZING'
Provisioning process is complete; 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).