As part of creating or modifying a discovery pattern, you can use the Cloud REST Query operation to extract information from configuration items (CIs) of the PaaS (Platform as a Service) type, such as Microsoft Azure or Amazon Web Services.

Before you begin

  • Verify that the operating system of the CIs for which you want to use the Cloud REST Query operation extends the Logical Data Center OS type [cmdb_ci_logical_datacenter]:
    1. Navigate to Pattern Designer > Discovery Patterns.
    2. Double-click the relevant pattern to open it in the Pattern Designer.
    3. Click the Basic tab.
    4. Note the operating system for this CI.
    5. Navigate to System Definition > Tables.
    6. Set the search field to Label and enter the name of the operating system as stated on the Basic tab of the pattern.
    7. Find the operating system in the list and verify that Logical Datacenter appears in the Extends table column.
  • Navigate to the relevant pattern step:

    1. On the pattern form, select the relevant identification section for Discovery.

      Alternatively, select the relevant identification or connection section for Service Mapping.

    2. Select the relevant pattern step or click the Add a step above icon to add a step.

Basic knowledge of programming is desirable.

Role required: pd_admin

About this task

Deploy the Cloud REST Query operation in patterns used for discovery of PaaS CIs. This Java-script based custom operation is available only after downloading patterns version 1.0.24 or later from ServiceNow Store. Use this operation instead of the Cloud REST Call operation available in the base system.

Refer to the official API-related documentation provided by manufacturers to obtain the query syntax for the device you want to query using the Cloud REST Query operation. For example:

Procedure

  1. Select Cloud REST Query from the Operation list.
  2. Define query parameters as necessary:
    Note: If you customized this operation, the query parameters may be different.
  3. To save the command output in its entirety as a variable, select NONE from the Define Parsing list and define the variable.
  4. Select the parsing strategy from the Define Parsing list.
  5. If working in the Debug Mode, define the parsing criteria as follows:
    1. Click Run Operation to see the result in the Output pane.
    2. In the Output pane, mark text or symbols that you want a variable to contain.
    3. In the variable name box, enter the name for the new variable, for example 'process_name'.

      Defining a variable name for the string marked in the Output pane
    4. Press Enter.
      The new variable is added in the Variables pane.
  6. If you are not working in Debug Mode, define the parsing criteria as follows:
    1. In the Variables pane, click Add Variable and enter the name for the new variable.
    2. Click the Advanced icon.

      Displaying the Advanced Variables pane
    3. Click Add Column Label.
    4. Enter the parsing query.
    5. Enter a value for the delimiter.
    6. Enter a value for the position.
  7. Select Terminate to stop discovery if no results are found.

Example


The Cloud REST Query operation

Use the Cloud REST Query operation to extract information about AWS buckets, their names and creation dates.