pydent.interfaces.UtilityInterface

class pydent.interfaces.UtilityInterface(aqhttp, session)[source]

Bases: pydent.interfaces.CRUDInterface

Miscellaneous and specialized requests for creating, updating, etc.

Initializer for SessionInterface.

Parameters
  • aqhttp (AqHTTP) – aqhttp instance for this interface

  • session (AqSession) – session instance for this interface

__init__(aqhttp, session)

Initializer for SessionInterface.

Parameters
  • aqhttp (AqHTTP) – aqhttp instance for this interface

  • session (AqSession) – session instance for this interface

Methods

__init__(aqhttp, session)

Initializer for SessionInterface.

batch_operations(operation_ids)

Batches operations from a list of operation_ids.

compatible_items(sample_id, object_type_id)

Find items compatible with the field value.

create_data_association(model_inst, key, value)

create_items(items)

create_samples(samples)

create_upload(upload)

estimate_plan_cost(plan)

Estimates the plan cost.

job_debug(job_id)

Runs debug on a job with id=job_id.

json_delete(model_name, model_data[, …])

json_post(model_name, model_data[, …])

json_save(model_name, model_data[, …])

rtype

dict

model_create(table, data[, params])

model_delete(table, model_id[, params])

model_update(table, model_id, data[, params])

replan(plan_id)

Copies a plan.

set_operation_status(operation_id, status)

Sets an operation’s status.

start_job(job_id)

step_plan(plan_id)

submit_plan(plan, user, budget)

Submits a plan.

unbatch_operations(operation_ids)

Unbatches operations from a list of operation_ids.

update_code(code)

Updates code for a operation_type.

Attributes

aqhttp

session

_json_controller(method, model_name, model_data, record_methods=None, record_getters=None)

Method for creating, updating, and deleting models using Aquarium’s JSON controller.

Parameters
  • method (basestring) – Method name (e.g. “save”, “delete”)

  • model_name (basestring) – Model name

  • model_data (dict) – Additional model and method data

  • record_methods (dict) – Optional ‘record_methods’ key

  • record_getters (dict) – Optional ‘record_getters’ key

Returns

json formatter response

Return type

basestring

_model_controller(method, table, model_id, data, params=None)

Method for creating, updating, and deleting models.

Parameters
  • method (str) – Request method name (one of ‘put’, ‘post’, ‘delete’

  • table (str) – Table name of model (e.g. ‘samples’ or ‘data_associations’)

  • model_id (Union[str, int, None]) – Optional model_id (not required for ‘post’)

  • data (Optional[dict]) – data

  • params – controller parameters

Returns

json formatted server response

Return type

dict

batch_operations(operation_ids)[source]

Batches operations from a list of operation_ids.

compatible_items(sample_id, object_type_id)[source]

Find items compatible with the field value.

create_library(library)[source]

Creates a new library type.

create_operation_type(operation_type)[source]

Creates a new operation type.

create_sample_type(sample_type)[source]

Create a Sample Type independent of an Operation Type

estimate_plan_cost(plan)[source]

Estimates the plan cost.

job_debug(job_id)[source]

Runs debug on a job with id=job_id.

replan(plan_id)[source]

Copies a plan.

set_operation_status(operation_id, status)[source]

Sets an operation’s status.

submit_plan(plan, user, budget)[source]

Submits a plan.

unbatch_operations(operation_ids)[source]

Unbatches operations from a list of operation_ids.

update_code(code)[source]

Updates code for a operation_type.

update_operation_type(operation_type)[source]

Creates a field type for an existing operation type