Tools for SL1 PowerFlow

Download this manual as a PDF file

PowerFlow includes the following developer tools to help you manage content:

  • iscli. PowerFlow includes a command line tool called iscli. When you install PowerFlow, iscli is automatically installed. The iscli tool allows you to upload PowerFlow applications, steps, and configurations.
  • PowerFlow API. PowerFlow includes an API. When you install PowerFlow, the API is available.

This section covers the following topics:

iscli

PowerFlow includes a command line tool called iscli. When you install PowerFlow, iscli is automatically installed. The iscli tool allows you to upload PowerFlow applications, steps, and configurations.

To access the iscli tool:

  • Either go to the console of the PowerFlow system or use SSH to access the server.
  • Log in as isadmin with the appropriate password.
  • Type the following at the command line:

iscli -h

Syntax

  • To upload a step:

    iscli -u -s -f path_and_name_of_step_file.py -H hostname_or_IP_address_of_powerflow_system -P port_number_of_http_on_powerflow_system -U user_name -p password

  • To upload an application:

    iscli -u -a -f path_and_name_of_application_file.json -H hostname_or_IP_address_of_powerflow_system -P port_number_of_http_on_powerflow_system -U user_name -p password

  • To upload a configuration:

    iscli -u -c -f path_and_name_of_configuration_file.json -H hostname_or_IP_address_of_powerflow_system -P port_number_of_http_on_powerflow_system -U user_name -p password

List of Arguments

The following is a list of arguments you can use in the iscli tool:

  • -h or --help. Help message.
  • -H or --host. Hostname of content store. If left blank, default from config is used.
  • -P or --port. Port of content store. If left blank, default from config is used.
  • -U or --username. Username used to access content store. If left blank, default is used.
  • -p or --password. Password used to access content store. If left blank, default is used.
  • -u or --upload. Upload data to content store. Requires -f tag and a version to be used.
  • -f or --fileLocation. File path of Synchronization PowerPacks, PowerFlow applications, steps, and configuration objects to upload. Note that while you can bulk upload applications, steps, and configuration objects, you cannot bulk upload Synchronization PowerPacks.
  • -c or --configuration.
  • -a or --application. Use the iscli tool to interact with an application.
  • -s or --step. Use the iscli tool to interact with a step.
  • -i or --insecure. Upload with an insecure (http) connection.

  • -k or --syncpack. Use the iscli tool to interact with a Synchronization PowerPack.

  • -A or --activate. Activate a Synchronization PowerPack. Requires -n, -v tag. -F is optional to force the activation and the tag -I to install the Synchronization PowerPack.

  • -I or --install. Install a Synchronization PowerPack. Requires -n, -v tag. -F is optional to force the installation.

  • -n or --name. Name of the Synchronization PowerPack that will be activated.

  • -V or --version. Version of the Synchronization PowerPack that will be activated.

  • -F or --force. Force a Synchronization PowerPack activation or installation.

  • -O or --overwrite. Specify if non-Synchronization PowerPack content will be overwritten.

  • -l or --license. Use the CLI to license your IS system.

  • -e or --email. Licensing: Customer Email.

  • -C or --customer. Licensing: Customer Name.

  • -o or --output. Licensing: Path to output license file.

You will use the following commands most often:

  • Upload an application file. iscli –uaf <app-file>
  • Upload a configuration file. iscli –ucf <config-fil>
  • Upload a step file. iscli –usf <step-file>

Example

iscli -u -s -f path_and_name_of_step_file.py -H hostname_or_IP_address_of_powerflow_system -P port_number_of_http_on_powerflow_system -U user_name -p password

where:

  • name_of_step_file is the full pathname for the step.
  • hostname_or_IP_address_of_powerflow_system is the hostname or IP address of the PowerFlow system.
  • port_number_of_http_on_powerflow_system is the port number to access the PowerFlow system.
  • user_name is the user name you use to log in to the PowerFlow system.
  • password is password you use to log in to the PowerFlow system.

API

PowerFlow includes an API. When you install PowerFlow, the API is available.

Viewing API Documentation

To view the full documentation for the PowerFlow API:

  1. From the PowerFlow system, copy the /opt/iservices/scripts/swagger.yml file to your local computer.
  2. Open a browser session and go to editor.swagger.io.
  3. In the Swagger Editor, open the File menu, select Import File, and import the file swagger.yml. The right pane in the Swagger Editor displays the API documentation.

Available Endpoints

POST

/applications. Add a new application or overwrite an existing application.

/applications/{appName}/run. Run a single application by name with saved or provided configurations.

/applications/run. Run a single application by name. For more information, see Querying for the State of a PowerFlow Application.

/configurations. Add a new configuration or overwrite an existing configuration.

/roles/owner. Add a new owner assigned a specific role.

/steps. Add a new step or overwrite an existing step.

/steps/run. Run a single step by name.

/schedule. Add a new scheduled PowerFlow application.

/syncpacks/{syncpackName}/install. Install a specific Synchronization PowerPack version by name.

