Skip to main content
Solved

Provisioning a Virtual Device in SL1 API

  • February 20, 2025
  • 1 reply
  • 0 views

Forum|alt.badge.img

We are building an app that will have a component to build a virtual device, align a dynamic app and a credential to it using the SL1 API.  Looking for some guidance on how to do this as we have never done anything with device creation through the API, only /alerts creation.

Best answer by TonyAndres

Hello Rob,

You can POST to /api/device, only filling out the specific fields and using a device class for virtual devices. An example payload is:

{
  "name": "Example Virtual Device",
  "class_type": "/api/device_class/<virtual device class ID>",
  "collector_group": "/api/collector_group/1",
  "organization": "/api/organization/0"

Replacing <virtual device class ID> with the ID of the virtual device class you want.

Antonio Andres

Senior Technical Support Engineer | ScienceLogic

1 reply

Forum|alt.badge.img

Creating a virtual device can be don pretty easily:

mutation { 
    createVirtualDevice (
      name: "test_1"
      organization: 35
      collectorGroup: 1
      deviceClass: "E4DC4FF34FEF1144051B1F2B103970F7"
    ) {
      id
    } 
  }

Though you have first to find the organization ID and deviceClass GUID

Quite similarly you can create credentials also with GQL there are mutations for that, for example createSoapCredential, createSshCredential etc

Then just align the DA with updateDeviceAlignedDynamicApplication mutation request