Configuring Network Request Run Book Actions

Download this manual as a PDF file

This section describes how to customize the network request run book actions included in the "Datacenter Automation Utilities" PowerPack.

The PowerPack also includes action types that are used by the automation action.

Use the following menu options to navigate the SL1 user interface:

  • To view a pop-out list of menu options, click the menu icon ().
  • To view a page containing all of the menu options, click the Advanced menu icon ().

Network Request Run Book Actions

You can use the following run book action policies to perform specific actions as part of the run book automations in the "Datacenter Automation Utilities":

  • HTTP Action Template. Use this template to create run book actions that use the "Make an HTTP Request" action type to make HTTP requests, such as a GET or a POST, to a third-party system.
  • HTTP Adaptive Card Action. Use this template, which includes a pre-built Microsoft Teams Adaptive Card, with a Microsoft Teams webhook. The adaptive card will provide basic data about the device and event that triggered the automation policy including the event ID, device name, and event message.

Customizing the HTTP Action Type Template

You can use the "HTTP Action Template" run book action to create run book actions that make HTTP requests, such as a GET or a POST, to a third-party system.

The most common use cases for a new run book action created by this template is to send data to Microsoft Teams and Slack webhook endpoints. However, GET and POST requests can be made to any endpoint based on the configuration of the run book action. There are multiple configuration options that can change the behavior of this request action.

To edit the "HTTP Action Template" run book action template:

  1. Go to the Action Policy Manager page (Registry > Run Book > Actions).
  2. Locate the "HTTP Action Template" automation action, and then click its wrench icon (). The Editing Action page appears.

An image of the Policy Editor page.

  1. In the Action Policy Editor page, supply a value in each field.
  • Action Name. Specify a new name for the action policy.
  • Action State. Select whether the policy can be executed by an automation policy (Enabled) or cannot be executed (Disabled).
  • Description. Type a detailed description of the action.
  • Organization. Select the organization to associate with the action policy.
  • Action Type. The action type is set to Make an HTTP Request .
  • Execution Environment. Select from the list of available Execution Environments. The default execution environment is System.
  • Action Run Context. Select Database or Collector as the context in which the action policy will run.

  1. In the Input Parameters field, you can change the values of the following parameters:

  • credential_id. The ID of a SOAP/XML credential from the ID column of the Credentials page (Manage > Credentials). The run book action policy will use this credential to make the HTTP request. If you want the credential to be determined by the dynapp_guidparameter below, or if you are using the url_override option, the value of this parameter should be "0". If you use the dynapp_guid field, the SOAP/XML credential aligned to that Dynamic Application on the same device will be used for the URL and HTTP method information.

    To make a GET or POST request to an API, set the base URL in the SOAP/XML credential and use the relative_url field, below, to add the endpoint to which you are making the request. The HTTP method used (GET or POST) is based on the value set in the Method field of the SOAP/XML credential.

  • You will need to specify the IP address in the SOAP credential. The use of %D as a variable is not supported.

  • dynapp_guid. The Dynamic Application GUID with a credential the action policy should use to make the HTTP request. If you are using the "url_override option", do not add a value to this parameter.

  • url_override. The URL of the webhook created from your third-party system, or an other URL to use to make the request. This is expected to be a full URL. If you use this field, you should not use the relative_url field. Any requests made using the url_override field are made with no authentication.

  • relative_url. Typically, the string appended to the end of the URL in the associated credential before making the request. You can use this parameter if you do not need to use authentication or other options in a SOAP/XML credential. If you use this field, you should not use the url_override field.

  • If you use the "relative_url" option and do not specify a payload, the action will perform a GET request. If you use this option and specify a payload, the action will perform a POST request.

  • payload. This parameter is sent in the body of the request and appears in the user interface to which the HTTP request is sent.

  • You can substitute this field with any Run Book Variables. For more information on Run Book Variables, see Run Book Variables.

  • payload_type. The data type to send the payload as in the request. Use the value "json" if you are using the "HTTP Adaptive Card Action" action policy, or if you are sending payloads to webhooks directly through this action using the payload field. Otherwise, leave this field blank.
  • command_label. This optional parameter is used to label the response to the HTTP request in the Event Actions Log. If you leave this parameter empty, the response to a request will be labeled with the URL that was used to make the request.
  1. Click Save As.

    When you use this run book action in a run book automation policy, add the "Datacenter Automation: Format JSON as simple HTML" run book after this new run book action to present the JSON response from the HTTP request in a human-readable HTML-based format.

Example: Using the HTTP Action Template to Send an HTTP Request

To send an HTTP request from SL1 to Microsoft Teams, you must create a new run book action using the "HTTP Action Template" action and align an automation policy. After you have completed the steps below, your Microsoft Teams channel should populate with SL1 event messages based on the configured criteria. You can also send authentication for the request through the URL instead of using an SL1 credential.

To send an HTTP request to Microsoft Teams using the "HTTP Action Template" action:

  1. Create an incoming webhook in Microsoft Teamsusing the instrcutions here: https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook.
  2. Go to the Action Policy Manager page (Registry > Run Book > Actions), locate the "HTTP Action Template" action, and then click its wrench icon ().
  3. Enter values in the following fields:
  • Action Name. Type a new name for your automation action.
  • Action State. Select Enabled.
  • Description. Type a description for your automation action.
  1. In the Input Parameters field, change the values of the following parameters:
  • credential_id. Set to 0: "credential_id":0,
  • url_override. Specify the URL of the webhook you created in step 1 for Microsoft Teams. When using the this parameter, the HTTP method used for the request is based on the presence of a value in the payload field:
  • If the field is empty, a GET request is made.
  • If there is a value in the field, a POST request is made, with the value sent as the request’s payload body. In this situation, the HTTP request will be made unauthenticated.
  • relative_url. Set to the default: "relative_url":"",
  • payload. As needed, change the value in this parameter to customize the message that appears in Microsoft Teams. You can substitute this field with any run book variables. For more information on run book variables, see Run Book Variables.
  • command_label. Type a label for your run book action that appears in the Event Actions Log.

  1. Click Save As.
  2. To create an automation policy for your newly created run book action, see Creating and Customizing Run Book Automation Policies. Be sure to add the new run book action to the Aligned Actions field.