ServiceNow REST Client
5 minute read
Pluggable Module Name is ServiceNow REST Client
Feature highlights
- Create flexible ServiceNow REST Client calls with OneFuse.
- JSON Data can consist of a mix of static text and dynamic content such as properties and/or custom logic.
Prerequisites
- Create a OneFuse Service Account for the ServiceNow instances used for ServiceNow REST Client.
- Create ServiceNow Scripted REST APIs.
- If the OneFuse Appliance does not have an internet connection, follow the instructions in the section below.
OneFuse Appliance without internet connection
Perform the following only if the OneFuse Appliance does not have an internet connection.
Offline setup overview
- SSH to the OneFuse Appliance.
- Verify that Python and
pipare installed. - Perform
pipinstalls.
Verify Python and pip
Identify a system to run the Python commands from. This can be your desktop or a server in your environment. Python 3 or greater must be installed on the system.
-
Verify that Python is installed.
Python 2 has sunset. If Python 2 is installed, upgrade to the latest Python version.
If Python is not installed, or if you are upgrading, download the latest Python from python.org.
-
Verify that
pipis installed. If it is not, install pip. -
Review Python’s Installing Packages documentation.
Install the OneFuse Python Package
The OneFuse Python Module is distributed as a Python Package. Install it using pip.
It is recommended to install the latest OneFuse Python Package that matches the OneFuse Appliance version.
If the OneFuse Python Module is already installed, skip to Upgrade the OneFuse Python Package.
- Open a Command Prompt or Terminal window.
- Install the OneFuse Python Package:
-
Option 1, install the latest version: Run
pip install onefuse. -
Option 2, install a specific version: Optionally, list available versions first. Then, install with a specific version:
# Replace <version> in the command below with a specific version number (e.g. 1.4.0) # Run the following in a Command Prompt/Terminal pip install onefuse==<version> # An output message similar to the below is returned, where <version> is replaced with the version number installed: # ~Successfully installed onefuse-<version>
-
Upgrade the OneFuse Python Package
Upgrade to the latest OneFuse Python Package using pip.
- Open a Command Prompt or Terminal window.
- Run
pip install --upgrade onefuse.
Setup overview
- Download the Pluggable Module.
- Upload the Pluggable Module.
- Create a Connection info.
- Create the Module Policy.
- Consume the Pluggable Module with an upstream provider.
Download the OneFuse Pluggable Module
Access the CloudBolt Download Article for CMP/OneFuse 2023.5. The article always contains the latest Pluggable Module ZIP folder(s).
- Log in with your CloudBolt Connect account.
- Download the OneFuse Pluggable Module ZIP folder.
Upload the module to OneFuse
For first-time uploads and upgrades:
- Log in to the OneFuse UI with an account that has the OneFuse Super Admin Global role.
- Select the wrench icon on the top left of the Top App Bar to access the Super Admin UI.
- Select Pluggable Modules.
- Select Upload on the top right of the Pluggable Module Management datatable.
- Select Module File (.zip) to select the latest Pluggable Module ZIP folder.
- Select Upload.
- Upon successful upload, you are redirected to the Pluggable Module Management datatable where the newly uploaded module is listed.
Create Connection Info
Create and manage Connection Info for the Pluggable Module Endpoint.
| Field | Description |
|---|---|
| Connection Name | Name of the Connection Info. In the sample payloads, servicenow_user_connection_info is set to ServiceNow_Rest and servicenow_oauth_connection_info is set to ServiceNow_Rest_oauth. Replace these values with the name of your Connection Info. |
| Protocol | Select HTTPS. |
| Connection Host | ServiceNow instance, for example myservicenow.service-now.com. |
| Port | Enter 443. |
| Authentication Type | Select Basic. |
| Username/Password | Credentials for the OneFuse Service Account in ServiceNow. If utilizing OAuth: enter the OAuth Token as the Username and the OAuth Secret Key as the Password. |
If utilizing OAuth with ServiceNow, two Connection Info entries are required:
- A Connection Info with Basic Authentication credentials to ServiceNow (OneFuse Service Account).
- A Connection Info with OAuth credentials where Username is the OAuth Token and Password is the OAuth Secret Key.
Access Module Policies
- Log in to the OneFuse UI.
- In the Workspace, select Module > ServiceNow REST Client (under the Pluggable section) from the left navigation menu.
This area displays all active Module Policies and Deployments. Perform the following from the Actions column:
| Action | Workspace role(s) |
|---|---|
| View | Admins, Members, or Viewers |
| Edit | Admins or Members |
| Delete | Admins or Members |
Manage Pluggable Module Policies
Once the Pluggable Module is uploaded by a OneFuse Super Admin, you can manage Pluggable Module Policies. Create a Connection info to the Pluggable Module’s Endpoint when applicable.
Module Policy form fields:
| Field | Description |
|---|---|
| Module Policy Name | Enter a name for this Module Policy. |
| Description | Optional description for this Module Policy. |
| Policy Parameters | Provide provisioning and deprovisioning scenarios. Refer to Sample payloads for examples. |
| Day2 Action Parameters | Optional. Provide Day2 Action parameters. |
Create a Module Policy:
- Access Module Policies.
- Select Create on the top right of the ServiceNow REST Client Policies datatable.
- Fill out the Module Policy form. Refer to Sample payloads for Policy Parameters examples.
- Enter Policy Parameters for provisioning and/or deprovisioning scenarios.
- Select Create.
Update a Module Policy:
- Access Module Policies.
- Find the Module Policy to update and select the edit icon.
- Edit the information on the Module Policy form.
- Select Update.
Delete a Module Policy:
Module Policies cannot be deleted if they are associated to a OneFuse Module Deployment.
- Access Module Policies.
- Find the Module Policy and select the delete icon.
- Select Delete to confirm.
Sample payloads
See Sample payloads for ServiceNow REST Client policy parameter examples, including optional OAuth parameters.
Consume with an upstream provider
The ServiceNow REST Client module can be consumed via:
- OneFuse API
- Ansible
- Python
- Terraform
- VMware Aria Automation 7.6 and/or 8.1+/Cloud