06-27-2017 10:03 PM - edited 03-01-2019 03:54 AM
Is there an API to fetch the device platform details using REST API?
Tried this API http://10.126.78.221:8080/api/config/devices/device/mydevice2
but platform details are not returned though visible in the NSO UI (Attached).
Got this response:
<device xmlns="http://tail-f.com/ns/ncs" xmlns:y="http://tail-f.com/ns/rest" xmlns:ncs="http://tail-f.com/ns/ncs">
<name>mydevice2</name>
<address>172.20.70.66</address>
<port>22</port>
<ssh>
<host-key>
<algorithm>ssh-rsa</algorithm>
</host-key>
<y:operations>
<fetch-host-keys>/api/config/devices/device/mydevice2/ssh/_operations/fetch-host-keys</fetch-host-keys>
</y:operations>
</ssh>
<authgroup>mycisco</authgroup>
<device-type>
<cli/>
</device-type>
<ned-settings>
<use-validate>false</use-validate>
<use-startup>true</use-startup>
</ned-settings>
<live-status-protocol>
<name>test</name>
</live-status-protocol>
<state>
<admin-state>unlocked</admin-state>
</state>
<config>
<EXEC xmlns="urn:ios">
<y:operations>
<default>/api/config/devices/device/mydevice2/config/ios:EXEC/_operations/default</default>
<exec>/api/config/devices/device/mydevice2/config/ios:EXEC/_operations/exec</exec>
</y:operations>
</EXEC>
</config>
<netconf-notifications>
<received-notifications>
<y:operations>
<clear>/api/config/devices/device/mydevice2/netconf-notifications/received-notifications/_operations/clear</clear>
</y:operations>
</received-notifications>
</netconf-notifications>
<y:operations>
<copy-capabilities>/api/config/devices/device/mydevice2/_operations/copy-capabilities</copy-capabilities>
<find-capabilities>/api/config/devices/device/mydevice2/_operations/find-capabilities</find-capabilities>
<add-capability>/api/config/devices/device/mydevice2/_operations/add-capability</add-capability>
<apply-template>/api/config/devices/device/mydevice2/_operations/apply-template</apply-template>
<instantiate-from-other-device>/api/config/devices/device/mydevice2/_operations/instantiate-from-other-device</instantiate-from-other-device>
<compare-config>/api/config/devices/device/mydevice2/_operations/compare-config</compare-config>
<sync-from>/api/config/devices/device/mydevice2/_operations/sync-from</sync-from>
<sync-to>/api/config/devices/device/mydevice2/_operations/sync-to</sync-to>
<check-sync>/api/config/devices/device/mydevice2/_operations/check-sync</check-sync>
<check-yang-modules>/api/config/devices/device/mydevice2/_operations/check-yang-modules</check-yang-modules>
<connect>/api/config/devices/device/mydevice2/_operations/connect</connect>
<disconnect>/api/config/devices/device/mydevice2/_operations/disconnect</disconnect>
<ping>/api/config/devices/device/mydevice2/_operations/ping</ping>
<delete-config>/api/config/devices/device/mydevice2/_operations/delete-config</delete-config>
<scp-to>/api/config/devices/device/mydevice2/_operations/scp-to</scp-to>
<scp-from>/api/config/devices/device/mydevice2/_operations/scp-from</scp-from>
</y:operations>
</device>
Solved! Go to Solution.
06-27-2017 10:21 PM
Hi!
platform is an operational data.
Please refer my test result below.
$ curl http://localhost:8080/api/operational/devices/device/csr1kv/platform -u admin:admin
<platform xmlns="http://tail-f.com/ns/ncs" xmlns:y="http://tail-f.com/ns/rest" xmlns:ncs="http://tail-f.com/ns/ncs">
<name>ios-xe</name>
<version>15.4(3)S4</version>
<model>CSR1000V</model>
</platform>
$
06-27-2017 10:21 PM
Hi!
platform is an operational data.
Please refer my test result below.
$ curl http://localhost:8080/api/operational/devices/device/csr1kv/platform -u admin:admin
<platform xmlns="http://tail-f.com/ns/ncs" xmlns:y="http://tail-f.com/ns/rest" xmlns:ncs="http://tail-f.com/ns/ncs">
<name>ios-xe</name>
<version>15.4(3)S4</version>
<model>CSR1000V</model>
</platform>
$
06-27-2017 10:34 PM
Thanks. It works.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide