How to use update_forced_down method in tempest

Best Python code snippet using tempest_python

services_client.py

Source:services_client.py Github

copy

Full Screen

...70 resp, body = self.put('os-services/disable-log-reason', post_body)71 body = json.loads(body)72 self.validate_response(schema.disable_log_reason, resp, body)73 return rest_client.ResponseBody(resp, body)74 def update_forced_down(self, **kwargs):75 """Set or unset ``forced_down`` flag for the service.76 For a full list of available parameters, please refer to the official77 API reference:78 https://developer.openstack.org/api-ref/compute/#update-forced-down79 """80 post_body = json.dumps(kwargs)81 resp, body = self.put('os-services/force-down', post_body)82 body = json.loads(body)83 # NOTE: Use schemav211.update_forced_down directly because there is no84 # update_forced_down schema for <2.11.85 self.validate_response(schemav211.update_forced_down, resp, body)...

Full Screen

Full Screen

services.py

Source:services.py Github

copy

Full Screen

1# Copyright 2018 AT&T Corporation.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.15import copy16from tempest.lib.api_schema.response.compute.v2_1 import parameter_types17from tempest.lib.api_schema.response.compute.v2_11 import services \18 as servicesv21119# ***************** Schemas changed in microversion 2.53 *****************20# NOTE(felipemonteiro): This is schema for microversion 2.53 which includes:21#22# * changing the service 'id' to 'string' type only23# * adding update_service which supersedes enable_service, disable_service,24# disable_log_reason, update_forced_down.25list_services = copy.deepcopy(servicesv211.list_services)26# The ID of the service is a uuid, so v2.1 pattern does not apply.27list_services['response_body']['properties']['services']['items'][28 'properties']['id'] = {'type': 'string', 'format': 'uuid'}29update_service = {30 'status_code': [200],31 'response_body': {32 'type': 'object',33 'properties': {34 'service': {35 'type': 'object',36 'properties': {37 'id': {'type': 'string', 'format': 'uuid'},38 'binary': {'type': 'string'},39 # disabled_reason can be null when status is enabled.40 'disabled_reason': {'type': ['string', 'null']},41 'host': {'type': 'string'},42 'state': {'type': 'string'},43 'status': {'type': 'string'},44 'updated_at': parameter_types.date_time,45 'zone': {'type': 'string'},46 'forced_down': {'type': 'boolean'}47 },48 'additionalProperties': False,49 'required': ['id', 'binary', 'disabled_reason', 'host',50 'state', 'status', 'updated_at', 'zone',51 'forced_down']52 }53 },54 'additionalProperties': False,55 'required': ['service']56 }57}58# **** Schemas unchanged in microversion 2.53 since microversion 2.11 ****59# Note(felipemonteiro): Below are the unchanged schema in this microversion. We60# need to keep this schema in this file to have the generic way to select the61# right schema based on self.schema_versions_info mapping in service client.62enable_disable_service = copy.deepcopy(servicesv211.enable_disable_service)63update_forced_down = copy.deepcopy(servicesv211.update_forced_down)...

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