Get All Devices in Service Now
Use this API to retrieve information about all the devices in Junos Space Service Now.
URI
https://[host]/api/juniper/servicenow/device-management/devices (HTTP method = GET)
Consumes
None
Produces
application/vnd.juniper.servicenow.device-management.devices+xml;version=7
application/vnd.juniper.servicenow.device-management.devices+json;version=7
Response Elements
Element | Type | Description |
---|---|---|
uri | String | URI to the collection of devices in Service Now |
size | Integer | Number of records in the collection |
device | device | A device in Service Now |
uri | String | URI to the device |
key | Integer | ID of the device |
hostName | String | Hostname of the device |
serialNumber | String | Serial number of the device |
product | String | Product name of the device |
softwareRelease | String | Release number of the software installed on the device |
osPlatform | String | Operating system installed on the device |
deviceFamily | String | Device family to which the device belongs, such as M Series |
shipToAddress | String | Ship-to address of the device; for example, the address of the company to which the replacement part of a router should be shipped. |
ipAddr | String | IP address of the device |
organizationName | String | Name of the organization with which the device is associated |
deviceGroupName | String | Name of the device group with which the device is associated |
domain-id | Integer | ID of the Junos Space domain to which the device belongs |
domain-name | String | Name of the Junos Space domain to which the device belongs |
messages | messages | Error messages generated on the device; for example, error while deleting JMB files from the device after copying the JMB files to Service Now |
Sample Output
Sample XML Output
<devices uri="/api/juniper/servicenow/device-management/devices/" size="1"> <device href="/api/juniper/servicenow/device-management/devices/4325412" uri="/api/juniper/servicenow/device-management/devices/4325412" key="4325412"> <hostName>mx-480-sn1</hostName> <serialNumber>JN11AFF42AFB</serialNumber> <product>MX480</product> <softwareRelease>13.2R2</softwareRelease> <osPlatform>junos</osPlatform> <deviceFamily>junos</deviceFamily> <ipAddr>192.0.2.125</ipAddr> <organizationName>test</organizationName> <deviceGroupName>Default for test</deviceGroupName> <domain-id>3</domain-id> <domain-name>Global</domain-name> <messages> <warningMessages> <warningMessage> <message>This device will be exposed to known issues with the selected Event Profile to be installed. Click the link in Exposure column to view the Exposure.</message> </warningMessage> <warningMessage> <message>There is a mismatch of AI Scripts installed on 're1', 're0' of device mx-480-sn1</message> </warningMessage> <warningMessage> <message>One or more files (JMB/Attachments/Logs) could not be deleted from the device.</message> </warningMessage> </warningMessages> </messages> </device> </devices>
Sample JSON Output
{ "devices": { "@uri": "/api/juniper/servicenow/device-management/devices/", "@size": "1", "device": { "@href": "/api/juniper/servicenow/device-management/devices/4325412", "@uri": "/api/juniper/servicenow/device-management/devices/4325412", "@key": "4325412", "hostName": "mx-480-sn1", "serialNumber": "JN11AFF42AFB", "product": "MX480", "softwareRelease": "13.2R2", "osPlatform": "junos", "deviceFamily": "junos", "ipAddr": "192.0.2.125", "organizationName": "test", "deviceGroupName": "Default for test", "domain-id": 3, "domain-name": "Global", "messages": { "warningMessages": { "warningMessage": [ { "message": "This device will be exposed to known issues with the selected Event Profile to be installed. Click the link in Exposure column to view the Exposure." }, { "message": "There is a mismatch of AI Scripts installed on 're1', 're0' of device mx-480-sn1" }, { "message": "One or more files (JMB/Attachments/Logs) could not be deleted from the device." } ] } } } } }
Response Status Code
Message | Description |
---|---|
204 No Content | No devices found |