PPA PPA: Task

Summary

This module contains actions related to the running task instance.

Actions

ppa.task.

get_payload_values

Get specific keys & values from the task payload.

Only use this action if the task payload is a dictionary.

Minimum Plugin Version: 5.0.0

Input

Missing & Optional Keys

Supplying a default_value to a PayloadKey will assign a value if it is missing.

This action will fail if any keys without a default_value are missing from the payload.

Output

A dictionary containing the requested keys & values from the payload.

Example - Required & Optional Keys
1
2
3
4
5
6
- ppa.task.get_payload_values:
    keys:
      - name: vpc_id
      - name: region_name
        default_value: null
  save: payload

ppa.task.

manifest

Get the task manifest.

Minimum Plugin Version: 1.0.0

Input

This action takes no inputs.

Output

A dictionary containing the task manifest.

Example
1
2
- ppa.task.manifest:
  save: manifest

ppa.task.

payload

Get the task payload.

Minimum Plugin Version: 1.0.0

Input

This action takes no inputs.

Output

A dictionary containing the task payload.

Example
1
2
- ppa.task.payload:
  save: payload

ppa.task.

save_result

Set the task JSON result.

A task's JSON result can be used to store information relevant to the run of a task.

This result is not shown in the PPA interface, but it can be fetched via the PPA API.

The action can only be run once per task, as the task result cannot be overwritten once it is set.

Minimum Plugin Version: 4.1.0

PPA Version

This action requires PPA v2.7.1 or newer.

Input
  • json: any valid JSON to store as the task result

  • reason: text to display when the action runs (defaults to Saving the task result)

Output

Nothing is outputted by this action.

Example

The following action:

1
2
3
- ppa.task.save_result:
    json:
      message: The task completed successfully

Will set the following task result:

{'message': 'The task completed successfully'}

ppa.task.

started_after_delay

Determine if a task was started by a delayed start.

Minimum Plugin Version: 5.7.0

Minimum PPA Version: 2.8.0

Input

This action takes no inputs.

Output

true if the task was started by a delayed start, otherwise false.

Example
1
2
- ppa.task.started_after_delay:
  save: delayed_task

ppa.task.

started_by_api

Determine if a task was started by an API call.

Minimum Plugin Version: 3.1.0

Input

This action takes no inputs.

Output

true if the task was started by an API call, otherwise false.

Example
1
2
- ppa.task.started_by_api:
  save: api_triggered

ppa.task.

started_by_schedule

Determine if a task was started by a PPA schedule.

Minimum Plugin Version: 3.1.0

Input

This action takes no inputs.

Output

true if the task was started by a schedule, otherwise false.

Example
1
2
- ppa.task.started_by_schedule:
  save: scheduled

ppa.task.

started_by_task

Determine if a task was started directly from another task.

Minimum Plugin Version: 5.7.0

Input

This action takes no inputs.

Output

true if the task was started by another task, otherwise false.

Example
1
2
- ppa.task.started_by_task:
  save: started_by_task

ppa.task.

started_by_user

Determine if a task was started by a PPA user.

Minimum Plugin Version: 3.1.0

Input

This action takes no inputs.

Output

true if the task was started by a user, otherwise false.

Example
1
2
- ppa.task.started_by_user:
  save: interactive

ppa.task.

url

Get a URL used to open this task instance in the PPA interface.

Minimum Plugin Version: 5.0.0

Input

This action takes no inputs.

Output

The task instance URL as a string.

Example
1
2
- ppa.task.url:
  save: url

ppa.task.

user_password

With the task operator's consent, get the password they used to authenticate to PPA.

This can be used to authenticate to other systems using the task operator's identity.

Minimum Plugin Version: 5.1.0

Input
  • text: the text to display when asking the user for consent
Remember

This operation is not possible if SAML is used to authenticate users to PPA.

Output

The operator's password if the consent was given, or null if it was not given.

Example
1
2
3
- ppa.task.user_password:
    text: PPA needs to use your login password to access a system
  save: operator_password

ppa.task.

uuid

Get the task UUID.

Minimum Plugin Version: 5.0.0

Input

This action takes no inputs.

Output

A string containing the task UUID.

Example
1
2
- ppa.task.uuid:
  save: uuid