StackPack - script API

Functions to work with StackPacks

This page describes StackState version 4.3.

The StackState 4.3 version range is End of Life (EOL) and no longer supported. We encourage customers still running the 4.3 version range to upgrade to a more recent release.

Go to the documentation for the latest StackState release.

The StackPack script API provides handy operations to get the status of a StackPack or resources that are provided by a StackPack.

Function isInstalled

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: sts stackpack list.

Examples:

The example below will return an AsyncScriptResult of a boolean indicating if the agent StackPack is installed

StackPack.isInstalled("agent")

Function getResources

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: sts graph list-types.

Examples:

The example below will return an AsyncScriptResult of an array of resources with type QueryView from the agent StackPack.

StackPack.getResources("agent", "QueryView")

Last updated