utils
konigle.cli.cloud.utils
¶
Shared helpers for BentoCloud CLI commands.
LINK_FILE = '.bentocloud.json'
module-attribute
¶
Filename written by konigle cloud link in the project directory.
LinkConfig
¶
Bases: BaseModel
Contents of the .bentocloud.json link file.
Written by konigle cloud link and read by deploy,
promote, and any future command (e.g. env var management)
that needs to know which space the current directory targets.
Deployments always go to the uat space. Promotion to production
is done exclusively via konigle cloud promote. The uat space
ID is resolved at link time so neither deploy nor promote
need to make additional resolution API calls.
computer = Field(..., title='Computer', description='Computer name slug.')
class-attribute
instance-attribute
¶
Computer name slug.
uat_space_id = Field(..., title='UAT Space ID', description='ID of the uat space, resolved at link time.')
class-attribute
instance-attribute
¶
ID of the uat space. Always the deployment target.
webapp = Field(..., title='WebApp', description='WebApp name slug.')
class-attribute
instance-attribute
¶
WebApp name slug.
load_link()
¶
Load and validate .bentocloud.json from the current directory.
| RETURNS | DESCRIPTION |
|---|---|
LinkConfig
|
Validated LinkConfig instance. |
| RAISES | DESCRIPTION |
|---|---|
SystemExit
|
If the file is missing, invalid JSON, or fails validation. |
resolve_space_id(client, computer_name, webapp_name, space_type)
¶
Resolve a space ID from human-readable names.
Walks the Computer → WebApp → Space chain using list APIs.
| PARAMETER | DESCRIPTION |
|---|---|
client
|
Authenticated Konigle client.
TYPE:
|
computer_name
|
Computer name slug from .bentocloud.json.
TYPE:
|
webapp_name
|
WebApp name slug from .bentocloud.json.
TYPE:
|
space_type
|
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Optional[str]
|
Space ID string, or None if any step fails to resolve. |
wait_for_job(client, job_id, poll_interval=5, timeout=600)
¶
Poll a job until it reaches a terminal state, streaming log entries.
New log entries are printed as they appear on each poll. A blank line is printed before the first log entry to separate it from any preceding inline output (e.g. a trailing dot or status line).
| PARAMETER | DESCRIPTION |
|---|---|
client
|
Authenticated Konigle client.
TYPE:
|
job_id
|
UUID of the job to poll.
TYPE:
|
poll_interval
|
Seconds between polls.
TYPE:
|
timeout
|
Maximum seconds to wait before giving up.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Job
|
Completed Job resource. |
| RAISES | DESCRIPTION |
|---|---|
SystemExit
|
If the timeout is exceeded. |