Manage decorations

Itential Automation Gateway (IAG) aggregates all of your Ansible modules, roles, playbooks, and scripts. Along with this attribute is the ability to decorate or enhance each module, role, playbook, and script. With decoration, you have the flexibility to edit JSON schemas for identifying and modifying metadata such as input parameters, descriptions, or types. Decoration is currently stored in the database.

Use the following set of APIs to export, import, and remove JSON schemas.

Export

Retrieve the schema from a module, role, playbook, or script. The response from this call can be saved and used as direct input for importing a schema to another Automation Gateway server.

API

GET hostname:port/modules/{module_name}/schema
GET hostname:port/roles/{role_name}/schema
GET hostname:port/playbooks/{playbook_name}/schema
GET hostname:port/scripts/{script_name}/schema
GET hostname:port/nornir/{nornir_name}/schema
GET hostname:port/terraforms/{terraform_name}/schema

Sample response

1{
2 "schema": {
3 "properties": {
4 "command": {
5 "type": "string",
6 "description": "CLI command to execute on network device"
7 }
8 },
9 "required": [
10 "command"
11 ],
12 "title": "sample_playbook",
13 "type": "object"
14 }
15}

Import

Add or update the schema for a module, role, playbook, or script.

API

PUT hostname:port/modules/{module_name}/schema
PUT hostname:port/roles/{role_name}/schema
PUT hostname:port/playbooks/{playbook_name}/schema
PUT hostname:port/scripts/{script_name}/schema
PUT hostname:port/nornir/{nornir_name}/schema
PUT hostname:port/terraforms/{terraform_name}/schema

Sample request

1{
2 "schema": {
3 "properties": {
4 "command": {
5 "type": "string",
6 "description": "CLI command to execute on a network device"
7 }
8 },
9 "required": [
10 "command"
11 ],
12 "title": "sample_playbook_1",
13 "type": "object"
14 }
15}

Sample response

1{
2 "type": "playbook",
3 "name": "sample_playbook_1",
4 "schema": {
5 "properties": {
6 "command": {
7 "type": "string",
8 "description": "CLI command to execute on a network device"
9 }
10 },
11 "required": [
12 "command"
13 ],
14 "title": "sample_playbook_1",
15 "type": "object"
16 }
17}

Removal

Delete the user decorated schema for a module, role, playbook, or script.

This call only removes a user decorated schema. It does not apply to the certified schemas provided by Itential for roles and modules, nor to a module’s native schema that is automatically created at discovery time by the AG server.

API

DELETE hostname:port/modules/{module_name}/schema
DELETE hostname:port/roles/{role_name}/schema
DELETE hostname:port/playbooks/{playbook_name}/schema
DELETE hostname:port/scripts/{script_name}/schema
DELETE hostname:port/nornir/{nornir_name}/schema
DELETE hostname:port/terraforms/{terraform_name}/schema

Sample response

1{
2 "code": 200,
3 "message": "deleted"
4}