Merge "Add available params in metering labels client's comment"

This commit is contained in:
Jenkins 2016-07-13 11:45:49 +00:00 committed by Gerrit Code Review
commit 98d97e1ac3

23
tempest/lib/services/network/metering_labels_client.py Normal file → Executable file
View File

@ -16,18 +16,41 @@ from tempest.lib.services.network import base
class MeteringLabelsClient(base.BaseNetworkClient): class MeteringLabelsClient(base.BaseNetworkClient):
def create_metering_label(self, **kwargs): def create_metering_label(self, **kwargs):
"""Creates an L3 metering label.
Available params: see http://developer.openstack.org/
api-ref-networking-v2-ext.html#
createMeteringLabel
"""
uri = '/metering/metering-labels' uri = '/metering/metering-labels'
post_data = {'metering_label': kwargs} post_data = {'metering_label': kwargs}
return self.create_resource(uri, post_data) return self.create_resource(uri, post_data)
def show_metering_label(self, metering_label_id, **fields): def show_metering_label(self, metering_label_id, **fields):
"""Shows details for a metering label.
Available params: see http://developer.openstack.org/
api-ref-networking-v2-ext.html#showMeteringLabel
"""
uri = '/metering/metering-labels/%s' % metering_label_id uri = '/metering/metering-labels/%s' % metering_label_id
return self.show_resource(uri, **fields) return self.show_resource(uri, **fields)
def delete_metering_label(self, metering_label_id): def delete_metering_label(self, metering_label_id):
"""Deletes an L3 metering label.
Available params: see http://developer.openstack.org/
api-ref-networking-v2-ext.html#
deleteMeteringLabel
"""
uri = '/metering/metering-labels/%s' % metering_label_id uri = '/metering/metering-labels/%s' % metering_label_id
return self.delete_resource(uri) return self.delete_resource(uri)
def list_metering_labels(self, **filters): def list_metering_labels(self, **filters):
"""Lists all L3 metering labels that belong to the tenant.
Available params: see http://developer.openstack.org/
api-ref-networking-v2-ext.html#
listMeteringLabels
"""
uri = '/metering/metering-labels' uri = '/metering/metering-labels'
return self.list_resources(uri, **filters) return self.list_resources(uri, **filters)