graviti.manager.action
#
The implementation of the Action and ActionManager.
Module Contents#
Classes#
This class defines the structure of an action. |
|
This class defines the operations on the action in Graviti. |
|
This class defines the structure of an action run. |
|
This class defines the operations on the action run in Graviti. |
|
This class defines the structure of a node of action run. |
- class graviti.manager.action.Action(dataset, response)[source]#
Bases:
graviti.utility.ReprMixin
This class defines the structure of an action.
- Parameters
dataset (graviti.manager.dataset.Dataset) – Class
Dataset
instance.response (Dict[str, Any]) –
The response of the OpenAPI associated with the action:
{ "id": <str>, "name": <str>, "edition": <int>, "state": <str>, "payload": <str>, },
- name#
The name of this action.
- edition#
The edition of this action.
- state#
The state of this action.
- payload#
The payload of this action.
- property runs(self)[source]#
Get class
RunManager
instance.- Returns
Required
RunManager
instance.- Return type
- class graviti.manager.action.ActionManager(dataset)[source]#
This class defines the operations on the action in Graviti.
- Parameters
dataset (graviti.manager.dataset.Dataset) –
Dataset
instance.
- get(self, name)[source]#
Get the action with the given name.
- Parameters
name (str) – The required action name.
- Raises
ResourceNameError – When the given name is an empty string.
- Returns
The
Action
instance with the given name.- Return type
- list(self, *, sort=None)[source]#
List the information of actions.
- Parameters
sort (graviti.utility.SortParam) – The column and the direction the list result sorted by.
- Returns
The LazyPagingList of
actions
instances.- Return type
- delete(self, name)[source]#
Delete an action.
- Parameters
name (str) – The name of the action to be deleted.
- Raises
ResourceNameError – When the given name is an empty string.
- Return type
None
- class graviti.manager.action.Run(action, response)[source]#
Bases:
graviti.utility.ReprMixin
This class defines the structure of an action run.
- Parameters
- number#
The number of this action run.
- name#
The name of this action run.
- status#
The status of this action run.
- arguments#
The arguments of this action run.
- started_at#
The start time of this action run.
- ended_at#
The end time of this action run.
- duration#
The duration of this action run.
- nodes(self)[source]#
Get the nodes of the action run.
- Returns
The nodes of the action run.
- Return type
List[Node]
- class graviti.manager.action.RunManager(action)[source]#
This class defines the operations on the action run in Graviti.
- class graviti.manager.action.Node(run, response)[source]#
Bases:
graviti.utility.ReprMixin
This class defines the structure of a node of action run.
- Parameters
- node_id#
The id of this action run node.
- name#
The name of this action run node.
- display_name#
The display name of this action run node.
- phase#
The phase of this action run node.
- started_at#
The start time of this action run node.
- ended_at#
The end time of this action run node.
- duration#
The duration of this action run node.
- children#
The children of this action run node.