CIActionEngine - Scoped
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- API reference
The CIActionEngine API provides methods that enable you to execute any action on a configuration item (CI), to check the authorization of a user before executing an action, and to get the status and action outputs of any action execution request.
The CI action is associated with the Metrics and CI Actions Framework application. To use this class in a scoped application, use the sn_cimaf
namespace identifier. The CIActionEngine API requires
the Metrics and CI Actions Framework (com.snc.sn_cimaf) plugin and is provided within the sn_cimaf
namespace.
CIActionEngine - execute()
Executes any action on a CI with the configured action parameters.
Name | Type | Description |
---|---|---|
action | String or Glide Record | Sys_id or GlideRecord of the Action [sn_cimaf_action] table. |
ci | String or Glide Record | Sys_id or GlideRecord of the CMDB [cmdb_ci] table on which the Action needs to be executed |
actionParams | Object | Optional. Map of Action parameter names and values. Note: Parameter values should be of the type defined in the Action parameter [sn_cimaf_action_parameter] table. |
Type | Description |
---|---|
String | Sys_id of the new or existing duplicate in-progress Action Request. |
Example
The following example shows how to kill a process on a CI.
Output:
CIActionEngine - getActionRequestOutput()
Gets the status and action outputs of an action execution request.
Name | Type | Description |
---|---|---|
actionRequest | Glide Record | GlideRecord of the Action Request [sn_cimaf_action_request] table. |
Type | Description |
---|---|
Object | Object contains the status and list of the action outputs of the provided action request. |
Example
The following example shows how to get status and action outputs for any action request.
Output:
CIActionEngine - isAuthorized()
Checks the authorization of the signed-in user before they can execute an action according to specified configurations.
The configurations are defined in the Action Role [sn_cimaf_action_role], User Criteria Action Inclusion [sn_cimaf_action_user_criteria_mtom], and User Criteria Action Exclusion [sn_cimaf_action_user_criteria_no_mtom] tables.
Name | Type | Description |
---|---|---|
action | Glide Record | GlideRecord of the Action [sn_cimaf_action] table. |
Type | Description |
---|---|
Boolean | Flag that indicates the success of the user's authorization. Valid values:
|
Example
The following example uses the isAuthorized() method to check a user's authorization to execute any action on a CI.