Skip to content

cloud

konigle.models.cloud

Pydantic models for BentoCloud resources.

Computer

Bases: BaseResource

A cloud VM owned by a project.

Computers host one or more WebApps and CronJobs. Provisioning is asynchronous — poll the associated Job until status reaches ready or error.

created_at = Field(..., title='Created At', description='Creation timestamp.') class-attribute instance-attribute

Creation timestamp.

display_name = Field(default='', title='Display Name', description='Human-readable label.') class-attribute instance-attribute

Human-readable label.

emoji = Field(default='', title='Emoji', description='Optional emoji avatar.') class-attribute instance-attribute

Optional emoji avatar.

id = Field(..., title='ID', description='Snowflake primary key.') class-attribute instance-attribute

Snowflake primary key.

name = Field(..., title='Name', description='Unique slug within the project.') class-attribute instance-attribute

Unique slug within the project.

public_ip = Field(default=None, title='Public IP', description='Public IP address. Null until provisioning completes.') class-attribute instance-attribute

Public IP address.

region = Field(..., title='Region', description="Geographic region slug, e.g. 'nyc3'.") class-attribute instance-attribute

Geographic region slug.

size = Field(..., title='Size', description='VM size tier: S (2GB/1vCPU), M (4GB/2vCPU), L (8GB/4vCPU).') class-attribute instance-attribute

VM size tier.

status = Field(..., title='Status', description='Lifecycle status: provisioning, ready, error, destroy_scheduled, destroying.') class-attribute instance-attribute

Lifecycle status of the computer.

ComputerCreate

Bases: CreateModel

Input model for provisioning a new Computer.

Example
from konigle.models.cloud import ComputerCreate

data = ComputerCreate(
    display_name="My Server",
    size="M",
    region="nyc3",
)
computer, job_id = client.computers.create(data)

display_name = Field(..., title='Display Name', description='Human-readable label for the computer.') class-attribute instance-attribute

Human-readable label for the computer.

emoji = Field(default='', title='Emoji', description='Optional emoji avatar.') class-attribute instance-attribute

Optional emoji avatar.

name = Field(default=None, title='Name', description='Slug name. Auto-generated if omitted.') class-attribute instance-attribute

Slug name, auto-generated if omitted.

region = Field(..., title='Region', description="Region slug, e.g. 'nyc3'.") class-attribute instance-attribute

Region slug.

size = Field(..., title='Size', description='VM size: S (2GB/1vCPU), M (4GB/2vCPU), L (8GB/4vCPU).') class-attribute instance-attribute

VM size tier.

Deployment

Bases: BaseResource

A single deploy attempt for a Space.

Returned by SpaceManager.deploy() and SpaceManager.promote(). Poll job_id via JobManager.get() to track progress.

created_at = Field(..., title='Created At', description='Timestamp when the deployment was created.') class-attribute instance-attribute

Timestamp when the deployment was created.

display_name = Field(..., title='Display Name', description='Human-readable label for this deployment.') class-attribute instance-attribute

Human-readable label for this deployment.

id = Field(..., title='ID', description='UUID used as the release folder name on the server.') class-attribute instance-attribute

UUID used as the release folder name on the server.

job_id = Field(..., title='Job ID', description='UUID of the tracking Job. Poll this to follow progress.') class-attribute instance-attribute

UUID of the tracking Job.

space_id = Field(..., title='Space ID', description='ID of the Space this deployment targets.') class-attribute instance-attribute

ID of the Space this deployment targets.

Job

Bases: BaseResource

An async Celery task triggered by an API call.

Created by slow operations such as computer provisioning and deployment. Poll JobManager.get(id_) until status reaches success or failed.

completed_at = Field(default=None, title='Completed At', description='Set when status transitions to success or failed.') class-attribute instance-attribute

Set when status transitions to success or failed.

created_at = Field(..., title='Created At', description='Creation timestamp.') class-attribute instance-attribute

Creation timestamp.

id = Field(..., title='ID', description='UUID primary key returned to the caller for polling.') class-attribute instance-attribute

UUID primary key.

is_terminal property

Return True if the job has reached a terminal state.

log = Field(default_factory=list, title='Log', description='Structured log entries written during execution.') class-attribute instance-attribute

Structured log entries written during execution.

status = Field(..., title='Status', description='Current status: pending, running, success, failed.') class-attribute instance-attribute

Current status.

succeeded property

Return True if the job completed successfully.

