firebolt.model package

firebolt.model.database module

class firebolt.model.database.Database(*, name: firebolt.model.database.ConstrainedStrValue, compute_region_id: firebolt.model.region.RegionKey, id: firebolt.model.database.DatabaseKey = None, description: firebolt.model.database.ConstrainedStrValue = None, emoji: firebolt.model.database.ConstrainedStrValue = None, current_status: str = None, health_status: str = None, data_size_full: int = None, data_size_compressed: int = None, is_system_database: bool = None, storage_bucket_name: str = None, create_time: datetime.datetime = None, create_actor: str = None, last_update_time: datetime.datetime = None, last_update_actor: str = None, desired_status: str = None)

Bases: firebolt.model.FireboltBaseModel

A Firebolt database.

Databases belong to a region and have a description, but otherwise are not configurable.

attach_to_engine(engine: Engine, is_default_engine: bool = False) Binding

Attach an engine to this database.

Parameters
  • engine – The engine to attach.

  • is_default_engine – Whether this engine should be used as default for this database. Only one engine can be set as default for a single database. This will overwrite any existing default.

compute_region_key: RegionKey
create_actor: Optional[str]
create_time: Optional[datetime]
current_status: Optional[str]
data_size_compressed: Optional[int]
data_size_full: Optional[int]
property database_id: Optional[str]
database_key: Optional[DatabaseKey]
delete() firebolt.model.database.Database

Delete a database from Firebolt.

Raises an error if there are any attached engines.

description: Optional[str]
desired_status: Optional[str]
emoji: Optional[str]
get_attached_engines() List[Engine]

Get a list of engines that are attached to this database.

health_status: Optional[str]
is_system_database: Optional[bool]
last_update_actor: Optional[str]
last_update_time: Optional[datetime]
name: str
classmethod parse_obj_with_service(obj: Any, database_service: DatabaseService) Database
storage_bucket_name: Optional[str]

firebolt.model.engine module

class firebolt.model.engine.Engine(*, name: firebolt.model.engine.ConstrainedStrValue, compute_region_id: firebolt.model.region.RegionKey, settings: firebolt.model.engine.EngineSettings, id: firebolt.model.engine.EngineKey = None, description: str = None, emoji: str = None, current_status: firebolt.service.types.EngineStatus = None, current_status_summary: firebolt.service.types.EngineStatusSummary = None, latest_revision_id: firebolt.model.engine_revision.EngineRevisionKey = None, endpoint: str = None, endpoint_serving_revision_id: firebolt.model.engine_revision.EngineRevisionKey = None, create_time: datetime.datetime = None, create_actor: str = None, last_update_time: datetime.datetime = None, last_update_actor: str = None, last_use_time: datetime.datetime = None, desired_status: str = None, health_status: str = None, endpoint_desired_revision_id: firebolt.model.engine_revision.EngineRevisionKey = None)

Bases: firebolt.model.FireboltBaseModel

A Firebolt engine. Responsible for performing work (queries, data ingestion).

Engines are configured in Settings and in EngineRevisionSpecification.

attach_to_database(database: firebolt.model.database.Database, is_default_engine: bool = False) firebolt.model.binding.Binding

Attach this engine to a database.

Parameters
  • database – Database to which the engine will be attached.

  • is_default_engine – Whether this engine should be used as default for this database. Only one engine can be set as default for a single database. This will overwrite any existing default.

compute_region_key: RegionKey
create_actor: Optional[str]
create_time: Optional[datetime]
current_status: Optional[EngineStatus]
current_status_summary: Optional[EngineStatusSummary]
property database: Optional[firebolt.model.database.Database]
delete() firebolt.model.engine.Engine

Delete an Engine from Firebolt.

description: Optional[str]
desired_status: Optional[str]
emoji: Optional[str]
endpoint: Optional[str]
endpoint_desired_revision_key: Optional[EngineRevisionKey]
endpoint_serving_revision_key: Optional[EngineRevisionKey]
property engine_id: str
get_connection() firebolt.db.connection.Connection

Get a connection to the attached database, for running queries.

get_latest() firebolt.model.engine.Engine

Get an up-to-date instance of the Engine from Firebolt.

health_status: Optional[str]
key: Optional[EngineKey]
last_update_actor: Optional[str]
last_update_time: Optional[datetime]
last_use_time: Optional[datetime]
latest_revision_key: Optional[EngineRevisionKey]
name: str
classmethod parse_obj_with_service(obj: Any, engine_service: EngineService) Engine
settings: EngineSettings
start(wait_for_startup: bool = True, wait_timeout_seconds: int = 3600, verbose: bool = False) firebolt.model.engine.Engine

Start an engine. If it’s already started, do nothing.

Parameters
  • wait_for_startup – If True, wait for startup to complete. If false, return immediately after requesting startup.

  • wait_timeout_seconds – Number of seconds to wait for startup to complete before raising a TimeoutError.

  • verbose – If True, print dots periodically while waiting for engine startup. If false, do not print any dots.

