Provisioners

smpsave is built such that the user can leverage any cloud provider they wish, as long as there is a Provisioner class implemented for that provider. Each Provisioner will generally have its own configuration requirements. At the time of writing, only linode is supported. It serves as an example of how other provisioners may be implemented.

class smpsave.provisioning.Provisioner

Abstract class for provisioner implementations.

abstract get_host() str | None

Return the IP address of the provisioned host, or None if the server has not been provisioned

abstract run_poststart_hooks()

Run the post-start lifecycle hooks.

abstract run_prestop_hooks()

Run the pre-stop lifecycle hooks.

abstract set_poststart_hooks(hooks: list[Callable])

Register post-start hooks.

abstract set_prestop_hooks(hooks: list[Callable])

Register pre-stop hooks.

abstract start()

Start the server. This method should: - Block until the instance is provisioned. - Run post-start lifecycle hooks (post-start)

abstract stop(force: bool = False)

Stop and deprovision the server, such that billing is not accrued. force: if True, skips running lifecycle hooks and deprovisions the server.

Linode

class smpsave.provisioning.LinodeProvisioner(config: LinodeProvisionerConfig)