Links
Comment on page

StackPack - script API

StackState Self-hosted v5.0.x
This page describes StackState version 5.0.
The StackPack script API provides handy operations to get the status of a StackPack or resources that are provided by a StackPack.

Function: StackPack.isInstalled(name: String)

Returns a flag indicating if the StackPack is installed

Args

  • name - the name of a StackPack. This much match exactly (case sensitive). The name of a StackPack can be found in the breadcrumb trail of the StackPack in the StackState UI or can be retrieved using StackState CLI command:
CLI: sts (new)
CLI: stac
sts stackpack list
⚠️ PLEASE NOTE - from StackState v5.0, the old sts CLI has been renamed to stac and there is a new sts CLI. The command(s) provided here are for use with the new sts CLI.
stac stackpack list
⚠️ PLEASE NOTE - from StackState v5.0, the old sts CLI is called stac.
In a future release of StackState, the new sts CLI will fully replace the stac CLI. It is advised to install the new sts CLI and upgrade any installed instance of the old sts CLI to stac. For details see:

Examples

The example below will return an AsyncScriptResult of a boolean indicating if the agent StackPack is installed
StackPack.isInstalled("agent")

Function: StackPack.getResources(stackPackNamespace: String, nodeType: String)

Returns resources originating from the StackPack.

Args

  • stackPackNamespace - the name of the URN namespace of the StackPack. For example aad checks for resources in the namespace urn:stackpack:aad.
  • nodeType - the type of node, for example CheckFunction or QueryView. You can get a full listing of all using the StackState CLI command:
CLI: sts (new)
CLI: stac
sts settings list-types
⚠️ PLEASE NOTE - from StackState v5.0, the old sts CLI has been renamed to stac and there is a new sts CLI. The command(s) provided here are for use with the new sts CLI.
stac graph list-types
⚠️ PLEASE NOTE - from StackState v5.0, the old sts CLI is called stac.
In a future release of StackState, the new sts CLI will fully replace the stac CLI. It is advised to install the new sts CLI and upgrade any installed instance of the old sts CLI to stac. For details see:

Examples

The example below will return an AsyncScriptResult of an array of resources with type QueryView from the agent StackPack.
StackPack.getResources("agent", "QueryView")