task_name = Field(..., title='Task Name', description="Celery task name, e.g. 'provision_computer'.") class-attribute instance-attribute

Celery task name.

Space

Bases: BaseResource

A deployment environment (uat or production) for a WebApp.

Deploy a ZIP archive to a Space via SpaceManager.deploy(). Promote the uat Space to production via SpaceManager.promote().

created_at = Field(..., title='Created At', description='Creation timestamp.') class-attribute instance-attribute

Creation timestamp.

custom_domain = Field(default='', title='Custom Domain', description='Customer-supplied domain. Empty when not mapped.') class-attribute instance-attribute

Customer-supplied domain.

custom_domain_status = Field(default='unmapped', title='Custom Domain Status', description='Lifecycle state of the custom domain: pending, active, failed, unmapped.') class-attribute instance-attribute

Lifecycle state of the custom domain mapping.

id = Field(..., title='ID', description='Snowflake primary key.') class-attribute instance-attribute

Snowflake primary key.

last_deployed_at = Field(default=None, title='Last Deployed At', description='Timestamp of the most recent deployment.') class-attribute instance-attribute

Timestamp of the most recent deployment.

last_deployment_status = Field(default=None, title='Last Deployment Status', description='Outcome of the most recent deployment.') class-attribute instance-attribute

Outcome of the most recent deployment.

platform_domain = Field(default='', title='Platform Domain', description='Platform-assigned subdomain.') class-attribute instance-attribute

Platform-assigned subdomain.

space_type = Field(..., title='Space Type', description='Whether this is the uat or production environment.') class-attribute instance-attribute

Whether this is the uat or production environment.

status = Field(..., title='Status', description='Lifecycle status: provisioning, running, stopped, error.') class-attribute instance-attribute

Lifecycle status.

webapp = Field(default=None, title='WebApp ID', description='ID of the parent WebApp. Present in list responses; may be absent in serializer responses.') class-attribute instance-attribute

ID of the parent WebApp.

WebApp

Bases: BaseResource

A customer web application hosted on a Computer.

Creating a WebApp automatically provisions two Spaces: uat and production.

computer = Field(default=None, title='Computer ID', description='ID of the Computer this webapp runs on. Present in list responses; may be absent in create responses.') class-attribute instance-attribute

ID of the Computer this webapp runs on.

created_at = Field(..., title='Created At', description='Creation timestamp.') class-attribute instance-attribute

Creation timestamp.

display_name = Field(default='', title='Display Name', description='Human-readable label.') class-attribute instance-attribute

Human-readable label.

emoji = Field(default='', title='Emoji', description='Optional emoji avatar.') class-attribute instance-attribute

Optional emoji avatar.

id = Field(..., title='ID', description='Snowflake primary key.') class-attribute instance-attribute

Snowflake primary key.

name = Field(..., title='Name', description='Globally unique slug used as the base for platform subdomains.') class-attribute instance-attribute

Globally unique slug.

runtime = Field(..., title='Runtime', description='Application runtime environment.') class-attribute instance-attribute

Application runtime environment.

WebAppCreate

Bases: CreateModel

Input model for creating a new WebApp.

Example
from konigle.models.cloud import WebAppCreate

data = WebAppCreate(
    computer_id="123456",
    name="my-app",
    display_name="My App",
    runtime="python3",
)
webapp, job_id = client.webapps.create(data)

cache = Field(default=None, title='Cache', description="Cache type to provision, e.g. 'redis'. Omit for no cache.") class-attribute instance-attribute

Cache type to provision, or None.

computer_id = Field(..., title='Computer ID', description='ID of the Computer to host this webapp.') class-attribute instance-attribute

ID of the Computer to host this webapp.

database = Field(default=None, title='Database', description="Database type to provision, e.g. 'postgres'. Omit for no database.") class-attribute instance-attribute

Database type to provision, or None.

display_name = Field(default=None, title='Display Name', description='Human-readable label. Defaults to name.') class-attribute instance-attribute

Human-readable label.

emoji = Field(default='', title='Emoji', description='Optional emoji avatar.') class-attribute instance-attribute

Optional emoji avatar.

name = Field(..., title='Name', description='Globally unique slug used as the base for subdomains.') class-attribute instance-attribute

Globally unique slug.

runtime = Field(..., title='Runtime', description='Application runtime environment.') class-attribute instance-attribute

Application runtime environment.

web_server = Field(..., title='Web Server', description="Web server type, e.g. 'nginx'.") class-attribute instance-attribute

Web server type.