API - Batch Pool Server Operations

Beginning in Avi Vantage 17.2.4, batch operations can be applied to servers across pools as described in this article.

Avi Vantage 17.2.4 supports the following operations on servers:

  • enable
  • disable
  • remove

Servers can be defined by any combination of the ip, port, hostname, and server_node fields. The servers to be operated on are provided as request data to the following endpoints:

/api/server/enable
/api/server/disable
/api/server/remove

Examples

If you wanted to remove all servers with ip 1.1.1.1 and all servers with 2.2.2.2:82 you could use the following request:


POST /api/server/remove
{
	"servers": [
		{'ip': {'addr': '1.1.1.1', 'type': 'V4'}},
		{'ip': {'addr': '2.2.2.2', 'type': 'V4'},
		 'port': 82 }
	]
}

With the following pool objects exist in the system, this would translate to a removal of the first server in p1 and p2 because they both have the same ip as 1.1.1.1, and the second server in p2 because it is the only one with 2.2.2.2:82:


{
	"name": "p1",
	"servers": [
		{'ip': {'addr': '1.1.1.1', 'type': 'V4'},
		 'port': 81 },
		{'ip': {'addr': '2.2.2.2', 'type': 'V4'},
		 'port': 81 }
	]
}

{
	"name": "p2",
	"servers": [
		{'ip': {'addr': '1.1.1.1', 'type': 'V4'},
		 'port': 81 },
		{'ip': {'addr': '2.2.2.2', 'type': 'V4'},
		 'port': 82 }
	]
}

The same servers could be enabled or disabled using the same data with a POST to /api/server/enable or /api/server/disable