/tasks/{taskId}/replay. Replay a specific PowerFlow application. Replayed applications run with the same application variables, configuration, and queue as the originally executed application.

/tasks/{taskId}/revoke. Revoke or terminate a specific task or application. By default, this command will not terminate the current running task. If an application ID is provided, all tasks associated with that application are revoked.

/api/v1/me/widgets/{widget_id}. Creates a new widget or updates a existing widget used on the PowerFlow Control Tower page.

Querying for the State of a PowerFlow Application

When triggering PowerFlow application from the applications/run endpoint, you can query for the state of that application in two ways:

  1. Asynchronously. When you POST a run of a PowerFlow application to /applications/run, the response is an integration status with a Task ID, such as: isap-23233-df2f24-etc. At any time, you can query for the current state of that task from the endpoint /api/v1/tasks/isap-23233-df2f24-etc. The response includes all of the steps run by the application, along with the status of the steps, and URL links to additional info, such as logs for each step.
  2. Synchronously. When you POST a run of an application, you can tell PowerFlow to wait responding until the application is complete by adding the wait argument. For example, /api/v1/applications/run?wait=20 will wait for 20 seconds before responding. The maximum wait time is 30 seconds. When the application completes, or 30 seconds has passed, the API returns the current status of the integration run. This process works the same as if you had manually queried /api/v1/tasks/isapp-w2ef2f2f. Please note that while the API is waiting for your application to complete, you are holding on to a thread. If you have multiple applications that run for a long period of time, do not use a synchronous query unless you have no other option. ScienceLogic recommends using an asynchronous query whenever possible.

GET

/about. Retrieve version information about the packages used by this PowerFlow system, including the version of PowerFlow.

/applications. Retrieve a list of all available applications on this PowerFlow system.

/applications/{appName}. Retrieve a specific application.

/applications/{appName}/logs. Retrieve the logs for the specified application.

/cache/{cache_id}. Retrieve a specific cache to gather information about the user interface and the PowerFlow applications.

/cache/{cache_key}. Retrieve cache documents, but only if this cache document was explicitly saved to be exposed to the API. You will need to save the cache document using the latest version of the "SaveToCache" step in the Base Steps Synchronization PowerPack. This step has a step parameter called "read_from_api" that lets you decide whether the cache document can be requested from the API.

/configurations. Retrieve a list of all configurations on this PowerFlow system.

/configurations/{configName}. Retrieve a specific configuration.

/license?type=platform. Retrieve license data for this PowerFlow system.

/reports. Retrieve a list of paginated reports.

/reports/{reportId}. Retrieve a specific report by ID.

/roles. Retrieve a list of available roles on this PowerFlow system.

/roles/owner. Retrieve a list of roles assigned to owners on this PowerFlow system.

/roles/owner/{owner}. Retrieve the role assigned to a specific owner.

/sessions. Retrieve a list of sessions for this PowerFlow system.

/sessions/status. Retrieve the Session Management status for this PowerFlow system.

/sessions/username/{username}. Retrieve the session IDs for a specific user.

/sessions/{session_id}. Retrieve a specific session from Session Management for this PowerFlow system.

/schedule. Retrieve a list of all scheduled applications on this PowerFlow system.

/steps. Retrieve a list of all steps on this PowerFlow system.

/steps/{stepName}. Retrieve a specific step.

/syncpacks. Retrieve a list of all Synchronization PowerPacks on this PowerFlow system.

/syncpacks/{synpackName}. Retrieve the full details about a specific Synchronization PowerPack.

/syncpacks?only_installed=true. Retrieve a list of only the installed Synchronization PowerPacks on this system.

/syncpacks?only_activated=true. Retrieve a list of only the activated Synchronization PowerPacks on this system.

/tasks/{taskId}. Retrieve a specific task.

/api/v1/me/widgets. Returns a list of all installed widgets used on the PowerFlow Control Tower page.

/api/v1/me/widgets/{widget_id}. Returns a specific widget using the specified widget ID.

REST

/tasks. Terminate all running tasks.

/tasks/{taskId}. Terminate a specific running task.

DELETE

/applications/{appName}. Delete a PowerFlow application by name.

/cache/{cache_id}. Delete a cache entry by name.

/configurations/{configName}. Delete a configuration by name.

/license?type=platform. Delete license data for this PowerFlow system.

/roles/owner. Delete a specific owner role.

/schedule. Delete a scheduled PowerFlow application by ID.

/sessions. Delete a list of sessions for this PowerFlow system.

/sessions?all=true. Delete all sessions for this PowerFlow system.

/sessions/status. Delete the Session Management status for this PowerFlow system.

/sessions/username/{username}. Delete the session IDs for a specific user.

/sessions/{session_id}. Delete a specific session from Session Management for this PowerFlow system.

/reports/{appName}. Delete a specific report by name.

/reports/{reportId}. Delete a specific report by report ID.

/steps/{stepName}. Delete a specific step by name.

/syncpacks/{spName}. Delete a specific Synchronization PowerPack by name.

/api/v1/me/widgets/{widget_id}. Delete the specified widget used on the PowerFlow Control Tower page.