Device Management API

/api/space/device-management/devices/{id}

The following operations are supported on this resource:

GET /api/space/device-management/devices/{id} (v1)


This API is used to retrieve information for a specified device. It retrieves the name, ID, and other important device attributes.

Access Control

The following capabilities are required to access this API:
"ReadDevices"


Example Usage

GET /api/space/device-management/devices/{id}


Parameters

NameTypeURI TypeDescriptionRequired
device-idIntegerPathThe ID of the device for which information will be retrieved. Y

Content Types

  • Produces content types:
    application/vnd.net.juniper.space.device-management.device+xml;version=1
    application/vnd.net.juniper.space.device-management.device+json;version=1


  • Sample Output XML:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <device uri="/api/space/device-management/devices/229377">
       <deviceFamily>junos-es</deviceFamily>
       <OSVersion>10.0R2.10</OSVersion>
       <platform>SRX100-LM</platform>
       <serialNumber>AT5109AF0621</serialNumber>
       <name>hsc-srx_100_lehar</name>
       <hostName>hsc-srx_100_lehar</hostName>
       <id>229377</id>
       <ipAddr>192.168.21.9</ipAddr>
       <change-requests uri="/api/space/device-management/devices/229377/change-requests">
       <change-request key="262186" href="/api/space/configuration-management/change-requests/262186">
          <deviceId>229377</deviceId>
          <name>TEST_NAME</name>
       </change-request>
       </change-requests>
       <managed-elements uri="/api/space/device-management/devices/229377/managed-elements">
          <managed-element key="262148" href="/api/space/managed-domain/managed-elements/262148">
             <ipAddr>192.168.21.9</ipAddr>
             <deviceId>229377</deviceId>
          </managed-element>
       </managed-elements>
       <managed-status uri="/api/space/device-management/devices/229377/managed-status">
           <status>In Sync</status>
       </managed-status>
       <connection-status uri="/api/space/device-management/devices/229377/connection-status">
           <status>up</status>
       </connection-status>
       <collection href="/api/space/device-management/devices/229377/configurations" rel="device configurations"/>
       <method href="/api/space/device-management/devices/229377/exec-rpc" rel="rpc"/>
       <method href="/api/space/device-management/devices/229377/synch-config" rel="synch device configuration"/>
    </device>


  • Sample Output JSON:

    {
    "device":
       {
          "@uri":"/api/space/device-management/devices/229377",
          "deviceFamily":"junos-es",
          "OSVersion":"10.0R2.10",
          "platform":"SRX100-LM",
          "serialNumber":"AT5109AF0621",
          "name":"hsc-srx_100_lehar",
          "hostName":"hsc-srx_100_lehar",
          "id":229377,"ipAddr":"192.168.21.9",
    "change-requests":
    {
    "@uri":"/api/space/device-management/devices/229377/change-requests",
    "change-request":
       {
       "@key":"262186",
       "@href":"/api/space/configuration-management/change-requests/262186",
       "deviceId":229377,
       "name":"TEST_NAME"
       }
    },
    "managed-elements":
       {
       "@uri":"/api/space/device-management/devices/229377/managed-elements",
       "managed-element":
       {
       "@key":"262148",
       "@href":"/api/space/managed-domain/managed-elements/262148",
       "ipAddr":"192.168.21.9",
       "deviceId":229377
       }
    },
    "managed-status":
       {
       "@uri":"/api/space/device-management/devices/229377/managed-status",
       "status":"In Sync"
       }
    },
    "connection-status":
       {
       "@uri":"/api/space/device-management/devices/229377/connection-status",
       "status":"up"
       }
    },
    "collection":
    {
       "@href":"/api/space/device-management/devices/229377/configurations",
       "@rel":"device configurations"},
    "method":
    [
    {
       "@href":"/api/space/device-management/devices/229377/exec-rpc",
       "@rel":"rpc"
    },
    {
       "@href":"/api/space/device-management/devices/229377/synch-config",
       "@rel":"synch device configuration"
    }
    ]
    }
    }
    }



DELETE /api/space/device-management/devices/{id} (v1)


This API is used to delete a device from the database.

Access Control

The following capabilities are required to access this API:
"DeleteDevice"


Example Usage

Since this API makes an asynchronous method call, the user must specify a queue parameter with this API.

DELETE /api/space/device-management/devices/{id}?queue-url=<queue-url>&schedule-time=<schedule-time>

Note: It is assumed that the queue denoted by <queue-url> has, already, been created.



Parameters

NameTypeURI TypeDescriptionRequired
device-idIntegerPathThe ID of the device to be removed from the database. Y
queue-urlURLQueryA fully qualified queue URL, where job progress notifications will be sent (See Asynchronous API Usage)Y
schedule-timecron-like-expressionQuerySchedule this API in the future, by specifying a cron-like-expression (See Job Scheduling)N

Content Types