Best Python code snippet using tempest_python
services.py
Source:services.py
1# Copyright 2018 NTT DATA2# All Rights Reserved.3#4# Licensed under the Apache License, Version 2.0 (the "License");5# you may not use this file except in compliance with the License.6# You may obtain 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,12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13# See the License for the specific language governing permissions and14# limitations under the License.15import copy16from cinder.api.validation import parameter_types17enable_and_disable = {18 'type': 'object',19 'properties': {20 'binary': {'type': 'string', 'minLength': 1, 'maxLength': 255},21 'host': parameter_types.cinder_host,22 'cluster': parameter_types.nullable_string,23 'service': {'type': 'string', 'minLength': 1, 'maxLength': 255},24 },25 'anyOf': [26 {'required': ['binary']},27 {'required': ['service']}28 ],29 'additionalProperties': False,30}31disable_log_reason = copy.deepcopy(enable_and_disable)32disable_log_reason['properties'][33 'disabled_reason'] = {'type': 'string', 'minLength': 1, 'maxLength': 255,34 'format': 'disabled_reason'}35set_log = {36 'type': 'object',37 'properties': {38 'binary': parameter_types.binary,39 'server': parameter_types.nullable_string,40 'prefix': parameter_types.nullable_string,41 'level': {'type': ['string', 'null'], 'format': 'level'}42 },43 'additionalProperties': False,44}45get_log = {46 'type': 'object',47 'properties': {48 'binary': parameter_types.binary,49 'server': parameter_types.nullable_string,50 'prefix': parameter_types.nullable_string,51 },52 'additionalProperties': False,53}54freeze_and_thaw = {55 'type': 'object',56 'properties': {57 'cluster': parameter_types.nullable_string,58 'host': parameter_types.cinder_host,59 },60 'additionalProperties': False,61}62failover_host = {63 'type': 'object',64 'properties': {65 'host': parameter_types.cinder_host,66 'backend_id': parameter_types.nullable_string,67 'cluster': parameter_types.nullable_string,68 },69 'additionalProperties': False,...
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!!