
Getting the configuration of a specific region using curl
This
GET
command retrieves the configuration of the specified region. The regions configuration
may have been modified since controller startup to reflect the dynamic addition or removal of
regions or devices within specific regions.
In this example, there were no changes to the region of interest since controller startup and the
configuration is the same is in
“Adding a region using curl” (page 192)
Example command
curl --noproxy
teamIp
--header "X-Auth-Token:
token
"
-ksS
--request
GET
--url
https://
teamIp
:8443/sdn/v2.0/owners/
region_uid
Example output
{
"region":{
"uid":"713def9a-4f96-485f-990c-8924bc06c8d8",
"name":"Region-Red",
"prioritizedControllerIps":[
"172.17.6.70",
"172.17.6.71",
"172.17.6.72"
],
"deviceIps":[
"192.168.1.101",
"192.168.1.102"
],
"deviceIpRanges":[
"192.168.1.103-105"
]
}
}
Determining whether or not a controller owns a specific device using curl
This
HEAD
command returns a status (essentially a Boolean value) indicating whether the local
controller owns the device corresponding to the specified IP address; this is decided based on
the controller's locally cached data, which is guaranteed to be consistent with the receipt of
DeviceOwnerEvents
events. You must specify the
deviceIp
query parameter. The command
returns one of the following status:
•
204
: The local controller owns the device.
•
404
: The local controller does not own the device.
Example command
curl --noproxy
controllerIp
-X HEAD --header "X-Auth-Token:
token
" -IL --insecure --url
https://
controllerIp
:8443/sdn/v2.0/owners?deviceIp=192.168.1.102
Example output
HTTP/1.1 204 No Content
Server: Apache-Coyote/1.1
X-FRAME-OPTIONS: deny
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, HEAD, PATCH
Access-Control-Allow-Headers: Content-Type, Accept, X-Auth-Token
Date: Wed, 11 Mar 2015 18:34:07 GMT
Getting the owning controller and devices for a region using curl
This
GET
command retrieves the devices in the region with the specified UID that the specified
controller currently owns. You can use an optional
controllerIp
parameter to specify the
controller IP address of interest; if no such address is specified, the local controller IP is used.
194
curl commands