3.2. Client
-
simbricks.client.client.non_close_file(handle: IO)
-
class simbricks.client.client.BaseClient(base_url='https://app.simbricks.io/api')
-
build_url(url: str) → str
-
session(overwrite_headers: dict[str, Any] | None = None) → AsyncIterator[ClientSession]
-
request(meth: str, url: str, data: Any = None, retry: bool = True, **kwargs: Any) → AsyncIterator[ClientResponse]
-
get(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
post(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
put(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
patch(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
delete(url: str, **kwargs: Any) → AsyncIterator[ClientResponse]
-
async info()
-
class simbricks.client.client.AdminClient(base_client: ~simbricks.client.client.BaseClient = <simbricks.client.client.BaseClient object>)
-
async get_ns(ns_id: int) → ApiNamespace
-
async get_ns_by_name(ns_name: str) → ApiNamespace
-
async get_all_ns() → list[ApiNamespace]
-
async create_ns(parent_id: int | None, name: str) → ApiNamespace
-
async delete(ns_id: int) → None
-
async schedule_ns(ns_id: int) → None
-
class simbricks.client.client.OrgClient(base_client: ~simbricks.client.client.BaseClient = <simbricks.client.client.BaseClient object>)
-
async get_members(org: str)
-
async invite_member(org: str, email: str, first_name: str, last_name: str)
-
async create_guest(org: str, email: str, first_name: str, last_name: str)
-
async guest_token(org: str, email: str) → Token
-
async guest_magic_link(org: str, email: str) → str
-
class simbricks.client.client.NSClient(base_client: ~simbricks.client.client.BaseClient = <simbricks.client.client.BaseClient object>, namespace: str | None = None)
-
async resolve_default_ns() → None
-
post(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
put(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
patch(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
get(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
delete(url: str, **kwargs: Any) → AsyncIterator[ClientResponse]
-
async create(parent_id: int, name: str) → ApiNamespace
-
async delete_ns(ns_id: int) → None
-
async get_ns(ns_id: int) → ApiNamespace
-
async get_ns_by_name(ns_name: str) → ApiNamespace
-
async get_cur() → ApiNamespace
-
async get_all() → list[ApiNamespace]
-
async get_members() → dict[str, list[dict]]
-
async get_role_members(role: str) → list[dict]
-
async add_member(role: str, username: str) → None
-
class simbricks.client.client.SimBricksClient(ns_client: ~simbricks.client.client.NSClient = <simbricks.client.client.NSClient object>)
-
async create_system(system: System) → ApiSystem
-
async delete_system(sys_id: int) → None
-
async get_systems() → list[ApiSystem]
-
async get_system(system_id: int) → ApiSystem
-
async create_simulation(system_db_id: int, simulation: Simulation) → ApiSimulation
-
async delete_simulation(sim_id: int) → None
-
async get_simulation(simulation_id: int) → ApiSimulation
-
async get_simulations() → list[ApiSimulation]
-
async create_instantiation(sim_db_id: int, instantiation: Instantiation) → ApiInstantiation
-
async delete_instantiation(inst_id: int) → None
-
async get_instantiation(instantiation_id: int) → ApiInstantiation
-
async get_instantiations() → list[ApiInstantiation]
-
async create_run(inst_db_id: int) → ApiRun
-
async delete_run(rid: int) → None
-
async update_run(rid: int, instantiation_id: int | None = None, state: RunState | None = None, output: str | None = None) → ApiRun
-
async get_run(run_id: int) → ApiRun
-
async get_runs() → list[ApiRun]
-
async set_inst_input_artifact(iid: int, uploaded_input_file: str) → None
-
async get_inst_input_artifact(iid: int, store_path: str) → None
-
async get_inst_input_artifact_raw(iid: int) → bytes
-
async set_fragment_input_artifact(iid: int, fid: int, uploaded_input_file: str) → None
-
async get_fragment_input_artifact(iid: int, fid: int, store_path: str) → None
-
async get_fragment_input_artifact_raw(iid: int, fid: int) → bytes
-
async set_run_fragment_output_artifact(rfid: int, uploaded_input_file: str) → None
-
async set_run_fragment_output_artifact_raw(rfid: int, uploaded_data: IO[bytes]) → None
-
async get_run_fragment_output_artifact(rfid: int, store_path: str) → None
-
async get_all_run_fragments(run_id: int) → list[ApiRunFragment]
-
async get_run_console(run_id: int, filter: ApiRunOutputFilter) → ApiRunOutput
-
class simbricks.client.client.ResourceGroupClient(ns_client)
-
async create_rg(label: str, available_cores: int, available_memory: int) → ApiResourceGroup
-
async update_rg(rg_id: int, label: str | None = None, available_cores: int | None = None, available_memory: int | None = None, cores_left: int | None = None, memory_left: int | None = None) → ApiResourceGroup
-
async get_rg(rg_id: int) → ApiResourceGroup
-
async filter_get_rg() → list[ApiResourceGroup]
-
class simbricks.client.client.RunnerClient(ns_client, id: int)
-
post(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
delete(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
put(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
patch(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
get(url: str, data: Any = None, **kwargs: Any) → AsyncIterator[ClientResponse]
-
async create_runner(resource_group_id: int, label: str, tags: list[str]) → ApiRunner
-
async runner_started(tags: list[ApiRunnerTag]) → None
-
async update_runner(resource_group_id: int | None = None, label: str | None = None, tags: list[str] | None = None) → ApiRunner
-
async delete_runner() → None
-
async get_runner() → ApiRunner
-
async list_runners() → list[ApiRunner]
-
async send_heartbeat() → None
-
async filter_get_runs(run_id: int | None = None, instantiation_id: int | None = None, state: str | None = None, limit: int | None = None) → list[ApiRun]
-
async next_run() → ApiRun | None
-
async update_run(run_id: int, state: RunState, output: str) → ApiRun
-
async create_events(event_bundle: ApiEventBundle[Annotated[ApiRunnerEventCreate | ApiRunEventCreate | ApiSimulatorOutputEventCreate | ApiSimulatorStateChangeEventCreate | ApiProxyStateChangeEventCreate | ApiProxyOutputEventCreate | ApiRunFragmentStateEventCreate | ApiRunFragmentOutputArtifactEventCreate, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]]) → ApiEventBundle[Annotated[ApiRunnerEventRead | ApiRunEventRead | ApiRunEventStartRunRead | ApiSimulatorOutputEventRead | ApiSimulatorStateChangeEventRead | ApiProxyStateChangeEventRead | ApiProxyOutputEventRead, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]]
-
async fetch_events(to_fetch: ApiEventBundle[Annotated[ApiRunnerEventQuery | ApiRunEventQuery | ApiRunEventStartRunQuery | ApiSimulatorStateChangeEventQuery | ApiProxyStateChangeEventQuery, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]]) → ApiEventBundle[Annotated[ApiRunnerEventRead | ApiRunEventRead | ApiRunEventStartRunRead | ApiSimulatorOutputEventRead | ApiSimulatorStateChangeEventRead | ApiProxyStateChangeEventRead | ApiProxyOutputEventRead, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]]
-
async update_events(event_bundle: ApiEventBundle[Annotated[ApiRunnerEventUpdate | ApiRunEventUpdate, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]]) → ApiEventBundle[Annotated[ApiRunnerEventRead | ApiRunEventRead | ApiRunEventStartRunRead | ApiSimulatorOutputEventRead | ApiSimulatorStateChangeEventRead | ApiProxyStateChangeEventRead | ApiProxyOutputEventRead, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]]
-
async delete_events(event_bundle: ApiEventBundle[Annotated[ApiRunnerEventDelete | ApiRunEventDelete | ApiSimulatorOutputEventDelete, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]]) → None
3.2.1. Opus
-
async simbricks.client.opus.base.still_running(run_id: int) → bool
-
class simbricks.client.opus.base.ConsoleLineGenerator(run_id: int, follow: bool)
-
async generate_lines() → AsyncGenerator[tuple[str, str], None]
-
class simbricks.client.opus.base.ComponentOutputPrettyPrinter(console: Console)
-
print_line(prefix: str, line: str)
-
async simbricks.client.opus.base.follow_run(run_id: int) → None
-
async simbricks.client.opus.base.submit_system(system: System) → int
-
async simbricks.client.opus.base.submit_simulation(system_id: int, simulation: Simulation) → int
-
async simbricks.client.opus.base.submit_instantiation(simulation_id: int, instantiation: Instantiation) → int
-
async simbricks.client.opus.base.submit_run(instantiation_id: int) → int
-
async simbricks.client.opus.base.create_run(instantiation: Instantiation) → int
-
async simbricks.client.opus.base.create_event(rc: RunnerClient, event: Annotated[ApiRunnerEventCreate | ApiRunEventCreate | ApiSimulatorOutputEventCreate | ApiSimulatorStateChangeEventCreate | ApiProxyStateChangeEventCreate | ApiProxyOutputEventCreate | ApiRunFragmentStateEventCreate | ApiRunFragmentOutputArtifactEventCreate, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]) → None
-
async simbricks.client.opus.base.update_event(rc: RunnerClient, event: Annotated[ApiRunnerEventUpdate | ApiRunEventUpdate, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')]) → None
-
async simbricks.client.opus.base.fetch_events(rc: RunnerClient, query: Annotated[ApiRunnerEventQuery | ApiRunEventQuery | ApiRunEventStartRunQuery | ApiSimulatorStateChangeEventQuery | ApiProxyStateChangeEventQuery, FieldInfo(annotation=NoneType, required=True, discriminator='event_discriminator')], expected: T) → list[T]