- Sciencelogic em7 experience python software#
- Sciencelogic em7 experience python code#
- Sciencelogic em7 experience python license#
- Sciencelogic em7 experience python free#
the variable is not None or an empty string). The variable that contains the asset location for the device that triggered the automation ( EM7_VALUES) is evaluated to ensure a valid location value is set (i.e. EM7_ACTION_CRED is a dictionary) and that the credential is the expected type (SOAP/XML). The credential associated with the automation action ( EM7_ACTION_CRED) is evaluated to ensure a credential is aligned (i.e. The necessary Python modules (requests and JSON) are imported. (json.dumps(response.json(),indent=2).replace("\n","").replace(" ", " "),)ĮM7_RESULT = "Automation Action Error: Non-2XX status code: %s returned from request to URL %s" %ĮM7_RESULT = "Automation Action Error: No location specified in asset record"ĮM7_RESULT = "Automation Action Error: SOAP/XML credential not aligned to action" If response.status_code Weather Report:%s" % Response = requests.get(uri, timeout=EM7_ACTION_CRED)Įxcept as e:ĮM7_RESULT = "Automation Action Error: Failed request for URL: %s Exception information: %s" % (url, e) If EM7_VALUES != "" and EM7_VALUES is not None:
If type(EM7_ACTION_CRED) = dict and EM7_ACTION_CRED = 3: The following snippet code is used in this example and is explained in the section below: The snippet action uses the asset location of the device associated with the triggering event, which is provided as a variable to the snippet code.
Sciencelogic em7 experience python license#
See the End User License Agreement (EULA) for more information. There is no written or implied guarantee that information contained herein will work for all third-party variants. ScienceLogic makes every attempt to maintain accurate technical information and cannot be held responsible for defects or changes in third-party vendor software.
Sciencelogic em7 experience python software#
Some of the configuration information contained herein pertains to third-party vendor software that is subject to change without notice to ScienceLogic. ScienceLogic provides this documentation for the convenience of ScienceLogic customers. The documentation for all available APIs and a link to sign up for an API key are available at the link below: The documentation for the API that provides current weather data is available at the link below:
Sciencelogic em7 experience python free#
To use the example code, you must request a free API key to include in the credential associated with the snippet action. This example uses OpenWeatherMap, a public API, to request a current weather report. The documentation for the library is available at the link below: Snippet code uses the third-party Python Requests library, which is installed on SL1 Database Server and Data Collector appliances, to perform an HTTP request. This example covers the following topics: Weather Report: Snippet Design A test automation policy that triggers the snippet action and adds the output to an existing SL1 ticket.