"""mgf-cloud-provision — declarative provisioning of the federation's own infra.

Sits *above* :mod:`mgf.cloud` (the OpenStack/Infomaniak adapter): a
:class:`ServiceSpec` describes the desired state of one self-hosted service
(devpi, a CI agent, Vault, …) as a VM + cloud-init, and :func:`plan` /
:func:`apply` / :func:`destroy` converge the cloud to it. The whole surface runs
against ``mgf.cloud``'s in-memory ``FakeProvider``, so it is fully testable with
no cloud and no credentials.

    from mgf.cloud.providers import get_provider
    from mgf.cloud_provision import devpi_service_spec, plan

    spec = devpi_service_spec(key_name="woodpecker-key")
    print(plan(spec, get_provider("fake")).action)   # Action.CREATE
"""

from __future__ import annotations

from mgf.cloud_provision._provision import apply, destroy, plan, to_server_spec
from mgf.cloud_provision._spec import load_spec
from mgf.cloud_provision.ci_host import (
    agent_service_spec,
    ci_host_service_spec,
    provision_ci_host,
)
from mgf.cloud_provision.models import Action, ApplyResult, ServicePlan, ServiceSpec
from mgf.cloud_provision.services import devpi_service_spec

__version__ = "0.1.2"

__all__ = [
    "Action",
    "ApplyResult",
    "ServicePlan",
    "ServiceSpec",
    "__version__",
    "agent_service_spec",
    "apply",
    "ci_host_service_spec",
    "destroy",
    "devpi_service_spec",
    "load_spec",
    "plan",
    "provision_ci_host",
    "to_server_spec",
]
