Batch operations can be applied to servers across pools. Servers can be defined by any combination of the ip, port, hostname, and server_node fields.

The following operations are supported on the servers:

  • enable

  • disable

  • remove

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 want to remove all servers with ip 1.1.1.1 and all servers with 2.2.2.2:82, you can 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 existing in the system, this will 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 can be enabled or disabled using the same data with a POST to /api/server/enable or /api/server/disable