How to use set_qos_key method in tempest

Best Python code snippet using tempest_python

test_qos_rbac.py

Source:test_qos_rbac.py Github

copy

Full Screen

...72 self.qos_client.list_qos()['qos_specs']73 @rbac_rule_validation.action(74 service="cinder", rules=["volume_extension:qos_specs_manage:update"])75 @decorators.idempotent_id('89b630b7-c170-47c3-ac80-50ed425c2d98')76 def test_set_qos_key(self):77 qos = self._create_test_qos_specs()78 with self.override_role():79 self.qos_client.set_qos_key(80 qos['id'], iops_bytes='500')['qos_specs']81 @rbac_rule_validation.action(82 service="cinder", rules=["volume_extension:qos_specs_manage:update"])83 @decorators.idempotent_id('6c50c837-de77-4dae-a2ec-30e05c62969c')84 def test_unset_qos_key(self):85 qos = self._create_test_qos_specs()86 self.qos_client.set_qos_key(qos['id'], iops_bytes='500')['qos_specs']87 with self.override_role():88 self.qos_client.unset_qos_key(qos['id'], ['iops_bytes'])89 waiters.wait_for_qos_operations(self.qos_client, qos['id'],90 'qos-key-unset', args=['iops_bytes'])91 @rbac_rule_validation.action(92 service="cinder", rules=["volume_extension:qos_specs_manage:update"])93 @decorators.idempotent_id('2047b347-8bbe-405e-bf5a-c75a0d7e3930')94 def test_associate_qos(self):95 qos = self._create_test_qos_specs()96 vol_type = self.create_volume_type()['id']97 with self.override_role():98 self.qos_client.associate_qos(qos['id'], vol_type)99 self.addCleanup(100 test_utils.call_and_ignore_notfound_exc,101 self.qos_client.disassociate_qos, qos['id'], vol_type)102 @rbac_rule_validation.action(...

Full Screen

Full Screen

qos_client.py

Source:qos_client.py Github

copy

Full Screen

...59 resp, body = self.get(url)60 body = json.loads(body)61 self.validate_response(schema.show_qos, resp, body)62 return rest_client.ResponseBody(resp, body)63 def set_qos_key(self, qos_id, **kwargs):64 """Set the specified keys/values of QoS specification.65 For a full list of available parameters, please refer to the official66 API reference:67 https://docs.openstack.org/api-ref/block-storage/v3/index.html#set-keys-in-a-qos-specification68 """69 put_body = json.dumps({"qos_specs": kwargs})70 resp, body = self.put('qos-specs/%s' % qos_id, put_body)71 body = json.loads(body)72 self.validate_response(schema.set_qos_key, resp, body)73 return rest_client.ResponseBody(resp, body)74 def unset_qos_key(self, qos_id, keys):75 """Unset the specified keys of QoS specification.76 :param keys: keys to delete from the QoS specification.77 For a full list of available parameters, please refer to the official78 API reference:79 https://docs.openstack.org/api-ref/block-storage/v3/index.html#unset-keys-in-a-qos-specification80 """81 put_body = json.dumps({'keys': keys})82 resp, body = self.put('qos-specs/%s/delete_keys' % qos_id, put_body)83 self.validate_response(schema.unset_qos_key, resp, body)84 return rest_client.ResponseBody(resp, body)85 def associate_qos(self, qos_id, vol_type_id):86 """Associate the specified QoS with specified volume-type."""87 url = "qos-specs/%s/associate" % qos_id88 url += "?vol_type_id=%s" % vol_type_id...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful