ARS Action Primitives#

An action primitive represents a step or set of steps taken after an automated remedy completes. Remedies can reference actions by name in the remedy after list.

The ClusterWareAI ™ auto remediation service (ARS) must be enabled before remedies and related actions are applied automatically after a heath check failure. See Configure ARS for details.

When issuing requests, the UID field in the URL can be the actual UID of the primitive or the name of the primitive as given in the "name" field.

Data Fields#

Action primitives have several fields:

name
   Required: The name of the action. Names must start with an alphabet
   character, not a number.

description
   Optional: A text description for the action.

runnable
   Required: The Python class name used to run the action. The value must be
   a valid Python identifier.

arguments
   Optional: A dictionary of arguments for the runnable.

Additional Endpoints#

The action API provides the following endpoints:

GET /actions
   Returns a list of all actions.

POST /actions
   Creates an action.

GET /action/<ACTION>
   Returns details about a given action (by name or UID).

PATCH /action/<ACTION>
   Updates an existing action (by name or UID).

DELETE /action/<ACTION>
   Deletes an action (by name or UID).

Example#

List all actions:

curl -X GET https://head1.cluster.local/api/v1/actions \
     -H "Authorization: Bearer <access_token>" \
     -H "Content-Type: application/json"
{"success":true,"data":["35a30c9349224e6093eae7f4f3c0010a","a914cfbf1ccf4e9a9fe23921a3ebf7da"]}

List details about an action by name:

curl -X GET https://head1.cluster.local/api/v1/action/send_auto_fixed \
     -H "Authorization: Bearer <access_token>" \
     -H "Content-Type: application/json" | jq
{
  "success": true,
  "data": {
    "name": "send_auto_fixed",
    "description": "Notify ARS that the node was automatically fixed when a remedy succeeds.",
    "runnable": "SendAutoFixedStrategy",
    "arguments": {},
    "last_modified": 1776693966.9676054,
    "last_modified_on": "head0.cluster.local",
    "last_modified_by": "admin",
    "uid": "35a30c9349224e6093eae7f4f3c0010a"
  }
}