Plugins
Plugins extend the functionality of Cloudomation.
Use Cases
Use a plugin to
- bundle various Cloudomation resources so they can be transported between Cloudomation workspaces.
- load bundled Cloudomation resources into your workspace.
- extend the Cloudomaton User Interface with action buttons which will create executions when clicked
Concept
All Cloudomation resources can be associated with a plugin. When exporting a plugin all associated resources will be included in the resulting YAML file. This YAML file can then be transported to other workspaces and import all resources at once.
Plugin actions are restricted to a resource type. For each plugin action an action button will appear when viewing resources of the specified type. Clicking on a plugin action button will start an execution of the referenced flow and pass the ID of the resource in the input_value.
Configuration
Please see the table below for the different plugin fields and their meanings
Field | Description |
---|---|
Version | A version number of the plugin. |
Enabled | If unset, Cloudomation will not create action buttons of the plugin actions. |
Please see the table below for the different plugin_action fields and their meanings
Field | Description |
---|---|
Parent action | When set, this action will be placed in a dropdown menu below the parent action. |
Resource type | A Cloudomation resource type where the action should create a button. |
Field name | The name of a field of the resource type where the button should appear. Currently not used. |
Color | The color of the button. Currently not used. |
Icon | An icon to display on the button. |
Enabled | If unset, the action does not create a button. |
Flow | The flow which should be started when the button is clicked. |
Type | One of LIST , RECORD , or FIELD . See Action types. |
Action Types
LIST
The action button is also shown in list views. When clicked the flow is started once and the execution gets all record IDs passed in the input_value.
RECORD
The action button is shown in the record header. When clicked the flow is started once for each record and each execution gets one record ID passed in the input_value.
FIELD
Currently not implemented
Export
The User Interface provides an "Export" button. When clicked, the browser will download the plugin YAML.
Export a plugin from the command line
$ curl https://jollyroger.cloudomation.com/api/latest/my-plugin\?by=name\&download=export
plugin:name: my-pluginversion: 1...
Import
The User Interface currently does not provide a way to import plugins.
Importing a plugin from the command line
$ curl -X POST https://jollyroger.cloudomation.com/api/latest/import -d @my-plugin.yaml
Action Handler Flow
The flow which is registered in a plugin action will be used to create an execution when the action button is pressed.
Flow to handle a "LIST" plugin action
import flow_apidef handler(system: flow_api.System, this: flow_api.Execution):inputs = this.get('input_value')# Type "LIST" actions pass "ids"ids = inputs['ids']# we iterate over the list of IDsfor id_ in ids:# read the type of the resource and the namethis.log(system.resource(id, by='id').get('resource_type', 'name'))return this.success('all done')
Flow to handle a "RECORD" plugin action
import flow_apidef handler(system: flow_api.System, this: flow_api.Execution):inputs = this.get('input_value')# Type "RECORD" actions pass "id"id_ = inputs['id']this.log(f'I was called with the ID {id_}')return this.success('all done')
Flow to handle a "FIELD" plugin action
#TBD