Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Modify a Device Group

    Use this API to modify a device group.

    URI

    https://[host]/api/juniper/servicenow/device-group-management/deviceGroup/ {id}/modifyDeviceGroup (HTTP method = PUT)

    URI Parameters

    Parameter

    Type

    Required

    Description

    id

    Integer

    Yes

    ID of the device group to be modified

    Consumes

    • application/vnd.juniper.servicenow.device-group-management.modifydevicegroup +xml;version=1
    • application/vnd.juniper.servicenow.device-group-management.modifydevicegroup +json;version=1

    Request Elements

    Element

    Type

    Description

    defaultDeviceGroup

    Boolean

    Flag to specify if the device group is the default device group in Junos Space Service Now

    Possible values

    • true—Device group is the default device group
    • false—Device group is not the default device group

    devices

    devices

    Collection of devices in the device group

    newDevice

    device

    Collection of devices to be added to the device group

    device

    device

    A device

    uri

    String

    URI of the device

    href

    String

    Link to the device

    removeDevice

    device

    Collection of devices to be removed from the device group

    uri

    String

    URI of the device

    href

    String

    Link to the device

    organization

    String

    Organization to which the device group is assigned

    uri

    String

    URI of the organization

    href

    String

    Link to the organization

    Produces

    • application/vnd.juniper.servicenow.device-group-management.modifydevicegroup. servicenowmsg+xml;version=1
    • application/vnd.juniper.servicenow.device-group-management.modifydevicegroup. servicenowmsg+json;version=1

    Response Elements

    Element

    Type

    Description

    msg

    String

    Status message of the modify device group job

    Sample Input

    Sample XML Input

    <modifyDeviceGroup>
    <defaultDeviceGroup>true</defaultDeviceGroup>
    <devices>
    <newDevice>
    <device href="/api/juniper/servicenow/device-management/devices/34639"  uri="/api/juniper/servicenow/device-management/devices/34639" />
    </newDevice>
    <removeDevice>
    <device href="/api/juniper/servicenow/device-management/devices/34641"  uri="/api/juniper/servicenow/device-management/devices/34641" />
    <device href="/api/juniper/servicenow/device-management/devices/34813"  uri="/api/juniper/servicenow/device-management/devices/34813" />
    </removeDevice>
    </devices>
    <organization  href="/api/juniper/servicenow/organization-management/organization/34635" uri="/api/juniper/servicenow/organization-management/organization/34635" />
    </modifyDeviceGroup>
    

    Sample JSON Input

    {
      "modifyDeviceGroup": {
        "defaultDeviceGroup": "true",
        "devices": {
          "newDevice": {
            "device": {
              "@href": "/api/juniper/servicenow/device-management/devices/34639",
              "@uri": "/api/juniper/servicenow/device-management/devices/34639"
            }
          },
          "removeDevice": {
            "device": [
              {
                "@href": "/api/juniper/servicenow/device-management/devices/34641",
                "@uri": "/api/juniper/servicenow/device-management/devices/34641"
              },
              {
                "@href": "/api/juniper/servicenow/device-management/devices/34813",
                "@uri": "/api/juniper/servicenow/device-management/devices/34813"
              }
            ]
          }
        },
        "organization": {
          "@href": "/api/juniper/servicenow/organization-management/organization/34635",
          "@uri": "/api/juniper/servicenow/organization-management/organization/34635"
        }
      }
    } 
    

    Sample Output

    Sample XML Output

    <servicenowmsg>
    <msg>Device Group modified successfully</msg>
    </servicenowmsg>
    

    Sample JSON Output

    {
      "servicenowmsg": { "msg": "Device Group modified successfully" }
    } 
    

    Modified: 2016-08-11