Configuration API#

Configuration#

Example Use Inside of an Adapter Action

@action()
async def fetch_and_set_lab_config(self, actx: ActionExecutionContext) -> None:
   lab_config = await self.artificial_api.config_api_v1.get_lab_config(actx=actx)
   lab_config['carrier2'] = '2d06d4a2-b845-4479-a7ba-8f134a7f4c2a'
   await self.artificial_api.config_api_v1.set_lab_config(actx=actx, values=lab_config)
class ConfigApi(
connections: Connections,
*args,
**kwargs,
)#

Provides the ability to get and set Organization, Lab, Workflow, and Job configuration values.

async get_job_config(*, actx: ActionContext) t.Dict[str, t.Any]#
async get_job_config(*, lab_id: str, job_id: str) t.Dict[str, t.Any]

Gets the current configuration values for the job.

Parameters:

actx – The ActionContext or ActionExecutionContext for the current action.

Returns:

The current configuration values for the job.

async get_lab_config(*, lab_id: str) t.Dict[str, str]#
async get_lab_config(*, actx: ActionContext) t.Dict[str, str]

Gets the current configuration values for the lab.

Parameters:

actx – The ActionContext or ActionExecutionContext for the current action.

Returns:

The current configuration values for the lab.

async get_org_config() Dict[str, str]#

Gets the current configuration values for the organization.

Returns:

The current configuration values for the organization.

async get_workflow_config(
*,
actx: ActionContext,
workflow_id: str,
) t.Dict[str, t.Any]#
async get_workflow_config(*, lab_id: str, workflow_id: str) t.Dict[str, t.Any]

Gets the current configuration values for the workflow.

Parameters:
  • actx – The ActionContext or ActionExecutionContext for the current action.

  • workflow_id – The ID of the workflow for which to get configuration values. Can be found in the @workflow decorator in your workflow

Returns:

The current configuration values for the workflow

async set_job_config(*, actx: ActionContext, values: t.Dict[str, str]) None#
async set_job_config(*, lab_id: str, job_id: str, values: t.Dict[str, str]) None

Sets the configuration values for the job.

Parameters:
  • actx – The ActionContext or ActionExecutionContext for the current action.

  • values – The configuration values to set.

async set_lab_config(*, actx: ActionContext, values: t.Dict[str, str]) None#
async set_lab_config(*, lab_id: str, values: t.Dict[str, str]) None

Sets the configuration values for the lab.

Parameters:
  • actx – The ActionContext or ActionExecutionContext for the current action.

  • values – The configuration values to set.

async set_workflow_config(
*,
actx: ActionContext,
workflow_id: str,
values: t.Dict[str, str],
) None#
async set_workflow_config(
*,
lab_id: str,
workflow_id: str,
values: t.Dict[str, str],
) None

Sets the configuration values for the workflow.

Parameters:
  • actx – The ActionContext or ActionExecutionContext for the current action.

  • workflow_id – The ID of the workflow for which to set configuration values. Can be found in the @workflow decorator in your workflow

  • values – The configuration values to set.