What is the REST API Command to Display All Members of an Address Group?
14608
Created On 09/26/18 13:51 PM - Last Modified 06/12/23 08:41 AM
Resolution
Follow the steps below to display the members of an address group though the REST API:
- Generate the API key
https://x.x.x.x/api/?type=keygen&user=admin&password=admin
<response status="success">
- <result>
<key>LUFRPT14MW5xOEo1R09KVlBZNnpnemh0VHRBOWl6TGM9bXcwM3JHUGVhRlNiY0dCR0srNERUQT09</key>
</result>
</response>
- Displaying the members of an address group
https://x.x.x.x/api/?type=config&action=get&xpath=/config/devices/entry[@name='localhost.localdomain']/vsys/entry[@name='vsys1']/address-group/entry[@name='test']&key=LUFRPT14MW5xOEo1R09KVlBZNnpnemh0VHRBOWl6TGM9bXcwM3JHUGVhRlNiY0dCR0srNERUQT09
Note: 'test' is name of the address group
<response status="success" code="19">
<result total-count="1" count="1">
<entry name="test">
<member>1.1.1.1</member>
<member>2.2.2.2</member>
</entry>
</result>
</response>
Note: 1.1.1.1 and 2.2.2.2 are address object names)
owner: saryan