Tagging IP Addresses
IP Addresses/Subnets can be tagged with EAST_WEST/INTERNET tags with this API.
List All Available Tags
-
Following API returns all the available tags in system.
Request GET https://operations-for-networks.example.com/api/ni/ip-tags Response { "tag_ids": [ "INTERNET", "EAST_WEST" ] }
Add IP Address/Subnet to a Tag.
-
Use the following request to add a subnet or IP address (es) to a tag. In the following example,
Subnet and IP addresses are being tagged with EAST_WEST tag.
Request POST https://operations-for-networks.example.com/api/ni/settings/ip-tags/EAST_WEST/add Request Body { "tag_id": "EAST_WEST", "subnets": [ "192.168.10.0/24" ], "ip_address_ranges": [ { "start_ip": "192.168.20.1", "end_ip": "192.168.20.5" } ] } Response 200 OK.
Remove IP Address/Subnet from a Tag
-
Use the following request to remove the subnet or IP address (es) for a tag. In the following example,
IP address ranges (192.168.20.1-192.168.20.5) are being removed from EAST_WEST tag.
Request POST https://operations-for-networks.example.com/api/ni/settings/ip-tags/EAST_WEST/remove Request Body { "tag_id": "EAST_WEST", "ip_address_ranges": [ { "start_ip": "192.168.20.1", "end_ip": "192.168.20.5" } ] } Response 200 OK.
Get Tag Details
-
Use the following request to get tag details.
Request GET https://operations-for-networks.example.com/api/ni/settings/ip-tags/EAST_WEST Response { "tag_id": "EAST_WEST", "ip_address_ranges": [ { "start_ip": "192.168.20.1", "end_ip": "192.168.20.5" } ] }