Create Custom Actions
While unSkript offers many Actions for your xRunBooks, it's probable that you'll want to create your own, or perhaps modify an existing Action for your specific needs.
You can modify the source code of a built-in Action to create your custom action.
For example, Perhaps the List all AWS IAM Users returns a list of usernames:
What if we'd like to also retrieve the Arn for each user? We can just modify the existing code:
for x in response['Users']:
We have commented out the original code that returns just the name, and repalced it with a dictionary with the name and Arn values for each User in the list:
Action Updated with refined code for your use case!
Each Connector has a "handle" Action that has the basic connectivity built in. Building on this Action allows you to make the API calls into your service as needed.
In the example below, the AWS boto3 handle Action is used as a base to create a new AWS Action to fetch all EC2 instances for that region.
The custom action can be renamed and saved as a new Action to fit your Task.
Fill out the details to save the new Action.
You can view all your Custom Actions in the Actions tab under myActions.