Queues Client Methods#

This page lists all relevant methods for Dioptra Queues that are available via the Python Client.

Requirements#

Queues - CRUD methods#

After importing and initializing the client, these methods for creating, reading, updating, and deleting (CRUD) Queues can be executed via client.queues.METHOD_NAME().

Create Queue#

QueuesCollectionClient.create(group_id: int, name: str, description: str | None = None) dioptra.client.queues.T[source]#

Creates a queue.

Parameters
  • group_id – The id of the group that will own the queue.

  • name – The name of the new queue.

  • description – The description of the new queue. Optional, defaults to None.

Returns

The response from the Dioptra API.

Get Queues#

QueuesCollectionClient.get(group_id: int | None = None, index: int = 0, page_length: int = 10, sort_by: str | None = None, descending: bool | None = None, search: str | None = None) dioptra.client.queues.T[source]#

Get a list of queues.

Parameters
  • group_id – The group id the queues belong to. If None, return queues from all groups that the user has access to. Optional, defaults to None.

  • index – The paging index. Optional, defaults to 0.

  • page_length – The maximum number of queues to return in the paged response. Optional, defaults to 10.

  • sort_by – The field to use to sort the returned list. Optional, defaults to None.

  • descending – Sort the returned list in descending order. Optional, defaults to None.

  • search – Search for queues using the Dioptra API’s query language. Optional, defaults to None.

Returns

The response from the Dioptra API.

Get Queue by ID#

QueuesCollectionClient.get_by_id(queue_id: str | int) dioptra.client.queues.T[source]#

Get the queue matching the provided id.

Parameters

queue_id – The queue id, an integer.

Returns

The response from the Dioptra API.

Modify Queue#

QueuesCollectionClient.modify_by_id(queue_id: str | int, name: str, description: str | None) dioptra.client.queues.T[source]#

Modify the queue matching the provided id.

Parameters
  • queue_id – The queue id, an integer.

  • name – The new name of the queue.

  • description – The new description of the queue. To remove the description, pass None.

Returns

The response from the Dioptra API.

Delete Queue#

QueuesCollectionClient.delete_by_id(queue_id: str | int) dioptra.client.queues.T[source]#

Delete the queue matching the provided id.

Parameters

queue_id – The queue id, an integer.

Returns

The response from the Dioptra API.

Tags Attached to Queue - Methods#

Methods belonging to the TagsSubCollectionClient can are accessed via the tags property of the Queues Client (which points to TagsSubCollectionClient)

Example - Get tags for a Queue

Get tags for a Queue

client.queues.tags.get(1)

See available methods for the TagsSubCollectionClient:

Snapshots of Queue - Methods#

Methods belonging to the SnapshotsSubCollectionClient can are accessed via the snapshots property of the Queues Client (which points to SnapshotsSubCollectionClient)

Example - Get snapshots for a Queue

Get snapshots for a Queue

client.queues.snapshots.get(1)

See available methods for the SnapshotsSubCollectionClient:

See Also#