completed_action Table
This table lists the current set of completed actions. A completed action is an action that completed its execution, whether the action succeeded or failed.
This table does not contain "in progress" or "queued" actions.
Data Object | Type | Nullable | Primary | Description | Reference |
---|---|---|---|---|---|
recommendation_time | timestamp with time zone | False | False | When analysis recommended the action. | |
acceptance_time | timestamp with time zone | False | False | For manual actions, when the action was accepted for execution. | |
completion_time | timestamp with time zone | False | False | When the action completed. Can be for success or failure. | |
action_oid | bigint | False | False | The ID of the action. Use this to get action details. | |
type | enum | False | False | The action type. | action_type |
severity | enum | False | False | The action severity. | severity |
category | enum | False | False | The action category. | action_category |
target_entity_id | bigint | False | False | The ID of the entity that the action affects. For example, for a VMem resize, the VM that is resized. | |
involved_entities | bigint[] | True | False | An array of IDs for entities involved in the action. This includes the target entity. | |
description | text | False | False | The text description of the action. | |
savings | double precision | False | False | The cost savings this action results in. A negative savings indicates an investment. | |
final_state | enum | False | False | Whether the action succeded or failed. | terminal_state |
final_message | text | False | False | A message for the final state. If the action failed, this should contain an error message. | |
attrs | jsonb | True | False | Additional (often type-specific) info for the action. For example, in resizes this will contain the commodity type and from/to amounts. | action.attrs |
Sample use cases
To get the target entities for all the completed actions, join this table with the
entities
table. This example lists the completed action type
and time, and the entity name type:
select completed_action.type AS action_type, completed_action.completion_time AS time, entity.name, entity.type AS ent_type
FROM completed_action
INNER JOIN entity ON completed_action.target_entity_id=entity.oid