Best Python code snippet using Kiwi_python
generated_classes.py
Source:generated_classes.py  
1# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.2# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>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 or13# implied.14# See the License for the specific language governing permissions and15# limitations under the License.16# NOTE: this file is intendend to be replaced with mechanically generated17# file if/when OF-Config yang specification is available with a suitable18# license.19from ryu.lib.of_config.base import _Base, _e, _ct20class OFPortConfigurationType(_Base):21    _ELEMENTS = [22        _e('admin-state', is_list=False),23        _e('no-receive', is_list=False),24        _e('no-forward', is_list=False),25        _e('no-packet-in', is_list=False),26    ]27class OFPortStateType(_Base):28    _ELEMENTS = [29        _e('oper-state', is_list=False),30        _e('blocked', is_list=False),31        _e('live', is_list=False),32    ]33class OFPortType(_Base):34    _ELEMENTS = [35        _e('resource-id', is_list=False),36        _e('number', is_list=False),37        _e('name', is_list=False),38        _e('current-rate', is_list=False),39        _e('max-rate', is_list=False),40        _ct('configuration', OFPortConfigurationType, is_list=False),41        _ct('state', OFPortStateType, is_list=False),42        _ct('features', None, is_list=False),43        _ct('tunnel-type', None, is_list=False),44    ]45class OFQueuePropertiesType(_Base):46    _ELEMENTS = [47        _e('min-rate', is_list=False),48        _e('max-rate', is_list=False),49        _e('experimenter', is_list=True),50    ]51class OFQueueType(_Base):52    _ELEMENTS = [53        _e('resource-id', is_list=False),54        _e('id', is_list=False),55        _e('port', is_list=False),56        _ct('properties', OFQueuePropertiesType, is_list=False),57    ]58class OFCapableSwitchResourcesType(_Base):59    _ELEMENTS = [60        _ct('port', OFPortType, is_list=True),61        _ct('queue', OFQueueType, is_list=True),62        _ct('owned-certificate', None, is_list=True),63        _ct('external-certificate', None, is_list=True),64        _ct('flow-table', None, is_list=True),65    ]66class OFControllerStateType(_Base):67    _ELEMENTS = [68        _e('connection-state', is_list=False),69        _e('current-version', is_list=False),70        # XXX OF-Config 1.1.1 is inconsistent about supported-versions.71        #72        # according to its xml schema (p.43), i believe this should look73        # like the following.  it's what linc/of_config does, too.74        #     <supported-versions>1.3</supported-versions>75        #76        # on the other hand, it has an example (p.45) like the following.77        # this one is compatible with OF-Config 1.1.78        #     <supported-versions>79        #         <version>1.2</version>80        #         <version>1.1</version>81        #     </supported-versions>82        _e('supported-versions', is_list=True),83        _e('local-ip-address-in-use', is_list=False),84        _e('local-port-in-use', is_list=False),85    ]86class OFControllerType(_Base):87    _ELEMENTS = [88        _e('id', is_list=False),89        _e('role', is_list=False),90        _e('ip-address', is_list=False),91        _e('port', is_list=False),92        _e('local-ip-address', is_list=False),93        _e('local-port', is_list=False),94        _e('protocol', is_list=False),95        _ct('state', OFControllerStateType, is_list=False),96    ]97class OFLogicalSwitchControllersType(_Base):98    _ELEMENTS = [99        _ct('controller', OFControllerType, is_list=True),100    ]101class OFLogicalSwitchResourcesType(_Base):102    _ELEMENTS = [103        _e('port', is_list=True),104        _e('queue', is_list=True),105        _e('certificate', is_list=False),106        _e('flow-table', is_list=True),107    ]108class OFLogicalSwitchType(_Base):109    _ELEMENTS = [110        _e('id', is_list=False),111        _ct('capabilities', None, is_list=False),112        _e('datapath-id', is_list=False),113        _e('enabled', is_list=False),114        _e('check-controller-certificate', is_list=False),115        _e('lost-connection-behavior', is_list=False),116        _ct('controllers', OFLogicalSwitchControllersType, is_list=False),117        _ct('resources', OFLogicalSwitchResourcesType, is_list=False),118    ]119class OFCapableSwitchLogicalSwitchesType(_Base):120    _ELEMENTS = [121        # this is named 'logical-switch' for OF-Config 1.1.122        _ct('switch', OFLogicalSwitchType, is_list=True),123    ]124class OFCapableSwitchType(_Base):125    _ELEMENTS = [126        _e('id', is_list=False),127        _e('config-version', is_list=False),128        _ct('configuration-points', None, is_list=False),129        _ct('resources', OFCapableSwitchResourcesType, is_list=False),130        _ct('logical-switches', OFCapableSwitchLogicalSwitchesType,131            is_list=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!!
