Add bulk methods to network service clients
The tempest network_client still contains some bulk methods, but they should be implemented on each resource client. This patch addes them into each client. After this patch and a new tempest-lib release, we can remove these bulk methods from Tempest. Partially implements blueprint consistent-service-method-names Change-Id: Iea34620ae8785cc593d9c68bf3c31840f3e79bd7
This commit is contained in:
parent
5e02b7844b
commit
d598f35ad9
|
@ -36,3 +36,12 @@ class NetworksClient(base.BaseNetworkClient):
|
|||
def list_networks(self, **filters):
|
||||
uri = '/networks'
|
||||
return self.list_resources(uri, **filters)
|
||||
|
||||
def create_bulk_networks(self, **kwargs):
|
||||
"""Create multiple networks in a single request.
|
||||
|
||||
Available params: see http://developer.openstack.org/
|
||||
api-ref-networking-v2.html#bulkCreateNetwork
|
||||
"""
|
||||
uri = '/networks'
|
||||
return self.create_resource(uri, kwargs)
|
||||
|
|
|
@ -36,3 +36,12 @@ class PortsClient(base.BaseNetworkClient):
|
|||
def list_ports(self, **filters):
|
||||
uri = '/ports'
|
||||
return self.list_resources(uri, **filters)
|
||||
|
||||
def create_bulk_ports(self, **kwargs):
|
||||
"""Create multiple ports in a single request.
|
||||
|
||||
Available params: see http://developer.openstack.org/
|
||||
api-ref-networking-v2.html#bulkCreatePorts
|
||||
"""
|
||||
uri = '/ports'
|
||||
return self.create_resource(uri, kwargs)
|
||||
|
|
|
@ -36,3 +36,12 @@ class SubnetsClient(base.BaseNetworkClient):
|
|||
def list_subnets(self, **filters):
|
||||
uri = '/subnets'
|
||||
return self.list_resources(uri, **filters)
|
||||
|
||||
def create_bulk_subnets(self, **kwargs):
|
||||
"""Create multiple subnets in a single request.
|
||||
|
||||
Available params: see http://developer.openstack.org/
|
||||
api-ref-networking-v2.html#bulkCreateSubnet
|
||||
"""
|
||||
uri = '/subnets'
|
||||
return self.create_resource(uri, kwargs)
|
||||
|
|
Loading…
Reference in New Issue