- 18 Oct 2024
-
DarkLight
-
PDF
Port/VLAN Configuration (IOS) - Transformations
- Updated on 18 Oct 2024
-
DarkLight
-
PDF
Next we need to build a Transformation (or JSON Schema Transformation) to manipulate the data from form input to the Itential Pre-Built. We know that users will be submitting data using our form, but when doing that the values are not sent to the workflow individually; they are sent as a single variable called formData. To handle this, we will need to transform the data. To do that, we’ll build a Transformation.
For this module, we will leverage the JSON Form created in the Port Turn Up (IOS) - JSON Form module. If you have not yet, please complete that module first. We will be using the JSON Preview form data for our Transformation in this module.
Transformation Video
Step 1
From the IAP dashboard, click Automation Studio
Step 2
Click the + icon in the upper left navigation window. The Create window opens.
Step 3
In the Create window, select Transformation and give it a name of Lab - Port Turn Up - IOS JST - XX. (XX represents your initials)
Click CREATE.
Step 4
A fresh canvas opens. If you would like to remove extra space from the canvas, you can do so by hovering your cursor near the top of the canvas and selecting the trash can icon. You can also add space to your canvas by hovering your cursor near the top of the canvas and selecting the plus icon. To zoom in or out on your canvas, use the canvas controls in the top right corner of the canvas.
We begin to create our transformation. Click the + under Incoming Schemas and select Incoming Schema.
Step 5
Schemas can be created by entering sample JSON. We'll use the output data we copied from the JSON Form. Paste the JSON Form data on the right. In case you no longer have your copied data, you can use the sample data below.
{
"autoApprove": true,
"type": "GigabitEthernet",
"interface": 1,
"subnetMask": "255.255.255.252",
"device": "IOS",
"subInterface": "300",
"description": "Test Interface 1.300",
"ipAddress": "10.20.30.1",
"vlan": "300"
}
Step 6
Next, click Infer Schema From Example JSON.
Step 7
By clicking Infer Schema from Example JSON, IAP digests the sample JSON, parses the data, determines appropriate data types and creates a JSON schema for it. We just need to add an ID.
To the right of “$id”: click between the “ “ and enter formData, then click Save.
Step 8
The incoming schema is created. Next we need to build the Outgoing Schema. The Outgoing Schema represents the structure or format that the Pre-Built needs to run. In order to adjust our Incoming Schema to fit the structure required for the Pre-Built, we are going to send the values individually.
Click the half-circle for the autoApprove value in the Incoming Schema and then click the Add + under Outgoing Schemas and select Outgoing Schema.
Step 9
The Outgoing Schema is created, building a connection between it and the Incoming Schema.
Step 10
Repeat for each formData value in the Incoming Schema. Click the Save icon.
Step 11
We are ready to test the Transformation. Click the ▶ button.
Step 12
Click the Run button.
Step 13
Review the output.
When you are finished, close the JST Designer tab in your browser to return to the Automation Studio view.