cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
539
Views
1
Helpful
3
Replies

How to use POST /network-device/location

Nathan Sowatskey
Cisco Employee
Cisco Employee

Hi

The attached image shows the documentation for POST /network-device/location.

The documentation says that it "Associates the given location to the given device".

The actual argument is a NetworkDeviceNIO, not a given location or device.

I can't actually see a "location" field in the NetworkDeviceNIO. The closest is a "snmpLocation".

So, how is this API supposed to be used please?

Many thanks

Nathan

device_location.png

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

I agree this is confusing.  However, there is a "location" element in the NetworkDeviceNIO model.  So, let's say your location UUID is "d2b063ad-ea9b-43cd-8536-e68aa9d31c66".  Create a JSON body for the /network-device/location resource:

{

"id":"1153fb76-06dd-4c61-9aa6-739e3d4ab80f",

"location":"d2b063ad-ea9b-43cd-8536-e68aa9d31c66"

}

Here, id is the device's UUID and location is the location UUID obtained from GET /location.

Thank you Joe. I was just being blind, there is a “location” attribute, I just didn’t see it. It is between “type” and “id”.

In my, limited. defence, some of the field names are in bold, and some in grey, so they don’t stand out. As I squint harder, I think that the convention is that the required fields are in bold, and those that are optional are in grey.

Regards

Nathan

Yeah, the bold/grey is why I say it's a bit confusing.  For the location API, one would expect all I should be able to enter in the model is device ID and location ID.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:


This community is intended for developer topics around Data Center technology and products. If you are looking for a non-developer topic about Data Center, you might find additional information in the Data Center and Cloud community