Python SDK API
Version 0.6.0. Generated source. This page corrects errors in that source.
Dedalus Python API
Complete reference of every operation, grouped by resource. See the README for usage and configuration.
Contents
MachinesOrganization
Setup
import os
from dedalus_sdk import Dedalus
client = Dedalus(
x_api_key=os.environ.get("DEDALUS_X_API_KEY"),
)
Machines
List machines
| Direction | Type |
|---|---|
| Request | MachineListParams |
page = client.machines.list()
Create machine
| Direction | Type |
|---|---|
| Request | MachineCreateParams |
| Response | Machine |
machine = client.machines.create(
autosleep="300s",
memory_mib=4096,
storage_gib=10,
vcpu=1,
)
Get machine
| Direction | Type |
|---|---|
| Response | MachineRetrieveResponse |
machine = client.machines.retrieve(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Update machine
| Direction | Type |
|---|---|
| Request | MachineUpdateParams |
| Response | Machine |
machine = client.machines.update(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Destroy machine
| Direction | Type |
|---|---|
| Response | Machine |
machine = client.machines.delete(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Sleep a running machine
| Direction | Type |
|---|---|
| Response | Machine |
machine = client.machines.sleep(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Wake a sleeping machine
| Direction | Type |
|---|---|
| Response | Machine |
machine = client.machines.wake(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Reboot a machine with fresh memory
Checkpoints files and replaces the runtime. The machine ID and filesystem are preserved. RAM, processes, and temporary mounts are cleared. Poll the machine until its phase is running. Retry the same Idempotency-Key after a lost response.
| Direction | Type |
|---|---|
| Request | MachineRebootParams |
| Response | Machine |
machine = client.machines.reboot(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Machines Ssh
List SSH sessions
| Direction | Type |
|---|---|
| Request | SSHListParams |
page = client.machines.ssh.list(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Create SSH session
| Direction | Type |
|---|---|
| Request | SSHCreateParams |
| Response | SSHSession |
ssh = client.machines.ssh.create(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
public_key="",
)
Get SSH session
| Direction | Type |
|---|---|
| Response | SSHSession |
ssh = client.machines.ssh.retrieve(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
session_id="sessionID",
)
Delete SSH session
| Direction | Type |
|---|---|
| Response | SSHSession |
ssh = client.machines.ssh.delete(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
session_id="sessionID",
)
Machines Executions
List executions
| Direction | Type |
|---|---|
| Request | ExecutionListParams |
page = client.machines.executions.list(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Create execution
| Direction | Type |
|---|---|
| Request | ExecutionCreateParams |
| Response | Execution |
execution = client.machines.executions.create(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
command=[""],
)
Get execution
| Direction | Type |
|---|---|
| Response | Execution |
execution = client.machines.executions.retrieve(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
execution_id="executionID",
)
Delete execution
| Direction | Type |
|---|---|
| Response | Execution |
execution = client.machines.executions.delete(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
execution_id="executionID",
)
Get execution output
| Direction | Type |
|---|---|
| Response | ExecutionOutput |
execution = client.machines.executions.output(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
execution_id="executionID",
)
List execution events
| Direction | Type |
|---|---|
| Request | ExecutionEventsParams |
page = client.machines.executions.events(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
execution_id="executionID",
)
Machines Executions Logs
Get execution log status
| Direction | Type |
|---|---|
| Response | Status |
log = client.machines.executions.logs.retrieve(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
execution_id="executionID",
)
Reauthorize execution log publication
| Direction | Type |
|---|---|
| Response | Status |
log = client.machines.executions.logs.reauthorize(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
execution_id="executionID",
)
Create execution log read token
| Direction | Type |
|---|---|
| Response | ReadToken |
log = client.machines.executions.logs.create_token(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
execution_id="executionID",
)
Machines Autoresizing
Read this machine's RAM autoresizing settings
| Direction | Type |
|---|---|
| Response | Settings |
autoresizing = client.machines.autoresizing.retrieve(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
)
Set this machine's RAM autoresizing settings
| Direction | Type |
|---|---|
| Request | AutoresizingUpdateParams |
| Response | Settings |
autoresizing = client.machines.autoresizing.update(
machine_id="017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
enabled=False,
)
Organization
Organization Autoresizing
Read organization RAM autoresizing policy
| Direction | Type |
|---|---|
| Response | Policy |
autoresizing = client.organization.autoresizing.retrieve()
Set organization RAM autoresizing policy
| Direction | Type |
|---|---|
| Request | AutoresizingUpdateParams |
| Response | Policy |
autoresizing = client.organization.autoresizing.update(
enabled=False,
)
