Best Python code snippet using tempest_python
group_snapshots_client.py
Source:group_snapshots_client.py
...65 resp, body = self.get(url)66 body = json.loads(body)67 self.validate_response(list_group_snapshots, resp, body)68 return rest_client.ResponseBody(resp, body)69 def reset_group_snapshot_status(self, group_snapshot_id, status_to_set):70 """Resets group snapshot status.71 For more information, please refer to the official API reference:72 https://docs.openstack.org/api-ref/block-storage/v3/#reset-group-snapshot-status73 """74 post_body = json.dumps({'reset_status': {'status': status_to_set}})75 resp, body = self.post('group_snapshots/%s/action' % group_snapshot_id,76 post_body)77 self.validate_response(schema.reset_group_snapshot_status, resp, body)78 return rest_client.ResponseBody(resp, body)79 def is_resource_deleted(self, id):80 try:81 self.show_group_snapshot(id)82 except lib_exc.NotFound:83 return True...
group_snapshot_actions.py
Source:group_snapshot_actions.py
1# Copyright (c) 2017 Huawei Technologies Co., Ltd.2# All Rights Reserved.3#4# Licensed under the Apache License, Version 2.0 (the "License"); you may5# not use this file except in compliance with the License. You may obtain6# a copy of the License at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing, software11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the13# License for the specific language governing permissions and limitations14# under the License.15from oslo_policy import policy16from cinder.policies import base17RESET_STATUS = 'group:reset_group_snapshot_status'18group_snapshot_actions_policies = [19 policy.DocumentedRuleDefault(20 name=RESET_STATUS,21 check_str=base.RULE_ADMIN_OR_OWNER,22 description="Reset status of group snapshot.",23 operations=[24 {25 'method': 'POST',26 'path':27 '/group_snapshots/{g_snapshot_id}/action (reset_status)'28 }29 ]),30]31def list_rules():...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!