- 18 Oct 2024
-
DarkLight
-
PDF
Create a DNS A Record (Infoblox) - JSON Forms
- Updated on 18 Oct 2024
-
DarkLight
-
PDF
Next we’ll build our JSON form. This form is how users will submit the information needed when running our Create a DNS A Record use case.
JSON Form Video
Step 1
Starting from the IAP Dashboard, click Automation Studio in the left navigation panel.
Step 2
Click the + button at the top.
Step 3
Click the drop-down for What would you like to create?
Step 4
And choose JSON Form.
Step 5
Give the form the name Lab - Create a Record - Infoblox form - (Your Initials) and click Create.
Step 6
JSON Forms utilize a drag and drop interface. Click to expand the Form Elements menu in the right navigation panel.
Step 7
There are 7 types of form fields, or elements, to choose from.
- Text Input – Used to capture short string values.
- Text Area – Used to capture long string values.
- Number Input - Used to capture integer or decimal values.
- Checkbox - Used to capture boolean values.
- Dropdown - Used to capture strings from a set of options. Allows the user to select multiple options from a dropdown menu.
- Radio - Used to capture strings from a set of options. Allows the user to generate buttons to choose a single option.
- File Upload - Used to define an input element for file uploads.
Step 8
The first element we will add is the Dropdown. To add, simply click and drag to the Drop element here box.
Step 9
Hovering over the three dots to the right of the Dropdown element will show the gear and trash icons. Click the gear icon to configure the form element.
Step 10
Enter DNS View for the Label and and select the Yes radio button for Required.
Step 11
Enter Select a DNS View for the Placeholder.
Step 12
Notice the warning message that options are needed. Click +Options.
Step 13
There are two types of options, Static and Dynamic. This will be a dynamic configuration.
Step 14
We accept the default GET for Method.
Step 15
Click the dropdown for Base URL and select /infoblox.
Step 16
For the API Route, click the drop down and filter for /getDNSView.
Step 17
Next, we click the Make API Call.
Step 18
The Response body loads and we scroll down to configure the remaining options.
Step 19
For Source Property, click the drop-down and select /response.
Step 20
For Property key, we select /Name.
Step 21
The configuration of the dropdown field is complete. Click Back, then click Save.
Step 22
Next, we will add a Text Input. We drag the element to the canvas.
Step 23
Hover the mouse over the three dots on the right and select the gear icon.
Step 24
Enter Hostname for the Label and select the Yes radio button under Required.
Step 25
Next for Placeholder, add Enter Hostname.
Step 26
Click Save to save the changes.
JSON Form Video (Part 2)
Step 27
Next, we need to add another Dropdown for the form.
Step 28
We hover the mouse over the three dots and click the gear icon to configure the element.
Step 29
For the Label, we enter Domain.
Step 30
Select the Yes radio button for Required.
Step 31
And for the Placeholder, we enter Select Domain.
Step 32
We need to configure the options, click the +Options button
Step 33
This one will also be Dynamic.
Step 34
The Configure Options window opens.
Step 35
For Request Configuration, we set the Method to Post.
Step 36
For Base URL, we enter Info into the search box and select Infoblox.
Step 37
And for API route, we filter for getZone and select getZoneAuth.
Step 38
We paste the JSON code from the article into the Request Body and click the Make API Call button.
{
"query": {}
}
Step 39
The Response Body displays on the right. Scroll down to continue the dynamic configuration.
Step 40
Under Data Mapping, for Source Property we select /response.
Step 41
And for Property Key, we select /fqdn.
Step 42
The options are configured. Click Back and Save.
Step 43
The last element for our JSON form is a Text Field.
Step 44
Drag the element to the canvas and hover the mouse over the three dots on the right. Click the gear icon to configure the element.
Step 45
Enter IP Address for the Label.
Step 46
Select the Yes radio button for Required.
Step 47
And add Enter IP Address for the Placeholder.
Step 48
For Format we filter for ip and select ipv4.
Step 49
When the configuration is complete, click Save.
Step 50
The form is complete and we are ready to preview. Click the eye icon at the top right.
Step 51
We complete the form and click the Show Form button.
Step 52
We know that users will be submitting data using our form, but when doing that the values are not sent to the workflow individually as our workflow currently expects; they are sent in as a single variable called formData. To handle this, we will need to transform the data. To do that, we’ll build a Transformation.
Step 53
We want to copy and save this JSON Form data for use when we build the Transformation. Hover the mouse over the top.
A small clipboard icon appears. Click the clipboard to copy the JSON data, then click close.
Step 54
This is the format in which the data will be submitted when executing our automation from Operations Manager. We will now build a Transformation that takes the data in this format and breaks it out into the individual variables that our workflow needs.