@itentialopensource/generate-query-jst-from-object

0.0.7-2023.1.0 • Public • Published

Generate Query JST from Object

Table of Contents

Overview

This pre-built allows IAP users to pass in an object and generate a JST that queries out individual items in the object which can then be used in IAP as a replacement for query tasks. At the time of publishing, only items in the first level of the object are exposed by the generated JST.

Installation Prerequisites

Users must satisfy the following prerequisites:

  • Itential Automation Platform: ^2022.1

How to Install

To install the pre-built:

  • Verify you are running a supported version of the Itential Automation Platform (IAP) as listed above in the Prerequisites section.
  • The pre-built can be installed from within App-Admin_Essential. Simply search for the name of your desired pre-built and click the install button (as shown below).
install

How to Run

Use the following to run the pre-built:

  1. Once the pre-built is installed as outlined in the How to Install section above, go to Automation Catalog and run the Generate Query JST automation. In the Enter name for the JST field, enter the name for the generated JST and in the Enter the Object, enter the object for which you want to create the JST and click on VIEW JOB.

Here's an example for what a user might send in:

Enter name for the JST testJST
Enter the Object { "name": "John", "age": 23, "location": "Atlanta" }
ac-item
  1. In the job, click on the WORK TASK button that would have popped up, to view the generated JST and copy/save it to a file on your local system.
run-job
If imported into the JST designer, the JST will look like this:
jst
  1. Now navigate to the workflow where you would like to query the items out of the object, add a JSON Transformation task and import the saved JST into IAP.
import
  1. Each of the items in original object should be accessible in all of the subsequent tasks of the workflow
tasks

Attributes

Attributes for the pre-built are outlined in the following tables.

  1. Input:
Attribute Description Type
Enter name for the JST Enter the name that you want the generated JST to be called string
Enter the Object Enter the object for which you want to create the query JST object
  1. Output:
Attribute Description Type
createdJST The generated query JST for the input object object

Examples

Examples describing how the pre-built will work for different inputs.

Example 1. Input:

{
  "data": {
    "fruit": "apple",
    "price": "42.2",
    "type": "fruit"
  },
  "jstName": "details"
}

Example 1. Output (If imported into the JST designer, the JST will look like this):

example1


Example 2. Input - Showing support for only the first level of items:

{
  "data": {
    "healthcheckVariables": {
      "numberOfRetries": 10,
      "numberOfRetriesStability": 10,
      "secondsBetweenRetry": 60
    },
    "mode": "Verbose",
    "iosDeviceHostname": "csr100v-03.10.03S",
    "release": "csr1000v-universalk9.03.10.03.S.153-3.S3-ext.SPA.bin"
  },
  "jstName": "device"
}

Example 2. Output (If imported into the JST designer, the JST will look like this):

example2

Additional Information

Please use your Itential Customer Success account if you need support when using this Pre-Built Transformation.

Package Sidebar

Install

npm i @itentialopensource/generate-query-jst-from-object

Weekly Downloads

2

Version

0.0.7-2023.1.0

License

Apache-2.0

Unpacked Size

7.3 MB

Total Files

23

Last publish

Collaborators

  • andyknaebel
  • johnpolansky
  • jared.obrien
  • charlie.wilson
  • zack.strulovitch
  • itential-ci