Returns

The updated Engine from Firebolt.

stop(wait_for_stop: bool = False, wait_timeout_seconds: int = 3600) firebolt.model.engine.Engine

Stop an Engine running on Firebolt.

class firebolt.model.engine.EngineSettings(*, preset: str, auto_stop_delay_duration: firebolt.model.engine.ConstrainedStrValue, minimum_logging_level: str, is_read_only: bool, warm_up: str)

Bases: firebolt.model.FireboltBaseModel

Engine Settings.

See Also: EngineRevisionSpecification which also contains engine configuration.

auto_stop_delay_duration: str
classmethod default(engine_type: firebolt.service.types.EngineType = EngineType.GENERAL_PURPOSE, auto_stop_delay_duration: str = '1200s', warm_up: firebolt.service.types.WarmupMethod = WarmupMethod.PRELOAD_INDEXES) firebolt.model.engine.EngineSettings
is_read_only: bool
minimum_logging_level: str
preset: str
warm_up: str
firebolt.model.engine.check_attached_to_database(func: Callable) Callable

(Decorator) Ensure the engine is attached to a database.

firebolt.model.engine.wait(seconds: int, timeout_time: float, error_message: str, verbose: bool) None

firebolt.model.engine_revision module

class firebolt.model.engine_revision.EngineRevision(*, specification: firebolt.model.engine_revision.EngineRevisionSpecification, id: firebolt.model.engine_revision.EngineRevisionKey = None, current_status: str = None, create_time: datetime.datetime = None, create_actor: str = None, last_update_time: datetime.datetime = None, last_update_actor: str = None, desired_status: str = None, health_status: str = None)

Bases: firebolt.model.FireboltBaseModel

A Firebolt Engine revision, which contains a Specification (instance types, counts).

As engines are updated with new settings, revisions are created.

create_actor: Optional[str]
create_time: Optional[datetime.datetime]
current_status: Optional[str]
desired_status: Optional[str]
health_status: Optional[str]
key: Optional[firebolt.model.engine_revision.EngineRevisionKey]
last_update_actor: Optional[str]
last_update_time: Optional[datetime.datetime]
specification: firebolt.model.engine_revision.EngineRevisionSpecification
class firebolt.model.engine_revision.EngineRevisionSpecification(*, db_compute_instances_type_id: firebolt.model.instance_type.InstanceTypeKey, db_compute_instances_count: pydantic.types.PositiveInt, db_compute_instances_use_spot: bool = False, db_version: str = '', proxy_instances_type_id: firebolt.model.instance_type.InstanceTypeKey, proxy_instances_count: pydantic.types.PositiveInt = 1, proxy_version: str = '')

Bases: firebolt.model.FireboltBaseModel

An EngineRevision Specification.

Notably, it determines which instance types and how many of them its Engine gets.

See Also: Settings, which also contains engine configuration.

db_compute_instances_count: pydantic.types.PositiveInt
db_compute_instances_type_key: firebolt.model.instance_type.InstanceTypeKey
db_compute_instances_use_spot: bool
db_version: str
proxy_instances_count: pydantic.types.PositiveInt
proxy_instances_type_key: firebolt.model.instance_type.InstanceTypeKey
proxy_version: str

firebolt.model.instance_type module

class firebolt.model.instance_type.InstanceType(*, id: firebolt.model.instance_type.InstanceTypeKey, name: str, is_spot_available: bool = None, cpu_virtual_cores_count: int = None, memory_size_bytes: str = None, storage_size_bytes: str = None, price_per_hour_cents: float = None, create_time: datetime.datetime = None, last_update_time: datetime.datetime = None)

Bases: firebolt.model.FireboltBaseModel

cpu_virtual_cores_count: Optional[int]
create_time: Optional[datetime.datetime]
is_spot_available: Optional[bool]
key: firebolt.model.instance_type.InstanceTypeKey
last_update_time: Optional[datetime.datetime]
memory_size_bytes: Optional[str]
name: str
price_per_hour_cents: Optional[float]
storage_size_bytes: Optional[str]

firebolt.model.provider module

class firebolt.model.provider.Provider(*, id: str, name: str, create_time: datetime.datetime = None, display_name: str = None, last_update_time: datetime.datetime = None)

Bases: firebolt.model.FireboltBaseModel

create_time: Optional[datetime.datetime]
display_name: Optional[str]
last_update_time: Optional[datetime.datetime]
name: str
provider_id: str

firebolt.model.region module

class firebolt.model.region.Region(*, id: firebolt.model.region.RegionKey, name: str, display_name: str = None, create_time: datetime.datetime = None, last_update_time: datetime.datetime = None)

Bases: firebolt.model.FireboltBaseModel

create_time: Optional[datetime.datetime]
display_name: Optional[str]
key: firebolt.model.region.RegionKey
last_update_time: Optional[datetime.datetime]
name: str