Forum Discussion
Vish_378264
Nimbostratus
Dec 03, 2018REST API examples related to devices, devicegroups and trust domain
Looking for links that shows REST API usage for the below with example POST bodies and correct usage
- Check for a device group (https://{{ server_ip }}:{{ device_port }}/mgmt/tm/cm/device-group/ ?)
- Check for devices in a device group ( https://{{ server_ip }}:{{ device_port }}/mgmt/tm/cm/device-group/{{DeviceGroupName}}/devices ?)
- Delete a device group ( https://{{server_ip }}:{{ device_port }}/mgmt/tm/cm/device-group/{{DeviceGroupName}} ?)
- Remove from trust domain (https://{{server_ip }}:{{ device_port }}/mgmt/tm/cm/remove-from-trust/{{ instance_name }}?)
Appreciate any guidance with the above, Thanks in advance
- Vish_378264
Nimbostratus
I got the below response from @tar on F5CloudSolutions slack channel
tar [4:25 PM]@Vish
1 https://github.com/F5Networks/f5-ansible/blob/devel/library/modules/bigip_device_group.pyL464library/modules/bigip_device_group.py:464
F5Networks/f5-ansibleAdded by GitHub 2 https://github.com/F5Networks/f5-ansible/blob/devel/library/modules/bigip_device_group_member.pyL213def exists(self):
library/modules/bigip_device_group_member.py:213
F5Networks/f5-ansibleAdded by GitHub 3 https://github.com/F5Networks/f5-ansible/blob/devel/library/modules/bigip_device_group.pyL544def exists(self):
library/modules/bigip_device_group.py:544
F5Networks/f5-ansibleAdded by GitHub 4 https://github.com/F5Networks/f5-ansible/blob/devel/library/modules/bigip_device_trust.pyL313def remove_from_device(self):
library/modules/bigip_device_trust.py:313
F5Networks/f5-ansibleAdded by GitHubdef remove_from_device(self):
- Satoshi_Toyosa1Ret. Employee
For those who wants to see straight curl command examples:
equivalent is (wheretmsh list cm device-group HA
is the device-group name):HA
curl -sku : https:///mgmt/tm/cm/device-group/HA?expandSubcollections=true
is:tmsh show cm device-group HA
curl -sku : https:///mgmt/tm/cm/device-group/HA/stats
is:tmsh list cm device-group HA devices
curl -sku : https:///mgmt/tm/cm/device-group/HA?\$select=devicesReference
To remove the device-group
, you need to first remove the devices from the group:HA
is:tmsh modify cm device-group HA devices none
curl -sku : https:///mgmt/tm/cm/device-group/HA \ -X PATCH -H "Content-type: application/json" \ -d '{"devicesReference": {"items": []}}'
is:tmsh delete cm device-group HA
curl -sku : https:///mgmt/tm/cm/device-group/HA -X DELETE
istmsh delete cm trust-domain all
curl -sku : https:///mgmt/tm/cm/trust-domain -X DELETE
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