Add delete_agent to NetworkClientJSON

This patchset add delete_agent method that implements respective API [1]

[1] https://developer.openstack.org/api-ref/network/v2/index.html#delete-agent

Change-Id: I0f4927944cb48a19eb8cdff5312557b3ba044420
Closes-Bug: 1792007
This commit is contained in:
Mykola Yakovliev 2018-09-12 09:26:39 -05:00
parent e80584e81b
commit 299c4bd450
2 changed files with 13 additions and 0 deletions

View File

@ -461,6 +461,12 @@ class NetworkClientJSON(service_client.RestClient):
body = jsonutils.loads(body)
return service_client.ResponseBody(resp, body)
def delete_agent(self, agent_id):
uri = '%s/agents/%s' % (self.uri_prefix, agent_id)
resp, body = self.delete(uri)
self.expected_success(204, resp.status)
return service_client.ResponseBody(resp, body)
def list_routers_on_l3_agent(self, agent_id):
uri = '%s/agents/%s/l3-routers' % (self.uri_prefix, agent_id)
resp, body = self.get(uri)

View File

@ -0,0 +1,7 @@
---
features:
- |
Added a new method ``delete_agent`` to the AgentsClient class that
implements agent deletion according to the neutron API.
https://developer.openstack.org/api-ref/network/v2/index.html#delete-agent