Configure component actions
Last updated
Last updated
This page describes StackState version 4.2.
The StackState 4.2 version range is End of Life (EOL) and no longer supported. We encourage customers still running the 4.2 version range to upgrade to a more recent release.
This how-to describes the steps to create a Component Action that can be executed from the component context menu in a Topology View.
To start working with Component Actions, go to the Settings page and then in Actions, select "Component Actions". There you can add a new Component Action or edit one that already exists.
A Component Action requires a name that is displayed in the Actions context menu; it is mandatory to provide a name. The Description, on the other hand, is optional. However, it is a good practice to provide a bit of explanation that gives more context about your Action.
Please note that the Component Action name is case-sensitive.
In this step, you determine which components of your topology are going to be able to use this Action. To do that, provide an STQL query that selects all components that should have access to this specific Action. You can find more about queries in StackState on our page about using STQL.
The below example binds an Action to all components in the "Production" domain that are present in the "databases" layer.
This step determines Action's behavior when it is executed from the component context menu. The scripting language here is Groovy, and you can script almost any action you need, from redirecting to another View with context, restarting remote components, to calling predictions for components.
Find more about the possibilities of scripting in StackState.
A valid Identifier for an Action is a URN that follows the below convention:
Actions have access to a component
object, representing the component the Action was invoked on.
Component properties can be accessed directly:
Component labels can be accessed via the labels
property:
Using GraphQL
, it is possible to access a specific StackPack's metadata:
The Action can direct StackState to open a new topology query:
The Action can direct StackState to navigate to a specific URL:
The Action can invoke an HTTP request to a remote URL: