diff options
author | Ken'ichi Ohmichi <ken-oomichi@wx.jp.nec.com> | 2015-12-17 00:32:41 +0000 |
---|---|---|
committer | Ken'ichi Ohmichi <ken-oomichi@wx.jp.nec.com> | 2015-12-17 00:38:20 +0000 |
commit | 815c89a44d662e55b7533d180c31baceef1161aa (patch) | |
tree | 2415a99584ff52ef6d1442653aacafad59814427 /tempest_lib/services/network/networks_client.py | |
parent | a2b073d51e4710bb50374e5927be6149d6f64988 (diff) | |
download | tempest-lib-815c89a44d662e55b7533d180c31baceef1161aa.tar.gz |
Migrated 6 network clients from tempest
This migrates the above files from tempest.
This includes tempest commits:
* base.py : Icf9f6fa4ea52a1fe72253391abf4880b1f8ed497
* floating_ips_client.py : Iaeabf6cb827e4153d72353dab6d1d66f0f246eb6
* metering_label_rules_client.py: Iddecde5f6f5c1ac88a18d71aab1fc26370b26ba8
* metering_labels_client.py : I3364fc9320640b875f5232c2ae5a4ae98121d821
* networks_client.py : Iff82c07bae2b1c82e5ff914ca90fcf5fc7de8daa
* ports_client.py : I1248cc6132f4a2e40ad13f6177c7ecda834db57d
* subnets_client.py : I52c9d099b97540440fa98343c736b894d130a07e
to see the commit history for these files refer to the above Change-Ids
in the tempest repository.
Partially implements blueprint migrate-service-clients-to-tempest-lib
Change-Id: Ic840c3697f727612dfe754948e9a5890e7f2505d
Diffstat (limited to 'tempest_lib/services/network/networks_client.py')
-rw-r--r-- | tempest_lib/services/network/networks_client.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tempest_lib/services/network/networks_client.py b/tempest_lib/services/network/networks_client.py new file mode 100644 index 0000000..71699db --- /dev/null +++ b/tempest_lib/services/network/networks_client.py @@ -0,0 +1,38 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from tempest_lib.services.network import base + + +class NetworksClient(base.BaseNetworkClient): + + def create_network(self, **kwargs): + uri = '/networks' + post_data = {'network': kwargs} + return self.create_resource(uri, post_data) + + def update_network(self, network_id, **kwargs): + uri = '/networks/%s' % network_id + post_data = {'network': kwargs} + return self.update_resource(uri, post_data) + + def show_network(self, network_id, **fields): + uri = '/networks/%s' % network_id + return self.show_resource(uri, **fields) + + def delete_network(self, network_id): + uri = '/networks/%s' % network_id + return self.delete_resource(uri) + + def list_networks(self, **filters): + uri = '/networks' + return self.list_resources(uri, **filters) |