Forum Discussion
REST 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
2 Replies
- 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):HAcurl -sku : https:///mgmt/tm/cm/device-group/HA?expandSubcollections=true
is:tmsh show cm device-group HAcurl -sku : https:///mgmt/tm/cm/device-group/HA/stats
is:tmsh list cm device-group HA devicescurl -sku : https:///mgmt/tm/cm/device-group/HA?\$select=devicesReferenceTo remove the device-group
, you need to first remove the devices from the group:HA
is:tmsh modify cm device-group HA devices nonecurl -sku : https:///mgmt/tm/cm/device-group/HA \ -X PATCH -H "Content-type: application/json" \ -d '{"devicesReference": {"items": []}}'
is:tmsh delete cm device-group HAcurl -sku : https:///mgmt/tm/cm/device-group/HA -X DELETE
istmsh delete cm trust-domain allcurl -sku : https:///mgmt/tm/cm/trust-domain -X DELETE
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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