cloud
konigle.managers.cloud
¶
Managers for BentoCloud resources.
AsyncCloudClient
¶
Async sub-client providing access to all BentoCloud resources.
Accessed via client.cloud on an AsyncClient.
Example
computers = AsyncComputerManager(session)
instance-attribute
¶
Async manager for Computer (VM) resources.
jobs = AsyncJobManager(session)
instance-attribute
¶
Async manager for async Job resources.
spaces = AsyncSpaceManager(session)
instance-attribute
¶
Async manager for Space (uat / production) resources.
webapps = AsyncWebAppManager(session)
instance-attribute
¶
Async manager for WebApp resources.
__init__(session)
¶
Initialize async sub-client with all cloud managers.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Asynchronous HTTP session from the parent AsyncClient.
TYPE:
|
AsyncComputerManager
¶
Bases: BaseComputerManager, BaseAsyncManager
Asynchronous manager for BentoCloud Computer resources.
Example
__init__(session)
¶
Initialize the AsyncComputerManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Asynchronous HTTP session.
TYPE:
|
create(data)
async
¶
Provision a new computer VM asynchronously.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Computer provisioning parameters.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[Computer, str]
|
Tuple of (Computer resource, job_id string). |
AsyncJobManager
¶
Bases: BaseJobManager, BaseAsyncManager
Asynchronous manager for BentoCloud Job resources.
__init__(session)
¶
Initialize the AsyncJobManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Asynchronous HTTP session.
TYPE:
|
AsyncSpaceManager
¶
Bases: BaseSpaceManager, BaseAsyncManager
Asynchronous manager for BentoCloud Space resources.
Example
__init__(session)
¶
Initialize the AsyncSpaceManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Asynchronous HTTP session.
TYPE:
|
deploy(space_id, zip_file, filename='app.zip', display_name=None)
async
¶
Upload a ZIP archive and enqueue a deployment.
| PARAMETER | DESCRIPTION |
|---|---|
space_id
|
ID of the target Space.
TYPE:
|
zip_file
|
File-like object containing the ZIP archive.
TYPE:
|
filename
|
Filename sent in the multipart request.
TYPE:
|
display_name
|
Human-readable label for the deployment.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Deployment
|
Deployment resource with an embedded job for polling. |
promote(uat_space_id)
async
¶
Promote the uat space image to production.
| PARAMETER | DESCRIPTION |
|---|---|
uat_space_id
|
ID of the uat Space to promote from.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Deployment
|
Deployment resource with an embedded job for polling. |
AsyncWebAppManager
¶
Bases: BaseWebAppManager, BaseAsyncManager
Asynchronous manager for BentoCloud WebApp resources.
Example
__init__(session)
¶
Initialize the AsyncWebAppManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Asynchronous HTTP session.
TYPE:
|
check_name_availability(name)
async
¶
Check whether a webapp name is available.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The webapp name slug to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the name is available, False if already taken. |
create(data)
async
¶
Create a new web application asynchronously.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
WebApp creation parameters.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[WebApp, str]
|
Tuple of (WebApp resource, job_id string). |
CloudClient
¶
Sub-client providing access to all BentoCloud resources.
Accessed via client.cloud.
Example
import konigle
from konigle.models.cloud import ComputerCreate, WebAppCreate
client = konigle.Client(api_key="...")
# List computers
computers = client.cloud.computers.list()
# Provision a computer
computer, job_id = client.cloud.computers.create(
ComputerCreate(
display_name="My Server",
size="M",
region="nyc3",
)
)
# Create a webapp
webapp, job_id = client.cloud.webapps.create(
WebAppCreate(
computer_id=computer.id,
name="my-app",
runtime="python3",
)
)
# Deploy
spaces = client.cloud.spaces.list(webapp_id=webapp.id)
uat = next(s for s in spaces.payload if s.space_type == "uat")
import io, zipfile
buf = io.BytesIO()
with zipfile.ZipFile(buf, "w") as zf:
zf.write("app.py")
buf.seek(0)
deployment = client.cloud.spaces.deploy(uat.id, buf)
job = client.cloud.jobs.get(deployment.job_id)
computers = ComputerManager(session)
instance-attribute
¶
Manager for Computer (VM) resources.
jobs = JobManager(session)
instance-attribute
¶
Manager for async Job resources.
spaces = SpaceManager(session)
instance-attribute
¶
Manager for Space (uat / production) resources.
webapps = WebAppManager(session)
instance-attribute
¶
Manager for WebApp resources.
__init__(session)
¶
Initialize sub-client with all cloud managers.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Synchronous HTTP session from the parent Client.
TYPE:
|
ComputerManager
¶
Bases: BaseComputerManager, BaseSyncManager
Synchronous manager for BentoCloud Computer resources.
Example
__init__(session)
¶
Initialize the ComputerManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Synchronous HTTP session.
TYPE:
|
create(data)
¶
Provision a new computer VM.
The operation is asynchronous. Poll the returned job_id via
client.jobs.get(job_id) until status reaches
success or failed.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Computer provisioning parameters.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[Computer, str]
|
Tuple of (Computer resource, job_id string). |
JobManager
¶
Bases: BaseJobManager, BaseSyncManager
Synchronous manager for BentoCloud Job resources.
Jobs are read-only from the SDK — they are created by service operations like computer provisioning and deployment.
Example
__init__(session)
¶
Initialize the JobManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Synchronous HTTP session.
TYPE:
|
SpaceManager
¶
Bases: BaseSpaceManager, BaseSyncManager
Synchronous manager for BentoCloud Space resources.
Example
__init__(session)
¶
Initialize the SpaceManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Synchronous HTTP session.
TYPE:
|
deploy(space_id, zip_file, filename='app.zip', display_name=None)
¶
Upload a ZIP archive and enqueue a deployment.
| PARAMETER | DESCRIPTION |
|---|---|
space_id
|
ID of the target Space.
TYPE:
|
zip_file
|
File-like object containing the ZIP archive.
TYPE:
|
filename
|
Filename sent in the multipart request.
TYPE:
|
display_name
|
Human-readable label for the deployment.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Deployment
|
Deployment resource with an embedded job for polling. |
promote(uat_space_id)
¶
Promote the uat space image to production.
No re-upload is needed — the currently running image tag is copied directly to the paired production space.
| PARAMETER | DESCRIPTION |
|---|---|
uat_space_id
|
ID of the uat Space to promote from.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Deployment
|
Deployment resource with an embedded job for polling. |
WebAppManager
¶
Bases: BaseWebAppManager, BaseSyncManager
Synchronous manager for BentoCloud WebApp resources.
Example
__init__(session)
¶
Initialize the WebAppManager.
| PARAMETER | DESCRIPTION |
|---|---|
session
|
Synchronous HTTP session.
TYPE:
|
check_name_availability(name)
¶
Check whether a webapp name (subdomain) is available.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The webapp name slug to check.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if the name is available, False if already taken. |
create(data)
¶
Create a new web application on a computer.
The backend automatically provisions uat and production spaces. The operation is asynchronous — poll the returned job_id to confirm provisioning completes.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
WebApp creation parameters.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[WebApp, str]
|
Tuple of (WebApp resource, job_id string). |