Forum Discussion
martek_58308
Aug 03, 2016Nimbostratus
REST - setSyncLeader in device-group
Hi guys,
Need a help with another bit of REST config - bellow is TMSH command to do this
modify cm device-group DEVICE_GROUP_NAME devices modify { DEVICE_NAME { set-sync-leader } }
a...
- Aug 03, 2016
Terse answer.. I am typing on phone traveling..
You woukd not use POST in the device group as you are working with an existing group, not creating one.
I believe you want to use the PATCH verb on the full devicegroup / devices / device URL.
tatmotiv
Aug 04, 2016Cirrostratus
I'm doing the same in a shell script using PUT as http method. Maybe the snippet will help you:
lb=my_bigip_fqdn
dg=device_group_name
lb_commit() {
local lb_name=$1
local rest_object_path=$2
local http_uri=/mgmt/tm"$rest_object_path"
local http_method=$3
local json_data=$4
echo $(curl --insecure -1 -sk -u admin:$adminpw https://$lb_name$http_uri -H 'Content-Type: application/json' -X $http_method -d "$json_data")
}
result=$(lb_commit $lb /cm/device-group/~Common~$dg/devices/$lb/ PUT "{\"set-sync-leader\":true}")
echo $result
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects