description |
---|
How to Submit xRunBooks and Actions to Github |
If you have created a xRunBook in the SAAS/Sandbox, select the xRunBook's 3 dot menu and choose "Download."
the xRUnbook list
The Three dot menu:
In the repository, there is a sanitize.py script that will remove all of your parameters, credentials and outputs. Run this script against your RunBook:\
python3 sanitize.py -f <ipynb file>
You'll need to create a <RunBook name>.json file. This JSON has several attributes:
- Name: the name of your xRunBook
- Description: a detailed description of your runbook.
- uuid: A unique Id. Generate this using the description value, and running:
echo "DESCRIPTION OF THE RUNBOOK" | shasum -a 256
- icon: The connector type
- categories: the categories of the xRunBook.
- connector_types: The connector type
- version: The version
Save this JSON file. With these 2 files, create a branch of the repo, and submit a PR.
To submit a custom Action, first create a working version in unSkript. To create an Action that can be submitted to Open Source:
-
Copy an existing "lego" in the Awesome-CloudOps-Automation.
-
Rename the folder, and the .py and .json files with teh same name - that describes your action (for example: "aws_get_ec2_instance_age")
-
Next we'll edit the files. Copy the Python code of your Action into the .py file.
- Add a Class called InputSchema that describes the inputs for your action:
class InputSchema(BaseModel): region: str = Field( title='Region', description='AWS Region of the ECS service')
-
Now Edit the JSON file (this is created for you when you save from Docker):
- Name: the Name of your Action,
- Description: the Description
- Type: what connector will it use (ex: "LEGO_TYPE_AWS")
- Entry Function: The name of the function called to run the Action.
- Needs Credential: Boolean
- Output_Type: Dict, Array, String
- Supports polling: Boolean
- Supports Iteration: Boolean
-
Write a readme file (a template is created on save from Docker). Attach images (save in the same directory) if helpful.
-
Once these files are completed, create a fork of the repo, and submit a PR to the Master branch. The unSkript team will promptly review your Action and provide comments, or accept your submission.