aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStuart Mackie <wsmackie@juniper.net>2017-03-23 06:26:16 -0700
committerStuart Mackie <wsmackie@juniper.net>2017-03-23 06:26:16 -0700
commitc29a525331b45ead15ec376d03f76836d622c943 (patch)
tree6713f16cb30c739a66a0cb56fb4e2efed732eff1
parent88df88a19674ccc0017836941b8ee32eaadf19fb (diff)
Removed test case files without correct license language. Will replace in future.
Change-Id: I16435a250257cf97a67a8ba31303c89d74204ac2 Signed-off-by: Stuart Mackie <wsmackie@juniper.net>
-rwxr-xr-xTestcases/RunTests.sh125
-rw-r--r--Testcases/Test_V42
-rw-r--r--Testcases/cfgm_common/__init__.py50
-rw-r--r--Testcases/cfgm_common/__init__.pycbin2555 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/analytics_client.py63
-rw-r--r--Testcases/cfgm_common/analytics_client.pycbin1928 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/buildinfo.py1
-rw-r--r--Testcases/cfgm_common/buildinfo.pycbin356 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/dependency_tracker.py50
-rw-r--r--Testcases/cfgm_common/dependency_tracker.pycbin1688 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/exceptions.py133
-rw-r--r--Testcases/cfgm_common/exceptions.pycbin6506 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/__init__.py29
-rw-r--r--Testcases/cfgm_common/ifmap/__init__.pycbin846 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/client.py263
-rw-r--r--Testcases/cfgm_common/ifmap/client.pycbin8050 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/id.py191
-rw-r--r--Testcases/cfgm_common/ifmap/id.pycbin8855 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/metadata.py36
-rw-r--r--Testcases/cfgm_common/ifmap/metadata.pycbin1674 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/operations.py75
-rw-r--r--Testcases/cfgm_common/ifmap/operations.pycbin5131 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/request.py106
-rw-r--r--Testcases/cfgm_common/ifmap/request.pycbin7617 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/response.py55
-rw-r--r--Testcases/cfgm_common/ifmap/response.pycbin2465 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/ifmap/util.py34
-rw-r--r--Testcases/cfgm_common/ifmap/util.pycbin933 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/imid.py344
-rw-r--r--Testcases/cfgm_common/imid.pycbin10688 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/importutils.py66
-rw-r--r--Testcases/cfgm_common/importutils.pycbin2176 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/rest.py41
-rw-r--r--Testcases/cfgm_common/rest.pycbin1355 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/svc_info.py99
-rw-r--r--Testcases/cfgm_common/svc_info.pycbin4584 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/utils.py110
-rw-r--r--Testcases/cfgm_common/utils.pycbin3544 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/__init__.py0
-rw-r--r--Testcases/cfgm_common/uve/__init__.pycbin147 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/acl/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/acl/__init__.pycbin200 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/acl/acl.html14
-rw-r--r--Testcases/cfgm_common/uve/acl/acl.xml3
-rw-r--r--Testcases/cfgm_common/uve/acl/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/acl/constants.pycbin302 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/acl/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/acl/http_request.pycbin214 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/acl/index.html9
-rw-r--r--Testcases/cfgm_common/uve/acl/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/acl/request_skeleton.pycbin159 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/acl/style.css10
-rw-r--r--Testcases/cfgm_common/uve/acl/ttypes.py837
-rw-r--r--Testcases/cfgm_common/uve/acl/ttypes.pycbin27990 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.py0
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.pycbin160 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.html14
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.xml3
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.pycbin311 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.pycbin217 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.pycbin319 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.html18
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.xml5
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.py15
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.pycbin340 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/index.html10
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.py25
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.pycbin641 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/style.css10
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.py960
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.pycbin32521 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.pycbin223 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/index.html14
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.pycbin222 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.py33
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.pycbin787 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.pycbin236 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/index.html9
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.html13
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.xml3
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.pycbin181 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/style.css10
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.py854
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.pycbin26064 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.pycbin168 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/style.css10
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py1281
-rw-r--r--Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.pycbin40928 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/physical_router/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/physical_router/__init__.pycbin212 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/physical_router/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/physical_router/constants.pycbin314 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/physical_router/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/physical_router/http_request.pycbin226 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/physical_router/index.html9
-rw-r--r--Testcases/cfgm_common/uve/physical_router/physical_router.html14
-rw-r--r--Testcases/cfgm_common/uve/physical_router/physical_router.xml3
-rw-r--r--Testcases/cfgm_common/uve/physical_router/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/physical_router/request_skeleton.pycbin171 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/physical_router/style.css10
-rw-r--r--Testcases/cfgm_common/uve/physical_router/ttypes.py461
-rw-r--r--Testcases/cfgm_common/uve/physical_router/ttypes.pycbin14361 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/service_instance/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/service_instance/__init__.pycbin213 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/service_instance/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/service_instance/constants.pycbin315 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/service_instance/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/service_instance/http_request.pycbin227 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/service_instance/index.html9
-rw-r--r--Testcases/cfgm_common/uve/service_instance/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/service_instance/request_skeleton.pycbin172 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/service_instance/service_instance.html14
-rw-r--r--Testcases/cfgm_common/uve/service_instance/service_instance.xml3
-rw-r--r--Testcases/cfgm_common/uve/service_instance/style.css10
-rw-r--r--Testcases/cfgm_common/uve/service_instance/ttypes.py484
-rw-r--r--Testcases/cfgm_common/uve/service_instance/ttypes.pycbin16150 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/__init__.pycbin212 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/constants.pycbin314 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/http_request.pycbin226 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/index.html9
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/request_skeleton.pycbin171 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/style.css10
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/ttypes.py517
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/ttypes.pycbin17222 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/virtual_machine.html14
-rw-r--r--Testcases/cfgm_common/uve/virtual_machine/virtual_machine.xml3
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/__init__.pycbin212 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/constants.pycbin314 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/http_request.pycbin226 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/index.html9
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/request_skeleton.pycbin171 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/style.css10
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/ttypes.py787
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/ttypes.pycbin25128 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/virtual_network.html14
-rw-r--r--Testcases/cfgm_common/uve/virtual_network/virtual_network.xml3
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/__init__.py1
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/__init__.pycbin204 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/constants.py12
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/constants.pycbin306 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/http_request.py14
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/http_request.pycbin218 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/index.html9
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/request_skeleton.py13
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/request_skeleton.pycbin163 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/style.css10
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/ttypes.py778
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/ttypes.pycbin23969 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/vnc_api.html14
-rw-r--r--Testcases/cfgm_common/uve/vnc_api/vnc_api.xml3
-rw-r--r--Testcases/cfgm_common/vnc_cassandra.py317
-rw-r--r--Testcases/cfgm_common/vnc_cassandra.pycbin10325 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/vnc_cpu_info.py196
-rw-r--r--Testcases/cfgm_common/vnc_cpu_info.pycbin5531 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/vnc_db.py205
-rw-r--r--Testcases/cfgm_common/vnc_db.pycbin7152 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/vnc_extensions.py65
-rw-r--r--Testcases/cfgm_common/vnc_extensions.pycbin2704 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/vnc_kombu.py226
-rw-r--r--Testcases/cfgm_common/vnc_kombu.pycbin8211 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/vnc_plugin_base.py71
-rw-r--r--Testcases/cfgm_common/vnc_plugin_base.pycbin3067 -> 0 bytes
-rw-r--r--Testcases/cfgm_common/zkclient.py358
-rw-r--r--Testcases/cfgm_common/zkclient.pycbin11818 -> 0 bytes
-rwxr-xr-xTestcases/cleanup10
-rwxr-xr-xTestcases/config19
-rwxr-xr-xTestcases/config.1619
-rwxr-xr-xTestcases/config.int19
-rw-r--r--Testcases/config_obj.py1737
-rw-r--r--Testcases/config_obj.pycbin65439 -> 0 bytes
-rw-r--r--Testcases/config_shell.py379
-rw-r--r--Testcases/config_shell.pycbin12344 -> 0 bytes
-rw-r--r--Testcases/configuration.md666
-rw-r--r--Testcases/openstackrc6
-rw-r--r--Testcases/openstackrc.int6
-rw-r--r--Testcases/vnc_api/__init__.py0
-rw-r--r--Testcases/vnc_api/__init__.pycbin139 -> 0 bytes
-rw-r--r--Testcases/vnc_api/common/__init__.py50
-rw-r--r--Testcases/vnc_api/common/__init__.pycbin2573 -> 0 bytes
-rw-r--r--Testcases/vnc_api/common/exceptions.py133
-rw-r--r--Testcases/vnc_api/common/exceptions.pycbin6605 -> 0 bytes
-rw-r--r--Testcases/vnc_api/common/rest.py41
-rw-r--r--Testcases/vnc_api/common/rest.pycbin1373 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/__init__.py0
-rw-r--r--Testcases/vnc_api/gen/__init__.pycbin143 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/cfixture.py46
-rw-r--r--Testcases/vnc_api/gen/cfixture.pycbin2639 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/connection_drv_gen.py2529
-rw-r--r--Testcases/vnc_api/gen/connection_drv_gen.pycbin125734 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/generatedssuper.py226
-rw-r--r--Testcases/vnc_api/gen/generatedssuper.pycbin10071 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/resource_client.py10026
-rw-r--r--Testcases/vnc_api/gen/resource_client.pycbin325404 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/resource_common.py15559
-rw-r--r--Testcases/vnc_api/gen/resource_common.pycbin523743 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/resource_server.py2161
-rw-r--r--Testcases/vnc_api/gen/resource_server.pycbin83009 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/resource_test.py5173
-rw-r--r--Testcases/vnc_api/gen/resource_test.pycbin195282 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/resource_xsd.py18494
-rw-r--r--Testcases/vnc_api/gen/resource_xsd.pycbin1012898 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/vnc_api_client_gen.py5354
-rw-r--r--Testcases/vnc_api/gen/vnc_api_client_gen.pycbin204398 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/vnc_api_extension_gen.py2469
-rw-r--r--Testcases/vnc_api/gen/vnc_api_extension_gen.pycbin93716 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/vnc_api_schema.py192
-rw-r--r--Testcases/vnc_api/gen/vnc_api_schema.pycbin7184 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/vnc_api_server_gen.py26142
-rw-r--r--Testcases/vnc_api/gen/vnc_api_server_gen.pycbin565409 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/vnc_api_test_gen.py182
-rw-r--r--Testcases/vnc_api/gen/vnc_api_test_gen.pycbin11187 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/vnc_cassandra_client_gen.py20248
-rw-r--r--Testcases/vnc_api/gen/vnc_cassandra_client_gen.pycbin457503 -> 0 bytes
-rw-r--r--Testcases/vnc_api/gen/vnc_ifmap_client_gen.py10533
-rw-r--r--Testcases/vnc_api/gen/vnc_ifmap_client_gen.pycbin260656 -> 0 bytes
-rw-r--r--Testcases/vnc_api/vnc_api.py682
-rw-r--r--Testcases/vnc_api/vnc_api.pycbin21621 -> 0 bytes
233 files changed, 0 insertions, 134099 deletions
diff --git a/Testcases/RunTests.sh b/Testcases/RunTests.sh
deleted file mode 100755
index 4c57ae8..0000000
--- a/Testcases/RunTests.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/bin/bash
-# FUNCTEST_REPO_DIR=/tmp
-# Setup environment
-export IMAGE_DIR="$FUNCTEST_REPO_DIR/ovno/images"
-export TESTCASE_DIR="$FUNCTEST_REPO_DIR/ovno/Testcases"
-export CIRROS_IMAGE=Cirros.img
-export FW_IMAGE="$FUNCTEST_REPO_DIR/ovno/images/OpenWRT-LRM--fw-v3.img"
-export RESULTS_DIR="$FUNCTEST_REPO_DIR/ovno/Testresults/results.`date +%Y-%m-%d:%H:%M:%S`"
-export RESULTS_FILE="$RESULTS_DIR/ocl_results"
-export ERR_FILE="$RESULTS_DIR/ocl__err"
-export TEST_ERR=/tmp/test_err
-mkdir -p $RESULTS_DIR
-
-
-check_test(){
-echo $test_desc
-if [ $($test > $TEST_ERR) ]
-then
- echo "Success $test_name" >> $RESULTS_FILE
-else
- echo "FAIL $test_name" >> $ERR_FILE
- cat $TEST_ERR >> $ERR_FILE
-fi
-}
-#------------------------------------------------------------------------------#
-# Go to the where the scripts are
-
-cd $TESTCASE_DIR
-
-export API_IP=`echo $OS_AUTH_URL | cut -d'/' -f3`
-
-export PATH=.:$PATH
-
-mkdir $LOG_DIR
-
-#___________________________________________________________________
-#Load images into OpenStack
-
-
-# Get the Cirros image onto jump/test server, then load into OpenStack
-glance image-create --name Cirros --file $IMAGE_DIR/$CIRROS_IMAGE --disk-format qcow2 --container-format bare --owner $TENANT_ID
-
-# Get firewall image
-glance image-create --name fw --file $IMAGE_DIR/$FW_IMAGE --disk-format qcow2 --container-format bare --owner $TENANT_ID
-
-
-export NET1="192.168.1.0/24"
-export NET2="192.168.2.0/24"
-export NET3="192.168.3.0/24"
-export NET_PUBLIC="10.8.10.0/24"
-
-
-# Set up the test list
-cat<<EOF | sed -e "/#/d" > Test_V4
-Add IP address manager|add_ipam|config add ipam ipam
-Add network Net1|add_network_Net1|config add network N1 --ipam ipam --subnet $NET1
-Add VM V11|add_VM_V11|config add vm V11 --image Cirros --flavor m1.tiny --network Net1
-Add VM V12|add_VM_V12|config add vm V12 --image Cirros --flavor m1.tiny --network Net1
-#Check V11 to V12 connectivity!! Still to be implemented !!
-Add policy Net2-Net3|add_plcy_Net2-Net3|config add policy Net2-Net3 --rule src-net=Net1,dst-net=Net2config add network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
-Add network Net2|add_net_Net2|config add network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
-Add network Net3|add_net_Net3|config add network Net3 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
-Add VM V21|add_VM_VM21|config add vm V21 --image Cirros --flavor m1.tiny --network Net2
-Add VM V31|add_VM_VM31|config add vm V31 --image Cirros --flavor m1.tiny --network Net3
-#Check V21 to V31 connectivity !! Still to be implemented !!
-Add svc tmplt fw-l3|add_ST_fw-l3|config add service-template fw-l3 --mode in-network --type firewall --image fw --flavor m1.medium --interface left --interface right --interface management
-Add service inst fw|add_svc_fw|config add service-instance fw --template fw-l3 --network network=left,tenant=$TENANT --network network=right,tenant=$TENANT --network=auto,tenant=$TENANT
-Add svc chain policy|add_svc_chain_plcy|config add policy left-right --rule src-net=left,dst-net=right --action service --service fw
-Add network left|add_network_left|config add network left --ipam ipam --subnet $NET2 --policy left-right
-Add network right|add_network_right|config add network right --ipam ipam --subnet $NET3 --policy left-right
-Add VM VL1|add_VM_VL1|config add vm VL1 --image Cirros --flavor m1.tiny --network left
-Add VM VR1|add_VM_VR1|config add vm VR1 --image Cirros --flavor m1.tiny --network right
-#Check V21 to V31 connectivity !! Still to be implemented !!
-Add network public|add_net_public|config add network public --ipam ipam-default --sbunet $NET_PUBLIC --route-target 64512:10000
-Add floating IP pool|add_float_ip_pool|config add floating-ip-pool public-pool --network public
-Add floating IP to VM|add_float_ip_vm|config add vm-interface server|V11 --floating-ip --floating-ip-pool public-pool
-# Check external connectivity to V11 !! Still to be implemented !!
-Clean up v4|clean_up_v4|cleanup v4
-EOF
-
-while IFS='|' read test_desc test_name test
-do
- check_test
-done <Test_V4
-
-# IPv6 tests
-export NET1="xx"
-export NET2="yy"
-export NET3="zz"
-export NET_PUBLIC="aa"
-
-cat<<EOF | sed -e "/#/d" > Test_V6
-V6 IP V6ress manager|V6_ipam|config add ipam ipam
-V6 network Net1|V6_network_Net1|config add network N1 --ipam ipam --subnet $NET1
-V6 VM V11|V6_VM_V11|config add vm V11 --image Cirros --flavor m1.tiny --network Net1
-V6 VM V12|V6_VM_V12|config add vm V12 --image Cirros --flavor m1.tiny --network Net1
-# Check V11 to V12 connectivity!! Still to be implemented !!
-V6 policy Net2-Net3|V6_plcy_Net2-Net3| config add policy Net2-Net3 --rule src-net=Net1,dst-net=Net2config V6 network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
-V6 network Net2|V6_net_Net2|config add network Net2 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
-V6 network Net3|V6_net_Net3|config add network Net3 --ipam ipam --subnet 192.168.2.0/24 --policy Net2-Net3
-V6 VM V21|V6_VM_VM21|config add vm V21 --image Cirros --flavor m1.tiny --network Net2
-V6 VM V31|V6_VM_VM31|config add vm V31 --image Cirros --flavor m1.tiny --network Net3
-# Check V21 to V31 connectivity !! Still to be implemented !!
-V6 svc tmplt fw-l3|V6_ST_fw-l3|config add service-template fw-l3 --mode in-network --type firewall --image fw --flavor m1.medium --interface left --interface right --interface management
-V6 service inst fw|V6_svc_fw|config add service-instance fw --template fw-l3 --network network=left,tenant=$TENANT --network network=right,tenant=$TENANT --network=auto,tenant=$TENANT
-V6 svc chain policy|V6_svc_chain_plcy|config add policy left-right --rule src-net=left,dst-net=right --action service --service fw
-V6 network left|V6_network_left|config add network left --ipam ipam --subnet $NET2 --policy left-right
-V6 network right|V6_network_right|config add network right --ipam ipam --subnet $NET3 --policy left-right
-V6 VM VL1|V6_VM_VL1|config add vm VL1 --image Cirros --flavor m1.tiny --network left
-V6 VM VR1|V6_VM_VR1|config add vm VR1 --image Cirros --flavor m1.tiny --network right
-# Check V21 to V31 connectivity !! Still to be implemented !!
-V6 network public|V6_net_public|config add network public --ipam ipam-default --sbunet $NET_PUBLIC --route-target 64512:10000
-V6 floating IP pool|V6_float_ip_pool|config add floating-ip-pool public-pool --network public
-V6 floating IP to VM|V6_float_ip_vm|config add vm-interface server|V11 --floating-ip --floating-ip-pool public-pool
-# Check external connectivity to V11 !! Still to be implemented !!
-Clean up v6|clean_up_v6|cleanup v6
-EOF
-
-while IFS='|' read test_desc test_name test
-do
- check_test
-done <Test_V6
-
-
-# After this send results to database
diff --git a/Testcases/Test_V4 b/Testcases/Test_V4
deleted file mode 100644
index 11890f6..0000000
--- a/Testcases/Test_V4
+++ /dev/null
@@ -1,2 +0,0 @@
-one|this one|echo "ok"
-two|that one|cho "not ok"
diff --git a/Testcases/cfgm_common/__init__.py b/Testcases/cfgm_common/__init__.py
deleted file mode 100644
index feaf215..0000000
--- a/Testcases/cfgm_common/__init__.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import sys
-import re
-
-IP_FABRIC_VN_FQ_NAME = ['default-domain', 'default-project', 'ip-fabric']
-IP_FABRIC_RI_FQ_NAME = IP_FABRIC_VN_FQ_NAME + ['__default__']
-LINK_LOCAL_VN_FQ_NAME = ['default-domain', 'default-project', '__link_local__']
-LINK_LOCAL_RI_FQ_NAME = LINK_LOCAL_VN_FQ_NAME + ['__link_local__']
-SG_NO_RULE_NAME = "__no_rule__"
-SG_NO_RULE_FQ_NAME = ['default-domain', 'default-project', SG_NO_RULE_NAME]
-
-BGP_RTGT_MIN_ID = 8000000
-SGID_MIN_ALLOC = 8000000
-
-def obj_to_json(obj):
- return dict((k, v) for k, v in obj.__dict__.iteritems())
-#end obj_to_json
-
-def json_to_obj(obj):
- pass
-#end json_to_obj
-
-def ignore_exceptions(func):
- def wrapper(*args, **kwargs):
- try:
- return func(*args, **kwargs)
- except Exception as e:
- return None
- return wrapper
-# end ignore_exceptions
-
-_illegal_unichrs = [(0x00, 0x08), (0x0B, 0x0C), (0x0E, 0x1F),
- (0x7F, 0x84), (0x86, 0x9F),
- (0xFDD0, 0xFDDF), (0xFFFE, 0xFFFF)]
-if sys.maxunicode >= 0x10000: # not narrow build
- _illegal_unichrs.extend([(0x1FFFE, 0x1FFFF), (0x2FFFE, 0x2FFFF),
- (0x3FFFE, 0x3FFFF), (0x4FFFE, 0x4FFFF),
- (0x5FFFE, 0x5FFFF), (0x6FFFE, 0x6FFFF),
- (0x7FFFE, 0x7FFFF), (0x8FFFE, 0x8FFFF),
- (0x9FFFE, 0x9FFFF), (0xAFFFE, 0xAFFFF),
- (0xBFFFE, 0xBFFFF), (0xCFFFE, 0xCFFFF),
- (0xDFFFE, 0xDFFFF), (0xEFFFE, 0xEFFFF),
- (0xFFFFE, 0xFFFFF), (0x10FFFE, 0x10FFFF)])
-
-_illegal_ranges = ["%s-%s" % (unichr(low), unichr(high))
- for (low, high) in _illegal_unichrs]
-illegal_xml_chars_RE = re.compile(u'[%s]' % u''.join(_illegal_ranges))
diff --git a/Testcases/cfgm_common/__init__.pyc b/Testcases/cfgm_common/__init__.pyc
deleted file mode 100644
index d5479c4..0000000
--- a/Testcases/cfgm_common/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/analytics_client.py b/Testcases/cfgm_common/analytics_client.py
deleted file mode 100644
index c5d14a0..0000000
--- a/Testcases/cfgm_common/analytics_client.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright (c) 2014 Cloudwatt
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# @author: Sylvain Afchain, eNovance.
-
-import requests
-import six
-from six.moves.urllib import parse as urlparse
-
-
-class OpenContrailAPIFailed(Exception):
- pass
-
-
-class Client(object):
- """Opencontrail Base Statistics REST API Client."""
- #TODO: use a pool of servers
-
- def __init__(self, endpoint, data={}):
- self.endpoint = endpoint
- self.data = data
-
- def request(self, path, fqdn_uuid, data=None):
- req_data = dict(self.data)
- if data:
- req_data.update(data)
-
- req_params = self._get_req_params(data=req_data)
-
- url = urlparse.urljoin(self.endpoint, path + fqdn_uuid)
- resp = requests.get(url, **req_params)
-
- if resp.status_code != 200:
- raise OpenContrailAPIFailed(
- ('Opencontrail API returned %(status)s %(reason)s') %
- {'status': resp.status_code, 'reason': resp.reason})
-
- return resp.json()
-
- def _get_req_params(self, data=None):
- req_params = {
- 'headers': {
- 'Accept': 'application/json'
- },
- 'data': data,
- 'allow_redirects': False,
- }
-
- return req_params
diff --git a/Testcases/cfgm_common/analytics_client.pyc b/Testcases/cfgm_common/analytics_client.pyc
deleted file mode 100644
index 0e70438..0000000
--- a/Testcases/cfgm_common/analytics_client.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/buildinfo.py b/Testcases/cfgm_common/buildinfo.py
deleted file mode 100644
index 478b1c1..0000000
--- a/Testcases/cfgm_common/buildinfo.py
+++ /dev/null
@@ -1 +0,0 @@
-build_info = "{\"build-info\" : [{\"build-version\" : \"2.20\", \"build-time\" : \"2015-06-25 07:52:54.221985\", \"build-user\" : \"mganley\", \"build-hostname\" : \"contrail-ec-build16\", \"build-git-ver\" : \"c6744e5\", ";
diff --git a/Testcases/cfgm_common/buildinfo.pyc b/Testcases/cfgm_common/buildinfo.pyc
deleted file mode 100644
index 50c9be7..0000000
--- a/Testcases/cfgm_common/buildinfo.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/dependency_tracker.py b/Testcases/cfgm_common/dependency_tracker.py
deleted file mode 100644
index dafc4f9..0000000
--- a/Testcases/cfgm_common/dependency_tracker.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
-#
-
-"""
-This file contains implementation of dependency tracker
-for physical router configuration manager
-"""
-
-
-class DependencyTracker(object):
-
- def __init__(self, object_class_map, reaction_map):
- self._reaction_map = reaction_map
- self._object_class_map = object_class_map
- self.resources = {}
- # end __init__
-
- def _add_resource(self, obj_type, obj_uuid):
- if obj_type in self.resources:
- if obj_uuid in self.resources[obj_type]:
- # already visited
- return False
- self.resources[obj_type].append(obj_uuid)
- else:
- self.resources[obj_type] = [obj_uuid]
- return True
- # end _add_resource
-
- def evaluate(self, obj_type, obj, from_type='self'):
- if obj_type not in self._reaction_map:
- return
- if not self._add_resource(obj_type, obj.uuid):
- return
-
- for ref_type in self._reaction_map[obj_type][from_type]:
- ref = getattr(obj, ref_type, None)
- if ref is None:
- refs = getattr(obj, ref_type+'s', [])
- else:
- refs = [ref]
-
- ref_class = self._object_class_map[ref_type]
- for ref in refs:
- ref_obj = ref_class.get(ref)
- if ref_obj is None:
- return
- self.evaluate(ref_type, ref_obj, obj_type)
- # end evaluate
-# end DependencyTracker
diff --git a/Testcases/cfgm_common/dependency_tracker.pyc b/Testcases/cfgm_common/dependency_tracker.pyc
deleted file mode 100644
index 259b394..0000000
--- a/Testcases/cfgm_common/dependency_tracker.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/exceptions.py b/Testcases/cfgm_common/exceptions.py
deleted file mode 100644
index d9723a4..0000000
--- a/Testcases/cfgm_common/exceptions.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-# Base class of all exceptions in VNC
-
-
-class VncError(Exception):
- pass
-# end class VncError
-
-class ServiceUnavailableError(VncError):
- def __init__(self, code):
- self._reason_code = code
- # end __init__
-
- def __str__(self):
- return 'Service unavailable time out due to: %s' % (str(self._reason_code))
- # end __str__
-# end class ServiceUnavailableError
-
-class TimeOutError(VncError):
- def __init__(self, code):
- self._reason_code = code
- # end __init__
-
- def __str__(self):
- return 'Timed out due to: %s' % (str(self._reason_code))
- # end __str__
-# end class TimeOutError
-
-
-class BadRequest(Exception):
- def __init__(self, status_code, content):
- self.status_code = status_code
- self.content = content
- # end __init__
-
- def __str__(self):
- return 'HTTP Status: %s Content: %s' % (self.status_code, self.content)
- # end __str__
-# end class BadRequest
-
-
-class NoIdError(VncError):
-
- def __init__(self, unknown_id):
- self._unknown_id = unknown_id
- # end __init__
-
- def __str__(self):
- return 'Unknown id: %s' % (self._unknown_id)
- # end __str__
-# end class NoIdError
-
-
-class MaxRabbitPendingError(VncError):
-
- def __init__(self, npending):
- self._npending = npending
- # end __init__
-
- def __str__(self):
- return 'Too many pending updates to RabbitMQ: %s' % (self._npending)
- # end __str__
-# end class MaxRabbitPendingError
-
-class ResourceExistsError(VncError):
- def __init__(self, eexists_fq_name, eexists_id):
- self._eexists_fq_name = eexists_fq_name
- self._eexists_id = eexists_id
- # end __init__
-
- def __str__(self):
- return 'FQ Name: %s exists already with ID: %s' \
- % (self._eexists_fq_name, self._eexists_id)
- # end __str__
-# end class ResourceExistsError
-
-class ResourceTypeUnknownError(VncError):
- def __init__(self, obj_type):
- self._unknown_type = obj_type
- # end __init__
-
- def __str__(self):
- return 'Unknown object type: %s' %(self._unknown_type)
- # end __str__
-# end class ResourceTypeUnknownError
-
-class PermissionDenied(VncError):
- pass
-# end class PermissionDenied
-
-
-class RefsExistError(VncError):
- pass
-# end class RefsExistError
-
-
-class ResourceExhaustionError(VncError):
- pass
-# end class ResourceExhaustionError
-
-
-class NoUserAgentKey(VncError):
- pass
-# end class NoUserAgentKey
-
-
-class UnknownAuthMethod(VncError):
- pass
-# end class UnknownAuthMethod
-
-
-class HttpError(VncError):
-
- def __init__(self, status_code, content):
- self.status_code = status_code
- self.content = content
- # end __init__
-
- def __str__(self):
- return 'HTTP Status: %s Content: %s' % (self.status_code, self.content)
- # end __str__
-# end class HttpError
-
-
-class AmbiguousParentError(VncError):
- pass
-
-
-class InvalidSessionID(VncError):
- pass
-# end InvalidSessionID
diff --git a/Testcases/cfgm_common/exceptions.pyc b/Testcases/cfgm_common/exceptions.pyc
deleted file mode 100644
index 57f9545..0000000
--- a/Testcases/cfgm_common/exceptions.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/__init__.py b/Testcases/cfgm_common/ifmap/__init__.py
deleted file mode 100644
index 189d225..0000000
--- a/Testcases/cfgm_common/ifmap/__init__.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-#
-
-"""
-ifmap-python client is an implementation of the TCG IF-MAP 2.0 protocol as a client library.
-"""
-
-import sys
-
-#
-# Project properties
-#
-
-__version__ = '0.1'
-__build__=""
-
-#
-# Exceptions
-#
-class Error(Exception):
- """
- Base class for exception handling
- """
- def __init__(self, msg):
- Exception.__init__(self, "Error: '%s'" % msg)
diff --git a/Testcases/cfgm_common/ifmap/__init__.pyc b/Testcases/cfgm_common/ifmap/__init__.pyc
deleted file mode 100644
index 263aa50..0000000
--- a/Testcases/cfgm_common/ifmap/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/client.py b/Testcases/cfgm_common/ifmap/client.py
deleted file mode 100644
index d4d4df8..0000000
--- a/Testcases/cfgm_common/ifmap/client.py
+++ /dev/null
@@ -1,263 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-#
-
-from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
-import gevent
-import geventhttpclient
-from geventhttpclient import HTTPClient
-
-import urllib
-
-import base64
-import cStringIO
-import sys
-
-
-from logging import getLogger
-
-log = getLogger(__name__) # when imported, the logger will be named "ifmap.client"
-
-# Import either httplib2 or urllib2 and map to same name
-try:
- import httplib2 as http_client_lib
- Http = http_client_lib.Http
- HttpException = http_client_lib.HttpLib2Error
-except ImportError:
- import urllib2 as http_client_lib
- HttpException = (http_client_lib.URLError, http_client_lib.HTTPError)
- class Http(): # wrapper to use when httplib2 not available
- def request(self, url, method, body, headers):
- f = http_client_lib.urlopen(http_client_lib.Request(url, body, headers))
- return f.info(), f.read()
-
-#import urllib2 as http_client_lib
-#class Http(): # wrapper to use when httplib2 not available
-# def request(self, url, method, body, headers):
-# f = http_client_lib.urlopen(http_client_lib.Request(url, body, headers))
-# return f.info(), f.read()
-
-namespaces = {
- 'env' : "http://www.w3.org/2003/05/soap-envelope",
- 'ifmap' : "http://www.trustedcomputinggroup.org/2010/IFMAP/2",
- 'meta' : "http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
-}
-
-# NOTE(sahid): It seems that the geventhttpclient uses gevent.queue.LifoQueue
-# to maintain a pool of connections and according to the doc it is possible
-# to configure the maxsize of the queue with None or a value less than 0 to
-# set the number of connections ulimited otherwise It is actually not possible
-# to set it to None or less than 0 since lock.BoundedSemaphore will return an
-# exception. https://github.com/gwik/geventhttpclient/blob/master/src/geventhttpclient/connectionpool.py#L37
-concurrency = 1 # arbitrary value since it is not possible to use ulimited.
-
-class AsyncReadWrapper(object):
- """ Perform the socket read in a separate greenlet """
- def __init__(self, request):
- self._greenlet = gevent.spawn(self.AsyncRead, request)
- self._content = None
-
- def AsyncRead(self, request):
- self._content = request.read()
-
- def __str__(self, *args, **kwargs):
- self._greenlet.join()
- return self._content
-
- def __repr__(self, *args, **kwargs):
- self._greenlet.join()
- return self._content
-
-class client:
- """
- IF-MAP client
- """
-
- __url = None
- __session_id = None
- __publisher_id = None
- __last_sent = None
- __last_received = None
- __namespaces = None
- __ssl_options = {
- 'cert_reqs' : gevent.ssl.CERT_NONE,
- 'ssl_version' : PROTOCOL_SSLv23,
- }
- if sys.version_info >= (2,7):
- __ssl_options['ciphers'] = "RC4-SHA"
-
- __envelope ="""<?xml version="1.0" encoding="UTF-8"?>
-<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" %(ns)s>
- <env:Body>
- %(body)s
- </env:Body>
-</env:Envelope>
-"""
-
- def __init__(self, url, user=None, password=None, namespaces={}, ssl_opts=None):
- if user and password:
-# self.__password_mgr=http_client_lib.HTTPPasswordMgrWithDefaultRealm()
-# self.__password_mgr.add_password(None, url, user, password)
-# handler = http_client_lib.HTTPBasicAuthHandler(self.__password_mgr)
-# opener = http_client_lib.build_opener(handler)
-# http_client_lib.install_opener(opener)
-
- #pycurl.global_init(pycurl.GLOBAL_SSL)
-
- pass
-
- #if namespaces:
- self.__namespaces = namespaces
- if ssl_opts:
- self.__ssl_options.update(ssl_opts)
-
- self.__url = url
- self.__username = user
- self.__password = password
- try:
- self._http = HTTPClient(*self.__url, ssl = True,
- connection_timeout = None,
- network_timeout = None,
- ssl_options = self.__ssl_options,
- insecure = True,
- concurrency = concurrency)
- except TypeError:
- self._http = HTTPClient(*self.__url, ssl = True,
- connection_timeout = None,
- network_timeout = None,
- ssl_options = self.__ssl_options,
- concurrency = concurrency)
-
-
- def last_sent(self):
- return self.__last_sent
-
- def last_received(self):
- return self.__last_received
-
- def envelope(self, body) :
- _ns = ""
- for ns_prefix, ns_uri in self.__namespaces.items():
- #if ns_prefix == "env": break # don't add the envelope namespace again
- if ns_prefix == "env": continue # don't add the envelope namespace again
- _ns += "xmlns:"+ns_prefix+'="'+ns_uri+'" '
- return str(self.__envelope % {'body':body, 'ns': _ns})
-
- def call(self, method, body):
- xml = self.envelope(body)
- #headers={
- # 'Content-type': 'text/xml; charset="UTF-8"',
- # 'Content-length': str(len(xml)),
- # "SOAPAction": '"%s"' % (method),
- #}
-
- base64string = base64.encodestring('%s:%s' % (self.__username, self.__password)).replace('\n', '')
- # pycurl
- #headers=[
- # 'Content-type: text/xml; charset="UTF-8"',
- # 'Content-length: %s' %(str(len(xml))),
- # 'Authorization : Basic %s' %(base64string),
- # 'SOAPAction: %s' % (method),
- #]
-
- # geventhttp
- headers={
- 'Content-type': 'text/xml; charset="UTF-8"',
- 'Content-length': '%s' %(str(len(xml))),
- 'Authorization': 'Basic %s' %(base64string),
- 'SOAPAction': '%s' % (method),
- }
-
- try:
- log.info("sending IF-MAP message to server")
- log.debug("======== sending IF-MAP message ========")
- log.debug("\n%s\n", xml)
- log.debug("======== /sending IF-MAP message ========")
-
- #response, content = self.http.request(self.__url,"POST", body=xml, headers=headers )
-
- #self.http = pycurl.Curl()
- #self.http.setopt(pycurl.URL, self.__url)
- #self.http.setopt(pycurl.HTTPHEADER, headers)
- #self.http.setopt(pycurl.POSTFIELDS, xml)
- #self.http.setopt(pycurl.VERBOSE, True)
- #self.http.setopt(pycurl.SSL_VERIFYPEER, 0)
- #self.http.setopt(pycurl.SSL_VERIFYHOST, 0)
- #content = cStringIO.StringIO()
- #self.http.setopt(pycurl.WRITEFUNCTION,
- # content.write)
- #self.http.perform()
-
- #self.http = HTTPClient(*self.__url, ssl = True,
- # ssl_options = {'cert_reqs': gevent.ssl.CERT_NONE,
- # 'ssl_version': PROTOCOL_SSLv3})
- #response = self.http.post('/', body = xml, headers = headers)
- response = self._http.post('/', body = xml, headers = headers)
- content = response.read()
-
- self.__last_sent = xml
-
- #self.__last_received = content
- #pycurl self.__last_received = content.getvalue()
- self.__last_received = content
-
- log.debug("======== received IF-MAP response ========")
- #log.debug("\n%s\n", content)
- #pycurl log.debug("\n%s\n", content.getvalue())
- log.debug("\n%s\n", content)
- log.debug("======== /receive IF-MAP response ========")
-
- #return content
- #pycurl return content.getvalue()
- return content
-
- except HttpException, e:
- log.error("HTTP Connection error in IF-MAP client: %s", e.reason)
- except Exception as e:
- log.error("Uknown error sending IF-MAP message to server %s", str(e))
- raise
-
- def call_async_result(self, method, body):
- xml = self.envelope(body)
- base64string = base64.encodestring('%s:%s' % (self.__username, self.__password)).replace('\n', '')
-
- # geventhttp
- headers={
- 'Content-type': 'text/xml; charset="UTF-8"',
- 'Content-length': '%s' %(str(len(xml))),
- 'Authorization': 'Basic %s' %(base64string),
- 'SOAPAction': '%s' % (method),
- }
-
- try:
- response = self._http.post('/', body = xml, headers = headers)
- content = AsyncReadWrapper(response)
-
- return content
-
- except HttpException, e:
- log.error("HTTP Connection error in IF-MAP client: %s", e.reason)
- except:
- log.error("Uknown error sending IF-MAP message to server")
- raise
-
- def set_session_id(self, session_id):
- self.__session_id = session_id
-
- def set_publisher_id(self, publisher_id):
- self.__publisher_id = publisher_id
-
- def get_session_id(self):
- return self.__session_id
-
- def get_publisher_id(self):
- return self.__publisher_id
-
-
-if __name__ == "__main__":
- print """The ifmap client library is not meant to be run from the command line or python interpreter
-- you should use it by including it in your python software. See testmap.py for an example.
-Hint: add this line to use the library - 'from ifmap import ifmapClient' """
diff --git a/Testcases/cfgm_common/ifmap/client.pyc b/Testcases/cfgm_common/ifmap/client.pyc
deleted file mode 100644
index 3670f20..0000000
--- a/Testcases/cfgm_common/ifmap/client.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/id.py b/Testcases/cfgm_common/ifmap/id.py
deleted file mode 100644
index 7a71d51..0000000
--- a/Testcases/cfgm_common/ifmap/id.py
+++ /dev/null
@@ -1,191 +0,0 @@
-#
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-
-# Module with ID factories for creating IF-MAP Identifiers.
-# Identifiers are used, for example, when publishing to an IF-MAP server, to represent an IP address.
-# The XML for such the IP address identifier would be generated by ifmap.id.IPAddress
-# example:
-# >>> print ifmap.id.IPAdress('10.0.0.1')
-
-from util import attr
-
-class ifmapIDFactory:
- pass
-
-
-class IPAddress(ifmapIDFactory):
- """
- XML Factory for an IP Address IF-MAP Identifier
- """
- def __init__(self, ip_address, type=None, administrative_domain=None):
- self.__ip_address = ip_address
- self.__type = type
- self.__administrative_domain = administrative_domain
-
- def administrative_domain(self):
- return self.__administrative_domain
-
- def ip_address(self):
- return self.__ip_address
-
- def type(self):
- return self.__type
-
- def __str__(self):
- _attr = attr({'value':self.__ip_address,'type':self.__type,'administrative-domain':self.__administrative_domain})
- return '<ip-address %s' % _attr + '/>'
-
-class MACAddress(ifmapIDFactory):
- """
- XML Factory for a MAC Address IF-MAP Identifier
- """
-
- def __init__(self, mac_address, administrative_domain=None):
- self.__mac_address = mac_address
- self.__administrative_domain = administrative_domain
- return None;
-
- def administrative_domain(self):
- return self.__administrative_domain
-
- def mac_address(self):
- return self.__mac_address
-
- def __str__(self):
- _attr = attr({'value':self.__mac_address,'administrative-domain':self.__administrative_domain})
- return '<mac-address %s' % _attr + '/>'
-
-
-class Device(ifmapIDFactory):
- """
- XML Factory for a Device IF-MAP Identifier
- """
-
- def __init__(self, name, aik_name=None):
- self.__name = name
- self.__aik_name = aik_name
- return None;
-
- def aik_name(self):
- return self.__aik_name
-
- def name(self):
- return self.__name
-
- def __str__(self):
- self.__XML = "<device>"
- self.__XML += '<name>'+self.__name+'</name>'
- # aik_name is optional
- if self.__aik_name:
- self.__XML += '<aik-name>'+self.__aik_name+'<aik-name>'
- self.__XML += "</device>"
- return self.__XML
-
-class AccessRequest(ifmapIDFactory):
- """
- XML Factory for an Access Request IF-MAP Identifier
- """
-
- def __init__(self, name, administrative_domain=None):
- self.__name = name
- self.__administrative_domain = administrative_domain
- return None;
-
- def administrative_domain(self):
- return self.__administrative_domain
-
- def name(self):
- return self.__name
-
- def __str__(self):
- self.__XML = "<access-request"
- self.__XML += ' name="'+self.__name+'"'
- # administrative_domain is optional
- if self.__administrative_domain:
- self.__XML += ' administrative-domain="'+self.__administrative_domain+'"'
- self.__XML += " />"
- return self.__XML
-
-class Identity(ifmapIDFactory):
- """
- XML Factory for an IF-MAP Identifier
- """
-
- def __init__(self, name, type=None, other_type=None, administrative_domain=None):
- self.__name = name # required
- self.__type = type # "aik_name"|"distinguished_name"|"dns_name"|"email_address"|"kerberos_principal"|"username"|"sip_uri"|"tel_uri"|"hip_hit"|"other"
- self.__other_type = other_type # vendor-specific type
- self.__administrative_domain = administrative_domain
- return None;
-
- def administrative_domain(self):
- return self.__administrative_domain
-
- def name(self):
- return self.__name
-
- def type(self):
- return self.__type
-
- def other_type(self):
- return self.__other_type
-
- def __str__(self):
- self.__XML = "<identity"
- self.__XML += ' name="'+self.__name+'"'
- # type and administrative_domain are optional
- if self.__type:
- self.__XML +=' type="'+self.__type+'"'
- if self.__other_type:
- self.__XML +=' other-type-definition="'+self.__other_type+'"'
- if self.__administrative_domain:
- self.__XML += ' administrative-domain="'+self.__administrative_domain+'"'
- self.__XML += " />"
- return self.__XML
-
-
-class CustomIdentity(ifmapIDFactory):
- """
- XML Factory for an Custom IF-MAP Identifier with namespace prefix or URL
- """
-
- def __init__(self, name, ns_prefix="", namespace="", attributes=None):
- self.__name = name # required
- self.__ns_prefix = ns_prefix # see ifmap.namespaces
- self.__namespace = namespace # a namespace IRI/URI
- self.__attributes = attributes # additional attributes in a dictionary (eg. {key1: value1, key2: value2})
- return None;
-
- def attributes(self):
- return self.__attributes
-
- def name(self):
- return self.__name
-
- def ns_prefix(self):
- return self.__ns_prefix
-
- def namespace(self):
- return self.__namespace
-
- def __str__(self):
- self.__XML = "<custom-identifier>"
-
-
- if self.__ns_prefix:
- self.__ns_prefix = self.__ns_prefix +':'
-
- self.__XML += '<'+self.__ns_prefix+self.__name
-
- if self.__namespace:
- self.__namespace=' xlmns='+self.__ns_prefix+self.__namespace
-
- self.__XML += self.__namespace
-
- if self.__attributes and (type(self.__attributes) == type({})) and self.__attributes.items():
- for key, attribute in self.__attributes.items():
- self.__XML += ' '+key+'="'+attribute+'"'
- self.__XML += " /></custom-identifier>"
- return self.__XML
diff --git a/Testcases/cfgm_common/ifmap/id.pyc b/Testcases/cfgm_common/ifmap/id.pyc
deleted file mode 100644
index ed8e87f..0000000
--- a/Testcases/cfgm_common/ifmap/id.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/metadata.py b/Testcases/cfgm_common/ifmap/metadata.py
deleted file mode 100644
index 17f4515..0000000
--- a/Testcases/cfgm_common/ifmap/metadata.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-#
-from util import attr, link_ids
-
-class MetadataBase:
- """ foundation class for metadata factory """
- pass
-
-class Metadata(MetadataBase):
- """
- Metadata factory
- """
- __ns_uri = ''
-
- def __init__(self, name, value=None, attributes=None, ns_prefix=None, ns_uri=None, elements=''):
- self.__value = value
- self.__attributes = attributes
- self.__elements = elements
-
- if ns_prefix:
- self.__name = ns_prefix + ':' + name
- elif not ns_uri:
- self.__name = 'meta:' + name
-
- if ns_uri:
- if ns_prefix:
- self.__ns_uri = ' xmlns:' + ns_prefix + '="' + ns_uri + '"'
- else:
- self.__ns_uri = ' xmlns="' + ns_uri + '"'
-
- def __str__(self):
- __attr = ' '+ attr(self.__attributes)
- return '<metadata><' + self.__name + self.__ns_uri + __attr + '>' + self.__value + self.__elements + '</' + self.__name + '></metadata>'
-
diff --git a/Testcases/cfgm_common/ifmap/metadata.pyc b/Testcases/cfgm_common/ifmap/metadata.pyc
deleted file mode 100644
index 7c4ec60..0000000
--- a/Testcases/cfgm_common/ifmap/metadata.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/operations.py b/Testcases/cfgm_common/ifmap/operations.py
deleted file mode 100644
index c4c2055..0000000
--- a/Testcases/cfgm_common/ifmap/operations.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-#
-from util import attr, link_ids
-
-class OperationBase:
- """ foundation class for operation factory """
- pass
-
-class PublishUpdateOperation(OperationBase):
- def __init__(self, id1, metadata, id2=None, lifetime=None):
- self.__id = link_ids(id1, id2)
- self.__metadata = metadata
- self.__lifetime = lifetime
-
- def __str__(self):
- if self.__lifetime:
- _attr = attr({'lifetime':self.__lifetime})
- return '<update %s>' % _attr + self.__id + self.__metadata + '</update>'
- else:
- return '<update>' + self.__id + self.__metadata + '</update>'
-
-class PublishDeleteOperation(OperationBase):
- def __init__(self, id1, id2=None, filter=None):
- self.__id = link_ids(id1, id2)
- self.__filter = filter
-
- def __str__(self):
- if self.__filter:
- _attr = attr({'filter':self.__filter})
- return '<delete %s>' % _attr + self.__id + '</delete>'
- else:
- return '<delete>' + self.__id + '</delete>'
-
-class PublishNotifyOperation(OperationBase):
- def __init__(self, id1, metadata, id2=None):
- self.__id = link_ids(id1, id2)
- self.__metadata = metadata
-
- def __str__(self):
- return '<notify>' + self.__id + self.__metadata + '</notify>'
-
-class SubscribeUpdateOperation(OperationBase):
- """
- SubscribeUpdate factory
- name
- identifier (single, or linked with link_ids())
- search_parameters - dictionary eg. {'max_depth':'3', 'max_size':'10000'}
- result_filter => string, #Optional. Rules for extracting specific data from the results
- match_links => string, #Optional. Filter to match links to be followed, unmatched links will not be followed in the search process
- max_depth => number, #Optional. Maximum distance of any included identifiers. Start depth is equal to 0
- max_size => number, #Optional. Maximum size in bytes of the results
- terminal_identifier_type => string, #Optional. Terminal identifier type of the search request
- """
- def __init__(self, name, identifier, search_parameters={}):
- self.__name = name
- self.__identifier = identifier
- self.__parameters = search_parameters
-
- def __str__(self):
- __attr = attr(self.__parameters)
- return '<update name="'+ self.__name + '" ' + __attr + '>' + self.__identifier +'</update>'
-
-class SubscribeDeleteOperation(OperationBase):
- def __init__(self, name):
- self.__name = name
-
- def __str__(self):
- return '<delete name="'+ self.__name + '" />'
-
-
-
-
- \ No newline at end of file
diff --git a/Testcases/cfgm_common/ifmap/operations.pyc b/Testcases/cfgm_common/ifmap/operations.pyc
deleted file mode 100644
index d07368a..0000000
--- a/Testcases/cfgm_common/ifmap/operations.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/request.py b/Testcases/cfgm_common/ifmap/request.py
deleted file mode 100644
index 47bc1f6..0000000
--- a/Testcases/cfgm_common/ifmap/request.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-#
-from util import attr
-
-class RequestBase:
- """ foundation class for request factory """
- pass
-
-class NewSessionRequest(RequestBase):
- def __init__(self, max_poll_result=None):
- self.__max_poll_result = max_poll_result
-
- def __str__(self):
- #import pdb; pdb.set_trace()
- return '<ifmap:newSession %s' % (attr({'max-poll-result-size':self.__max_poll_result})) + '/>';
-
-class RenewSessionRequest(RequestBase):
- def __init__(self, session_id):
- self.__session_id = session_id
-
- def __str__(self):
- return '<ifmap:renewSession %s' % (attr({'session-id':self.__session_id})) + '/>';
-
-class EndSessionRequest(RequestBase):
- def __init__(self, session_id):
- self.__session_id = session_id
-
- def __str__(self):
- return '<ifmap:endSession %s' % (attr({'session-id':self.__session_id})) + '/>';
-
-class PublishRequest(RequestBase):
- __session_id = None
- def __init__(self, session_id, operations, namespaces=None, validation=None):
- self.__session_id = session_id
- self.__namespaces = namespaces
- self.__validation = validation
- self.__operations = operations
-
- def __str__(self):
- _attr = attr({'session-id': self.__session_id, 'validation' : self.__validation})
- return '<ifmap:publish %s' % _attr + '>' + self.__operations + '</ifmap:publish>'
-
-class SearchRequest(RequestBase):
- """
- Search request factory
- session_id
- identifier (single, or linked with link_ids())
- namespaces
- validation "None"|"BaseOnly"|"MetadataOnly"|"All"
- search_parameters - dictionary eg. {'max_depth':'3', 'max_size':'10000'}
- result_filter => string, #Optional. Rules for extracting specific data from the results
- match_links => string, #Optional. Filter to match links to be followed, unmatched links will not be followed in the search process
- max_depth => number, #Optional. Maximum distance of any included identifiers. Start depth is equal to 0
- max_size => number, #Optional. Maximum size in bytes of the results
- terminal_identifier_type => string, #Optional. Terminal identifier type of the search request
- """
- def __init__(self, session_id, identifier, namespaces=None, validation=None, search_parameters={}):
- self.__session_id = session_id
- self.__identifier = identifier
- self.__namespaces = namespaces
- self.__validation = validation
- self.__parameters = search_parameters
-
- def __str__(self):
- _params = attr(self.__parameters)
- _attr = attr({'session-id': self.__session_id, 'validation' : self.__validation})
- return '<ifmap:search ' + _attr + _params + '>' + self.__identifier + '</ifmap:search>'
-
-class SubscribeRequest(RequestBase):
- """
- Subscribe request factory
- """
-
- def __init__(self, session_id, validation=None, namespaces=None, operations=None):
- self.__session_id = session_id
- self.__namespaces = namespaces
- self.__validation = validation
- self.__operations = operations
-
- def __str__(self):
- _attr = attr({'session-id': self.__session_id, 'validation' : self.__validation})
- return '<ifmap:subscribe %s' % _attr + '>' + self.__operations + '</ifmap:subscribe>'
-
-class PollRequest(RequestBase):
- def __init__(self, session_id, validation=None, namespaces=None):
- self.__session_id = session_id
- self.__namespaces = namespaces
- self.__validation = validation
-
- def __str__(self):
- _attr = attr({'session-id': self.__session_id, 'validation' : self.__validation})
- return '<ifmap:poll %s' % _attr + '/>'
-
-class PurgeRequest(RequestBase):
- def __init__(self, session_id, publisher_id=None, validation=None):
- self.__session_id = session_id
- self.__publisher_id = publisher_id
- self.__validation = validation
-
- def __str__(self):
- __attr = attr({'session-id':self.__session_id, 'validation':self.__validation,'ifmap-publisher-id':self.__publisher_id})
- return '<ifmap:purgePublisher %s' % __attr + '/>';
diff --git a/Testcases/cfgm_common/ifmap/request.pyc b/Testcases/cfgm_common/ifmap/request.pyc
deleted file mode 100644
index 94537b5..0000000
--- a/Testcases/cfgm_common/ifmap/request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/response.py b/Testcases/cfgm_common/ifmap/response.py
deleted file mode 100644
index 179fd01..0000000
--- a/Testcases/cfgm_common/ifmap/response.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-#
-
-from xml.etree import ElementTree
-
-class Response():
- """
- Base class to handle and parse IF-MAP responses
- """
- __xml = ""
-
- def __init__(self, result):
- """
- Take a result string and process it
- """
- if result:
- env = ElementTree.fromstring(result)
- body = env.find('{http://www.w3.org/2003/05/soap-envelope}Body')
- response = body.find('{http://www.trustedcomputinggroup.org/2010/IFMAP/2}response')
- # xml.etree.ElementTree find is broken in python 2.6
- children = response.findall('*')
- if len(children):
- self.__xml = children[0]
-
- def element(self):
- """
- Returns the raw Element object
- """
- return self.__xml
-
- def __str__(self):
- """
- Print the XML tree as a string
- """
- return ElementTree.tostring(self.__xml)
-
-class newSessionResult(Response):
- """
- newSessionResult
- """
- def __init__(self, result):
- #import pdb; pdb.set_trace()
- self.__newSession = Response(result).element()
-
- def get_session_id(self):
- return self.__newSession.attrib['session-id']
-
- def get_publisher_id(self):
- return self.__newSession.attrib['ifmap-publisher-id']
-
-
-
-
diff --git a/Testcases/cfgm_common/ifmap/response.pyc b/Testcases/cfgm_common/ifmap/response.pyc
deleted file mode 100644
index 93710a8..0000000
--- a/Testcases/cfgm_common/ifmap/response.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/ifmap/util.py b/Testcases/cfgm_common/ifmap/util.py
deleted file mode 100644
index e4d06dd..0000000
--- a/Testcases/cfgm_common/ifmap/util.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright 2011, Infoblox, All Rights Reserved
-#
-# Open Source, see LICENSE
-#
-
-def attr(attributes):
- """
- attr creates an XML string for any attribute that has a value
- attr({'session-id': '2345', 'validation':'metadata'})
- """
- if attributes and (type(attributes) == type({})): # check if it is a dictionary
- __xml = ""
- for label, value in attributes.items():
- if value != None:
- __xml += label + '="' + value + '" '
- return __xml
- else:
- return ''
-
-def link_ids(id1, id2):
- """
- Takes two id arguments.
- Returns XML for id1 or links id1 and id2 together
- """
- if id1 and id2: # Both exist, so link them
- #return '<link>' + id1 + id2 + '</link>'
- return id1 + id2
- else:
- return id1
-
-
-
diff --git a/Testcases/cfgm_common/ifmap/util.pyc b/Testcases/cfgm_common/ifmap/util.pyc
deleted file mode 100644
index bb357e3..0000000
--- a/Testcases/cfgm_common/ifmap/util.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/imid.py b/Testcases/cfgm_common/imid.py
deleted file mode 100644
index 432674d..0000000
--- a/Testcases/cfgm_common/imid.py
+++ /dev/null
@@ -1,344 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-# This file deals with the ifmap id handling for both vnc-user-visible entities
-# and bgp-visible entities
-
-import uuid
-import re
-import StringIO
-from lxml import etree
-from cfgm_common import exceptions
-from cfgm_common.ifmap.client import client
-from ifmap.request import NewSessionRequest, RenewSessionRequest, \
- EndSessionRequest, PublishRequest, SearchRequest, \
- SubscribeRequest, PurgeRequest, PollRequest
-from ifmap.id import IPAddress, MACAddress, Device, AccessRequest, Identity, \
- CustomIdentity
-from ifmap.operations import PublishUpdateOperation, PublishNotifyOperation, \
- PublishDeleteOperation, SubscribeUpdateOperation,\
- SubscribeDeleteOperation
-from ifmap.util import attr, link_ids
-from ifmap.response import Response, newSessionResult
-from ifmap.metadata import Metadata
-from xml.sax.saxutils import escape as s_esc, unescape as s_unesc
-
-
-_TENANT_GRP = "(?P<tenant_uuid>.*)"
-_VPC_GRP = "(?P<vpc_name>.*)"
-_VN_GRP = "(?P<vn_name>.*)"
-_SG_GRP = "(?P<sg_name>.*)"
-_POL_GRP = "(?P<pol_name>.*)"
-_INST_GRP = "(?P<instance_uuid>.*)"
-_PORT_GRP = "(?P<port_id>.*)"
-
-_TENANT_ID_RE = "contrail:tenant:%s" % (_TENANT_GRP)
-_VPC_NAME_RE = "contrail:network-group:%s:%s" % (_TENANT_GRP, _VPC_GRP)
-_VN_NAME_RE = "contrail:virtual-network:%s:%s:%s" % (
- _TENANT_GRP, _VPC_GRP, _VN_GRP)
-_SG_NAME_RE = "contrail:security-group:%s:%s:%s" % (
- _TENANT_GRP, _VPC_GRP, _SG_GRP)
-_POL_NAME_RE = "contrail:policy:%s:%s:%s" % (_TENANT_GRP, _VPC_GRP, _POL_GRP)
-_INST_ID_RE = "contrail:instance:%s:%s:%s:%s" \
- % (_TENANT_GRP, _VPC_GRP, _VN_GRP, _INST_GRP)
-_PORT_ID_RE = "contrail:port:%s:%s:%s:%s:%s" \
- % (_TENANT_GRP, _VPC_GRP, _VN_GRP, _INST_GRP, _PORT_GRP)
-
-_CT_NS = "contrail"
-_ROOT_IMID = _CT_NS + ":config-root:root"
-
-_SOAP_XSD = "http://www.w3.org/2003/05/soap-envelope"
-_IFMAP_XSD = "http://www.trustedcomputinggroup.org/2010/IFMAP/2"
-_IFMAP_META_XSD = "http://www.trustedcomputinggroup.org/2010/IFMAP-METADATA/2"
-_CONTRAIL_XSD = "http://www.contrailsystems.com/vnc_cfg.xsd"
-
-# Parse ifmap-server returned search results and create list of tuples
-# of (ident-1, ident-2, link-attribs)
-
-
-def parse_result_items(result_items, my_imid=None):
- all_result_list = []
- for r_item in result_items:
- children = r_item.getchildren()
- num_children = len(children)
- if num_children == 1: # ignore ident-only result-items
- continue
- elif num_children == 2:
- result_info = [children[0], None, children[1]]
- elif num_children == 3:
- result_info = [children[0], children[1], children[2]]
- else:
- raise Exception('Result item of length %s not handled!'
- % (num_children))
- all_result_list.append(result_info)
-
- if not my_imid:
- return all_result_list
-
- # strip ones that don't originate from or to my_imid
- filtered_result_list = []
- for (ident_1, ident_2, meta) in all_result_list:
- if (((ident_2 is not None) and (ident_2.attrib['name'] == my_imid)) or
- (ident_1.attrib['name'] == my_imid)):
- if meta is None:
- filtered_result_list.append((ident_1, ident_2, None))
- else:
- # search gives all props under one metadata. expand it.
- for m_elem in meta:
- filtered_result_list.append((ident_1, ident_2, m_elem))
-
- return filtered_result_list
-# end parse_result_items
-
-
-def get_ifmap_id_from_fq_name(type, fq_name):
- my_fqn = ':' + ':'.join(fq_name)
- my_imid = 'contrail:' + type + escape(my_fqn)
-
- return my_imid
-# end get_ifmap_id_from_fq_name
-
-
-def get_type_from_ifmap_id(ifmap_id):
- type = ifmap_id.split(':')[1]
- return type
-# end get_type_from_ifmap_id
-
-
-def get_fq_name_str_from_ifmap_id(ifmap_id):
- return re.sub(r'contrail:.*?:', '', unescape(ifmap_id))
-# end get_fq_name_str_from_ifmap_id
-
-
-def get_fq_name_from_ifmap_id(ifmap_id):
- type = get_type_from_ifmap_id(ifmap_id)
- # route-target has ':' in the name, so handle it as a special case
- if type=='route-target':
- return [':'.join(unescape(ifmap_id).split(':')[2:])]
- return unescape(ifmap_id).split(':')[2:]
-# end get_fq_name_from_ifmap_id
-
-def get_vm_id_from_interface(vmi_obj):
- if vmi_obj.parent_type=='virtual-machine':
- return vmi_obj.parent_uuid
- else:
- vm_refs = vmi_obj.get_virtual_machine_refs()
- return vm_refs[0]['uuid'] if vm_refs else None
-# end get_vmi_id_from_interface
-
-def subscribe_root(ssrc_mapc):
- #self._ident_type_subscribe(_CLOUD_IMID, "ct:member-of")
- ident = str(Identity(name=_ROOT_IMID, type="other",
- other_type="extended"))
- subreq = SubscribeRequest(
- ssrc_mapc.get_session_id(),
- operations=str(SubscribeUpdateOperation("root", ident,
- {"max-depth": "255", })))
-
- result = ssrc_mapc.call('subscribe', subreq)
-# end _subscribe_root
-
-
-def ssrc_initialize(args):
- ssrc_mapc = ifmap_server_connect(args)
- result = ssrc_mapc.call('newSession', NewSessionRequest())
- ssrc_mapc.set_session_id(newSessionResult(result).get_session_id())
- ssrc_mapc.set_publisher_id(newSessionResult(result).get_publisher_id())
- subscribe_root(ssrc_mapc)
- return ssrc_mapc
-# end ssrc_initialize
-
-
-def arc_initialize(args, ssrc_mapc):
- #
- # Poll requests go on ARC channel which don't do newSession but
- # share session-id with ssrc channel. so 2 connections to server but 1
- # session/session-id in ifmap-server (mamma mia!)
- #
- arc_mapc = ifmap_server_connect(args)
- arc_mapc.set_session_id(ssrc_mapc.get_session_id())
- arc_mapc.set_publisher_id(ssrc_mapc.get_publisher_id())
-
- return arc_mapc
-# end arc_initialize
-
-
-def ifmap_server_connect(args):
- _CLIENT_NAMESPACES = {
- 'env': _SOAP_XSD,
- 'ifmap': _IFMAP_XSD,
- 'meta': _IFMAP_META_XSD,
- _CT_NS: _CONTRAIL_XSD
- }
-
- ssl_options = None
- if args.use_certs:
- ssl_options = {
- 'keyfile': args.keyfile,
- 'certfile': args.certfile,
- 'ca_certs': args.ca_certs,
- 'cert_reqs': ssl.CERT_REQUIRED,
- 'ciphers': 'ALL'
- }
- return client(("%s" % (args.ifmap_server_ip),
- "%s" % (args.ifmap_server_port)),
- args.ifmap_username, args.ifmap_password,
- _CLIENT_NAMESPACES, ssl_options)
-# end ifmap_server_connect
-
-
-def parse_poll_result(poll_result_str):
- _XPATH_NAMESPACES = {
- 'a': _SOAP_XSD,
- 'b': _IFMAP_XSD,
- 'c': _CONTRAIL_XSD
- }
-
- soap_doc = etree.parse(StringIO.StringIO(poll_result_str))
- #soap_doc.write(sys.stdout, pretty_print=True)
-
- xpath_error = '/a:Envelope/a:Body/b:response/errorResult'
- error_results = soap_doc.xpath(xpath_error,
- namespaces=_XPATH_NAMESPACES)
-
- if error_results:
- if error_results[0].get('errorCode') == 'InvalidSessionID':
- raise exceptions.InvalidSessionID(etree.tostring(error_results[0]))
- raise Exception(etree.tostring(error_results[0]))
-
- xpath_expr = '/a:Envelope/a:Body/b:response/pollResult'
- poll_results = soap_doc.xpath(xpath_expr,
- namespaces=_XPATH_NAMESPACES)
-
- result_list = []
- for result in poll_results:
- children = result.getchildren()
- for child in children:
- result_type = child.tag
- if result_type == 'errorResult':
- raise Exception(etree.tostring(child))
-
- result_items = child.getchildren()
- item_list = parse_result_items(result_items)
- for item in item_list:
- ident1 = item[0]
- ident2 = item[1]
- meta = item[2]
- idents = {}
- ident1_imid = ident1.attrib['name']
- ident1_type = get_type_from_ifmap_id(ident1_imid)
- idents[ident1_type] = get_fq_name_str_from_ifmap_id(
- ident1_imid)
- if ident2 is not None:
- ident2_imid = ident2.attrib['name']
- ident2_type = get_type_from_ifmap_id(ident2_imid)
- if ident1_type == ident2_type:
- idents[ident1_type] = [
- idents[ident1_type],
- get_fq_name_str_from_ifmap_id(ident2_imid)]
- else:
- idents[ident2_type] = get_fq_name_str_from_ifmap_id(
- ident2_imid)
- result_list.append((result_type, idents, meta))
- return result_list
-# end parse_poll_result
-
-def parse_search_result(search_result_str):
- _XPATH_NAMESPACES = {
- 'a': _SOAP_XSD,
- 'b': _IFMAP_XSD,
- 'c': _CONTRAIL_XSD
- }
-
- soap_doc = etree.parse(StringIO.StringIO(search_result_str))
- #soap_doc.write(sys.stdout, pretty_print=True)
-
- xpath_error = '/a:Envelope/a:Body/b:response/errorResult'
- error_results = soap_doc.xpath(xpath_error,
- namespaces=_XPATH_NAMESPACES)
-
- if error_results:
- if error_results[0].get('errorCode') == 'InvalidSessionID':
- raise exceptions.InvalidSessionID(etree.tostring(error_results[0]))
- raise Exception(etree.tostring(error_results[0]))
-
- xpath_expr = '/a:Envelope/a:Body/b:response/searchResult'
- search_results = soap_doc.xpath(xpath_expr,
- namespaces=_XPATH_NAMESPACES)
-
- result_list = []
- for result in search_results:
- result_items = result.getchildren()
- item_list = parse_result_items(result_items)
- for item in item_list:
- ident1 = item[0]
- ident2 = item[1]
- meta = item[2]
- idents = {}
- ident1_imid = ident1.attrib['name']
- ident1_type = get_type_from_ifmap_id(ident1_imid)
- idents[ident1_type] = get_fq_name_str_from_ifmap_id(
- ident1_imid)
- if ident2 is not None:
- ident2_imid = ident2.attrib['name']
- ident2_type = get_type_from_ifmap_id(ident2_imid)
- if ident1_type == ident2_type:
- idents[ident1_type] = [
- idents[ident1_type],
- get_fq_name_str_from_ifmap_id(ident2_imid)]
- else:
- idents[ident2_type] = get_fq_name_str_from_ifmap_id(
- ident2_imid)
- result_list.append((idents, meta))
- return result_list
-# end parse_search_result
-
-def ifmap_read(mapclient, ifmap_id, srch_meta, result_meta, field_names=None):
- start_id = str(
- Identity(name=ifmap_id, type='other', other_type='extended'))
-
- def _search(start_id, match_meta=None, result_meta=None,
- max_depth=1):
- # set ifmap search parmeters
- srch_params = {}
- srch_params['max-depth'] = str(max_depth)
- srch_params['max-size'] = '50000000'
-
- if match_meta is not None:
- srch_params['match-links'] = match_meta
-
- if result_meta is not None:
- # all => don't set result-filter, so server returns all id + meta
- if result_meta == "all":
- pass
- else:
- srch_params['result-filter'] = result_meta
- else:
- # default to return match_meta metadata types only
- srch_params['result-filter'] = match_meta
-
- srch_req = SearchRequest(mapclient.get_session_id(), start_id,
- search_parameters=srch_params
- )
- result = mapclient.call('search', srch_req)
-
- return result
- # end _search
-
- return _search(start_id, srch_meta, result_meta, max_depth=10)
-# end ifmap_read
-
-def ifmap_read_all(mapclient):
- srch_meta = None
- result_meta = 'all'
- return ifmap_read(mapclient, 'contrail:config-root:root',
- srch_meta, result_meta)
-# end ifmap_read_all
-
-def escape(string):
- return s_esc(string, entities={'"':'&quot;', "'": "&apos;"})
-# end escape
-
-def unescape(string):
- return s_unesc(string, entities={'&quot;':'"', "&apos;": "'"})
-# end unescape
diff --git a/Testcases/cfgm_common/imid.pyc b/Testcases/cfgm_common/imid.pyc
deleted file mode 100644
index 8975407..0000000
--- a/Testcases/cfgm_common/imid.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/importutils.py b/Testcases/cfgm_common/importutils.py
deleted file mode 100644
index 0ae7ffe..0000000
--- a/Testcases/cfgm_common/importutils.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 2011 OpenStack Foundation.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-"""
-Import related utilities and helper functions.
-"""
-
-import sys
-import traceback
-
-
-def import_class(import_str):
- """Returns a class from a string including module and class."""
- mod_str, _sep, class_str = import_str.rpartition('.')
- __import__(mod_str)
- try:
- return getattr(sys.modules[mod_str], class_str)
- except AttributeError:
- raise ImportError('Class %s cannot be found (%s)' %
- (class_str,
- traceback.format_exception(*sys.exc_info())))
-
-
-def import_object(import_str, *args, **kwargs):
- """Import a class and return an instance of it."""
- return import_class(import_str)(*args, **kwargs)
-
-
-def import_object_ns(name_space, import_str, *args, **kwargs):
- """Tries to import object from default namespace.
-
- Imports a class and return an instance of it, first by trying
- to find the class in a default namespace, then failing back to
- a full path if not found in the default namespace.
- """
- import_value = "%s.%s" % (name_space, import_str)
- try:
- return import_class(import_value)(*args, **kwargs)
- except ImportError:
- return import_class(import_str)(*args, **kwargs)
-
-
-def import_module(import_str):
- """Import a module."""
- __import__(import_str)
- return sys.modules[import_str]
-
-
-def try_import(import_str, default=None):
- """Try to import a module and if it fails return default."""
- try:
- return import_module(import_str)
- except ImportError:
- return default
diff --git a/Testcases/cfgm_common/importutils.pyc b/Testcases/cfgm_common/importutils.pyc
deleted file mode 100644
index bbbcb95..0000000
--- a/Testcases/cfgm_common/importutils.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/rest.py b/Testcases/cfgm_common/rest.py
deleted file mode 100644
index 7287f8d..0000000
--- a/Testcases/cfgm_common/rest.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-OP_POST = 1
-OP_GET = 2
-OP_PUT = 3
-OP_DELETE = 4
-
-
-def hdr_client_tenant():
- return 'X-Tenant-Name'
-# end hdr_tenant_client
-
-# TODO transform from client value
-
-
-def hdr_server_tenant():
- return 'HTTP_X_TENANT_NAME'
-# end hdr_tenant_server
-
-
-class LinkObject(object):
-
- def __init__(self, rel, base_url, uri, name):
- self.rel = rel
- self.base_url = base_url
- self.uri = uri
- self.name = name
- # end __init__
-
- def to_dict(self, with_url=None):
- if not with_url:
- url = self.base_url
- else:
- url = with_url
- return {'rel': self.rel,
- 'href': url + self.uri,
- 'name': self.name}
- # end to_dict
-
-# end class LinkObject
diff --git a/Testcases/cfgm_common/rest.pyc b/Testcases/cfgm_common/rest.pyc
deleted file mode 100644
index 33218d3..0000000
--- a/Testcases/cfgm_common/rest.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/svc_info.py b/Testcases/cfgm_common/svc_info.py
deleted file mode 100644
index 9f9eba9..0000000
--- a/Testcases/cfgm_common/svc_info.py
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-_MGMT_STR = "management"
-_LEFT_STR = "left"
-_RIGHT_STR = "right"
-
-_SVC_VN_MGMT = "svc-vn-mgmt"
-_SVC_VN_LEFT = "svc-vn-left"
-_SVC_VN_RIGHT = "svc-vn-right"
-_VN_MGMT_SUBNET_CIDR = '10.250.1.0/24'
-_VN_LEFT_SUBNET_CIDR = '10.250.2.0/24'
-_VN_RIGHT_SUBNET_CIDR = '10.250.3.0/24'
-
-_VN_SNAT_PREFIX_NAME = 'snat-si-left'
-_VN_SNAT_SUBNET_CIDR = '100.64.0.0/29'
-
-_CHECK_SVC_VM_HEALTH_INTERVAL = 30
-
-_VM_INSTANCE_TYPE = 'virtual-machine'
-_NETNS_INSTANCE_TYPE = 'network-namespace'
-
-_SNAT_SVC_TYPE = 'source-nat'
-_LB_SVC_TYPE = 'loadbalancer'
-
-_ACTIVE_LOCAL_PREFERENCE = 200
-_STANDBY_LOCAL_PREFERENCE = 100
-
-# Version from the vrouter agent can manage service instances
-_VROUTER_NETNS_SUPPORTED_VERSION = '1.10'
-
-def get_management_if_str():
- return _MGMT_STR
-
-def get_left_if_str():
- return _LEFT_STR
-
-def get_right_if_str():
- return _RIGHT_STR
-
-def get_if_str_list():
- if_str_list = []
- if_str_list.append(get_management_if_str())
- if_str_list.append(get_left_if_str())
- if_str_list.append(get_right_if_str())
- return if_str_list
-
-def get_management_vn_name():
- return _SVC_VN_MGMT
-
-def get_left_vn_name():
- return _SVC_VN_LEFT
-
-def get_right_vn_name():
- return _SVC_VN_RIGHT
-
-def get_shared_vn_list():
- shared_vn_list = []
- shared_vn_list.append(get_management_vn_name())
- shared_vn_list.append(get_left_vn_name())
- shared_vn_list.append(get_right_vn_name())
- return shared_vn_list
-
-def get_management_vn_subnet():
- return _VN_MGMT_SUBNET_CIDR
-
-def get_left_vn_subnet():
- return _VN_LEFT_SUBNET_CIDR
-
-def get_right_vn_subnet():
- return _VN_RIGHT_SUBNET_CIDR
-
-def get_snat_left_vn_prefix():
- return _VN_SNAT_PREFIX_NAME
-
-def get_snat_left_subnet():
- return _VN_SNAT_SUBNET_CIDR
-
-def get_vm_instance_type():
- return _VM_INSTANCE_TYPE
-
-def get_netns_instance_type():
- return _NETNS_INSTANCE_TYPE
-
-def get_snat_service_type():
- return _SNAT_SVC_TYPE
-
-def get_lb_service_type():
- return _LB_SVC_TYPE
-
-def get_vm_health_interval():
- return _CHECK_SVC_VM_HEALTH_INTERVAL
-
-def get_active_preference():
- return _ACTIVE_LOCAL_PREFERENCE
-
-def get_standby_preference():
- return _STANDBY_LOCAL_PREFERENCE
diff --git a/Testcases/cfgm_common/svc_info.pyc b/Testcases/cfgm_common/svc_info.pyc
deleted file mode 100644
index e298b95..0000000
--- a/Testcases/cfgm_common/svc_info.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/utils.py b/Testcases/cfgm_common/utils.py
deleted file mode 100644
index a023912..0000000
--- a/Testcases/cfgm_common/utils.py
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright (c) 2015 Juniper Networks
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-#
-# @author: Numan Siddique, eNovance.
-
-
-import urllib
-from collections import OrderedDict
-import sys
-import cgitb
-import cStringIO
-
-def detailed_traceback():
- buf = cStringIO.StringIO()
- cgitb.Hook(format="text", file=buf).handle(sys.exc_info())
- tb_txt = buf.getvalue()
- buf.close()
- return tb_txt
-# end detailed_traceback
-
-def encode_string(enc_str, encoding='utf-8'):
- """Encode the string using urllib.quote_plus
-
- Eg. @input:
- enc_str = 'neté
- type - 'unicode' or 'str'
- @retval
- enc_str = 'net%C3%A9%C3%B9'
- type - str
- """
- try:
- enc_str.encode()
- except (UnicodeDecodeError, UnicodeEncodeError):
- if type(enc_str) is unicode:
- enc_str = enc_str.encode(encoding)
- enc_str = urllib.quote_plus(enc_str)
- except Exception:
- pass
- return enc_str
-
-
-def decode_string(dec_str, encoding='utf-8'):
- """Decode the string previously encoded using urllib.quote_plus.
-
- Eg. If dec_str = 'net%C3%A9%C3%B9'
- type - 'unicode' or 'str'
- @retval
- ret_dec_str = 'neté
- type - unicode
- """
- ret_dec_str = dec_str
- try:
- if type(ret_dec_str) is unicode:
- ret_dec_str = str(ret_dec_str)
- ret_dec_str = urllib.unquote_plus(ret_dec_str)
- return ret_dec_str.decode(encoding)
- except Exception:
- return dec_str
-
-
-class CacheContainer(object):
- def __init__(self, size):
- self.container_size = size
- self.dictionary = OrderedDict()
-
- def __getitem__(self, key, default=None):
- value = self.dictionary[key]
- # item accessed - put it in the front
- del self.dictionary[key]
- self.dictionary[key] = value
-
- return value
-
- def __setitem__(self, key, value):
- self.dictionary[key] = value
- if len(self.dictionary.keys()) > self.container_size:
- # container is full, loose the least used item
- self.dictionary.popitem(last=False)
-
- def __contains__(self, key):
- return key in self.dictionary
-
- def __repr__(self):
- return str(self.dictionary)
-
-
-def CamelCase(input):
- words = input.replace('_', '-').split('-')
- name = ''
- for w in words:
- name += w.capitalize()
- return name
-#end CamelCase
diff --git a/Testcases/cfgm_common/utils.pyc b/Testcases/cfgm_common/utils.pyc
deleted file mode 100644
index fdc525e..0000000
--- a/Testcases/cfgm_common/utils.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/__init__.py b/Testcases/cfgm_common/uve/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/Testcases/cfgm_common/uve/__init__.py
+++ /dev/null
diff --git a/Testcases/cfgm_common/uve/__init__.pyc b/Testcases/cfgm_common/uve/__init__.pyc
deleted file mode 100644
index 1c66ce2..0000000
--- a/Testcases/cfgm_common/uve/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/acl/__init__.py b/Testcases/cfgm_common/uve/acl/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/acl/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/acl/__init__.pyc b/Testcases/cfgm_common/uve/acl/__init__.pyc
deleted file mode 100644
index dedeeb1..0000000
--- a/Testcases/cfgm_common/uve/acl/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/acl/acl.html b/Testcases/cfgm_common/uve/acl/acl.html
deleted file mode 100644
index b942438..0000000
--- a/Testcases/cfgm_common/uve/acl/acl.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: acl</title></head><body>
-<h1>Module: acl</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>acl</td><td></td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/acl/acl.xml b/Testcases/cfgm_common/uve/acl/acl.xml
deleted file mode 100644
index 8fbac67..0000000
--- a/Testcases/cfgm_common/uve/acl/acl.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<acl type="rlist">
-</acl>
diff --git a/Testcases/cfgm_common/uve/acl/constants.py b/Testcases/cfgm_common/uve/acl/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/acl/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/acl/constants.pyc b/Testcases/cfgm_common/uve/acl/constants.pyc
deleted file mode 100644
index 4ee591b..0000000
--- a/Testcases/cfgm_common/uve/acl/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/acl/http_request.py b/Testcases/cfgm_common/uve/acl/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/acl/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/acl/http_request.pyc b/Testcases/cfgm_common/uve/acl/http_request.pyc
deleted file mode 100644
index 73a314c..0000000
--- a/Testcases/cfgm_common/uve/acl/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/acl/index.html b/Testcases/cfgm_common/uve/acl/index.html
deleted file mode 100644
index 0f31e1b..0000000
--- a/Testcases/cfgm_common/uve/acl/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>acl</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/acl/request_skeleton.py b/Testcases/cfgm_common/uve/acl/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/acl/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/acl/request_skeleton.pyc b/Testcases/cfgm_common/uve/acl/request_skeleton.pyc
deleted file mode 100644
index 7fbba89..0000000
--- a/Testcases/cfgm_common/uve/acl/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/acl/style.css b/Testcases/cfgm_common/uve/acl/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/acl/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/acl/ttypes.py b/Testcases/cfgm_common/uve/acl/ttypes.py
deleted file mode 100644
index 6575253..0000000
--- a/Testcases/cfgm_common/uve/acl/ttypes.py
+++ /dev/null
@@ -1,837 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class AclRuleToVnPolicyRule(object):
- """
- Attributes:
- - acl_major
- - acl_minor
- - policy_or_group_name
- - policy_major
- - policy_minor
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.I32, 'acl_major', None, None, ), # 1
- (2, TType.I32, 'acl_minor', None, None, ), # 2
- (3, TType.STRING, 'policy_or_group_name', None, None, ), # 3
- (4, TType.I32, 'policy_major', None, None, ), # 4
- (5, TType.I32, 'policy_minor', None, None, ), # 5
- )
-
- def __init__(self, acl_major=None, acl_minor=None, policy_or_group_name=None, policy_major=None, policy_minor=None,):
- self.acl_major = acl_major
- self.acl_minor = acl_minor
- self.policy_or_group_name = policy_or_group_name
- self.policy_major = policy_major
- self.policy_minor = policy_minor
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.I32:
- (length, self.acl_major) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.I32:
- (length, self.acl_minor) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.policy_or_group_name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.I32:
- (length, self.policy_major) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.I32:
- (length, self.policy_minor) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('AclRuleToVnPolicyRule') < 0: return -1
- if self.acl_major is not None:
- annotations = {}
- if oprot.writeFieldBegin('acl_major', TType.I32, 1, annotations) < 0: return -1
- if oprot.writeI32(self.acl_major) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.acl_minor is not None:
- annotations = {}
- if oprot.writeFieldBegin('acl_minor', TType.I32, 2, annotations) < 0: return -1
- if oprot.writeI32(self.acl_minor) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.policy_or_group_name is not None:
- annotations = {}
- if oprot.writeFieldBegin('policy_or_group_name', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.policy_or_group_name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.policy_major is not None:
- annotations = {}
- if oprot.writeFieldBegin('policy_major', TType.I32, 4, annotations) < 0: return -1
- if oprot.writeI32(self.policy_major) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.policy_minor is not None:
- annotations = {}
- if oprot.writeFieldBegin('policy_minor', TType.I32, 5, annotations) < 0: return -1
- if oprot.writeI32(self.policy_minor) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.acl_major is not None:
- log_str.write('acl_major = ')
- log_str.write(str(self.acl_major))
- log_str.write(' ')
- if self.acl_minor is not None:
- log_str.write('acl_minor = ')
- log_str.write(str(self.acl_minor))
- log_str.write(' ')
- if self.policy_or_group_name is not None:
- log_str.write('policy_or_group_name = ')
- log_str.write(self.policy_or_group_name)
- log_str.write(' ')
- if self.policy_major is not None:
- log_str.write('policy_major = ')
- log_str.write(str(self.policy_major))
- log_str.write(' ')
- if self.policy_minor is not None:
- log_str.write('policy_minor = ')
- log_str.write(str(self.policy_minor))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveAclConfig(object):
- """
- Attributes:
- - virtual_network
- - attached_policies
- - acl_rule_to_policy
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'virtual_network', None, None, ), # 1
- (2, TType.LIST, 'attached_policies', (TType.STRING,None), None, ), # 2
- (3, TType.LIST, 'acl_rule_to_policy', (TType.STRUCT,(AclRuleToVnPolicyRule, AclRuleToVnPolicyRule.thrift_spec)), None, ), # 3
- )
-
- def __init__(self, virtual_network=None, attached_policies=None, acl_rule_to_policy=None,):
- self.virtual_network = virtual_network
- self.attached_policies = attached_policies
- self.acl_rule_to_policy = acl_rule_to_policy
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.virtual_network) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.LIST:
- self.attached_policies = []
- (length, _etype3, _size0) = iprot.readListBegin()
- read_cnt += length
- for _i4 in xrange(_size0):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem5) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.attached_policies.append(_elem5)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.LIST:
- self.acl_rule_to_policy = []
- (length, _etype9, _size6) = iprot.readListBegin()
- read_cnt += length
- for _i10 in xrange(_size6):
- _elem11 = AclRuleToVnPolicyRule()
- read_cnt += _elem11.read(iprot)
- self.acl_rule_to_policy.append(_elem11)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveAclConfig') < 0: return -1
- if self.virtual_network is not None:
- annotations = {}
- if oprot.writeFieldBegin('virtual_network', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.virtual_network) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.attached_policies is not None:
- annotations = {}
- if oprot.writeFieldBegin('attached_policies', TType.LIST, 2, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.attached_policies)) < 0: return -1
- for iter12 in self.attached_policies:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter12) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.acl_rule_to_policy is not None:
- annotations = {}
- if oprot.writeFieldBegin('acl_rule_to_policy', TType.LIST, 3, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.acl_rule_to_policy)) < 0: return -1
- for iter13 in self.acl_rule_to_policy:
- if iter13.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.virtual_network is not None:
- log_str.write('virtual_network = ')
- log_str.write(self.virtual_network)
- log_str.write(' ')
- if self.attached_policies is not None:
- log_str.write('attached_policies = ')
- log_str.write('[ ')
- for iter14 in self.attached_policies:
- log_str.write(iter14)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.acl_rule_to_policy is not None:
- log_str.write('acl_rule_to_policy = ')
- log_str.write('[ ')
- for iter15 in self.acl_rule_to_policy:
- log_str.write('<< ')
- log_str.write(iter15.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveAclVirtualNetworkConfig(object):
- """
- Attributes:
- - name
- - deleted
- - config
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.STRUCT, 'config', (UveAclConfig, UveAclConfig.thrift_spec), None, ), # 3
- )
-
- def __init__(self, name=None, deleted=None, config=None,):
- self.name = name
- self.deleted = deleted
- self.config = config
- self._table = 'ObjectVNTable'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRUCT:
- self.config = UveAclConfig()
- read_cnt += self.config.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveAclVirtualNetworkConfig') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.config is not None:
- annotations = {}
- if oprot.writeFieldBegin('config', TType.STRUCT, 3, annotations) < 0: return -1
- if self.config.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.config is not None:
- log_str.write('config = ')
- log_str.write('<< ')
- log_str.write(self.config.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveAclVirtualMachineConfig(object):
- """
- Attributes:
- - name
- - deleted
- - config
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.STRUCT, 'config', (UveAclConfig, UveAclConfig.thrift_spec), None, ), # 3
- )
-
- def __init__(self, name=None, deleted=None, config=None,):
- self.name = name
- self.deleted = deleted
- self.config = config
- self._table = 'ObjectVMTable'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRUCT:
- self.config = UveAclConfig()
- read_cnt += self.config.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveAclVirtualMachineConfig') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.config is not None:
- annotations = {}
- if oprot.writeFieldBegin('config', TType.STRUCT, 3, annotations) < 0: return -1
- if self.config.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.config is not None:
- log_str.write('config = ')
- log_str.write('<< ')
- log_str.write(self.config.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveAclVirtualNetworkConfigTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (UveAclVirtualNetworkConfig, UveAclVirtualNetworkConfig.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 1124326490
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.config is not None:
- tdata.config = self.data.config
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('UveAclVirtualNetworkConfigTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = UveAclVirtualNetworkConfig()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('UveAclVirtualNetworkConfigTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveAclVirtualMachineConfigTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (UveAclVirtualMachineConfig, UveAclVirtualMachineConfig.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 1124326490
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.config is not None:
- tdata.config = self.data.config
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('UveAclVirtualMachineConfigTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = UveAclVirtualMachineConfig()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('UveAclVirtualMachineConfigTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-'UveAclVirtualNetworkConfigTrace',
-'UveAclVirtualMachineConfigTrace',
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-'UveAclVirtualNetworkConfig',
-'UveAclVirtualMachineConfig',
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/acl/ttypes.pyc b/Testcases/cfgm_common/uve/acl/ttypes.pyc
deleted file mode 100644
index eafdd71..0000000
--- a/Testcases/cfgm_common/uve/acl/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.py
+++ /dev/null
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.pyc
deleted file mode 100644
index 8d74650..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.html b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.html
deleted file mode 100644
index 166887a..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: cfgm_cpuinfo</title></head><body>
-<h1>Module: cfgm_cpuinfo</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>cfgm_cpuinfo</td><td></td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.xml b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.xml
deleted file mode 100644
index da831a3..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cfgm_cpuinfo.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<cfgm_cpuinfo type="rlist">
-</cfgm_cpuinfo>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.pyc
deleted file mode 100644
index 9d1a5e5..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.pyc
deleted file mode 100644
index 1446e7d..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.pyc
deleted file mode 100644
index 453ec8d..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.html b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.html
deleted file mode 100644
index f2fb672..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: cpuinfo</title></head><body>
-<h1>Module: cpuinfo</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>cpuinfo</td><td><a href="cpuinfo.html#Snh_CpuLoadInfoReq">CpuLoadInfoReq</a><br/>
-</td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-<div class="definition"><h3 id="Snh_CpuLoadInfoReq">CpuLoadInfoReq</h3>
-<form action="Snh_CpuLoadInfoReq" method="get">
-<table><tr><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</th><th>Value</th></tr>
-</table><button type="submit">Send</button></form><br/></div></body></html>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.xml b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.xml
deleted file mode 100644
index d3a129b..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/cpuinfo.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<cpuinfo type="rlist">
-<CpuLoadInfoReq type="sandesh">
-</CpuLoadInfoReq>
-</cpuinfo>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.py
deleted file mode 100644
index e48bba8..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.py
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-{ 'uri':'/Snh_CpuLoadInfoReq', 'method':ttypes.CpuLoadInfoReq.handle_http_request },
-]
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.pyc
deleted file mode 100644
index c013398..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/index.html b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/index.html
deleted file mode 100644
index a338214..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>cpuinfo</td><td><a href="cpuinfo.html#Snh_CpuLoadInfoReq">CpuLoadInfoReq</a><br/>
-</td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.py
deleted file mode 100644
index 22463de..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
-
-# Create a derived class from "CpuLoadInfoReq" to handle
-# the sandesh request. Add this derived class "CpuLoadInfoReq_derived"
-# in module CpuLoadInfoReq_derived.py and add it in your package
-
-class CpuLoadInfoReq_derived(CpuLoadInfoReq):
-
-
- def handle_request(self):
- # Add your code to handle the "CpuLoadInfoReq" request
- pass
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.pyc
deleted file mode 100644
index d8eb2c1..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/style.css b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.py
deleted file mode 100644
index fa6ed17..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.py
+++ /dev/null
@@ -1,960 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class CpuLoadAvg(object):
- """
- Attributes:
- - one_min_avg
- - five_min_avg
- - fifteen_min_avg
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.DOUBLE, 'one_min_avg', None, None, ), # 1
- (2, TType.DOUBLE, 'five_min_avg', None, None, ), # 2
- (3, TType.DOUBLE, 'fifteen_min_avg', None, None, ), # 3
- )
-
- def __init__(self, one_min_avg=None, five_min_avg=None, fifteen_min_avg=None,):
- self.one_min_avg = one_min_avg
- self.five_min_avg = five_min_avg
- self.fifteen_min_avg = fifteen_min_avg
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.DOUBLE:
- (length, self.one_min_avg) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.DOUBLE:
- (length, self.five_min_avg) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.DOUBLE:
- (length, self.fifteen_min_avg) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('CpuLoadAvg') < 0: return -1
- if self.one_min_avg is not None:
- annotations = {}
- if oprot.writeFieldBegin('one_min_avg', TType.DOUBLE, 1, annotations) < 0: return -1
- if oprot.writeDouble(self.one_min_avg) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.five_min_avg is not None:
- annotations = {}
- if oprot.writeFieldBegin('five_min_avg', TType.DOUBLE, 2, annotations) < 0: return -1
- if oprot.writeDouble(self.five_min_avg) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.fifteen_min_avg is not None:
- annotations = {}
- if oprot.writeFieldBegin('fifteen_min_avg', TType.DOUBLE, 3, annotations) < 0: return -1
- if oprot.writeDouble(self.fifteen_min_avg) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.one_min_avg is not None:
- log_str.write('one_min_avg = ')
- log_str.write(str(self.one_min_avg))
- log_str.write(' ')
- if self.five_min_avg is not None:
- log_str.write('five_min_avg = ')
- log_str.write(str(self.five_min_avg))
- log_str.write(' ')
- if self.fifteen_min_avg is not None:
- log_str.write('fifteen_min_avg = ')
- log_str.write(str(self.fifteen_min_avg))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class MemInfo(object):
- """
- Attributes:
- - virt
- - peakvirt
- - res
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.U32, 'virt', None, None, ), # 1
- (2, TType.U32, 'peakvirt', None, None, ), # 2
- (3, TType.U32, 'res', None, None, ), # 3
- )
-
- def __init__(self, virt=None, peakvirt=None, res=None,):
- self.virt = virt
- self.peakvirt = peakvirt
- self.res = res
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.U32:
- (length, self.virt) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.U32:
- (length, self.peakvirt) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.U32:
- (length, self.res) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('MemInfo') < 0: return -1
- if self.virt is not None:
- annotations = {}
- if oprot.writeFieldBegin('virt', TType.U32, 1, annotations) < 0: return -1
- if oprot.writeU32(self.virt) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.peakvirt is not None:
- annotations = {}
- if oprot.writeFieldBegin('peakvirt', TType.U32, 2, annotations) < 0: return -1
- if oprot.writeU32(self.peakvirt) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.res is not None:
- annotations = {}
- if oprot.writeFieldBegin('res', TType.U32, 3, annotations) < 0: return -1
- if oprot.writeU32(self.res) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.virt is not None:
- log_str.write('virt = ')
- log_str.write(str(self.virt))
- log_str.write(' ')
- if self.peakvirt is not None:
- log_str.write('peakvirt = ')
- log_str.write(str(self.peakvirt))
- log_str.write(' ')
- if self.res is not None:
- log_str.write('res = ')
- log_str.write(str(self.res))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class SysMemInfo(object):
- """
- Attributes:
- - total
- - used
- - free
- - buffers
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.U32, 'total', None, None, ), # 1
- (2, TType.U32, 'used', None, None, ), # 2
- (3, TType.U32, 'free', None, None, ), # 3
- (4, TType.U32, 'buffers', None, None, ), # 4
- )
-
- def __init__(self, total=None, used=None, free=None, buffers=None,):
- self.total = total
- self.used = used
- self.free = free
- self.buffers = buffers
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.U32:
- (length, self.total) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.U32:
- (length, self.used) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.U32:
- (length, self.free) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.U32:
- (length, self.buffers) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('SysMemInfo') < 0: return -1
- if self.total is not None:
- annotations = {}
- if oprot.writeFieldBegin('total', TType.U32, 1, annotations) < 0: return -1
- if oprot.writeU32(self.total) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.used is not None:
- annotations = {}
- if oprot.writeFieldBegin('used', TType.U32, 2, annotations) < 0: return -1
- if oprot.writeU32(self.used) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.free is not None:
- annotations = {}
- if oprot.writeFieldBegin('free', TType.U32, 3, annotations) < 0: return -1
- if oprot.writeU32(self.free) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.buffers is not None:
- annotations = {}
- if oprot.writeFieldBegin('buffers', TType.U32, 4, annotations) < 0: return -1
- if oprot.writeU32(self.buffers) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.total is not None:
- log_str.write('total = ')
- log_str.write(str(self.total))
- log_str.write(' ')
- if self.used is not None:
- log_str.write('used = ')
- log_str.write(str(self.used))
- log_str.write(' ')
- if self.free is not None:
- log_str.write('free = ')
- log_str.write(str(self.free))
- log_str.write(' ')
- if self.buffers is not None:
- log_str.write('buffers = ')
- log_str.write(str(self.buffers))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class CpuLoadInfo(object):
- """
- Attributes:
- - num_cpu
- - sys_mem_info
- - meminfo
- - cpuload
- - cpu_share
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.U32, 'num_cpu', None, None, ), # 1
- (2, TType.STRUCT, 'meminfo', (MemInfo, MemInfo.thrift_spec), None, ), # 2
- (3, TType.STRUCT, 'cpuload', (CpuLoadAvg, CpuLoadAvg.thrift_spec), None, ), # 3
- (4, TType.DOUBLE, 'cpu_share', None, None, ), # 4
- (5, TType.STRUCT, 'sys_mem_info', (SysMemInfo, SysMemInfo.thrift_spec), None, ), # 5
- )
-
- def __init__(self, num_cpu=None, sys_mem_info=None, meminfo=None, cpuload=None, cpu_share=None,):
- self.num_cpu = num_cpu
- self.sys_mem_info = sys_mem_info
- self.meminfo = meminfo
- self.cpuload = cpuload
- self.cpu_share = cpu_share
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.U32:
- (length, self.num_cpu) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.STRUCT:
- self.sys_mem_info = SysMemInfo()
- read_cnt += self.sys_mem_info.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRUCT:
- self.meminfo = MemInfo()
- read_cnt += self.meminfo.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRUCT:
- self.cpuload = CpuLoadAvg()
- read_cnt += self.cpuload.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.DOUBLE:
- (length, self.cpu_share) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('CpuLoadInfo') < 0: return -1
- if self.num_cpu is not None:
- annotations = {}
- if oprot.writeFieldBegin('num_cpu', TType.U32, 1, annotations) < 0: return -1
- if oprot.writeU32(self.num_cpu) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.meminfo is not None:
- annotations = {}
- if oprot.writeFieldBegin('meminfo', TType.STRUCT, 2, annotations) < 0: return -1
- if self.meminfo.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.cpuload is not None:
- annotations = {}
- if oprot.writeFieldBegin('cpuload', TType.STRUCT, 3, annotations) < 0: return -1
- if self.cpuload.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.cpu_share is not None:
- annotations = {}
- if oprot.writeFieldBegin('cpu_share', TType.DOUBLE, 4, annotations) < 0: return -1
- if oprot.writeDouble(self.cpu_share) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.sys_mem_info is not None:
- annotations = {}
- if oprot.writeFieldBegin('sys_mem_info', TType.STRUCT, 5, annotations) < 0: return -1
- if self.sys_mem_info.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.num_cpu is not None:
- log_str.write('num_cpu = ')
- log_str.write(str(self.num_cpu))
- log_str.write(' ')
- if self.sys_mem_info is not None:
- log_str.write('sys_mem_info = ')
- log_str.write('<< ')
- log_str.write(self.sys_mem_info.log())
- log_str.write('>>')
- log_str.write(' ')
- if self.meminfo is not None:
- log_str.write('meminfo = ')
- log_str.write('<< ')
- log_str.write(self.meminfo.log())
- log_str.write('>>')
- log_str.write(' ')
- if self.cpuload is not None:
- log_str.write('cpuload = ')
- log_str.write('<< ')
- log_str.write(self.cpuload.log())
- log_str.write('>>')
- log_str.write(' ')
- if self.cpu_share is not None:
- log_str.write('cpu_share = ')
- log_str.write(str(self.cpu_share))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ProcessCpuInfo(object):
- """
- Attributes:
- - module_id
- - inst_id
- - mem_virt
- - cpu_share
- - mem_res
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'module_id', None, None, ), # 1
- (2, TType.STRING, 'inst_id', None, None, ), # 2
- (3, TType.U32, 'mem_virt', None, None, ), # 3
- (4, TType.DOUBLE, 'cpu_share', None, None, ), # 4
- (5, TType.U32, 'mem_res', None, None, ), # 5
- )
-
- def __init__(self, module_id=None, inst_id=None, mem_virt=None, cpu_share=None, mem_res=None,):
- self.module_id = module_id
- self.inst_id = inst_id
- self.mem_virt = mem_virt
- self.cpu_share = cpu_share
- self.mem_res = mem_res
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.module_id) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.inst_id) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.U32:
- (length, self.mem_virt) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.DOUBLE:
- (length, self.cpu_share) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.U32:
- (length, self.mem_res) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('ProcessCpuInfo') < 0: return -1
- if self.module_id is not None:
- annotations = {}
- if oprot.writeFieldBegin('module_id', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.module_id) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.inst_id is not None:
- annotations = {}
- if oprot.writeFieldBegin('inst_id', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.inst_id) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.mem_virt is not None:
- annotations = {}
- if oprot.writeFieldBegin('mem_virt', TType.U32, 3, annotations) < 0: return -1
- if oprot.writeU32(self.mem_virt) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.cpu_share is not None:
- annotations = {}
- if oprot.writeFieldBegin('cpu_share', TType.DOUBLE, 4, annotations) < 0: return -1
- if oprot.writeDouble(self.cpu_share) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.mem_res is not None:
- annotations = {}
- if oprot.writeFieldBegin('mem_res', TType.U32, 5, annotations) < 0: return -1
- if oprot.writeU32(self.mem_res) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.module_id is not None:
- log_str.write('module_id = ')
- log_str.write(self.module_id)
- log_str.write(' ')
- if self.inst_id is not None:
- log_str.write('inst_id = ')
- log_str.write(self.inst_id)
- log_str.write(' ')
- if self.mem_virt is not None:
- log_str.write('mem_virt = ')
- log_str.write(str(self.mem_virt))
- log_str.write(' ')
- if self.cpu_share is not None:
- log_str.write('cpu_share = ')
- log_str.write(str(self.cpu_share))
- log_str.write(' ')
- if self.mem_res is not None:
- log_str.write('mem_res = ')
- log_str.write(str(self.mem_res))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class CpuLoadInfoReq(sandesh_base.SandeshRequest):
-
- thrift_spec = (
- )
-
- def __init__(self, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshRequest.__init__(self)
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 2471203225
- self._hints = 0
-
- @staticmethod
- def handle_http_request(sandesh=sandesh_base.sandesh_global):
- sandesh_req = CpuLoadInfoReq()
- if not sandesh_req:
- return SandeshHttp.http_error('Sandesh Request "CpuLoadInfoReq" not implemented')
- sandesh_req._context = bottle.request.url
- handle_req_fn = getattr(sandesh_req, "handle_request", None)
- if callable(handle_req_fn):
- handle_req_fn(sandesh_req)
- else:
- return SandeshHttp.http_error('Sandesh Request "CpuLoadInfoReq" not implemented')
- resp = SandeshHttp.get_http_response()
- if resp:
- return resp
- else:
- return SandeshHttp.http_error('No Response for Sandesh Request "CpuLoadInfoReq"')
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('CpuLoadInfoReq') < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class CpuLoadInfoResp(sandesh_base.SandeshResponse):
-
- thrift_spec = (
- (0, TType.BOOL, 'more', None, None, ), # 0
- (1, TType.STRUCT, 'cpu_info', (CpuLoadInfo, CpuLoadInfo.thrift_spec), None, ), # 1
- )
-
- def __init__(self, cpu_info=None, more=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshResponse.__init__(self)
- self.cpu_info = cpu_info
- self.more = more
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 4227955829
- self._hints = 0
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('CpuLoadInfoResp: ')
- if self.cpu_info is not None:
- log_str.write('cpu_info = ')
- log_str.write('<< ')
- log_str.write(self.cpu_info.log())
- log_str.write('>>')
- log_str.write(' ')
- if self.more is not None:
- log_str.write('more = ')
- if self.more:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.cpu_info = CpuLoadInfo()
- read_cnt += self.cpu_info.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 0:
- if ftype == TType.BOOL:
- (length, self.more) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('CpuLoadInfoResp') < 0: return -1
- if self.more is not None:
- annotations = {}
- if oprot.writeFieldBegin('more', TType.BOOL, 0, annotations) < 0: return -1
- if oprot.writeBool(self.more) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.cpu_info is not None:
- annotations = {}
- if oprot.writeFieldBegin('cpu_info', TType.STRUCT, 1, annotations) < 0: return -1
- if self.cpu_info.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.more != other.more:
- return False
- if self.cpu_info != other.cpu_info:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-'CpuLoadInfoReq',
-]
-
-
-_SANDESH_UVE_LIST = [
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.pyc
deleted file mode 100644
index 5cffc67..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/cpuinfo/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.pyc
deleted file mode 100644
index 8dec371..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/index.html b/Testcases/cfgm_common/uve/cfgm_cpuinfo/index.html
deleted file mode 100644
index d9836a6..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>cfgm_cpuinfo</td><td></td></tr>
-<tr>
-<td>cpuinfo</td><td><a href="cpuinfo.html#Snh_CpuLoadInfoReq">CpuLoadInfoReq</a><br/>
-</td></tr>
-<tr>
-<td>process_info</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.pyc
deleted file mode 100644
index 34a8d06..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.py
deleted file mode 100644
index 561413e..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
-ConnectionTypeNames = {
- 0 : "Test",
- 1 : "IFMap",
- 2 : "XMPP",
- 3 : "Collector",
- 4 : "Database",
- 5 : "Redis",
- 6 : "Zookeeper",
- 7 : "Discovery",
- 8 : "ApiServer",
- 9 : "ToR",
-}
-ConnectionStatusNames = {
- 0 : "Initializing",
- 1 : "Down",
- 2 : "Up",
-}
-ProcessStateNames = {
- 0 : "Functional",
- 1 : "Non-Functional",
-}
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.pyc
deleted file mode 100644
index a13a91f..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.pyc
deleted file mode 100644
index 4348a49..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/index.html b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/index.html
deleted file mode 100644
index 9550828..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>process_info</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.html b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.html
deleted file mode 100644
index 2a1230f..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: process_info</title></head><body>
-<h1>Module: process_info</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>process_info</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.xml b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.xml
deleted file mode 100644
index ed715d3..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/process_info.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<process_info type="rlist">
-</process_info>
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.pyc
deleted file mode 100644
index 11f0c97..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/style.css b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.py
deleted file mode 100644
index 5c12c29..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.py
+++ /dev/null
@@ -1,854 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-class ConnectionType(object):
- TEST = 0
- IFMAP = 1
- XMPP = 2
- COLLECTOR = 3
- DATABASE = 4
- REDIS = 5
- ZOOKEEPER = 6
- DISCOVERY = 7
- APISERVER = 8
- TOR = 9
-
- _VALUES_TO_NAMES = {
- 0: "TEST",
- 1: "IFMAP",
- 2: "XMPP",
- 3: "COLLECTOR",
- 4: "DATABASE",
- 5: "REDIS",
- 6: "ZOOKEEPER",
- 7: "DISCOVERY",
- 8: "APISERVER",
- 9: "TOR",
- }
-
- _NAMES_TO_VALUES = {
- "TEST": 0,
- "IFMAP": 1,
- "XMPP": 2,
- "COLLECTOR": 3,
- "DATABASE": 4,
- "REDIS": 5,
- "ZOOKEEPER": 6,
- "DISCOVERY": 7,
- "APISERVER": 8,
- "TOR": 9,
- }
-
-class ConnectionStatus(object):
- INIT = 0
- DOWN = 1
- UP = 2
-
- _VALUES_TO_NAMES = {
- 0: "INIT",
- 1: "DOWN",
- 2: "UP",
- }
-
- _NAMES_TO_VALUES = {
- "INIT": 0,
- "DOWN": 1,
- "UP": 2,
- }
-
-class ProcessState(object):
- FUNCTIONAL = 0
- NON_FUNCTIONAL = 1
-
- _VALUES_TO_NAMES = {
- 0: "FUNCTIONAL",
- 1: "NON_FUNCTIONAL",
- }
-
- _NAMES_TO_VALUES = {
- "FUNCTIONAL": 0,
- "NON_FUNCTIONAL": 1,
- }
-
-
-class ConnectionInfo(object):
- """
- Attributes:
- - type
- - name
- - server_addrs
- - status
- - description
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'type', None, None, ), # 1
- (2, TType.STRING, 'name', None, None, ), # 2
- (3, TType.LIST, 'server_addrs', (TType.STRING,None), None, ), # 3
- (4, TType.STRING, 'status', None, None, ), # 4
- (5, TType.STRING, 'description', None, None, ), # 5
- )
-
- def __init__(self, type=None, name=None, server_addrs=None, status=None, description=None,):
- self.type = type
- self.name = name
- self.server_addrs = server_addrs
- self.status = status
- self.description = description
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.type) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.LIST:
- self.server_addrs = []
- (length, _etype3, _size0) = iprot.readListBegin()
- read_cnt += length
- for _i4 in xrange(_size0):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem5) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.server_addrs.append(_elem5)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.STRING:
- (length, self.status) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.STRING:
- (length, self.description) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('ConnectionInfo') < 0: return -1
- if self.type is not None:
- annotations = {}
- if oprot.writeFieldBegin('type', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.type) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.name is not None:
- annotations = {}
- if oprot.writeFieldBegin('name', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.server_addrs is not None:
- annotations = {}
- if oprot.writeFieldBegin('server_addrs', TType.LIST, 3, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.server_addrs)) < 0: return -1
- for iter6 in self.server_addrs:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter6) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.status is not None:
- annotations = {}
- if oprot.writeFieldBegin('status', TType.STRING, 4, annotations) < 0: return -1
- if oprot.writeString(self.status) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.description is not None:
- annotations = {}
- if oprot.writeFieldBegin('description', TType.STRING, 5, annotations) < 0: return -1
- if oprot.writeString(self.description) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.type is not None:
- log_str.write('type = ')
- log_str.write(self.type)
- log_str.write(' ')
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.server_addrs is not None:
- log_str.write('server_addrs = ')
- log_str.write('[ ')
- for iter7 in self.server_addrs:
- log_str.write(iter7)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.status is not None:
- log_str.write('status = ')
- log_str.write(self.status)
- log_str.write(' ')
- if self.description is not None:
- log_str.write('description = ')
- log_str.write(self.description)
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ProcessStatus(object):
- """
- Attributes:
- - module_id
- - instance_id
- - state
- - connection_infos
- - description
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'module_id', None, None, ), # 1
- (2, TType.STRING, 'instance_id', None, None, ), # 2
- (3, TType.STRING, 'state', None, None, ), # 3
- (4, TType.LIST, 'connection_infos', (TType.STRUCT,(ConnectionInfo, ConnectionInfo.thrift_spec)), None, ), # 4
- (5, TType.STRING, 'description', None, None, ), # 5
- )
-
- def __init__(self, module_id=None, instance_id=None, state=None, connection_infos=None, description=None,):
- self.module_id = module_id
- self.instance_id = instance_id
- self.state = state
- self.connection_infos = connection_infos
- self.description = description
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.module_id) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.instance_id) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.state) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.LIST:
- self.connection_infos = []
- (length, _etype11, _size8) = iprot.readListBegin()
- read_cnt += length
- for _i12 in xrange(_size8):
- _elem13 = ConnectionInfo()
- read_cnt += _elem13.read(iprot)
- self.connection_infos.append(_elem13)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.STRING:
- (length, self.description) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('ProcessStatus') < 0: return -1
- if self.module_id is not None:
- annotations = {}
- if oprot.writeFieldBegin('module_id', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.module_id) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.instance_id is not None:
- annotations = {}
- if oprot.writeFieldBegin('instance_id', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.instance_id) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.state is not None:
- annotations = {}
- if oprot.writeFieldBegin('state', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.state) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.connection_infos is not None:
- annotations = {}
- if oprot.writeFieldBegin('connection_infos', TType.LIST, 4, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.connection_infos)) < 0: return -1
- for iter14 in self.connection_infos:
- if iter14.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.description is not None:
- annotations = {}
- if oprot.writeFieldBegin('description', TType.STRING, 5, annotations) < 0: return -1
- if oprot.writeString(self.description) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.module_id is not None:
- log_str.write('module_id = ')
- log_str.write(self.module_id)
- log_str.write(' ')
- if self.instance_id is not None:
- log_str.write('instance_id = ')
- log_str.write(self.instance_id)
- log_str.write(' ')
- if self.state is not None:
- log_str.write('state = ')
- log_str.write(self.state)
- log_str.write(' ')
- if self.connection_infos is not None:
- log_str.write('connection_infos = ')
- log_str.write('[ ')
- for iter15 in self.connection_infos:
- log_str.write('<< ')
- log_str.write(iter15.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.description is not None:
- log_str.write('description = ')
- log_str.write(self.description)
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class DiskPartitionUsageStats(object):
- """
- Attributes:
- - partition_type
- - partition_name
- - partition_space_used_1k
- - partition_space_available_1k
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'partition_type', None, None, ), # 1
- (2, TType.STRING, 'partition_name', None, None, ), # 2
- (3, TType.U64, 'partition_space_used_1k', None, None, ), # 3
- (4, TType.U64, 'partition_space_available_1k', None, None, ), # 4
- )
-
- def __init__(self, partition_type=None, partition_name=None, partition_space_used_1k=None, partition_space_available_1k=None,):
- self.partition_type = partition_type
- self.partition_name = partition_name
- self.partition_space_used_1k = partition_space_used_1k
- self.partition_space_available_1k = partition_space_available_1k
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.partition_type) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.partition_name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.U64:
- (length, self.partition_space_used_1k) = iprot.readU64();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.U64:
- (length, self.partition_space_available_1k) = iprot.readU64();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('DiskPartitionUsageStats') < 0: return -1
- if self.partition_type is not None:
- annotations = {}
- if oprot.writeFieldBegin('partition_type', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.partition_type) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.partition_name is not None:
- annotations = {}
- if oprot.writeFieldBegin('partition_name', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.partition_name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.partition_space_used_1k is not None:
- annotations = {}
- if oprot.writeFieldBegin('partition_space_used_1k', TType.U64, 3, annotations) < 0: return -1
- if oprot.writeU64(self.partition_space_used_1k) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.partition_space_available_1k is not None:
- annotations = {}
- if oprot.writeFieldBegin('partition_space_available_1k', TType.U64, 4, annotations) < 0: return -1
- if oprot.writeU64(self.partition_space_available_1k) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.partition_type is not None:
- log_str.write('partition_type = ')
- log_str.write(self.partition_type)
- log_str.write(' ')
- if self.partition_name is not None:
- log_str.write('partition_name = ')
- log_str.write(self.partition_name)
- log_str.write(' ')
- if self.partition_space_used_1k is not None:
- log_str.write('partition_space_used_1k = ')
- log_str.write(str(self.partition_space_used_1k))
- log_str.write(' ')
- if self.partition_space_available_1k is not None:
- log_str.write('partition_space_available_1k = ')
- log_str.write(str(self.partition_space_available_1k))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ProcessInfo(object):
- """
- Attributes:
- - process_name
- - process_state
- - start_count
- - stop_count
- - exit_count
- - last_start_time
- - last_stop_time
- - last_exit_time
- - core_file_list
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'process_name', None, None, ), # 1
- (2, TType.STRING, 'process_state', None, None, ), # 2
- (3, TType.U32, 'start_count', None, None, ), # 3
- (4, TType.U32, 'stop_count', None, None, ), # 4
- (5, TType.U32, 'exit_count', None, None, ), # 5
- (6, TType.STRING, 'last_start_time', None, None, ), # 6
- (7, TType.STRING, 'last_stop_time', None, None, ), # 7
- (8, TType.STRING, 'last_exit_time', None, None, ), # 8
- (9, TType.LIST, 'core_file_list', (TType.STRING,None), None, ), # 9
- )
-
- def __init__(self, process_name=None, process_state=None, start_count=None, stop_count=None, exit_count=None, last_start_time=None, last_stop_time=None, last_exit_time=None, core_file_list=None,):
- self.process_name = process_name
- self.process_state = process_state
- self.start_count = start_count
- self.stop_count = stop_count
- self.exit_count = exit_count
- self.last_start_time = last_start_time
- self.last_stop_time = last_stop_time
- self.last_exit_time = last_exit_time
- self.core_file_list = core_file_list
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.process_name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.process_state) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.U32:
- (length, self.start_count) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.U32:
- (length, self.stop_count) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.U32:
- (length, self.exit_count) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.STRING:
- (length, self.last_start_time) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 7:
- if ftype == TType.STRING:
- (length, self.last_stop_time) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 8:
- if ftype == TType.STRING:
- (length, self.last_exit_time) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 9:
- if ftype == TType.LIST:
- self.core_file_list = []
- (length, _etype19, _size16) = iprot.readListBegin()
- read_cnt += length
- for _i20 in xrange(_size16):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem21) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.core_file_list.append(_elem21)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('ProcessInfo') < 0: return -1
- if self.process_name is not None:
- annotations = {}
- if oprot.writeFieldBegin('process_name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.process_name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.process_state is not None:
- annotations = {}
- if oprot.writeFieldBegin('process_state', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.process_state) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.start_count is not None:
- annotations = {}
- if oprot.writeFieldBegin('start_count', TType.U32, 3, annotations) < 0: return -1
- if oprot.writeU32(self.start_count) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.stop_count is not None:
- annotations = {}
- if oprot.writeFieldBegin('stop_count', TType.U32, 4, annotations) < 0: return -1
- if oprot.writeU32(self.stop_count) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.exit_count is not None:
- annotations = {}
- if oprot.writeFieldBegin('exit_count', TType.U32, 5, annotations) < 0: return -1
- if oprot.writeU32(self.exit_count) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.last_start_time is not None:
- annotations = {}
- if oprot.writeFieldBegin('last_start_time', TType.STRING, 6, annotations) < 0: return -1
- if oprot.writeString(self.last_start_time) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.last_stop_time is not None:
- annotations = {}
- if oprot.writeFieldBegin('last_stop_time', TType.STRING, 7, annotations) < 0: return -1
- if oprot.writeString(self.last_stop_time) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.last_exit_time is not None:
- annotations = {}
- if oprot.writeFieldBegin('last_exit_time', TType.STRING, 8, annotations) < 0: return -1
- if oprot.writeString(self.last_exit_time) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.core_file_list is not None:
- annotations = {}
- if oprot.writeFieldBegin('core_file_list', TType.LIST, 9, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.core_file_list)) < 0: return -1
- for iter22 in self.core_file_list:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter22) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.process_name is not None:
- log_str.write('process_name = ')
- log_str.write(self.process_name)
- log_str.write(' ')
- if self.process_state is not None:
- log_str.write('process_state = ')
- log_str.write(self.process_state)
- log_str.write(' ')
- if self.start_count is not None:
- log_str.write('start_count = ')
- log_str.write(str(self.start_count))
- log_str.write(' ')
- if self.stop_count is not None:
- log_str.write('stop_count = ')
- log_str.write(str(self.stop_count))
- log_str.write(' ')
- if self.exit_count is not None:
- log_str.write('exit_count = ')
- log_str.write(str(self.exit_count))
- log_str.write(' ')
- if self.last_start_time is not None:
- log_str.write('last_start_time = ')
- log_str.write(self.last_start_time)
- log_str.write(' ')
- if self.last_stop_time is not None:
- log_str.write('last_stop_time = ')
- log_str.write(self.last_stop_time)
- log_str.write(' ')
- if self.last_exit_time is not None:
- log_str.write('last_exit_time = ')
- log_str.write(self.last_exit_time)
- log_str.write(' ')
- if self.core_file_list is not None:
- log_str.write('core_file_list = ')
- log_str.write('[ ')
- for iter23 in self.core_file_list:
- log_str.write(iter23)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.pyc
deleted file mode 100644
index a07afd4..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/process_info/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.pyc
deleted file mode 100644
index 0ba81c0..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/style.css b/Testcases/cfgm_common/uve/cfgm_cpuinfo/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py b/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py
deleted file mode 100644
index ce6e3ae..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.py
+++ /dev/null
@@ -1,1281 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-import cpuinfo.ttypes
-import process_info.ttypes
-
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class ModuleCpuInfo(object):
- """
- Attributes:
- - module_id
- - cpu_info
- - instance_id
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'module_id', None, None, ), # 1
- (2, TType.STRUCT, 'cpu_info', (cpuinfo.ttypes.CpuLoadInfo, cpuinfo.ttypes.CpuLoadInfo.thrift_spec), None, ), # 2
- (3, TType.STRING, 'instance_id', None, None, ), # 3
- )
-
- def __init__(self, module_id=None, cpu_info=None, instance_id=None,):
- self.module_id = module_id
- self.cpu_info = cpu_info
- self.instance_id = instance_id
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.module_id) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRUCT:
- self.cpu_info = cpuinfo.ttypes.CpuLoadInfo()
- read_cnt += self.cpu_info.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.instance_id) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('ModuleCpuInfo') < 0: return -1
- if self.module_id is not None:
- annotations = {}
- if oprot.writeFieldBegin('module_id', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.module_id) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.cpu_info is not None:
- annotations = {}
- if oprot.writeFieldBegin('cpu_info', TType.STRUCT, 2, annotations) < 0: return -1
- if self.cpu_info.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.instance_id is not None:
- annotations = {}
- if oprot.writeFieldBegin('instance_id', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.instance_id) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.module_id is not None:
- log_str.write('module_id = ')
- log_str.write(self.module_id)
- log_str.write(' ')
- if self.cpu_info is not None:
- log_str.write('cpu_info = ')
- log_str.write('<< ')
- log_str.write(self.cpu_info.log())
- log_str.write('>>')
- log_str.write(' ')
- if self.instance_id is not None:
- log_str.write('instance_id = ')
- log_str.write(self.instance_id)
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ModuleCpuState(object):
- """
- Attributes:
- - name
- - deleted
- - module_cpu_info
- - build_info
- - config_node_ip
- - api_server_cpu_share
- - schema_xmer_cpu_share
- - service_monitor_cpu_share
- - api_server_mem_virt
- - schema_xmer_mem_virt
- - service_monitor_mem_virt
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.LIST, 'module_cpu_info', (TType.STRUCT,(ModuleCpuInfo, ModuleCpuInfo.thrift_spec)), None, ), # 3
- (4, TType.STRING, 'build_info', None, None, ), # 4
- (5, TType.LIST, 'config_node_ip', (TType.STRING,None), None, ), # 5
- (6, TType.DOUBLE, 'api_server_cpu_share', None, None, ), # 6
- (7, TType.DOUBLE, 'schema_xmer_cpu_share', None, None, ), # 7
- (8, TType.DOUBLE, 'service_monitor_cpu_share', None, None, ), # 8
- (9, TType.U32, 'api_server_mem_virt', None, None, ), # 9
- (10, TType.U32, 'schema_xmer_mem_virt', None, None, ), # 10
- (11, TType.U32, 'service_monitor_mem_virt', None, None, ), # 11
- )
-
- def __init__(self, name=None, deleted=None, module_cpu_info=None, build_info=None, config_node_ip=None, api_server_cpu_share=None, schema_xmer_cpu_share=None, service_monitor_cpu_share=None, api_server_mem_virt=None, schema_xmer_mem_virt=None, service_monitor_mem_virt=None,):
- self.name = name
- self.deleted = deleted
- self.module_cpu_info = module_cpu_info
- self.build_info = build_info
- self.config_node_ip = config_node_ip
- self.api_server_cpu_share = api_server_cpu_share
- self.schema_xmer_cpu_share = schema_xmer_cpu_share
- self.service_monitor_cpu_share = service_monitor_cpu_share
- self.api_server_mem_virt = api_server_mem_virt
- self.schema_xmer_mem_virt = schema_xmer_mem_virt
- self.service_monitor_mem_virt = service_monitor_mem_virt
- self._table = 'ObjectConfigNode'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.LIST:
- self.module_cpu_info = []
- (length, _etype3, _size0) = iprot.readListBegin()
- read_cnt += length
- for _i4 in xrange(_size0):
- _elem5 = ModuleCpuInfo()
- read_cnt += _elem5.read(iprot)
- self.module_cpu_info.append(_elem5)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.STRING:
- (length, self.build_info) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.LIST:
- self.config_node_ip = []
- (length, _etype9, _size6) = iprot.readListBegin()
- read_cnt += length
- for _i10 in xrange(_size6):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem11) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.config_node_ip.append(_elem11)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.DOUBLE:
- (length, self.api_server_cpu_share) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 7:
- if ftype == TType.DOUBLE:
- (length, self.schema_xmer_cpu_share) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 8:
- if ftype == TType.DOUBLE:
- (length, self.service_monitor_cpu_share) = iprot.readDouble();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 9:
- if ftype == TType.U32:
- (length, self.api_server_mem_virt) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 10:
- if ftype == TType.U32:
- (length, self.schema_xmer_mem_virt) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 11:
- if ftype == TType.U32:
- (length, self.service_monitor_mem_virt) = iprot.readU32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('ModuleCpuState') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.module_cpu_info is not None:
- annotations = {}
- annotations['aggtype'] = 'union'
- if oprot.writeFieldBegin('module_cpu_info', TType.LIST, 3, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.module_cpu_info)) < 0: return -1
- for iter12 in self.module_cpu_info:
- if iter12.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.build_info is not None:
- annotations = {}
- if oprot.writeFieldBegin('build_info', TType.STRING, 4, annotations) < 0: return -1
- if oprot.writeString(self.build_info) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.config_node_ip is not None:
- annotations = {}
- if oprot.writeFieldBegin('config_node_ip', TType.LIST, 5, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.config_node_ip)) < 0: return -1
- for iter13 in self.config_node_ip:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter13) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.api_server_cpu_share is not None:
- annotations = {}
- annotations['aggtype'] = 'stats'
- if oprot.writeFieldBegin('api_server_cpu_share', TType.DOUBLE, 6, annotations) < 0: return -1
- if oprot.writeDouble(self.api_server_cpu_share) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.schema_xmer_cpu_share is not None:
- annotations = {}
- annotations['aggtype'] = 'stats'
- if oprot.writeFieldBegin('schema_xmer_cpu_share', TType.DOUBLE, 7, annotations) < 0: return -1
- if oprot.writeDouble(self.schema_xmer_cpu_share) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.service_monitor_cpu_share is not None:
- annotations = {}
- annotations['aggtype'] = 'stats'
- if oprot.writeFieldBegin('service_monitor_cpu_share', TType.DOUBLE, 8, annotations) < 0: return -1
- if oprot.writeDouble(self.service_monitor_cpu_share) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.api_server_mem_virt is not None:
- annotations = {}
- annotations['aggtype'] = 'stats'
- annotations['hbin'] = '100000'
- if oprot.writeFieldBegin('api_server_mem_virt', TType.U32, 9, annotations) < 0: return -1
- if oprot.writeU32(self.api_server_mem_virt) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.schema_xmer_mem_virt is not None:
- annotations = {}
- annotations['aggtype'] = 'stats'
- annotations['hbin'] = '100000'
- if oprot.writeFieldBegin('schema_xmer_mem_virt', TType.U32, 10, annotations) < 0: return -1
- if oprot.writeU32(self.schema_xmer_mem_virt) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.service_monitor_mem_virt is not None:
- annotations = {}
- annotations['aggtype'] = 'stats'
- annotations['hbin'] = '100000'
- if oprot.writeFieldBegin('service_monitor_mem_virt', TType.U32, 11, annotations) < 0: return -1
- if oprot.writeU32(self.service_monitor_mem_virt) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.module_cpu_info is not None:
- log_str.write('module_cpu_info = ')
- log_str.write('[ ')
- for iter14 in self.module_cpu_info:
- log_str.write('<< ')
- log_str.write(iter14.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.build_info is not None:
- log_str.write('build_info = ')
- log_str.write(self.build_info)
- log_str.write(' ')
- if self.config_node_ip is not None:
- log_str.write('config_node_ip = ')
- log_str.write('[ ')
- for iter15 in self.config_node_ip:
- log_str.write(iter15)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.api_server_cpu_share is not None:
- log_str.write('api_server_cpu_share = ')
- log_str.write(str(self.api_server_cpu_share))
- log_str.write(' ')
- if self.schema_xmer_cpu_share is not None:
- log_str.write('schema_xmer_cpu_share = ')
- log_str.write(str(self.schema_xmer_cpu_share))
- log_str.write(' ')
- if self.service_monitor_cpu_share is not None:
- log_str.write('service_monitor_cpu_share = ')
- log_str.write(str(self.service_monitor_cpu_share))
- log_str.write(' ')
- if self.api_server_mem_virt is not None:
- log_str.write('api_server_mem_virt = ')
- log_str.write(str(self.api_server_mem_virt))
- log_str.write(' ')
- if self.schema_xmer_mem_virt is not None:
- log_str.write('schema_xmer_mem_virt = ')
- log_str.write(str(self.schema_xmer_mem_virt))
- log_str.write(' ')
- if self.service_monitor_mem_virt is not None:
- log_str.write('service_monitor_mem_virt = ')
- log_str.write(str(self.service_monitor_mem_virt))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ConfigCpuState(object):
- """
- Attributes:
- - name
- - deleted
- - cpu_info
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.LIST, 'cpu_info', (TType.STRUCT,(cpuinfo.ttypes.ProcessCpuInfo, cpuinfo.ttypes.ProcessCpuInfo.thrift_spec)), None, ), # 3
- )
-
- def __init__(self, name=None, deleted=None, cpu_info=None,):
- self.name = name
- self.deleted = deleted
- self.cpu_info = cpu_info
- self._table = 'ObjectConfigNode'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.LIST:
- self.cpu_info = []
- (length, _etype19, _size16) = iprot.readListBegin()
- read_cnt += length
- for _i20 in xrange(_size16):
- _elem21 = cpuinfo.ttypes.ProcessCpuInfo()
- read_cnt += _elem21.read(iprot)
- self.cpu_info.append(_elem21)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('ConfigCpuState') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.cpu_info is not None:
- annotations = {}
- annotations['aggtype'] = 'union'
- annotations['tags'] = '.module_id,.mem_virt,.cpu_share,.mem_res'
- if oprot.writeFieldBegin('cpu_info', TType.LIST, 3, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.cpu_info)) < 0: return -1
- for iter22 in self.cpu_info:
- if iter22.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.cpu_info is not None:
- log_str.write('cpu_info = ')
- log_str.write('[ ')
- for iter23 in self.cpu_info:
- log_str.write('<< ')
- log_str.write(iter23.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class NodeStatus(object):
- """
- Attributes:
- - name
- - deleted
- - status
- - process_status
- - process_info
- - disk_usage_info
- - description
- - all_core_file_list
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.STRING, 'status', None, None, ), # 3
- (4, TType.LIST, 'process_status', (TType.STRUCT,(process_info.ttypes.ProcessStatus, process_info.ttypes.ProcessStatus.thrift_spec)), None, ), # 4
- (5, TType.LIST, 'process_info', (TType.STRUCT,(process_info.ttypes.ProcessInfo, process_info.ttypes.ProcessInfo.thrift_spec)), None, ), # 5
- (6, TType.LIST, 'disk_usage_info', (TType.STRUCT,(process_info.ttypes.DiskPartitionUsageStats, process_info.ttypes.DiskPartitionUsageStats.thrift_spec)), None, ), # 6
- (7, TType.STRING, 'description', None, None, ), # 7
- (8, TType.LIST, 'all_core_file_list', (TType.STRING,None), None, ), # 8
- )
-
- def __init__(self, name=None, deleted=None, status=None, process_status=None, process_info=None, disk_usage_info=None, description=None, all_core_file_list=None,):
- self.name = name
- self.deleted = deleted
- self.status = status
- self.process_status = process_status
- self.process_info = process_info
- self.disk_usage_info = disk_usage_info
- self.description = description
- self.all_core_file_list = all_core_file_list
- self._table = 'ObjectConfigNode'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.status) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.LIST:
- self.process_status = []
- (length, _etype27, _size24) = iprot.readListBegin()
- read_cnt += length
- for _i28 in xrange(_size24):
- _elem29 = process_info.ttypes.ProcessStatus()
- read_cnt += _elem29.read(iprot)
- self.process_status.append(_elem29)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.LIST:
- self.process_info = []
- (length, _etype33, _size30) = iprot.readListBegin()
- read_cnt += length
- for _i34 in xrange(_size30):
- _elem35 = process_info.ttypes.ProcessInfo()
- read_cnt += _elem35.read(iprot)
- self.process_info.append(_elem35)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.LIST:
- self.disk_usage_info = []
- (length, _etype39, _size36) = iprot.readListBegin()
- read_cnt += length
- for _i40 in xrange(_size36):
- _elem41 = process_info.ttypes.DiskPartitionUsageStats()
- read_cnt += _elem41.read(iprot)
- self.disk_usage_info.append(_elem41)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 7:
- if ftype == TType.STRING:
- (length, self.description) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 8:
- if ftype == TType.LIST:
- self.all_core_file_list = []
- (length, _etype45, _size42) = iprot.readListBegin()
- read_cnt += length
- for _i46 in xrange(_size42):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem47) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.all_core_file_list.append(_elem47)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('NodeStatus') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.status is not None:
- annotations = {}
- if oprot.writeFieldBegin('status', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.status) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.process_status is not None:
- annotations = {}
- annotations['aggtype'] = 'union'
- if oprot.writeFieldBegin('process_status', TType.LIST, 4, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.process_status)) < 0: return -1
- for iter48 in self.process_status:
- if iter48.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.process_info is not None:
- annotations = {}
- annotations['aggtype'] = 'union'
- if oprot.writeFieldBegin('process_info', TType.LIST, 5, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.process_info)) < 0: return -1
- for iter49 in self.process_info:
- if iter49.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.disk_usage_info is not None:
- annotations = {}
- annotations['tags'] = ''
- if oprot.writeFieldBegin('disk_usage_info', TType.LIST, 6, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.disk_usage_info)) < 0: return -1
- for iter50 in self.disk_usage_info:
- if iter50.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.description is not None:
- annotations = {}
- if oprot.writeFieldBegin('description', TType.STRING, 7, annotations) < 0: return -1
- if oprot.writeString(self.description) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.all_core_file_list is not None:
- annotations = {}
- if oprot.writeFieldBegin('all_core_file_list', TType.LIST, 8, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.all_core_file_list)) < 0: return -1
- for iter51 in self.all_core_file_list:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter51) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.status is not None:
- log_str.write('status = ')
- log_str.write(self.status)
- log_str.write(' ')
- if self.process_status is not None:
- log_str.write('process_status = ')
- log_str.write('[ ')
- for iter52 in self.process_status:
- log_str.write('<< ')
- log_str.write(iter52.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.process_info is not None:
- log_str.write('process_info = ')
- log_str.write('[ ')
- for iter53 in self.process_info:
- log_str.write('<< ')
- log_str.write(iter53.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.disk_usage_info is not None:
- log_str.write('disk_usage_info = ')
- log_str.write('[ ')
- for iter54 in self.disk_usage_info:
- log_str.write('<< ')
- log_str.write(iter54.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.description is not None:
- log_str.write('description = ')
- log_str.write(self.description)
- log_str.write(' ')
- if self.all_core_file_list is not None:
- log_str.write('all_core_file_list = ')
- log_str.write('[ ')
- for iter55 in self.all_core_file_list:
- log_str.write(iter55)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ModuleCpuStateTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (ModuleCpuState, ModuleCpuState.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 3681498004
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.module_cpu_info is not None:
- tdata.module_cpu_info = self.data.module_cpu_info
- if self.data.build_info is not None:
- tdata.build_info = self.data.build_info
- if self.data.config_node_ip is not None:
- tdata.config_node_ip = self.data.config_node_ip
- if self.data.api_server_cpu_share is not None:
- tdata.api_server_cpu_share = self.data.api_server_cpu_share
- if self.data.schema_xmer_cpu_share is not None:
- tdata.schema_xmer_cpu_share = self.data.schema_xmer_cpu_share
- if self.data.service_monitor_cpu_share is not None:
- tdata.service_monitor_cpu_share = self.data.service_monitor_cpu_share
- if self.data.api_server_mem_virt is not None:
- tdata.api_server_mem_virt = self.data.api_server_mem_virt
- if self.data.schema_xmer_mem_virt is not None:
- tdata.schema_xmer_mem_virt = self.data.schema_xmer_mem_virt
- if self.data.service_monitor_mem_virt is not None:
- tdata.service_monitor_mem_virt = self.data.service_monitor_mem_virt
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('ModuleCpuStateTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = ModuleCpuState()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('ModuleCpuStateTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class ConfigCpuStateTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (ConfigCpuState, ConfigCpuState.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 3278957034
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.cpu_info is not None:
- tdata.cpu_info = self.data.cpu_info
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('ConfigCpuStateTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = ConfigCpuState()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('ConfigCpuStateTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class NodeStatusUVE(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (NodeStatus, NodeStatus.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 2778367443
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.status is not None:
- tdata.status = self.data.status
- if self.data.process_status is not None:
- tdata.process_status = self.data.process_status
- if self.data.process_info is not None:
- tdata.process_info = self.data.process_info
- if self.data.disk_usage_info is not None:
- tdata.disk_usage_info = self.data.disk_usage_info
- if self.data.description is not None:
- tdata.description = self.data.description
- if self.data.all_core_file_list is not None:
- tdata.all_core_file_list = self.data.all_core_file_list
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('NodeStatusUVE: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = NodeStatus()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('NodeStatusUVE') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-'ModuleCpuStateTrace',
-'ConfigCpuStateTrace',
-'NodeStatusUVE',
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-'ModuleCpuState',
-'ConfigCpuState',
-'NodeStatus',
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.pyc b/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.pyc
deleted file mode 100644
index 4a16093..0000000
--- a/Testcases/cfgm_common/uve/cfgm_cpuinfo/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/physical_router/__init__.py b/Testcases/cfgm_common/uve/physical_router/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/physical_router/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/physical_router/__init__.pyc b/Testcases/cfgm_common/uve/physical_router/__init__.pyc
deleted file mode 100644
index 1b6bfe5..0000000
--- a/Testcases/cfgm_common/uve/physical_router/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/physical_router/constants.py b/Testcases/cfgm_common/uve/physical_router/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/physical_router/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/physical_router/constants.pyc b/Testcases/cfgm_common/uve/physical_router/constants.pyc
deleted file mode 100644
index aee32ed..0000000
--- a/Testcases/cfgm_common/uve/physical_router/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/physical_router/http_request.py b/Testcases/cfgm_common/uve/physical_router/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/physical_router/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/physical_router/http_request.pyc b/Testcases/cfgm_common/uve/physical_router/http_request.pyc
deleted file mode 100644
index 8f6d434..0000000
--- a/Testcases/cfgm_common/uve/physical_router/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/physical_router/index.html b/Testcases/cfgm_common/uve/physical_router/index.html
deleted file mode 100644
index 8e90634..0000000
--- a/Testcases/cfgm_common/uve/physical_router/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>physical_router</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/physical_router/physical_router.html b/Testcases/cfgm_common/uve/physical_router/physical_router.html
deleted file mode 100644
index 9c65e61..0000000
--- a/Testcases/cfgm_common/uve/physical_router/physical_router.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: physical_router</title></head><body>
-<h1>Module: physical_router</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>physical_router</td><td></td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/physical_router/physical_router.xml b/Testcases/cfgm_common/uve/physical_router/physical_router.xml
deleted file mode 100644
index e1befde..0000000
--- a/Testcases/cfgm_common/uve/physical_router/physical_router.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<physical_router type="rlist">
-</physical_router>
diff --git a/Testcases/cfgm_common/uve/physical_router/request_skeleton.py b/Testcases/cfgm_common/uve/physical_router/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/physical_router/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/physical_router/request_skeleton.pyc b/Testcases/cfgm_common/uve/physical_router/request_skeleton.pyc
deleted file mode 100644
index 70674a0..0000000
--- a/Testcases/cfgm_common/uve/physical_router/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/physical_router/style.css b/Testcases/cfgm_common/uve/physical_router/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/physical_router/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/physical_router/ttypes.py b/Testcases/cfgm_common/uve/physical_router/ttypes.py
deleted file mode 100644
index 2f487ce..0000000
--- a/Testcases/cfgm_common/uve/physical_router/ttypes.py
+++ /dev/null
@@ -1,461 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class UvePhysicalRouterConfig(object):
- """
- Attributes:
- - name
- - deleted
- - ip_address
- - connected_bgp_router
- - product_info
- - auto_conf_enabled
- - netconf_enabled_status
- - last_commit_time
- - last_commit_duration
- - commit_status_message
- - total_commits_sent_since_up
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.STRING, 'ip_address', None, None, ), # 3
- (4, TType.STRING, 'connected_bgp_router', None, None, ), # 4
- (5, TType.STRING, 'product_info', None, None, ), # 5
- (6, TType.BOOL, 'auto_conf_enabled', None, None, ), # 6
- (7, TType.BOOL, 'netconf_enabled_status', None, None, ), # 7
- (8, TType.STRING, 'last_commit_time', None, None, ), # 8
- (9, TType.STRING, 'last_commit_duration', None, None, ), # 9
- (10, TType.STRING, 'commit_status_message', None, None, ), # 10
- (11, TType.I32, 'total_commits_sent_since_up', None, None, ), # 11
- )
-
- def __init__(self, name=None, deleted=None, ip_address=None, connected_bgp_router=None, product_info=None, auto_conf_enabled=None, netconf_enabled_status=None, last_commit_time=None, last_commit_duration=None, commit_status_message=None, total_commits_sent_since_up=None,):
- self.name = name
- self.deleted = deleted
- self.ip_address = ip_address
- self.connected_bgp_router = connected_bgp_router
- self.product_info = product_info
- self.auto_conf_enabled = auto_conf_enabled
- self.netconf_enabled_status = netconf_enabled_status
- self.last_commit_time = last_commit_time
- self.last_commit_duration = last_commit_duration
- self.commit_status_message = commit_status_message
- self.total_commits_sent_since_up = total_commits_sent_since_up
- self._table = 'ObjectPRouter'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.ip_address) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.STRING:
- (length, self.connected_bgp_router) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.STRING:
- (length, self.product_info) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.BOOL:
- (length, self.auto_conf_enabled) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 7:
- if ftype == TType.BOOL:
- (length, self.netconf_enabled_status) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 8:
- if ftype == TType.STRING:
- (length, self.last_commit_time) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 9:
- if ftype == TType.STRING:
- (length, self.last_commit_duration) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 10:
- if ftype == TType.STRING:
- (length, self.commit_status_message) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 11:
- if ftype == TType.I32:
- (length, self.total_commits_sent_since_up) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UvePhysicalRouterConfig') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.ip_address is not None:
- annotations = {}
- if oprot.writeFieldBegin('ip_address', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.ip_address) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.connected_bgp_router is not None:
- annotations = {}
- if oprot.writeFieldBegin('connected_bgp_router', TType.STRING, 4, annotations) < 0: return -1
- if oprot.writeString(self.connected_bgp_router) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.product_info is not None:
- annotations = {}
- if oprot.writeFieldBegin('product_info', TType.STRING, 5, annotations) < 0: return -1
- if oprot.writeString(self.product_info) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.auto_conf_enabled is not None:
- annotations = {}
- if oprot.writeFieldBegin('auto_conf_enabled', TType.BOOL, 6, annotations) < 0: return -1
- if oprot.writeBool(self.auto_conf_enabled) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.netconf_enabled_status is not None:
- annotations = {}
- if oprot.writeFieldBegin('netconf_enabled_status', TType.BOOL, 7, annotations) < 0: return -1
- if oprot.writeBool(self.netconf_enabled_status) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.last_commit_time is not None:
- annotations = {}
- if oprot.writeFieldBegin('last_commit_time', TType.STRING, 8, annotations) < 0: return -1
- if oprot.writeString(self.last_commit_time) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.last_commit_duration is not None:
- annotations = {}
- if oprot.writeFieldBegin('last_commit_duration', TType.STRING, 9, annotations) < 0: return -1
- if oprot.writeString(self.last_commit_duration) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.commit_status_message is not None:
- annotations = {}
- if oprot.writeFieldBegin('commit_status_message', TType.STRING, 10, annotations) < 0: return -1
- if oprot.writeString(self.commit_status_message) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.total_commits_sent_since_up is not None:
- annotations = {}
- if oprot.writeFieldBegin('total_commits_sent_since_up', TType.I32, 11, annotations) < 0: return -1
- if oprot.writeI32(self.total_commits_sent_since_up) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.ip_address is not None:
- log_str.write('ip_address = ')
- log_str.write(self.ip_address)
- log_str.write(' ')
- if self.connected_bgp_router is not None:
- log_str.write('connected_bgp_router = ')
- log_str.write(self.connected_bgp_router)
- log_str.write(' ')
- if self.product_info is not None:
- log_str.write('product_info = ')
- log_str.write(self.product_info)
- log_str.write(' ')
- if self.auto_conf_enabled is not None:
- log_str.write('auto_conf_enabled = ')
- if self.auto_conf_enabled:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.netconf_enabled_status is not None:
- log_str.write('netconf_enabled_status = ')
- if self.netconf_enabled_status:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.last_commit_time is not None:
- log_str.write('last_commit_time = ')
- log_str.write(self.last_commit_time)
- log_str.write(' ')
- if self.last_commit_duration is not None:
- log_str.write('last_commit_duration = ')
- log_str.write(self.last_commit_duration)
- log_str.write(' ')
- if self.commit_status_message is not None:
- log_str.write('commit_status_message = ')
- log_str.write(self.commit_status_message)
- log_str.write(' ')
- if self.total_commits_sent_since_up is not None:
- log_str.write('total_commits_sent_since_up = ')
- log_str.write(str(self.total_commits_sent_since_up))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UvePhysicalRouterConfigTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (UvePhysicalRouterConfig, UvePhysicalRouterConfig.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 147236693
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.ip_address is not None:
- tdata.ip_address = self.data.ip_address
- if self.data.connected_bgp_router is not None:
- tdata.connected_bgp_router = self.data.connected_bgp_router
- if self.data.product_info is not None:
- tdata.product_info = self.data.product_info
- if self.data.auto_conf_enabled is not None:
- tdata.auto_conf_enabled = self.data.auto_conf_enabled
- if self.data.netconf_enabled_status is not None:
- tdata.netconf_enabled_status = self.data.netconf_enabled_status
- if self.data.last_commit_time is not None:
- tdata.last_commit_time = self.data.last_commit_time
- if self.data.last_commit_duration is not None:
- tdata.last_commit_duration = self.data.last_commit_duration
- if self.data.commit_status_message is not None:
- tdata.commit_status_message = self.data.commit_status_message
- if self.data.total_commits_sent_since_up is not None:
- tdata.total_commits_sent_since_up = self.data.total_commits_sent_since_up
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('UvePhysicalRouterConfigTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = UvePhysicalRouterConfig()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('UvePhysicalRouterConfigTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-'UvePhysicalRouterConfigTrace',
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-'UvePhysicalRouterConfig',
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/physical_router/ttypes.pyc b/Testcases/cfgm_common/uve/physical_router/ttypes.pyc
deleted file mode 100644
index 3b39e02..0000000
--- a/Testcases/cfgm_common/uve/physical_router/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/service_instance/__init__.py b/Testcases/cfgm_common/uve/service_instance/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/service_instance/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/service_instance/__init__.pyc b/Testcases/cfgm_common/uve/service_instance/__init__.pyc
deleted file mode 100644
index 0841faa..0000000
--- a/Testcases/cfgm_common/uve/service_instance/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/service_instance/constants.py b/Testcases/cfgm_common/uve/service_instance/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/service_instance/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/service_instance/constants.pyc b/Testcases/cfgm_common/uve/service_instance/constants.pyc
deleted file mode 100644
index e8ee618..0000000
--- a/Testcases/cfgm_common/uve/service_instance/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/service_instance/http_request.py b/Testcases/cfgm_common/uve/service_instance/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/service_instance/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/service_instance/http_request.pyc b/Testcases/cfgm_common/uve/service_instance/http_request.pyc
deleted file mode 100644
index c14433a..0000000
--- a/Testcases/cfgm_common/uve/service_instance/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/service_instance/index.html b/Testcases/cfgm_common/uve/service_instance/index.html
deleted file mode 100644
index 6f164e3..0000000
--- a/Testcases/cfgm_common/uve/service_instance/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>service_instance</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/service_instance/request_skeleton.py b/Testcases/cfgm_common/uve/service_instance/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/service_instance/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/service_instance/request_skeleton.pyc b/Testcases/cfgm_common/uve/service_instance/request_skeleton.pyc
deleted file mode 100644
index 96f839a..0000000
--- a/Testcases/cfgm_common/uve/service_instance/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/service_instance/service_instance.html b/Testcases/cfgm_common/uve/service_instance/service_instance.html
deleted file mode 100644
index 75ca67b..0000000
--- a/Testcases/cfgm_common/uve/service_instance/service_instance.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: service_instance</title></head><body>
-<h1>Module: service_instance</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>service_instance</td><td></td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/service_instance/service_instance.xml b/Testcases/cfgm_common/uve/service_instance/service_instance.xml
deleted file mode 100644
index 4ccfff9..0000000
--- a/Testcases/cfgm_common/uve/service_instance/service_instance.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<service_instance type="rlist">
-</service_instance>
diff --git a/Testcases/cfgm_common/uve/service_instance/style.css b/Testcases/cfgm_common/uve/service_instance/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/service_instance/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/service_instance/ttypes.py b/Testcases/cfgm_common/uve/service_instance/ttypes.py
deleted file mode 100644
index c8cb3a4..0000000
--- a/Testcases/cfgm_common/uve/service_instance/ttypes.py
+++ /dev/null
@@ -1,484 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class UveSvcInstanceVMConfig(object):
- """
- Attributes:
- - uuid
- - vr_name
- - ha
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'uuid', None, None, ), # 1
- (2, TType.STRING, 'vr_name', None, None, ), # 2
- (3, TType.STRING, 'ha', None, None, ), # 3
- )
-
- def __init__(self, uuid=None, vr_name=None, ha=None,):
- self.uuid = uuid
- self.vr_name = vr_name
- self.ha = ha
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.uuid) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.vr_name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.ha) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveSvcInstanceVMConfig') < 0: return -1
- if self.uuid is not None:
- annotations = {}
- if oprot.writeFieldBegin('uuid', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.uuid) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.vr_name is not None:
- annotations = {}
- if oprot.writeFieldBegin('vr_name', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.vr_name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.ha is not None:
- annotations = {}
- if oprot.writeFieldBegin('ha', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.ha) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.uuid is not None:
- log_str.write('uuid = ')
- log_str.write(self.uuid)
- log_str.write(' ')
- if self.vr_name is not None:
- log_str.write('vr_name = ')
- log_str.write(self.vr_name)
- log_str.write(' ')
- if self.ha is not None:
- log_str.write('ha = ')
- log_str.write(self.ha)
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveSvcInstanceConfig(object):
- """
- Attributes:
- - name
- - deleted
- - st_name
- - status
- - create_ts
- - vm_list
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.STRING, 'st_name', None, None, ), # 3
- (4, TType.STRING, 'status', None, None, ), # 4
- (5, TType.I64, 'create_ts', None, None, ), # 5
- (6, TType.LIST, 'vm_list', (TType.STRUCT,(UveSvcInstanceVMConfig, UveSvcInstanceVMConfig.thrift_spec)), None, ), # 6
- )
-
- def __init__(self, name=None, deleted=None, st_name=None, status=None, create_ts=None, vm_list=None,):
- self.name = name
- self.deleted = deleted
- self.st_name = st_name
- self.status = status
- self.create_ts = create_ts
- self.vm_list = vm_list
- self._table = 'ObjectSITable'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.st_name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.STRING:
- (length, self.status) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.I64:
- (length, self.create_ts) = iprot.readI64();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.LIST:
- self.vm_list = []
- (length, _etype3, _size0) = iprot.readListBegin()
- read_cnt += length
- for _i4 in xrange(_size0):
- _elem5 = UveSvcInstanceVMConfig()
- read_cnt += _elem5.read(iprot)
- self.vm_list.append(_elem5)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveSvcInstanceConfig') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.st_name is not None:
- annotations = {}
- if oprot.writeFieldBegin('st_name', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.st_name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.status is not None:
- annotations = {}
- if oprot.writeFieldBegin('status', TType.STRING, 4, annotations) < 0: return -1
- if oprot.writeString(self.status) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.create_ts is not None:
- annotations = {}
- if oprot.writeFieldBegin('create_ts', TType.I64, 5, annotations) < 0: return -1
- if oprot.writeI64(self.create_ts) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.vm_list is not None:
- annotations = {}
- if oprot.writeFieldBegin('vm_list', TType.LIST, 6, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.vm_list)) < 0: return -1
- for iter6 in self.vm_list:
- if iter6.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.st_name is not None:
- log_str.write('st_name = ')
- log_str.write(self.st_name)
- log_str.write(' ')
- if self.status is not None:
- log_str.write('status = ')
- log_str.write(self.status)
- log_str.write(' ')
- if self.create_ts is not None:
- log_str.write('create_ts = ')
- log_str.write(str(self.create_ts))
- log_str.write(' ')
- if self.vm_list is not None:
- log_str.write('vm_list = ')
- log_str.write('[ ')
- for iter7 in self.vm_list:
- log_str.write('<< ')
- log_str.write(iter7.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveSvcInstanceConfigTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (UveSvcInstanceConfig, UveSvcInstanceConfig.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 1572544528
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.st_name is not None:
- tdata.st_name = self.data.st_name
- if self.data.status is not None:
- tdata.status = self.data.status
- if self.data.create_ts is not None:
- tdata.create_ts = self.data.create_ts
- if self.data.vm_list is not None:
- tdata.vm_list = self.data.vm_list
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('UveSvcInstanceConfigTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = UveSvcInstanceConfig()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('UveSvcInstanceConfigTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-'UveSvcInstanceConfigTrace',
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-'UveSvcInstanceConfig',
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/service_instance/ttypes.pyc b/Testcases/cfgm_common/uve/service_instance/ttypes.pyc
deleted file mode 100644
index d0f3ce4..0000000
--- a/Testcases/cfgm_common/uve/service_instance/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_machine/__init__.py b/Testcases/cfgm_common/uve/virtual_machine/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/virtual_machine/__init__.pyc b/Testcases/cfgm_common/uve/virtual_machine/__init__.pyc
deleted file mode 100644
index 9037b16..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_machine/constants.py b/Testcases/cfgm_common/uve/virtual_machine/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/virtual_machine/constants.pyc b/Testcases/cfgm_common/uve/virtual_machine/constants.pyc
deleted file mode 100644
index 5b0397a..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_machine/http_request.py b/Testcases/cfgm_common/uve/virtual_machine/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/virtual_machine/http_request.pyc b/Testcases/cfgm_common/uve/virtual_machine/http_request.pyc
deleted file mode 100644
index ba5b9e6..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_machine/index.html b/Testcases/cfgm_common/uve/virtual_machine/index.html
deleted file mode 100644
index 656351f..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>virtual_machine</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/virtual_machine/request_skeleton.py b/Testcases/cfgm_common/uve/virtual_machine/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/virtual_machine/request_skeleton.pyc b/Testcases/cfgm_common/uve/virtual_machine/request_skeleton.pyc
deleted file mode 100644
index 7a0ffff..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_machine/style.css b/Testcases/cfgm_common/uve/virtual_machine/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/virtual_machine/ttypes.py b/Testcases/cfgm_common/uve/virtual_machine/ttypes.py
deleted file mode 100644
index d2a95f0..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/ttypes.py
+++ /dev/null
@@ -1,517 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class VmInterfaceConfig(object):
- """
- Attributes:
- - name
- - ip_address
- - virtual_network
- - floating_ips
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.STRING, 'ip_address', None, None, ), # 2
- (3, TType.STRING, 'virtual_network', None, None, ), # 3
- (4, TType.LIST, 'floating_ips', (TType.STRING,None), None, ), # 4
- )
-
- def __init__(self, name=None, ip_address=None, virtual_network=None, floating_ips=None,):
- self.name = name
- self.ip_address = ip_address
- self.virtual_network = virtual_network
- self.floating_ips = floating_ips
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.ip_address) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.virtual_network) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.LIST:
- self.floating_ips = []
- (length, _etype3, _size0) = iprot.readListBegin()
- read_cnt += length
- for _i4 in xrange(_size0):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem5) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.floating_ips.append(_elem5)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('VmInterfaceConfig') < 0: return -1
- if self.name is not None:
- annotations = {}
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.ip_address is not None:
- annotations = {}
- if oprot.writeFieldBegin('ip_address', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.ip_address) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.virtual_network is not None:
- annotations = {}
- annotations['aggtype'] = 'listkey'
- if oprot.writeFieldBegin('virtual_network', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.virtual_network) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.floating_ips is not None:
- annotations = {}
- if oprot.writeFieldBegin('floating_ips', TType.LIST, 4, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.floating_ips)) < 0: return -1
- for iter6 in self.floating_ips:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter6) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.ip_address is not None:
- log_str.write('ip_address = ')
- log_str.write(self.ip_address)
- log_str.write(' ')
- if self.virtual_network is not None:
- log_str.write('virtual_network = ')
- log_str.write(self.virtual_network)
- log_str.write(' ')
- if self.floating_ips is not None:
- log_str.write('floating_ips = ')
- log_str.write('[ ')
- for iter7 in self.floating_ips:
- log_str.write(iter7)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveVirtualMachineConfig(object):
- """
- Attributes:
- - name
- - deleted
- - attached_groups
- - interface_list
- - vrouter
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.LIST, 'attached_groups', (TType.STRING,None), None, ), # 3
- (4, TType.LIST, 'interface_list', (TType.STRUCT,(VmInterfaceConfig, VmInterfaceConfig.thrift_spec)), None, ), # 4
- (5, TType.STRING, 'vrouter', None, None, ), # 5
- )
-
- def __init__(self, name=None, deleted=None, attached_groups=None, interface_list=None, vrouter=None,):
- self.name = name
- self.deleted = deleted
- self.attached_groups = attached_groups
- self.interface_list = interface_list
- self.vrouter = vrouter
- self._table = 'ObjectVMTable'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.LIST:
- self.attached_groups = []
- (length, _etype11, _size8) = iprot.readListBegin()
- read_cnt += length
- for _i12 in xrange(_size8):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem13) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.attached_groups.append(_elem13)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.LIST:
- self.interface_list = []
- (length, _etype17, _size14) = iprot.readListBegin()
- read_cnt += length
- for _i18 in xrange(_size14):
- _elem19 = VmInterfaceConfig()
- read_cnt += _elem19.read(iprot)
- self.interface_list.append(_elem19)
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.STRING:
- (length, self.vrouter) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveVirtualMachineConfig') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.attached_groups is not None:
- annotations = {}
- if oprot.writeFieldBegin('attached_groups', TType.LIST, 3, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.attached_groups)) < 0: return -1
- for iter20 in self.attached_groups:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter20) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.interface_list is not None:
- annotations = {}
- if oprot.writeFieldBegin('interface_list', TType.LIST, 4, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRUCT, len(self.interface_list)) < 0: return -1
- for iter21 in self.interface_list:
- if iter21.write(oprot) < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.vrouter is not None:
- annotations = {}
- if oprot.writeFieldBegin('vrouter', TType.STRING, 5, annotations) < 0: return -1
- if oprot.writeString(self.vrouter) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.attached_groups is not None:
- log_str.write('attached_groups = ')
- log_str.write('[ ')
- for iter22 in self.attached_groups:
- log_str.write(iter22)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.interface_list is not None:
- log_str.write('interface_list = ')
- log_str.write('[ ')
- for iter23 in self.interface_list:
- log_str.write('<< ')
- log_str.write(iter23.log())
- log_str.write('>>')
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.vrouter is not None:
- log_str.write('vrouter = ')
- log_str.write(self.vrouter)
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveVirtualMachineConfigTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (UveVirtualMachineConfig, UveVirtualMachineConfig.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 4221818251
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.attached_groups is not None:
- tdata.attached_groups = self.data.attached_groups
- if self.data.interface_list is not None:
- tdata.interface_list = self.data.interface_list
- if self.data.vrouter is not None:
- tdata.vrouter = self.data.vrouter
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('UveVirtualMachineConfigTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = UveVirtualMachineConfig()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('UveVirtualMachineConfigTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-'UveVirtualMachineConfigTrace',
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-'UveVirtualMachineConfig',
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/virtual_machine/ttypes.pyc b/Testcases/cfgm_common/uve/virtual_machine/ttypes.pyc
deleted file mode 100644
index 44085c2..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_machine/virtual_machine.html b/Testcases/cfgm_common/uve/virtual_machine/virtual_machine.html
deleted file mode 100644
index ab3f29d..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/virtual_machine.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: virtual_machine</title></head><body>
-<h1>Module: virtual_machine</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>virtual_machine</td><td></td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/virtual_machine/virtual_machine.xml b/Testcases/cfgm_common/uve/virtual_machine/virtual_machine.xml
deleted file mode 100644
index 72fb587..0000000
--- a/Testcases/cfgm_common/uve/virtual_machine/virtual_machine.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<virtual_machine type="rlist">
-</virtual_machine>
diff --git a/Testcases/cfgm_common/uve/virtual_network/__init__.py b/Testcases/cfgm_common/uve/virtual_network/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/virtual_network/__init__.pyc b/Testcases/cfgm_common/uve/virtual_network/__init__.pyc
deleted file mode 100644
index 5e20ef0..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_network/constants.py b/Testcases/cfgm_common/uve/virtual_network/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/virtual_network/constants.pyc b/Testcases/cfgm_common/uve/virtual_network/constants.pyc
deleted file mode 100644
index 13aede5..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_network/http_request.py b/Testcases/cfgm_common/uve/virtual_network/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/virtual_network/http_request.pyc b/Testcases/cfgm_common/uve/virtual_network/http_request.pyc
deleted file mode 100644
index cebf344..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_network/index.html b/Testcases/cfgm_common/uve/virtual_network/index.html
deleted file mode 100644
index 0884ed5..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>virtual_network</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/virtual_network/request_skeleton.py b/Testcases/cfgm_common/uve/virtual_network/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/virtual_network/request_skeleton.pyc b/Testcases/cfgm_common/uve/virtual_network/request_skeleton.pyc
deleted file mode 100644
index 438188b..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_network/style.css b/Testcases/cfgm_common/uve/virtual_network/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/virtual_network/ttypes.py b/Testcases/cfgm_common/uve/virtual_network/ttypes.py
deleted file mode 100644
index b58ac6e..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/ttypes.py
+++ /dev/null
@@ -1,787 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class UveVirtualNetworkConfig(object):
- """
- Attributes:
- - name
- - deleted
- - connected_networks
- - partially_connected_networks
- - routing_instance_list
- - total_acl_rules
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- None, # 3
- (4, TType.LIST, 'connected_networks', (TType.STRING,None), None, ), # 4
- (5, TType.LIST, 'partially_connected_networks', (TType.STRING,None), None, ), # 5
- (6, TType.LIST, 'routing_instance_list', (TType.STRING,None), None, ), # 6
- (7, TType.I32, 'total_acl_rules', None, None, ), # 7
- )
-
- def __init__(self, name=None, deleted=None, connected_networks=None, partially_connected_networks=None, routing_instance_list=None, total_acl_rules=None,):
- self.name = name
- self.deleted = deleted
- self.connected_networks = connected_networks
- self.partially_connected_networks = partially_connected_networks
- self.routing_instance_list = routing_instance_list
- self.total_acl_rules = total_acl_rules
- self._table = 'ObjectVNTable'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.LIST:
- self.connected_networks = []
- (length, _etype3, _size0) = iprot.readListBegin()
- read_cnt += length
- for _i4 in xrange(_size0):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem5) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.connected_networks.append(_elem5)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.LIST:
- self.partially_connected_networks = []
- (length, _etype9, _size6) = iprot.readListBegin()
- read_cnt += length
- for _i10 in xrange(_size6):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem11) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.partially_connected_networks.append(_elem11)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.LIST:
- self.routing_instance_list = []
- (length, _etype15, _size12) = iprot.readListBegin()
- read_cnt += length
- for _i16 in xrange(_size12):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem17) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.routing_instance_list.append(_elem17)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- elif fid == 7:
- if ftype == TType.I32:
- (length, self.total_acl_rules) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveVirtualNetworkConfig') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.connected_networks is not None:
- annotations = {}
- annotations['aggtype'] = 'union'
- if oprot.writeFieldBegin('connected_networks', TType.LIST, 4, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.connected_networks)) < 0: return -1
- for iter18 in self.connected_networks:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter18) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.partially_connected_networks is not None:
- annotations = {}
- annotations['aggtype'] = 'union'
- if oprot.writeFieldBegin('partially_connected_networks', TType.LIST, 5, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.partially_connected_networks)) < 0: return -1
- for iter19 in self.partially_connected_networks:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter19) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.routing_instance_list is not None:
- annotations = {}
- annotations['aggtype'] = 'union'
- if oprot.writeFieldBegin('routing_instance_list', TType.LIST, 6, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.routing_instance_list)) < 0: return -1
- for iter20 in self.routing_instance_list:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter20) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.total_acl_rules is not None:
- annotations = {}
- if oprot.writeFieldBegin('total_acl_rules', TType.I32, 7, annotations) < 0: return -1
- if oprot.writeI32(self.total_acl_rules) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.connected_networks is not None:
- log_str.write('connected_networks = ')
- log_str.write('[ ')
- for iter21 in self.connected_networks:
- log_str.write(iter21)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.partially_connected_networks is not None:
- log_str.write('partially_connected_networks = ')
- log_str.write('[ ')
- for iter22 in self.partially_connected_networks:
- log_str.write(iter22)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.routing_instance_list is not None:
- log_str.write('routing_instance_list = ')
- log_str.write('[ ')
- for iter23 in self.routing_instance_list:
- log_str.write(iter23)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- if self.total_acl_rules is not None:
- log_str.write('total_acl_rules = ')
- log_str.write(str(self.total_acl_rules))
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveServiceChainData(object):
- """
- Attributes:
- - name
- - deleted
- - source_virtual_network
- - destination_virtual_network
- - source_ports
- - destination_ports
- - protocol
- - direction
- - services
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'name', None, None, ), # 1
- (2, TType.BOOL, 'deleted', None, None, ), # 2
- (3, TType.STRING, 'source_virtual_network', None, None, ), # 3
- (4, TType.STRING, 'destination_virtual_network', None, None, ), # 4
- (5, TType.STRING, 'source_ports', None, None, ), # 5
- (6, TType.STRING, 'destination_ports', None, None, ), # 6
- (7, TType.STRING, 'protocol', None, None, ), # 7
- (8, TType.STRING, 'direction', None, None, ), # 8
- (9, TType.LIST, 'services', (TType.STRING,None), None, ), # 9
- )
-
- def __init__(self, name=None, deleted=None, source_virtual_network=None, destination_virtual_network=None, source_ports=None, destination_ports=None, protocol=None, direction=None, services=None,):
- self.name = name
- self.deleted = deleted
- self.source_virtual_network = source_virtual_network
- self.destination_virtual_network = destination_virtual_network
- self.source_ports = source_ports
- self.destination_ports = destination_ports
- self.protocol = protocol
- self.direction = direction
- self.services = services
- self._table = 'ServiceChain'
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.BOOL:
- (length, self.deleted) = iprot.readBool();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.source_virtual_network) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.STRING:
- (length, self.destination_virtual_network) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.STRING:
- (length, self.source_ports) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.STRING:
- (length, self.destination_ports) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 7:
- if ftype == TType.STRING:
- (length, self.protocol) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 8:
- if ftype == TType.STRING:
- (length, self.direction) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 9:
- if ftype == TType.LIST:
- self.services = []
- (length, _etype27, _size24) = iprot.readListBegin()
- read_cnt += length
- for _i28 in xrange(_size24):
- read_cnt += iprot.readContainerElementBegin()
- (length, _elem29) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- self.services.append(_elem29)
- read_cnt += iprot.readContainerElementEnd()
- read_cnt += iprot.readListEnd()
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('UveServiceChainData') < 0: return -1
- if self.name is not None:
- annotations = {}
- if self._table is None or self._table is '': return -1
- annotations['key'] = self._table
- if oprot.writeFieldBegin('name', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.deleted is not None:
- annotations = {}
- if oprot.writeFieldBegin('deleted', TType.BOOL, 2, annotations) < 0: return -1
- if oprot.writeBool(self.deleted) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.source_virtual_network is not None:
- annotations = {}
- if oprot.writeFieldBegin('source_virtual_network', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.source_virtual_network) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.destination_virtual_network is not None:
- annotations = {}
- if oprot.writeFieldBegin('destination_virtual_network', TType.STRING, 4, annotations) < 0: return -1
- if oprot.writeString(self.destination_virtual_network) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.source_ports is not None:
- annotations = {}
- if oprot.writeFieldBegin('source_ports', TType.STRING, 5, annotations) < 0: return -1
- if oprot.writeString(self.source_ports) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.destination_ports is not None:
- annotations = {}
- if oprot.writeFieldBegin('destination_ports', TType.STRING, 6, annotations) < 0: return -1
- if oprot.writeString(self.destination_ports) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.protocol is not None:
- annotations = {}
- if oprot.writeFieldBegin('protocol', TType.STRING, 7, annotations) < 0: return -1
- if oprot.writeString(self.protocol) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.direction is not None:
- annotations = {}
- if oprot.writeFieldBegin('direction', TType.STRING, 8, annotations) < 0: return -1
- if oprot.writeString(self.direction) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.services is not None:
- annotations = {}
- if oprot.writeFieldBegin('services', TType.LIST, 9, annotations) < 0: return -1
- if oprot.writeListBegin(TType.STRING, len(self.services)) < 0: return -1
- for iter30 in self.services:
- if oprot.writeContainerElementBegin() < 0: return -1
- if oprot.writeString(iter30) < 0: return -1
- if oprot.writeContainerElementEnd() < 0: return -1
- if oprot.writeListEnd() < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.name is not None:
- log_str.write('name = ')
- log_str.write(self.name)
- log_str.write(' ')
- if self.deleted is not None:
- log_str.write('deleted = ')
- if self.deleted:
- log_str.write('True')
- else:
- log_str.write('False')
- log_str.write(' ')
- if self.source_virtual_network is not None:
- log_str.write('source_virtual_network = ')
- log_str.write(self.source_virtual_network)
- log_str.write(' ')
- if self.destination_virtual_network is not None:
- log_str.write('destination_virtual_network = ')
- log_str.write(self.destination_virtual_network)
- log_str.write(' ')
- if self.source_ports is not None:
- log_str.write('source_ports = ')
- log_str.write(self.source_ports)
- log_str.write(' ')
- if self.destination_ports is not None:
- log_str.write('destination_ports = ')
- log_str.write(self.destination_ports)
- log_str.write(' ')
- if self.protocol is not None:
- log_str.write('protocol = ')
- log_str.write(self.protocol)
- log_str.write(' ')
- if self.direction is not None:
- log_str.write('direction = ')
- log_str.write(self.direction)
- log_str.write(' ')
- if self.services is not None:
- log_str.write('services = ')
- log_str.write('[ ')
- for iter31 in self.services:
- log_str.write(iter31)
- log_str.write(', ')
- log_str.write(' ]')
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveVirtualNetworkConfigTrace(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (UveVirtualNetworkConfig, UveVirtualNetworkConfig.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 74672981
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.connected_networks is not None:
- tdata.connected_networks = self.data.connected_networks
- if self.data.partially_connected_networks is not None:
- tdata.partially_connected_networks = self.data.partially_connected_networks
- if self.data.routing_instance_list is not None:
- tdata.routing_instance_list = self.data.routing_instance_list
- if self.data.total_acl_rules is not None:
- tdata.total_acl_rules = self.data.total_acl_rules
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('UveVirtualNetworkConfigTrace: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = UveVirtualNetworkConfig()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('UveVirtualNetworkConfigTrace') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class UveServiceChain(sandesh_base.SandeshUVE):
-
- thrift_spec = (
- None, # 0
- (1, TType.STRUCT, 'data', (UveServiceChainData, UveServiceChainData.thrift_spec), None, ), # 1
- )
-
- def __init__(self, data=None, table=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshUVE.__init__(self)
- self.data = data
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 2360766836
- self._hints = 0 | SANDESH_KEY_HINT
- if table is not None:
- self.data._table = table
-
- def update_uve(self, tdata):
- if self.data.name is not None:
- tdata.name = self.data.name
- if self.data.deleted is not None:
- tdata.deleted = self.data.deleted
- if self.data.source_virtual_network is not None:
- tdata.source_virtual_network = self.data.source_virtual_network
- if self.data.destination_virtual_network is not None:
- tdata.destination_virtual_network = self.data.destination_virtual_network
- if self.data.source_ports is not None:
- tdata.source_ports = self.data.source_ports
- if self.data.destination_ports is not None:
- tdata.destination_ports = self.data.destination_ports
- if self.data.protocol is not None:
- tdata.protocol = self.data.protocol
- if self.data.direction is not None:
- tdata.direction = self.data.direction
- if self.data.services is not None:
- tdata.services = self.data.services
- return tdata
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('UveServiceChain: ')
- if self.data is not None:
- log_str.write('data = ')
- log_str.write('<< ')
- log_str.write(self.data.log())
- log_str.write('>>')
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.data = UveServiceChainData()
- read_cnt += self.data.read(iprot)
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('UveServiceChain') < 0: return -1
- if self.data is not None:
- annotations = {}
- if oprot.writeFieldBegin('data', TType.STRUCT, 1, annotations) < 0: return -1
- if self.data.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.data != other.data:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-'UveVirtualNetworkConfigTrace',
-'UveServiceChain',
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-'UveVirtualNetworkConfig',
-'UveServiceChainData',
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/virtual_network/ttypes.pyc b/Testcases/cfgm_common/uve/virtual_network/ttypes.pyc
deleted file mode 100644
index 2888df8..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/virtual_network/virtual_network.html b/Testcases/cfgm_common/uve/virtual_network/virtual_network.html
deleted file mode 100644
index 270901f..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/virtual_network.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: virtual_network</title></head><body>
-<h1>Module: virtual_network</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>virtual_network</td><td></td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/virtual_network/virtual_network.xml b/Testcases/cfgm_common/uve/virtual_network/virtual_network.xml
deleted file mode 100644
index 7089d62..0000000
--- a/Testcases/cfgm_common/uve/virtual_network/virtual_network.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<virtual_network type="rlist">
-</virtual_network>
diff --git a/Testcases/cfgm_common/uve/vnc_api/__init__.py b/Testcases/cfgm_common/uve/vnc_api/__init__.py
deleted file mode 100644
index adefd8e..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-__all__ = ['ttypes', 'constants']
diff --git a/Testcases/cfgm_common/uve/vnc_api/__init__.pyc b/Testcases/cfgm_common/uve/vnc_api/__init__.pyc
deleted file mode 100644
index 0ac091c..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/vnc_api/constants.py b/Testcases/cfgm_common/uve/vnc_api/constants.py
deleted file mode 100644
index aadd78e..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/constants.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-from ttypes import *
-
diff --git a/Testcases/cfgm_common/uve/vnc_api/constants.pyc b/Testcases/cfgm_common/uve/vnc_api/constants.pyc
deleted file mode 100644
index efe1f9b..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/constants.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/vnc_api/http_request.py b/Testcases/cfgm_common/uve/vnc_api/http_request.py
deleted file mode 100644
index 8baea4f..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/http_request.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import ttypes
-
-_HTTP_REQUEST_LIST = [
-]
-
diff --git a/Testcases/cfgm_common/uve/vnc_api/http_request.pyc b/Testcases/cfgm_common/uve/vnc_api/http_request.pyc
deleted file mode 100644
index 2f6880e..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/http_request.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/vnc_api/index.html b/Testcases/cfgm_common/uve/vnc_api/index.html
deleted file mode 100644
index bb522d0..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html><head>
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>All Thrift declarations</title></head><body>
-<h1>All Thrift declarations</h1>
-<table><tr><th>Module</th><th>Services</th><th>Sandeshs</th><th>Data types</th><th>Constants</th></tr>
-<tr>
-<td>vnc_api</td><td></td></tr>
-</table>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/vnc_api/request_skeleton.py b/Testcases/cfgm_common/uve/vnc_api/request_skeleton.py
deleted file mode 100644
index 99c1196..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/request_skeleton.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-
-# This autogenerated skeleton file illustrates the implementation of
-# derived class to handle the sandesh request.
-
diff --git a/Testcases/cfgm_common/uve/vnc_api/request_skeleton.pyc b/Testcases/cfgm_common/uve/vnc_api/request_skeleton.pyc
deleted file mode 100644
index 0e855d5..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/request_skeleton.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/vnc_api/style.css b/Testcases/cfgm_common/uve/vnc_api/style.css
deleted file mode 100644
index 6dc2f22..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/style.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Auto-generated CSS for generated Thrift docs */
-body { font-family: Tahoma, sans-serif; }
-pre { background-color: #dddddd; padding: 6px; }
-h3,h4 { padding-top: 0px; margin-top: 0px; }
-div.definition { border: 1px solid gray; margin: 10px; padding: 10px; }
-div.extends { margin: -0.5em 0 1em 5em }
-table { border: 1px solid grey; border-collapse: collapse; }
-td { border: 1px solid grey; padding: 1px 6px; vertical-align: top; }
-th { border: 1px solid black; background-color: #bbbbbb;
- text-align: left; padding: 1px 6px; }
diff --git a/Testcases/cfgm_common/uve/vnc_api/ttypes.py b/Testcases/cfgm_common/uve/vnc_api/ttypes.py
deleted file mode 100644
index 4a38dd2..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/ttypes.py
+++ /dev/null
@@ -1,778 +0,0 @@
-#
-# Autogenerated by Sandesh Compiler (1.0)
-#
-# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
-#
-# options string: py:new_style
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-from pysandesh.Thrift import TType, TMessageType, TException
-
-from pysandesh.transport import TTransport
-from pysandesh.protocol import TBinaryProtocol, TProtocol
-try:
- from pysandesh.protocol import fastbinary
-except:
- fastbinary = None
-
-import cStringIO
-import uuid
-import bottle
-from pysandesh import sandesh_base
-from pysandesh.sandesh_http import SandeshHttp
-from pysandesh.sandesh_uve import SandeshUVETypeMaps
-from pysandesh.util import UTCTimestampUsec, UTCTimestampUsecToString
-from pysandesh.gen_py.sandesh.constants import *
-
-
-
-class VncApiCommon(object):
- """
- Attributes:
- - identifier_uuid
- - object_type
- - identifier_name
- - url
- - operation
- - useragent
- - remote_ip
- - params
- - body
- - domain
- - project
- - user
- - error
- """
-
- thrift_spec = (
- None, # 0
- (1, TType.STRING, 'identifier_uuid', None, None, ), # 1
- (2, TType.STRING, 'object_type', None, None, ), # 2
- (3, TType.STRING, 'identifier_name', None, None, ), # 3
- (4, TType.STRING, 'url', None, None, ), # 4
- (5, TType.STRING, 'operation', None, None, ), # 5
- (6, TType.STRING, 'useragent', None, None, ), # 6
- (7, TType.STRING, 'remote_ip', None, None, ), # 7
- (8, TType.STRING, 'params', None, None, ), # 8
- (9, TType.STRING, 'body', None, None, ), # 9
- (10, TType.STRING, 'domain', None, None, ), # 10
- (11, TType.STRING, 'project', None, None, ), # 11
- (12, TType.STRING, 'user', None, None, ), # 12
- (13, TType.STRING, 'error', None, None, ), # 13
- )
-
- def __init__(self, identifier_uuid=None, object_type=None, identifier_name=None, url=None, operation=None, useragent=None, remote_ip=None, params=None, body=None, domain=None, project=None, user=None, error=None,):
- self.identifier_uuid = identifier_uuid
- self.object_type = object_type
- self.identifier_name = identifier_name
- self.url = url
- self.operation = operation
- self.useragent = useragent
- self.remote_ip = remote_ip
- self.params = params
- self.body = body
- self.domain = domain
- self.project = project
- self.user = user
- self.error = error
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return 0
- read_cnt = 0
- length = iprot.readStructBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.identifier_uuid) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 2:
- if ftype == TType.STRING:
- (length, self.object_type) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 3:
- if ftype == TType.STRING:
- (length, self.identifier_name) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 4:
- if ftype == TType.STRING:
- (length, self.url) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 5:
- if ftype == TType.STRING:
- (length, self.operation) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 6:
- if ftype == TType.STRING:
- (length, self.useragent) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 7:
- if ftype == TType.STRING:
- (length, self.remote_ip) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 8:
- if ftype == TType.STRING:
- (length, self.params) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 9:
- if ftype == TType.STRING:
- (length, self.body) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 10:
- if ftype == TType.STRING:
- (length, self.domain) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 11:
- if ftype == TType.STRING:
- (length, self.project) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 12:
- if ftype == TType.STRING:
- (length, self.user) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == 13:
- if ftype == TType.STRING:
- (length, self.error) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readStructEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeStructBegin('VncApiCommon') < 0: return -1
- if self.identifier_uuid is not None:
- annotations = {}
- if oprot.writeFieldBegin('identifier_uuid', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.identifier_uuid) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.object_type is not None:
- annotations = {}
- annotations['key'] = 'ConfigObjectTable'
- if oprot.writeFieldBegin('object_type', TType.STRING, 2, annotations) < 0: return -1
- if oprot.writeString(self.object_type) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.identifier_name is not None:
- annotations = {}
- annotations['key'] = 'ConfigObjectTable'
- if oprot.writeFieldBegin('identifier_name', TType.STRING, 3, annotations) < 0: return -1
- if oprot.writeString(self.identifier_name) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.url is not None:
- annotations = {}
- if oprot.writeFieldBegin('url', TType.STRING, 4, annotations) < 0: return -1
- if oprot.writeString(self.url) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.operation is not None:
- annotations = {}
- if oprot.writeFieldBegin('operation', TType.STRING, 5, annotations) < 0: return -1
- if oprot.writeString(self.operation) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.useragent is not None:
- annotations = {}
- if oprot.writeFieldBegin('useragent', TType.STRING, 6, annotations) < 0: return -1
- if oprot.writeString(self.useragent) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.remote_ip is not None:
- annotations = {}
- if oprot.writeFieldBegin('remote_ip', TType.STRING, 7, annotations) < 0: return -1
- if oprot.writeString(self.remote_ip) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.params is not None:
- annotations = {}
- if oprot.writeFieldBegin('params', TType.STRING, 8, annotations) < 0: return -1
- if oprot.writeString(self.params) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.body is not None:
- annotations = {}
- if oprot.writeFieldBegin('body', TType.STRING, 9, annotations) < 0: return -1
- if oprot.writeString(self.body) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.domain is not None:
- annotations = {}
- annotations['key'] = 'ConfigObjectTableByUser'
- if oprot.writeFieldBegin('domain', TType.STRING, 10, annotations) < 0: return -1
- if oprot.writeString(self.domain) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.project is not None:
- annotations = {}
- annotations['key'] = 'ConfigObjectTableByUser'
- if oprot.writeFieldBegin('project', TType.STRING, 11, annotations) < 0: return -1
- if oprot.writeString(self.project) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.user is not None:
- annotations = {}
- annotations['key'] = 'ConfigObjectTableByUser'
- if oprot.writeFieldBegin('user', TType.STRING, 12, annotations) < 0: return -1
- if oprot.writeString(self.user) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.error is not None:
- annotations = {}
- if oprot.writeFieldBegin('error', TType.STRING, 13, annotations) < 0: return -1
- if oprot.writeString(self.error) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeStructEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def log(self):
- log_str = cStringIO.StringIO()
- if self.identifier_uuid is not None:
- log_str.write('identifier_uuid = ')
- log_str.write(self.identifier_uuid)
- log_str.write(' ')
- if self.object_type is not None:
- log_str.write('object_type = ')
- log_str.write(self.object_type)
- log_str.write(' ')
- if self.identifier_name is not None:
- log_str.write('identifier_name = ')
- log_str.write(self.identifier_name)
- log_str.write(' ')
- if self.url is not None:
- log_str.write('url = ')
- log_str.write(self.url)
- log_str.write(' ')
- if self.operation is not None:
- log_str.write('operation = ')
- log_str.write(self.operation)
- log_str.write(' ')
- if self.useragent is not None:
- log_str.write('useragent = ')
- log_str.write(self.useragent)
- log_str.write(' ')
- if self.remote_ip is not None:
- log_str.write('remote_ip = ')
- log_str.write(self.remote_ip)
- log_str.write(' ')
- if self.params is not None:
- log_str.write('params = ')
- log_str.write(self.params)
- log_str.write(' ')
- if self.body is not None:
- log_str.write('body = ')
- log_str.write(self.body)
- log_str.write(' ')
- if self.domain is not None:
- log_str.write('domain = ')
- log_str.write(self.domain)
- log_str.write(' ')
- if self.project is not None:
- log_str.write('project = ')
- log_str.write(self.project)
- log_str.write(' ')
- if self.user is not None:
- log_str.write('user = ')
- log_str.write(self.user)
- log_str.write(' ')
- if self.error is not None:
- log_str.write('error = ')
- log_str.write(self.error)
- log_str.write(' ')
- return log_str.getvalue()
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class VncApiReadLog(sandesh_base.SandeshTrace):
-
- thrift_spec = None
-
- def __init__(self, api_log=None, file=None, line=None, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshTrace.__init__(self, type=SandeshType.TRACE_OBJECT)
- self.api_log = api_log
- self.file = file
- self.line = line
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 103727244
- self._hints = 0 | SANDESH_KEY_HINT
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- log_str.write('VncApiReadLog: ')
- if self.api_log is not None:
- log_str.write('api_log = ')
- log_str.write('<< ')
- log_str.write(self.api_log.log())
- log_str.write('>>')
- log_str.write(' ')
- if self.file is not None:
- log_str.write('file = ')
- log_str.write(self.file)
- log_str.write(' ')
- if self.line is not None:
- log_str.write('line = ')
- log_str.write(str(self.line))
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.api_log = VncApiCommon()
- read_cnt += self.api_log.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == -32768:
- if ftype == TType.STRING:
- (length, self.file) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == -32767:
- if ftype == TType.I32:
- (length, self.line) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('VncApiReadLog') < 0: return -1
- if self.file is not None:
- annotations = {}
- if oprot.writeFieldBegin('file', TType.STRING, -32768, annotations) < 0: return -1
- if oprot.writeString(self.file) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.line is not None:
- annotations = {}
- if oprot.writeFieldBegin('line', TType.I32, -32767, annotations) < 0: return -1
- if oprot.writeI32(self.line) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.api_log is not None:
- annotations = {}
- if oprot.writeFieldBegin('api_log', TType.STRUCT, 1, annotations) < 0: return -1
- if self.api_log.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.file != other.file:
- return False
- if self.line != other.line:
- return False
- if self.api_log != other.api_log:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class VncApiConfigLog(sandesh_base.SandeshObject):
-
- thrift_spec = None
-
- def __init__(self, api_log=None, file=None, line=None, category='__default__', level=SandeshLevel.SYS_INFO, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshObject.__init__(self)
- self.api_log = api_log
- self.file = file
- self.line = line
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 103727244
- self._hints = 0 | SANDESH_KEY_HINT
- self._category = category
- self._level = level
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- if self._category is not None:
- log_str.write(self._category)
- log_str.write(' [')
- log_str.write(SandeshLevel._VALUES_TO_NAMES[self._level])
- log_str.write(']: ')
- log_str.write('VncApiConfigLog: ')
- if self.api_log is not None:
- log_str.write('api_log = ')
- log_str.write('<< ')
- log_str.write(self.api_log.log())
- log_str.write('>>')
- log_str.write(' ')
- if self.file is not None:
- log_str.write('file = ')
- log_str.write(self.file)
- log_str.write(' ')
- if self.line is not None:
- log_str.write('line = ')
- log_str.write(str(self.line))
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRUCT:
- self.api_log = VncApiCommon()
- read_cnt += self.api_log.read(iprot)
- else:
- iprot.skip(ftype)
- elif fid == -32768:
- if ftype == TType.STRING:
- (length, self.file) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == -32767:
- if ftype == TType.I32:
- (length, self.line) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('VncApiConfigLog') < 0: return -1
- if self.file is not None:
- annotations = {}
- if oprot.writeFieldBegin('file', TType.STRING, -32768, annotations) < 0: return -1
- if oprot.writeString(self.file) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.line is not None:
- annotations = {}
- if oprot.writeFieldBegin('line', TType.I32, -32767, annotations) < 0: return -1
- if oprot.writeI32(self.line) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.api_log is not None:
- annotations = {}
- if oprot.writeFieldBegin('api_log', TType.STRUCT, 1, annotations) < 0: return -1
- if self.api_log.write(oprot) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.file != other.file:
- return False
- if self.line != other.line:
- return False
- if self.api_log != other.api_log:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-class VncApiError(sandesh_base.SandeshSystem):
-
- thrift_spec = None
-
- def __init__(self, api_error_msg=None, file=None, line=None, category='__default__', level=SandeshLevel.SYS_INFO, sandesh=sandesh_base.sandesh_global):
- sandesh_base.SandeshSystem.__init__(self)
- self.api_error_msg = api_error_msg
- self.file = file
- self.line = line
- self._scope = sandesh.scope()
- self._module = sandesh.module()
- self._source = sandesh.source_id()
- self._node_type = sandesh.node_type()
- self._instance_id = sandesh.instance_id()
- self._seqnum = 0
- self._timestamp = UTCTimestampUsec()
- self._versionsig = 2183673535
- self._hints = 0
- self._category = category
- self._level = level
-
- def log(self, trace=False):
- log_str = cStringIO.StringIO()
- if trace:
- log_str.write(str(self._timestamp))
- log_str.write(' ')
- if self._category is not None:
- log_str.write(self._category)
- log_str.write(' [')
- log_str.write(SandeshLevel._VALUES_TO_NAMES[self._level])
- log_str.write(']: ')
- log_str.write('VncApiError: ')
- if self.api_error_msg is not None:
- log_str.write(self.api_error_msg)
- log_str.write(' ')
- if self.file is not None:
- log_str.write(self.file)
- log_str.write(' ')
- if self.line is not None:
- log_str.write(str(self.line))
- log_str.write(' ')
- return log_str.getvalue()
-
- def read(self, iprot):
- if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
- fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
- return -1
- read_cnt = 0
- (length, sandesh_name) = iprot.readSandeshBegin()
- if length < 0: return -1
- read_cnt += length
- while True:
- (length, fname, ftype, fid) = iprot.readFieldBegin()
- if length < 0: return -1
- read_cnt += length
- if ftype == TType.STOP:
- break
- if fid == 1:
- if ftype == TType.STRING:
- (length, self.api_error_msg) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == -32768:
- if ftype == TType.STRING:
- (length, self.file) = iprot.readString();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- elif fid == -32767:
- if ftype == TType.I32:
- (length, self.line) = iprot.readI32();
- if length < 0: return -1
- read_cnt += length
- else:
- iprot.skip(ftype)
- else:
- iprot.skip(ftype)
- length = iprot.readFieldEnd()
- if length < 0: return -1
- read_cnt += length
- length = iprot.readSandeshEnd()
- if length < 0: return -1
- read_cnt += length
- return read_cnt
-
- def write(self, oprot):
- if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
- oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
- return 0
- if oprot.writeSandeshBegin('VncApiError') < 0: return -1
- if self.file is not None:
- annotations = {}
- if oprot.writeFieldBegin('file', TType.STRING, -32768, annotations) < 0: return -1
- if oprot.writeString(self.file) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.line is not None:
- annotations = {}
- if oprot.writeFieldBegin('line', TType.I32, -32767, annotations) < 0: return -1
- if oprot.writeI32(self.line) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if self.api_error_msg is not None:
- annotations = {}
- if oprot.writeFieldBegin('api_error_msg', TType.STRING, 1, annotations) < 0: return -1
- if oprot.writeString(self.api_error_msg) < 0: return -1
- if oprot.writeFieldEnd() < 0: return -1
- if oprot.writeFieldStop() < 0: return -1
- if oprot.writeSandeshEnd() < 0: return -1
- return 0
-
- def validate(self):
- return
-
-
- def compare(self, other):
- if not isinstance(other, self.__class__):
- return False
- if self.file != other.file:
- return False
- if self.line != other.line:
- return False
- if self.api_error_msg != other.api_error_msg:
- return False
- return True
-
- def __repr__(self):
- L = ['%s=%r' % (key, value)
- for key, value in self.__dict__.iteritems()]
- return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
-
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
-
- def __ne__(self, other):
- return not (self == other)
-
-
-_SANDESH_REQUEST_LIST = [
-]
-
-
-_SANDESH_UVE_LIST = [
-]
-
-
-_SANDESH_UVE_DATA_LIST = [
-]
-
-
-_SANDESH_ALARM_LIST = [
-]
-
-
-_SANDESH_ALARM_DATA_LIST = [
-]
diff --git a/Testcases/cfgm_common/uve/vnc_api/ttypes.pyc b/Testcases/cfgm_common/uve/vnc_api/ttypes.pyc
deleted file mode 100644
index 1d0400a..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/ttypes.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/uve/vnc_api/vnc_api.html b/Testcases/cfgm_common/uve/vnc_api/vnc_api.html
deleted file mode 100644
index b467b7c..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/vnc_api.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<link href="style.css" rel="stylesheet" type="text/css"/>
-<title>Module: vnc_api</title></head><body>
-<h1>Module: vnc_api</h1>
-<table><tr><th>Module</th><th>Sandeshs</th></tr>
-<tr>
-<td>vnc_api</td><td></td></tr>
-</table>
-<hr/><h2 id="Sandeshs"></h2>
-</body></html>
diff --git a/Testcases/cfgm_common/uve/vnc_api/vnc_api.xml b/Testcases/cfgm_common/uve/vnc_api/vnc_api.xml
deleted file mode 100644
index 4cf212d..0000000
--- a/Testcases/cfgm_common/uve/vnc_api/vnc_api.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
-<vnc_api type="rlist">
-</vnc_api>
diff --git a/Testcases/cfgm_common/vnc_cassandra.py b/Testcases/cfgm_common/vnc_cassandra.py
deleted file mode 100644
index 1bbb109..0000000
--- a/Testcases/cfgm_common/vnc_cassandra.py
+++ /dev/null
@@ -1,317 +0,0 @@
-#
-# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
-#
-
-import pycassa
-from pycassa import ColumnFamily
-from pycassa.batch import Mutator
-from pycassa.system_manager import SystemManager, SIMPLE_STRATEGY
-from pycassa.pool import AllServersUnavailable
-
-from vnc_api.gen.vnc_cassandra_client_gen import VncCassandraClientGen
-from exceptions import NoIdError
-from pysandesh.connection_info import ConnectionState
-from pysandesh.gen_py.process_info.ttypes import ConnectionStatus, \
- ConnectionType
-from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
-import time
-import json
-import utils
-
-class VncCassandraClient(VncCassandraClientGen):
- # Name to ID mapping keyspace + tables
- _UUID_KEYSPACE_NAME = 'config_db_uuid'
-
- # TODO describe layout
- _OBJ_UUID_CF_NAME = 'obj_uuid_table'
-
- # TODO describe layout
- _OBJ_FQ_NAME_CF_NAME = 'obj_fq_name_table'
-
- @classmethod
- def get_db_info(cls):
- db_info = [(cls._UUID_KEYSPACE_NAME, [cls._OBJ_UUID_CF_NAME,
- cls._OBJ_FQ_NAME_CF_NAME])]
- return db_info
- # end get_db_info
-
- def __init__(self, server_list, reset_config, db_prefix, keyspaces, logger,
- generate_url=None):
- super(VncCassandraClient, self).__init__()
- self._reset_config = reset_config
- self._cache_uuid_to_fq_name = {}
- if db_prefix:
- self._db_prefix = '%s_' %(db_prefix)
- else:
- self._db_prefix = ''
- self._server_list = server_list
- self._conn_state = ConnectionStatus.INIT
- self._logger = logger
-
- # if no generate_url is specified, use a dummy function that always
- # returns an empty string
- self._generate_url = generate_url or (lambda x,y: '')
- self._cf_dict = {}
- self._keyspaces = {
- self._UUID_KEYSPACE_NAME: [(self._OBJ_UUID_CF_NAME, None),
- (self._OBJ_FQ_NAME_CF_NAME, None)]}
-
- if keyspaces:
- self._keyspaces.update(keyspaces)
- self._cassandra_init(server_list)
- self._cache_uuid_to_fq_name = {}
- self._obj_uuid_cf = self._cf_dict[self._OBJ_UUID_CF_NAME]
- self._obj_fq_name_cf = self._cf_dict[self._OBJ_FQ_NAME_CF_NAME]
- # end __init__
-
- def _update_sandesh_status(self, status, msg=''):
- ConnectionState.update(conn_type=ConnectionType.DATABASE,
- name='Cassandra', status=status, message=msg,
- server_addrs=self._server_list)
-
- def _handle_exceptions(self, func):
- def wrapper(*args, **kwargs):
- try:
- if self._conn_state != ConnectionStatus.UP:
- # will set conn_state to UP if successful
- self._cassandra_init_conn_pools()
-
- return func(*args, **kwargs)
- except AllServersUnavailable:
- if self._conn_state != ConnectionStatus.DOWN:
- self._update_sandesh_status(ConnectionStatus.DOWN)
- msg = 'Cassandra connection down. Exception in %s' \
- %(str(func))
- self._logger(msg, level=SandeshLevel.SYS_ERR)
-
- self._conn_state = ConnectionStatus.DOWN
- raise
-
- return wrapper
- # end _handle_exceptions
-
- # Helper routines for cassandra
- def _cassandra_init(self, server_list):
- # 1. Ensure keyspace and schema/CFs exist
- # 2. Read in persisted data and publish to ifmap server
-
- self._update_sandesh_status(ConnectionStatus.INIT)
-
- ColumnFamily.get = self._handle_exceptions(ColumnFamily.get)
- ColumnFamily.multiget = self._handle_exceptions(ColumnFamily.multiget)
- ColumnFamily.xget = self._handle_exceptions(ColumnFamily.xget)
- ColumnFamily.get_range = self._handle_exceptions(ColumnFamily.get_range)
- ColumnFamily.insert = self._handle_exceptions(ColumnFamily.insert)
- ColumnFamily.remove = self._handle_exceptions(ColumnFamily.remove)
- Mutator.send = self._handle_exceptions(Mutator.send)
-
- for ks,cf_list in self._keyspaces.items():
- keyspace = '%s%s' %(self._db_prefix, ks)
- self._cassandra_ensure_keyspace(server_list, keyspace, cf_list)
-
- self._cassandra_init_conn_pools()
- # end _cassandra_init
-
- def _cassandra_ensure_keyspace(self, server_list,
- keyspace_name, cf_info_list):
- # Retry till cassandra is up
- server_idx = 0
- num_dbnodes = len(self._server_list)
- connected = False
- while not connected:
- try:
- cass_server = self._server_list[server_idx]
- sys_mgr = SystemManager(cass_server)
- connected = True
- except Exception as e:
- # TODO do only for
- # thrift.transport.TTransport.TTransportException
- server_idx = (server_idx + 1) % num_dbnodes
- time.sleep(3)
-
- if self._reset_config:
- try:
- sys_mgr.drop_keyspace(keyspace_name)
- except pycassa.cassandra.ttypes.InvalidRequestException as e:
- # TODO verify only EEXISTS
- self._logger("Warning! " + str(e), level=SandeshLevel.SYS_WARN)
-
- try:
- sys_mgr.create_keyspace(keyspace_name, SIMPLE_STRATEGY,
- {'replication_factor': str(num_dbnodes)})
- except pycassa.cassandra.ttypes.InvalidRequestException as e:
- # TODO verify only EEXISTS
- self._logger("Warning! " + str(e), level=SandeshLevel.SYS_WARN)
-
- gc_grace_sec = 0
- if num_dbnodes > 1:
- gc_grace_sec = 60
-
- for cf_info in cf_info_list:
- try:
- (cf_name, comparator_type) = cf_info
- if comparator_type:
- sys_mgr.create_column_family(
- keyspace_name, cf_name,
- comparator_type=comparator_type,
- gc_grace_seconds=gc_grace_sec,
- default_validation_class='UTF8Type')
- else:
- sys_mgr.create_column_family(keyspace_name, cf_name,
- gc_grace_seconds=gc_grace_sec,
- default_validation_class='UTF8Type')
- except pycassa.cassandra.ttypes.InvalidRequestException as e:
- # TODO verify only EEXISTS
- self._logger("Warning! " + str(e), level=SandeshLevel.SYS_WARN)
- sys_mgr.alter_column_family(keyspace_name, cf_name,
- gc_grace_seconds=gc_grace_sec,
- default_validation_class='UTF8Type')
- # end _cassandra_ensure_keyspace
-
- def _cassandra_init_conn_pools(self):
- for ks,cf_list in self._keyspaces.items():
- pool = pycassa.ConnectionPool(
- ks, self._server_list, max_overflow=-1, use_threadlocal=True,
- prefill=True, pool_size=20, pool_timeout=120,
- max_retries=-1, timeout=5)
-
- rd_consistency = pycassa.cassandra.ttypes.ConsistencyLevel.QUORUM
- wr_consistency = pycassa.cassandra.ttypes.ConsistencyLevel.QUORUM
-
- for (cf, _) in cf_list:
- self._cf_dict[cf] = ColumnFamily(
- pool, cf, read_consistency_level = rd_consistency,
- write_consistency_level = wr_consistency)
-
- ConnectionState.update(conn_type = ConnectionType.DATABASE,
- name = 'Cassandra', status = ConnectionStatus.UP, message = '',
- server_addrs = self._server_list)
- self._conn_state = ConnectionStatus.UP
- msg = 'Cassandra connection ESTABLISHED'
- self._logger(msg, level=SandeshLevel.SYS_NOTICE)
- # end _cassandra_init_conn_pools
-
- def cache_uuid_to_fq_name_add(self, id, fq_name, obj_type):
- self._cache_uuid_to_fq_name[id] = (fq_name, obj_type)
- # end cache_uuid_to_fq_name_add
-
- def cache_uuid_to_fq_name_del(self, id):
- try:
- del self._cache_uuid_to_fq_name[id]
- except KeyError:
- pass
- # end cache_uuid_to_fq_name_del
-
- def uuid_to_fq_name(self, id):
- try:
- return self._cache_uuid_to_fq_name[id][0]
- except KeyError:
- try:
- obj = self._obj_uuid_cf.get(id, columns=['fq_name', 'type'])
- except pycassa.NotFoundException:
- raise NoIdError(id)
-
- fq_name = json.loads(obj['fq_name'])
- obj_type = json.loads(obj['type'])
- self.cache_uuid_to_fq_name_add(id, fq_name, obj_type)
- return fq_name
- # end uuid_to_fq_name
-
- def uuid_to_obj_type(self, id):
- try:
- return self._cache_uuid_to_fq_name[id][1]
- except KeyError:
- try:
- obj = self._obj_uuid_cf.get(id, columns=['fq_name', 'type'])
- except pycassa.NotFoundException:
- raise NoIdError(id)
-
- fq_name = json.loads(obj['fq_name'])
- obj_type = json.loads(obj['type'])
- self.cache_uuid_to_fq_name_add(id, fq_name, obj_type)
- return obj_type
- # end uuid_to_obj_type
-
-
- def fq_name_to_uuid(self, obj_type, fq_name):
- method_name = obj_type.replace('-', '_')
- fq_name_str = ':'.join(fq_name)
- col_start = '%s:' % (utils.encode_string(fq_name_str))
- col_fin = '%s;' % (utils.encode_string(fq_name_str))
- try:
- col_info_iter = self._obj_fq_name_cf.xget(
- method_name, column_start=col_start, column_finish=col_fin)
- except pycassa.NotFoundException:
- raise NoIdError('%s %s' % (obj_type, fq_name))
-
- col_infos = list(col_info_iter)
-
- if len(col_infos) == 0:
- raise NoIdError('%s %s' % (obj_type, fq_name))
-
- for (col_name, col_val) in col_infos:
- obj_uuid = col_name.split(':')[-1]
-
- return obj_uuid
- # end fq_name_to_uuid
-
- def _read_child(self, result, obj_uuid, child_type,
- child_uuid, child_tstamp):
- if '%ss' % (child_type) not in result:
- result['%ss' % (child_type)] = []
-
- child_info = {}
- child_info['to'] = self.uuid_to_fq_name(child_uuid)
- child_info['href'] = self._generate_url(child_type, child_uuid)
- child_info['uuid'] = child_uuid
- child_info['tstamp'] = child_tstamp
-
- result['%ss' % (child_type)].append(child_info)
- # end _read_child
-
- def _read_ref(self, result, obj_uuid, ref_type, ref_uuid, ref_data_json):
- if '%s_refs' % (ref_type) not in result:
- result['%s_refs' % (ref_type)] = []
-
- ref_data = json.loads(ref_data_json)
- ref_info = {}
- try:
- ref_info['to'] = self.uuid_to_fq_name(ref_uuid)
- except NoIdError as e:
- ref_info['to'] = ['ERROR']
-
- if ref_data:
- try:
- ref_info['attr'] = ref_data['attr']
- except KeyError:
- # TODO remove backward compat old format had attr directly
- ref_info['attr'] = ref_data
-
- ref_info['href'] = self._generate_url(ref_type, ref_uuid)
- ref_info['uuid'] = ref_uuid
-
- result['%s_refs' % (ref_type)].append(ref_info)
- # end _read_ref
-
- def _read_back_ref(self, result, obj_uuid, back_ref_type,
- back_ref_uuid, back_ref_data_json):
- if '%s_back_refs' % (back_ref_type) not in result:
- result['%s_back_refs' % (back_ref_type)] = []
-
- back_ref_info = {}
- back_ref_info['to'] = self.uuid_to_fq_name(back_ref_uuid)
- back_ref_data = json.loads(back_ref_data_json)
- if back_ref_data:
- try:
- back_ref_info['attr'] = back_ref_data['attr']
- except KeyError:
- # TODO remove backward compat old format had attr directly
- back_ref_info['attr'] = back_ref_data
-
- back_ref_info['href'] = self._generate_url(back_ref_type, back_ref_uuid)
- back_ref_info['uuid'] = back_ref_uuid
-
- result['%s_back_refs' % (back_ref_type)].append(back_ref_info)
- # end _read_back_ref
-
-
diff --git a/Testcases/cfgm_common/vnc_cassandra.pyc b/Testcases/cfgm_common/vnc_cassandra.pyc
deleted file mode 100644
index 4c8cac5..0000000
--- a/Testcases/cfgm_common/vnc_cassandra.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/vnc_cpu_info.py b/Testcases/cfgm_common/vnc_cpu_info.py
deleted file mode 100644
index d929534..0000000
--- a/Testcases/cfgm_common/vnc_cpu_info.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-"""
-.. attention:: Fix the license string
-"""
-import os
-import socket
-import psutil
-import gevent
-from uve.cfgm_cpuinfo.ttypes import *
-from uve.cfgm_cpuinfo.cpuinfo.ttypes import *
-from buildinfo import build_info
-from sandesh_common.vns.ttypes import Module
-from sandesh_common.vns.constants import ModuleNames
-
-# CpuInfo object for config-node
-
-
-class CpuInfo(object):
-
- def __init__(self, module_id, instance_id, sysinfo_req, sandesh,
- time_interval, server_ip=None):
- # store cpuinfo at init
- self._module_id = module_id
- self._instance_id = instance_id
- self._sysinfo = sysinfo_req
- self._sandesh = sandesh
- self._time_interval = time_interval
- self._rss = 0
- self._vms = 0
- self._pvms = 0
- self._load_avg = (0, 0, 0)
- self._phymem_usage = (0, 0, 0, 0)
- self._phymem_buffers = 0
- self._num_cpus = 0
- self._cpu_share = 0
- self._curr_build_info = None
- self._new_build_info = None
- self._curr_ip = server_ip
- self._new_ip = None
-
- # spawn a Greenlet object to do periodic collect and send.
- gevent.spawn(self.cpu_stats)
- # end __init__
-
- def get_config_node_ip(self):
- return self._curr_ip
- # end __get_config_ndoe_ip
-
- def set_config_node_ip(self, server_ip):
- self._curr_ip = server_ip
- # end __set_config_ndoe_ip
-
- def cpu_stats(self):
- cfg_process = psutil.Process(os.getpid())
- while True:
- # collect Vmsizes
- self._ip_change = 0
- self._build_change = 0
- rss = cfg_process.get_memory_info().rss
- if (self._rss != rss):
- self._rss = rss
-
- vms = cfg_process.get_memory_info().vms
- if (self._vms != vms):
- self._vms = vms
-
- pvms = vms
- if (pvms > self._pvms):
- self._pvms = pvms
-
- if self._sysinfo:
- # collect CPU Load avg
- load_avg = os.getloadavg()
- if (load_avg != self._load_avg):
- self._load_avg = load_avg
-
- # collect systemmeory info
- phymem_usage = psutil.phymem_usage()
- if (phymem_usage != self._phymem_usage):
- self._phymem_usage = phymem_usage
-
- phymem_buffers = psutil.phymem_buffers()
- if (phymem_buffers != self._phymem_buffers):
- self._phymem_buffers = phymem_buffers
-
- if (self._new_ip != self._curr_ip):
- self._new_ip = self.get_config_node_ip()
- self._ip_change = 1
-
- # Retrieve build_info from package/rpm and cache it
- if self._curr_build_info is None:
- command = "contrail-version contrail-config | grep 'contrail-config'"
- version = os.popen(command).read()
- _, rpm_version, build_num = version.split()
- self._new_build_info = build_info + '"build-id" : "' + \
- rpm_version + '", "build-number" : "' + \
- build_num + '"}]}'
- if (self._new_build_info != self._curr_build_info):
- self._curr_build_info = self._new_build_info
- self._build_change = 1
-
- num_cpus = psutil.NUM_CPUS
- if (num_cpus != self._num_cpus):
- self._num_cpus = num_cpus
-
- cpu_percent = cfg_process.get_cpu_percent(interval=0.1)
- cpu_share = cpu_percent / num_cpus
- self._cpu_share = cpu_share
-
- self._send_cpustats()
-
- gevent.sleep(self._time_interval)
- # end cpu_stats
-
- # Send Uve Object
- def _send_cpustats(self):
- mod_cpu = ModuleCpuInfo()
- mod_cpu.module_id = self._module_id
- mod_cpu.instance_id = self._instance_id
-
- mod_cpu.cpu_info = CpuLoadInfo()
-
- # populate number of available CPU
- mod_cpu.cpu_info.num_cpu = self._num_cpus
-
- if self._sysinfo:
- # populate system memory details
- mod_cpu.cpu_info.sys_mem_info = SysMemInfo()
- mod_cpu.cpu_info.sys_mem_info.total = self._phymem_usage[0] / 1024
- mod_cpu.cpu_info.sys_mem_info.used = self._phymem_usage[1] / 1024
- mod_cpu.cpu_info.sys_mem_info.free = self._phymem_usage[2] / 1024
- mod_cpu.cpu_info.sys_mem_info.buffers = self._phymem_buffers / 1024
-
- # populate CPU Load avg
- mod_cpu.cpu_info.cpuload = CpuLoadAvg()
- mod_cpu.cpu_info.cpuload.one_min_avg = self._load_avg[0]
- mod_cpu.cpu_info.cpuload.five_min_avg = self._load_avg[1]
- mod_cpu.cpu_info.cpuload.fifteen_min_avg = self._load_avg[2]
-
- # populate Virtual Memory details
- mod_cpu.cpu_info.meminfo = MemInfo()
- mod_cpu.cpu_info.meminfo.virt = self._vms / 1024
- mod_cpu.cpu_info.meminfo.peakvirt = self._pvms / 1024
- mod_cpu.cpu_info.meminfo.res = self._rss / 1024
-
- # populate cpu_share, which is calibrated with num_cpu
- mod_cpu.cpu_info.cpu_share = self._cpu_share
-
- cpu_load_info_list = [mod_cpu]
-
- cfgm_cpu_uve = ModuleCpuState(module_cpu_info=cpu_load_info_list)
- cfgm_cpu_uve.name = socket.gethostname()
- if self._sysinfo:
- if self._ip_change:
- cfgm_cpu_uve.config_node_ip = self._new_ip
- if self._build_change:
- cfgm_cpu_uve.build_info = self._curr_build_info
-
- if (self._module_id == ModuleNames[Module.API_SERVER]):
- cfgm_cpu_uve.api_server_mem_virt = mod_cpu.cpu_info.meminfo.virt
- cfgm_cpu_uve.api_server_cpu_share = self._cpu_share
-
- if (self._module_id == ModuleNames[Module.SCHEMA_TRANSFORMER]):
- cfgm_cpu_uve.schema_xmer_mem_virt = mod_cpu.cpu_info.meminfo.virt
- cfgm_cpu_uve.schema_xmer_cpu_share = self._cpu_share
-
- if (self._module_id == ModuleNames[Module.SVC_MONITOR]):
- cfgm_cpu_uve.service_monitor_mem_virt =\
- mod_cpu.cpu_info.meminfo.virt
- cfgm_cpu_uve.service_monitor_cpu_share = self._cpu_share
-
- cpu_info_trace = ModuleCpuStateTrace(
- data=cfgm_cpu_uve, sandesh=self._sandesh)
- cpu_info_trace.send(sandesh=self._sandesh)
-
- cnf_cpu_state = ConfigCpuState()
- cnf_cpu_state.name = socket.gethostname()
-
- cnf_cpu_info = ProcessCpuInfo()
- cnf_cpu_info.module_id = self._module_id
- cnf_cpu_info.inst_id = self._instance_id
- cnf_cpu_info.cpu_share = self._cpu_share
- cnf_cpu_info.mem_virt = mod_cpu.cpu_info.meminfo.virt
- cnf_cpu_info.mem_res = mod_cpu.cpu_info.meminfo.res
- cnf_cpu_state.cpu_info = [cnf_cpu_info]
-
- cnf_cpu_state_trace = ConfigCpuStateTrace(
- sandesh=self._sandesh, data=cnf_cpu_state)
- cnf_cpu_state_trace.send(sandesh=self._sandesh)
-
- # end _send_cpustats
-
-# end class CpuInfo
diff --git a/Testcases/cfgm_common/vnc_cpu_info.pyc b/Testcases/cfgm_common/vnc_cpu_info.pyc
deleted file mode 100644
index 8a122c9..0000000
--- a/Testcases/cfgm_common/vnc_cpu_info.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/vnc_db.py b/Testcases/cfgm_common/vnc_db.py
deleted file mode 100644
index fae990d..0000000
--- a/Testcases/cfgm_common/vnc_db.py
+++ /dev/null
@@ -1,205 +0,0 @@
-#
-# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
-#
-
-"""
-This file contains implementation of database model for contrail config daemons
-"""
-from vnc_api.common.exceptions import NoIdError
-
-class DBBase(object):
- # This is the base class for all DB objects. All derived objects must
- # have a class member called _dict of dictionary type.
- # The init method of this class must be callled before using any functions
-
- _logger = None
- _cassandra = None
- _manager = None
-
- @classmethod
- def init(cls, manager, logger, cassandra):
- cls._logger = logger
- cls._cassandra = cassandra
- cls._manager = manager
- # end init
-
- class __metaclass__(type):
-
- def __iter__(cls):
- for i in cls._dict:
- yield i
- # end __iter__
-
- def values(cls):
- for i in cls._dict.values():
- yield i
- # end values
-
- def items(cls):
- for i in cls._dict.items():
- yield i
- # end items
- # end __metaclass__
-
- @classmethod
- def get(cls, key):
- if key in cls._dict:
- return cls._dict[key]
- return None
- # end get
-
- @classmethod
- def locate(cls, key, *args):
- if key not in cls._dict:
- try:
- cls._dict[key] = cls(key, *args)
- except NoIdError as e:
- cls._logger.debug(
- "Exception %s while creating %s for %s",
- e, cls.__name__, key)
- return None
- return cls._dict[key]
- # end locate
-
- @classmethod
- def delete(cls, key):
- if key in cls._dict:
- del cls._dict[key]
- # end delete
-
- def get_ref_uuid_from_dict(self, obj_dict, ref_name):
- if ref_name in obj_dict:
- return obj_dict[ref_name][0]['uuid']
- else:
- return None
-
- def add_ref(self, ref_type, ref):
- if hasattr(self, ref_type):
- setattr(self, ref_type, ref)
- elif hasattr(self, ref_type+'s'):
- ref_set = getattr(self, ref_type+'s')
- ref_set.add(ref)
- # end add_ref
-
- def delete_ref(self, ref_type, ref):
- if hasattr(self, ref_type) and getattr(self, ref_type) == ref:
- setattr(self, ref_type, None)
- elif hasattr(self, ref_type+'s'):
- ref_set = getattr(self, ref_type+'s')
- ref_set.discard(ref)
- # end delete_ref
-
- def add_to_parent(self, obj_dict):
- self.parent_type = obj_dict.get('parent_type')
- self.parent_id = obj_dict.get('parent_uuid')
- if not self.parent_type or not self.parent_id:
- return
- p_obj = self._OBJ_TYPE_MAP[self.parent_type].get(self.parent_id)
- if p_obj is not None:
- p_obj.add_ref(self.obj_type, self.uuid)
- # end
-
- def remove_from_parent(self):
- if not self.parent_type or not self.parent_id:
- return
- p_obj = self._OBJ_TYPE_MAP[self.parent_type].get(self.parent_id)
- if p_obj is not None:
- p_obj.delete_ref(self.obj_type, self.uuid)
-
- def update_single_ref(self, ref_type, obj):
- refs = obj.get(ref_type+'_refs') or obj.get(ref_type+'_back_refs')
- if refs:
- try:
- new_id = refs[0]['uuid']
- except KeyError:
- fq_name = refs[0]['to']
- new_id = self._cassandra.fq_name_to_uuid(ref_type, fq_name)
- else:
- new_id = None
- old_id = getattr(self, ref_type, None)
- if old_id == new_id:
- return
- ref_obj = self._OBJ_TYPE_MAP[ref_type].get(old_id)
- if ref_obj is not None:
- ref_obj.delete_ref(self.obj_type, self.uuid)
- ref_obj = self._OBJ_TYPE_MAP[ref_type].get(new_id)
- if ref_obj is not None:
- ref_obj.add_ref(self.obj_type, self.uuid)
- setattr(self, ref_type, new_id)
- # end update_single_ref
-
- def set_children(self, ref_type, obj):
- refs = obj.get(ref_type+'s')
- new_refs = set()
- for ref in refs or []:
- try:
- new_id = ref['uuid']
- except KeyError:
- fq_name = ref['to']
- new_id = self._cassandra.fq_name_to_uuid(ref_type, fq_name)
- new_refs.add(new_id)
- setattr(self, ref_type+'s', new_refs)
- # end
-
- def update_multiple_refs(self, ref_type, obj):
- refs = obj.get(ref_type+'_refs') or obj.get(ref_type+'_back_refs')
- new_refs = set()
- for ref in refs or []:
- try:
- new_id = ref['uuid']
- except KeyError:
- fq_name = ref['to']
- new_id = self._cassandra.fq_name_to_uuid(ref_type, fq_name)
- new_refs.add(new_id)
- old_refs = getattr(self, ref_type+'s')
- for ref_id in old_refs - new_refs:
- ref_obj = self._OBJ_TYPE_MAP[ref_type].get(ref_id)
- if ref_obj is not None:
- ref_obj.delete_ref(self.obj_type, self.uuid)
- for ref_id in new_refs - old_refs:
- ref_obj = self._OBJ_TYPE_MAP[ref_type].get(ref_id)
- if ref_obj is not None:
- ref_obj.add_ref(self.obj_type, self.uuid)
- setattr(self, ref_type+'s', new_refs)
- # end update_multiple_refs
-
- def read_obj(self, uuid, obj_type=None):
- method_name = "_cassandra_%s_read" % (obj_type or self.obj_type)
- method = getattr(self._cassandra, method_name)
- ok, objs = method([uuid])
- if not ok:
- self._logger.error(
- 'Cannot read %s %s, error %s' % (obj_type, uuid, objs))
- raise NoIdError('')
- return objs[0]
- # end read_obj
-
- def get_parent_uuid(self, obj):
- if 'parent_uuid' in obj:
- return obj['parent_uuid']
- else:
- parent_type = obj['parent_type'].replace('-', '_')
- parent_fq_name = obj['fq_name'][:-1]
- return self._cassandra.fq_name_to_uuid(parent_type, parent_fq_name)
- # end get_parent_uuid
-
- @classmethod
- def find_by_name_or_uuid(cls, name_or_uuid):
- obj = cls.get(name_or_uuid)
- if obj:
- return obj
-
- for obj in cls.values():
- if obj.name == name_or_uuid:
- return obj
- return None
- # end find_by_name_or_uuid
-
- @classmethod
- def reset(cls):
- cls._dict = {}
-# end class DBBase
-
-DBBase._OBJ_TYPE_MAP = {
-}
-
diff --git a/Testcases/cfgm_common/vnc_db.pyc b/Testcases/cfgm_common/vnc_db.pyc
deleted file mode 100644
index af6d0d6..0000000
--- a/Testcases/cfgm_common/vnc_db.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/vnc_extensions.py b/Testcases/cfgm_common/vnc_extensions.py
deleted file mode 100644
index cebbe4d..0000000
--- a/Testcases/cfgm_common/vnc_extensions.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import functools
-
-import stevedore
-
-
-class ApiHookManager(stevedore.hook.HookManager):
- def __init__(self, namespace, hook_name):
- super(ApiHookManager, self).__init__(namespace, hook_name,
- invoke_on_load=True)
- #end __init__
-
- def run_pre(self, hook_name, args, kwargs):
- for e in self.extensions:
- obj = e.obj
- pre = getattr(obj, 'pre', None)
- if pre:
- pre(*args, **kwargs)
- #end run_pre
-
- def run_post(self, hook_name, rv, args, kwargs):
- for e in reversed(self.extensions):
- obj = e.obj
- post = getattr(obj, 'post', None)
- if post:
- post(rv, *args, **kwargs)
- #end run_post
-#end class ApiHookManager
-
-
-def add_api_hook(hook_manager, hook_name):
- def outer(f):
- @functools.wraps(f)
- def inner(*args, **kwargs):
- hook_manager.run_pre(hook_name, args, kwargs)
- rv = f(*args, **kwargs)
- hook_manager.run_post(hook_name, rv, args, kwargs)
-
- return rv
-
- return inner
- #end inner
- #end outer
-
- return outer
-#end add_api_hook
-
-
-class ExtensionManager(stevedore.extension.ExtensionManager):
- def __init__(self, namespace, api_server_ip,
- api_server_port, conf_sections, sandesh,
- propagate_map_exceptions=False):
- super(ExtensionManager, self).__init__(
- namespace, invoke_on_load=True,
- invoke_kwds={'api_server_ip': api_server_ip,
- 'api_server_port': api_server_port,
- 'conf_sections': conf_sections,
- 'sandesh': sandesh },
- propagate_map_exceptions=propagate_map_exceptions)
- #end __init__
-
-#end class ExtensionManager
diff --git a/Testcases/cfgm_common/vnc_extensions.pyc b/Testcases/cfgm_common/vnc_extensions.pyc
deleted file mode 100644
index 68318a9..0000000
--- a/Testcases/cfgm_common/vnc_extensions.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/vnc_kombu.py b/Testcases/cfgm_common/vnc_kombu.py
deleted file mode 100644
index 0f00865..0000000
--- a/Testcases/cfgm_common/vnc_kombu.py
+++ /dev/null
@@ -1,226 +0,0 @@
-#
-# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
-#
-import re
-import amqp.exceptions
-import kombu
-import gevent
-import gevent.monkey
-gevent.monkey.patch_all()
-import time
-from gevent.queue import Queue
-try:
- from gevent.lock import Semaphore
-except ImportError:
- # older versions of gevent
- from gevent.coros import Semaphore
-
-from pysandesh.connection_info import ConnectionState
-from pysandesh.gen_py.process_info.ttypes import ConnectionStatus, \
- ConnectionType
-from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
-
-__all__ = "VncKombuClient"
-
-
-class VncKombuClientBase(object):
- def _update_sandesh_status(self, status, msg=''):
- ConnectionState.update(conn_type=ConnectionType.DATABASE,
- name='RabbitMQ', status=status, message=msg,
- server_addrs=["%s:%s" % (self._rabbit_ip, self._rabbit_port)])
- # end _update_sandesh_status
-
- def publish(self, message):
- self._publish_queue.put(message)
- # end publish
-
- def __init__(self, rabbit_ip, rabbit_port, rabbit_user, rabbit_password,
- rabbit_vhost, rabbit_ha_mode, q_name, subscribe_cb, logger):
- self._rabbit_ip = rabbit_ip
- self._rabbit_port = rabbit_port
- self._rabbit_user = rabbit_user
- self._rabbit_password = rabbit_password
- self._rabbit_vhost = rabbit_vhost
- self._subscribe_cb = subscribe_cb
- self._logger = logger
- self._publish_queue = Queue()
- self._conn_lock = Semaphore()
-
- self.obj_upd_exchange = kombu.Exchange('vnc_config.object-update', 'fanout',
- durable=False)
-
- def num_pending_messages(self):
- return self._publish_queue.qsize()
- # end num_pending_messages
-
- def prepare_to_consume(self):
- # override this method
- return
-
- def _reconnect(self, delete_old_q=False):
- if self._conn_lock.locked():
- # either connection-monitor or publisher should have taken
- # the lock. The one who acquired the lock would re-establish
- # the connection and releases the lock, so the other one can
- # just wait on the lock, till it gets released
- self._conn_lock.wait()
- return
-
- self._conn_lock.acquire()
-
- msg = "RabbitMQ connection down"
- self._logger(msg, level=SandeshLevel.SYS_ERR)
- self._update_sandesh_status(ConnectionStatus.DOWN)
- self._conn_state = ConnectionStatus.DOWN
-
- self._conn.close()
-
- self._conn.ensure_connection()
- self._conn.connect()
-
- self._update_sandesh_status(ConnectionStatus.UP)
- self._conn_state = ConnectionStatus.UP
- msg = 'RabbitMQ connection ESTABLISHED %s' % repr(self._conn)
- self._logger(msg, level=SandeshLevel.SYS_NOTICE)
-
- self._channel = self._conn.channel()
- if delete_old_q:
- # delete the old queue in first-connect context
- # as db-resync would have caught up with history.
- try:
- bound_q = self._update_queue_obj(self._channel)
- bound_q.delete()
- except Exception as e:
- msg = 'Unable to delete the old ampq queue: %s' %(str(e))
- self._logger(msg, level=SandeshLevel.SYS_ERR)
-
- self._consumer = kombu.Consumer(self._channel,
- queues=self._update_queue_obj,
- callbacks=[self._subscribe])
- self._producer = kombu.Producer(self._channel, exchange=self.obj_upd_exchange)
-
- self._conn_lock.release()
- # end _reconnect
-
- def _connection_watch(self):
- self.prepare_to_consume()
- while True:
- try:
- self._consumer.consume()
- self._conn.drain_events()
- except self._conn.connection_errors + self._conn.channel_errors as e:
- self._reconnect()
- # end _connection_watch
-
- def _publisher(self):
- message = None
- while True:
- try:
- if not message:
- # earlier was sent fine, dequeue one more
- message = self._publish_queue.get()
-
- while True:
- try:
- self._producer.publish(message)
- message = None
- break
- except self._conn.connection_errors + self._conn.channel_errors as e:
- self._reconnect()
- except Exception as e:
- log_str = "Unknown exception in _publisher greenlet" + str(e)
- self._logger(log_str, level=SandeshLevel.SYS_ERR)
- # end _publisher
-
- def _subscribe(self, body, message):
- try:
- self._subscribe_cb(body)
- finally:
- message.ack()
-
-
- def _start(self):
- self._reconnect(delete_old_q=True)
-
- self._publisher_greenlet = gevent.spawn(self._publisher)
- self._connection_monitor_greenlet = gevent.spawn(self._connection_watch)
-
- def shutdown(self):
- self._publisher_greenlet.kill()
- self._connection_monitor_greenlet.kill()
- self._producer.close()
- self._consumer.close()
- self._conn.close()
-
-
-class VncKombuClientV1(VncKombuClientBase):
- def __init__(self, rabbit_ip, rabbit_port, rabbit_user, rabbit_password,
- rabbit_vhost, rabbit_ha_mode, q_name, subscribe_cb, logger):
- super(VncKombuClientV1, self).__init__(rabbit_ip, rabbit_port,
- rabbit_user, rabbit_password,
- rabbit_vhost, rabbit_ha_mode,
- q_name, subscribe_cb, logger)
-
- self._conn = kombu.Connection(hostname=self._rabbit_ip,
- port=self._rabbit_port,
- userid=self._rabbit_user,
- password=self._rabbit_password,
- virtual_host=self._rabbit_vhost)
- self._update_queue_obj = kombu.Queue(q_name, self.obj_upd_exchange, durable=False)
- self._start()
- # end __init__
-
-
-class VncKombuClientV2(VncKombuClientBase):
- def _parse_rabbit_hosts(self, rabbit_hosts):
- server_list = rabbit_hosts.split(",")
-
- default_dict = {'user': self._rabbit_user,
- 'password': self._rabbit_password,
- 'port': self._rabbit_port}
- ret = []
- for s in server_list:
- match = re.match("(?:(?P<user>.*?)(?::(?P<password>.*?))*@)*(?P<host>.*?)(?::(?P<port>\d+))*$", s)
- if match:
- mdict = match.groupdict().copy()
- for key in ['user', 'password', 'port']:
- if not mdict[key]:
- mdict[key] = default_dict[key]
-
- ret.append(mdict)
-
- return ret
-
- def __init__(self, rabbit_hosts, rabbit_port, rabbit_user, rabbit_password,
- rabbit_vhost, rabbit_ha_mode, q_name, subscribe_cb, logger):
- super(VncKombuClientV2, self).__init__(rabbit_hosts, rabbit_port,
- rabbit_user, rabbit_password,
- rabbit_vhost, rabbit_ha_mode,
- q_name, subscribe_cb, logger)
-
- _hosts = self._parse_rabbit_hosts(rabbit_hosts)
- self._urls = []
- for h in _hosts:
- h['vhost'] = "" if not rabbit_vhost else rabbit_vhost
- _url = "pyamqp://%(user)s:%(password)s@%(host)s:%(port)s/%(vhost)s/" % h
- self._urls.append(_url)
-
- msg = "Initializing RabbitMQ connection, urls %s" % self._urls
- self._logger(msg, level=SandeshLevel.SYS_NOTICE)
- self._update_sandesh_status(ConnectionStatus.INIT)
- self._conn_state = ConnectionStatus.INIT
- self._conn = kombu.Connection(self._urls)
- queue_args = {"x-ha-policy": "all"} if rabbit_ha_mode else None
- self._update_queue_obj = kombu.Queue(q_name, self.obj_upd_exchange,
- durable=False,
- queue_arguments=queue_args)
-
- self._start()
- # end __init__
-
-
-from distutils.version import LooseVersion
-if LooseVersion(kombu.__version__) >= LooseVersion("2.5.0"):
- VncKombuClient = VncKombuClientV2
-else:
- VncKombuClient = VncKombuClientV1
diff --git a/Testcases/cfgm_common/vnc_kombu.pyc b/Testcases/cfgm_common/vnc_kombu.pyc
deleted file mode 100644
index a8c19ed..0000000
--- a/Testcases/cfgm_common/vnc_kombu.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/vnc_plugin_base.py b/Testcases/cfgm_common/vnc_plugin_base.py
deleted file mode 100644
index e1d3517..0000000
--- a/Testcases/cfgm_common/vnc_plugin_base.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import abc
-from vnc_api.gen.vnc_api_extension_gen import ResourceApiGen
-
-class Resync(object):
- @abc.abstractmethod
- def __init__(self, api_server_ip, api_server_port, conf_sections):
- pass
- #end __init__
-
- @abc.abstractmethod
- def resync_domains_projects(self):
- """
- Method that implements auditing of projects between orchestration
- system and OpenContrail VNC
- """
- pass
- #end resync_projects
-
-#end class Resync
-
-
-class ResourceApi(ResourceApiGen):
- @abc.abstractmethod
- def __init__(self):
- pass
- #end __init__
-
- @abc.abstractmethod
- def transform_request(self, request):
- pass
- # end transform_request
-
- @abc.abstractmethod
- def validate_request(self, request):
- pass
- # end validate_request
-
- @abc.abstractmethod
- def transform_response(self, request, response):
- pass
- # end transform_response
-
-
-class NeutronApi(object):
- @abc.abstractmethod
- def __init__(self):
- pass
- #end __init__
-
-
-class AuthBase(object):
- __metaclass__ = abc.ABCMeta
-
- @abc.abstractmethod
- def __init__(self, auth_method, auth_opts):
- pass
- #end __init__
-
- @abc.abstractmethod
- def get_request_auth_app(self):
- """
- Middleware to invoke for authentication on every request
- """
- pass
- #end get_request_auth_app
-
-#end class AuthBase
diff --git a/Testcases/cfgm_common/vnc_plugin_base.pyc b/Testcases/cfgm_common/vnc_plugin_base.pyc
deleted file mode 100644
index 598918a..0000000
--- a/Testcases/cfgm_common/vnc_plugin_base.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cfgm_common/zkclient.py b/Testcases/cfgm_common/zkclient.py
deleted file mode 100644
index 5c8d461..0000000
--- a/Testcases/cfgm_common/zkclient.py
+++ /dev/null
@@ -1,358 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-import os
-import gevent
-import logging
-import kazoo.client
-import kazoo.exceptions
-import kazoo.handlers.gevent
-import kazoo.recipe.election
-from kazoo.client import KazooState
-from kazoo.retry import KazooRetry
-
-from bitarray import bitarray
-from cfgm_common.exceptions import ResourceExhaustionError, ResourceExistsError
-from gevent.coros import BoundedSemaphore
-
-import uuid
-
-LOG_DIR = '/var/log/contrail/'
-
-class IndexAllocator(object):
-
- def __init__(self, zookeeper_client, path, size=0, start_idx=0,
- reverse=False,alloc_list=None, max_alloc=0):
- if alloc_list is None:
- self._alloc_list = [{'start':start_idx, 'end':start_idx+size}]
- else:
- sorted_alloc_list = sorted(alloc_list, key=lambda k: k['start'])
- self._alloc_list = sorted_alloc_list
-
- alloc_count = len(self._alloc_list)
- total_size = 0
- start_idx = self._alloc_list[0]['start']
- size = 0
-
- #check for overlap in alloc_list --TODO
- for alloc_idx in range (0, alloc_count -1):
- idx_start_addr = self._alloc_list[alloc_idx]['start']
- idx_end_addr = self._alloc_list[alloc_idx]['end']
- next_start_addr = self._alloc_list[alloc_idx+1]['start']
- if next_start_addr <= idx_end_addr:
- raise Exception()
- size += idx_end_addr - idx_start_addr + 1
- size += self._alloc_list[alloc_count-1]['end'] - self._alloc_list[alloc_count-1]['start'] + 1
-
- self._size = size
- self._start_idx = start_idx
- if max_alloc == 0:
- self._max_alloc = self._size
- else:
- self._max_alloc = max_alloc
-
- self._zookeeper_client = zookeeper_client
- self._path = path
- self._in_use = bitarray('0')
- self._reverse = reverse
- for idx in self._zookeeper_client.get_children(path):
- idx_int = self._get_bit_from_zk_index(int(idx))
- if idx_int >= 0:
- self._set_in_use(idx_int)
- # end for idx
- # end __init__
-
- def _get_zk_index_from_bit(self, idx):
- size = idx
- if self._reverse:
- for alloc in reversed(self._alloc_list):
- size -= alloc['end'] - alloc['start'] + 1
- if size < 0:
- return alloc['start']-size - 1
- else:
- for alloc in self._alloc_list:
- size -= alloc['end'] - alloc['start'] + 1
- if size < 0:
- return alloc['end']+size + 1
-
- raise Exception()
- # end _get_zk_index
-
- def _get_bit_from_zk_index(self, idx):
- size = 0
- if self._reverse:
- for alloc in reversed(self._alloc_list):
- if alloc['start'] <= idx <= alloc['end']:
- return alloc['end'] - idx + size
- size += alloc['end'] - alloc['start'] + 1
- pass
- else:
- for alloc in self._alloc_list:
- if alloc['start'] <= idx <= alloc['end']:
- return idx - alloc['start'] + size
- size += alloc['end'] - alloc['start'] + 1
- return -1
- # end _get_bit_from_zk_index
-
- def _set_in_use(self, idx):
- # if the index is higher than _max_alloc, do not use the bitarray, in
- # order to reduce the size of the bitarray. Otherwise, set the bit
- # corresponding to idx to 1 and extend the _in_use bitarray if needed
- if idx > self._max_alloc:
- return
- if idx >= self._in_use.length():
- temp = bitarray(idx - self._in_use.length())
- temp.setall(0)
- temp.append('1')
- self._in_use.extend(temp)
- else:
- self._in_use[idx] = 1
- # end _set_in_use
-
- def alloc(self, value=None):
- if self._in_use.all():
- idx = self._in_use.length()
- if idx > self._max_alloc:
- raise ResourceExhaustionError()
- self._in_use.append(1)
- else:
- idx = self._in_use.index(0)
- self._in_use[idx] = 1
-
- idx = self._get_zk_index_from_bit(idx)
- try:
- # Create a node at path and return its integer value
- id_str = "%(#)010d" % {'#': idx}
- self._zookeeper_client.create_node(self._path + id_str, value)
- return idx
- except ResourceExistsError:
- return self.alloc(value)
- # end alloc
-
- def reserve(self, idx, value=None):
- bit_idx = self._get_bit_from_zk_index(idx)
- if bit_idx < 0:
- return None
- try:
- # Create a node at path and return its integer value
- id_str = "%(#)010d" % {'#': idx}
- self._zookeeper_client.create_node(self._path + id_str, value)
- self._set_in_use(bit_idx)
- return idx
- except ResourceExistsError:
- self._set_in_use(bit_idx)
- return None
- # end reserve
-
- def delete(self, idx):
- id_str = "%(#)010d" % {'#': idx}
- self._zookeeper_client.delete_node(self._path + id_str)
- bit_idx = self._get_bit_from_zk_index(idx)
- if 0 <= bit_idx < self._in_use.length():
- self._in_use[bit_idx] = 0
- # end delete
-
- def read(self, idx):
- id_str = "%(#)010d" % {'#': idx}
- id_val = self._zookeeper_client.read_node(self._path+id_str)
- if id_val is not None:
- bit_idx = self._get_bit_from_zk_index(idx)
- if bit_idx >= 0:
- self._set_in_use(bit_idx)
- return id_val
- # end read
-
- def empty(self):
- return not self._in_use.any()
- # end empty
-
- @classmethod
- def delete_all(cls, zookeeper_client, path):
- try:
- zookeeper_client.delete_node(path, recursive=True)
- except kazoo.exceptions.NotEmptyError:
- #TODO: Add retries for NotEmptyError
- zookeeper_client.syslog("NotEmptyError while deleting %s" % path)
- # end delete_all
-
-#end class IndexAllocator
-
-
-class ZookeeperClient(object):
-
- def __init__(self, module, server_list, logging_fn=None):
- # logging
- logger = logging.getLogger(module)
- logger.setLevel(logging.INFO)
- try:
- handler = logging.handlers.RotatingFileHandler(LOG_DIR + module + '-zk.log', maxBytes=10*1024*1024, backupCount=5)
- except IOError:
- print "Cannot open log file in %s" %(LOG_DIR)
- else:
- log_format = logging.Formatter('%(asctime)s [%(name)s]: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
- handler.setFormatter(log_format)
- logger.addHandler(handler)
-
- if logging_fn:
- self.log = logging_fn
- else:
- self.log = self.syslog
-
- self._zk_client = \
- kazoo.client.KazooClient(
- server_list,
- timeout=400,
- handler=kazoo.handlers.gevent.SequentialGeventHandler(),
- logger=logger)
-
- self._zk_client.add_listener(self._zk_listener)
- self._logger = logger
- self._election = None
- self._server_list = server_list
- # KazooRetry to retry keeper CRUD operations
- self._retry = KazooRetry(max_tries=None, max_delay=300,
- sleep_func=gevent.sleep)
-
- self._conn_state = None
- self._sandesh_connection_info_update(status='INIT', message='')
- self._lost_cb = None
-
- self.connect()
- # end __init__
-
- # start
- def connect(self):
- while True:
- try:
- self._zk_client.start()
- break
- except gevent.event.Timeout as e:
- # Update connection info
- self._sandesh_connection_info_update(status='DOWN',
- message=str(e))
- gevent.sleep(1)
- # Zookeeper is also throwing exception due to delay in master election
- except Exception as e:
- # Update connection info
- self._sandesh_connection_info_update(status='DOWN',
- message=str(e))
- gevent.sleep(1)
- # Update connection info
- self._sandesh_connection_info_update(status='UP', message='')
-
- # end
-
- def is_connected(self):
- return self._zk_client.state == KazooState.CONNECTED
- # end is_connected
-
- def syslog(self, msg, *args, **kwargs):
- if not self._logger:
- return
- self._logger.info(msg)
- # end syslog
-
- def set_lost_cb(self, lost_cb=None):
- # set a callback to be called when kazoo state is lost
- # set to None for default action
- self._lost_cb = lost_cb
- # end set_lost_cb
-
- def _zk_listener(self, state):
- if state == KazooState.CONNECTED:
- if self._election:
- self._election.cancel()
- # Update connection info
- self._sandesh_connection_info_update(status='UP', message='')
- elif state == KazooState.LOST:
- # Lost the session with ZooKeeper Server
- # Best of option we have is to exit the process and restart all
- # over again
- if self._lost_cb:
- self._lost_cb()
- else:
- os._exit(2)
- elif state == KazooState.SUSPENDED:
- # Update connection info
- self._sandesh_connection_info_update(status='INIT',
- message = 'Connection to zookeeper lost. Retrying')
-
- # end
-
- def _zk_election_callback(self, func, *args, **kwargs):
- func(*args, **kwargs)
- # Exit if running master encounters error or exception
- exit(1)
- # end
-
- def master_election(self, path, identifier, func, *args, **kwargs):
- while True:
- self._election = self._zk_client.Election(path, identifier)
- self._election.run(self._zk_election_callback, func, *args, **kwargs)
- # end master_election
-
- def create_node(self, path, value=None):
- try:
- if value is None:
- value = uuid.uuid4()
- retry = self._retry.copy()
- retry(self._zk_client.create, path, str(value), makepath=True)
- except kazoo.exceptions.NodeExistsError:
- current_value = self.read_node(path)
- if current_value == value:
- return True;
- raise ResourceExistsError(path, str(current_value))
- # end create_node
-
- def delete_node(self, path, recursive=False):
- try:
- retry = self._retry.copy()
- retry(self._zk_client.delete, path, recursive=recursive)
- except kazoo.exceptions.NoNodeError:
- pass
- except Exception as e:
- raise e
- # end delete_node
-
- def read_node(self, path):
- try:
- retry = self._retry.copy()
- value = retry(self._zk_client.get, path)
- return value[0]
- except Exception:
- return None
- # end read_node
-
- def get_children(self, path):
- try:
- retry = self._retry.copy()
- return retry(self._zk_client.get_children, path)
- except Exception:
- return []
- # end read_node
-
- def _sandesh_connection_info_update(self, status, message):
- from pysandesh.connection_info import ConnectionState
- from pysandesh.gen_py.process_info.ttypes import ConnectionStatus, \
- ConnectionType
- from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
-
- new_conn_state = getattr(ConnectionStatus, status)
- ConnectionState.update(conn_type = ConnectionType.ZOOKEEPER,
- name = 'Zookeeper', status = new_conn_state,
- message = message,
- server_addrs = self._server_list.split(','))
-
- if (self._conn_state and self._conn_state != ConnectionStatus.DOWN and
- new_conn_state == ConnectionStatus.DOWN):
- msg = 'Connection to Zookeeper down: %s' %(message)
- self.log(msg, level=SandeshLevel.SYS_ERR)
- if (self._conn_state and self._conn_state != new_conn_state and
- new_conn_state == ConnectionStatus.UP):
- msg = 'Connection to Zookeeper ESTABLISHED'
- self.log(msg, level=SandeshLevel.SYS_NOTICE)
-
- self._conn_state = new_conn_state
- # end _sandesh_connection_info_update
-
-# end class ZookeeperClient
diff --git a/Testcases/cfgm_common/zkclient.pyc b/Testcases/cfgm_common/zkclient.pyc
deleted file mode 100644
index c18a227..0000000
--- a/Testcases/cfgm_common/zkclient.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/cleanup b/Testcases/cleanup
deleted file mode 100755
index c23d556..0000000
--- a/Testcases/cleanup
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-
-
-if [ $1 == "v4" ]
-then
- echo "Cleaning v4"
-else
- echo "Cleaning v6"
-fi
-
diff --git a/Testcases/config b/Testcases/config
deleted file mode 100755
index bdbd1e1..0000000
--- a/Testcases/config
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import os
-from config_shell import *
-default_client_args = [
- ('--username', 'admin'),
- ('--password', os.environ["OS_PASSWORD"]),
- ('--region', 'RegionOne'),
- ('--tenant', os.environ["OS_TENANT_NAME"]),
- ('--api-server', '10.10.11.16')]
-
-
-if __name__ == '__main__':
- for arg in default_client_args:
- if not arg[0] in sys.argv:
- sys.argv.insert(1, arg[0])
- sys.argv.insert(2, arg[1])
- ConfigShell().main()
diff --git a/Testcases/config.16 b/Testcases/config.16
deleted file mode 100755
index bdbd1e1..0000000
--- a/Testcases/config.16
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import os
-from config_shell import *
-default_client_args = [
- ('--username', 'admin'),
- ('--password', os.environ["OS_PASSWORD"]),
- ('--region', 'RegionOne'),
- ('--tenant', os.environ["OS_TENANT_NAME"]),
- ('--api-server', '10.10.11.16')]
-
-
-if __name__ == '__main__':
- for arg in default_client_args:
- if not arg[0] in sys.argv:
- sys.argv.insert(1, arg[0])
- sys.argv.insert(2, arg[1])
- ConfigShell().main()
diff --git a/Testcases/config.int b/Testcases/config.int
deleted file mode 100755
index 9911363..0000000
--- a/Testcases/config.int
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-
-import sys
-import os
-from config_shell import *
-default_client_args = [
- ('--username', 'admin'),
- ('--password', 'openstack'),
- ('--region', 'RegionOne'),
- ('--tenant', 'admin'),
- ('--api-server', '172.16.50.199')]
-
-
-if __name__ == '__main__':
- for arg in default_client_args:
- if not arg[0] in sys.argv:
- sys.argv.insert(1, arg[0])
- sys.argv.insert(2, arg[1])
- ConfigShell().main()
diff --git a/Testcases/config_obj.py b/Testcases/config_obj.py
deleted file mode 100644
index 9470588..0000000
--- a/Testcases/config_obj.py
+++ /dev/null
@@ -1,1737 +0,0 @@
-
-import os
-import sys
-import time
-import uuid
-from vnc_api import vnc_api
-try:
- import novaclient.v1_1.client
- config_nova = True
-except:
- config_nova = False
-
-
-class ConfigVirtualDns():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.virtual_DNSs_list()['virtual-DNSs']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == name):
- return self.vnc.virtual_DNS_read(id = item['uuid'])
-
- def obj_show(self, obj):
- print 'Virtual DNS'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- dns = obj.get_virtual_DNS_data()
- print 'Domain name: %s' %(dns.domain_name)
- print 'Record order: %s' %(dns.record_order)
- print 'Default TTL: %s seconds' %(dns.default_ttl_seconds)
- print 'Next DNS: %s' %(dns.next_virtual_DNS)
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- print ' %s' %(item['fq_name'][1])
-
- def add(self, name, domain_name, record_order, next_dns):
- data = vnc_api.VirtualDnsType(domain_name = domain_name,
- dynamic_records_from_client = True,
- record_order = record_order,
- default_ttl_seconds = 86400,
- next_virtual_DNS = 'default-domain:' + next_dns)
- obj = vnc_api.VirtualDns(name = name, virtual_DNS_data = data)
- try:
- self.vnc.virtual_DNS_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
- def delete(self, name):
- try:
- self.vnc.virtual_DNS_delete(
- fq_name = ['default-domain', name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigIpam():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.network_ipams_list()['network-ipams']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == name):
- return self.vnc.network_ipam_read(id = item['uuid'])
-
- def dns_show(self, mgmt):
- print ' DNS Type: %s' %(mgmt.ipam_dns_method)
- if (mgmt.ipam_dns_method == 'virtual-dns-server'):
- print ' Virtual DNS Server: %s' %(
- mgmt.get_ipam_dns_server().virtual_dns_server_name)
- elif (mgmt.ipam_dns_method == 'tenant-dns-server'):
- list = mgmt.get_ipam_dns_server().get_tenant_dns_server_address().get_ip_address()
- print ' Tenant DNS Server:'
- for item in list:
- print ' %s' %(item)
-
- def dhcp_show(self, mgmt):
- dhcp_opt = {'4':'NTP Server', '15':'Domain Name'}
- print ' DHCP Options:'
- dhcp = mgmt.get_dhcp_option_list()
- if not dhcp:
- return
- for item in dhcp.get_dhcp_option():
- print ' %s: %s' %(dhcp_opt[item.dhcp_option_name],
- item.dhcp_option_value)
-
- def obj_show(self, obj):
- print 'IPAM'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- print 'Management:'
- mgmt = obj.get_network_ipam_mgmt()
- if not mgmt:
- return
- self.dns_show(mgmt)
- self.dhcp_show(mgmt)
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s' %(item['fq_name'][2])
-
- def dns_add(self, mgmt, dns_type, virtual_dns = None, tenant_dns = None):
- type = {'none':'none',
- 'default':'default-dns-server',
- 'virtual':'virtual-dns-server',
- 'tenant':'tenant-dns-server'}
- if not dns_type:
- return
- mgmt.set_ipam_dns_method(type[dns_type])
- if virtual_dns:
- mgmt.set_ipam_dns_server(vnc_api.IpamDnsAddressType(
- virtual_dns_server_name = virtual_dns))
- if tenant_dns:
- mgmt.set_ipam_dns_server(vnc_api.IpamDnsAddressType(
- tenant_dns_server_address = vnc_api.IpAddressesType(
- ip_address = tenant_dns)))
-
- def dhcp_add(self, mgmt, domain_name = None, ntp_server = None):
- if domain_name:
- list = mgmt.get_dhcp_option_list()
- if not list:
- list = vnc_api.DhcpOptionsListType()
- mgmt.set_dhcp_option_list(list)
- list.add_dhcp_option(vnc_api.DhcpOptionType(
- dhcp_option_name = '15',
- dhcp_option_value = domain_name))
- if ntp_server:
- list = mgmt.get_dhcp_option_list()
- if not list:
- list = vnc_api.DhcpOptionsListType()
- mgmt.set_dhcp_option_list()
- list.add_dhcp_option(vnc_api.DhcpOptionType(
- dhcp_option_name = '4',
- dhcp_option_value = ntp_server))
-
- def add(self, name, dns_type, virtual_dns = None, tenant_dns = None,
- domain_name = None, ntp_server = None):
- create = False
- obj = self.obj_get(name)
- if not obj:
- obj = vnc_api.NetworkIpam(name = name,
- parent_obj = self.tenant)
- create = True
- mgmt = obj.get_network_ipam_mgmt()
- if not mgmt:
- mgmt = vnc_api.IpamType()
- obj.set_network_ipam_mgmt(mgmt)
- self.dns_add(mgmt, dns_type, virtual_dns, tenant_dns)
- self.dhcp_add(mgmt, domain_name, ntp_server)
- if create:
- try:
- self.vnc.network_ipam_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- else:
- self.vnc.network_ipam_update(obj)
-
- def delete(self, name, domain_name = None):
- update = False
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- if domain_name:
- mgmt = obj.get_network_ipam_mgmt()
- list = mgmt.get_dhcp_option_list()
- for item in list.get_dhcp_option():
- if (item.dhcp_option_name == '15') and \
- (item.dhcp_option_value == domain_name):
- list.delete_dhcp_option(item)
- break
- update = True
- if update:
- self.vnc.network_ipam_update(obj)
- else:
- try:
- self.vnc.network_ipam_delete(
- fq_name = ['default-domain', self.tenant.name,
- name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigPolicy():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.network_policys_list()['network-policys']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == name):
- return self.vnc.network_policy_read(id = item['uuid'])
-
- def addr_show(self, addr_list):
- for item in addr_list:
- print ' Virtual Network: %s' %(item.get_virtual_network())
-
- def port_show(self, port_list):
- for item in port_list:
- print ' %d:%d' %(item.get_start_port(), item.get_end_port())
-
- def action_show(self, rule):
- list = rule.get_action_list()
- if not list:
- return
- action = list.get_simple_action()
- if action:
- print ' %s' %(action)
- else:
- for item in rule.get_action_list().get_apply_service():
- print ' %s' %(item)
-
- def rule_show(self, obj):
- rules_obj = obj.get_network_policy_entries()
- if (rules_obj == None):
- return
- list = rules_obj.get_policy_rule()
- count = 1
- for rule in list:
- print 'Rule #%d' %(count)
- print ' Direction: %s' %(rule.get_direction())
- print ' Protocol: %s' %(rule.get_protocol())
- print ' Source Addresses:'
- self.addr_show(rule.get_src_addresses())
- print ' Source Ports:'
- self.port_show(rule.get_src_ports())
- print ' Destination Addresses:'
- self.addr_show(rule.get_dst_addresses())
- print ' Destination Ports:'
- self.port_show(rule.get_dst_ports())
- print ' Action:'
- self.action_show(rule)
- count += 1
-
- def obj_show(self, obj):
- print 'Policy'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- self.rule_show(obj)
- list = obj.get_virtual_network_back_refs()
- if (list != None):
- print '[BR] network:'
- for item in list:
- print ' %s' %(item['to'][2])
-
- def show(self, name):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s' %(item['fq_name'][2])
-
- def rule_add(self, arg_list):
- direction = None
- protocol = None
- src_net_list = []
- dst_net_list = []
- src_port_list = []
- dst_port_list = []
- action = None
- service_list = []
- for arg in arg_list:
- arg_name = arg.split('=')[0]
- arg_val = arg.split('=')[1]
- if (arg_name == 'direction'):
- direction = arg_val
- elif (arg_name == 'protocol'):
- protocol = arg_val
- elif (arg_name == 'src-net'):
- net = 'default-domain:%s:%s' %(self.tenant.name, arg_val)
- src_net_list.append(vnc_api.AddressType(virtual_network = net))
- elif (arg_name == 'dst-net'):
- net = 'default-domain:%s:%s' %(self.tenant.name, arg_val)
- dst_net_list.append(vnc_api.AddressType(virtual_network = net))
- elif (arg_name == 'src-port'):
- if (arg_val == 'any'):
- src_port_list.append(vnc_api.PortType(
- start_port = -1, end_port = -1))
- else:
- s_e = arg_val.split(':')
- src_port_list.append(vnc_api.PortType(
- start_port = int(s_e[0]), end_port = int(s_e[1])))
- elif (arg_name == 'dst-port'):
- if (arg_val == 'any'):
- src_port_list.append(vnc_api.PortType(
- start_port = -1, end_port = -1))
- else:
- s_e = arg_val.split(':')
- src_port_list.append(vnc_api.PortType(
- start_port = int(s_e[0]), end_port = int(s_e[1])))
- elif (arg_name == 'action'):
- action = arg_val
- elif (arg_name == 'service'):
- service_list.append('default-domain:%s:%s' \
- %(self.tenant.name, arg_val))
-
- rule = vnc_api.PolicyRuleType()
- if not direction:
- direction = '<>'
- rule.set_direction(direction)
- if not protocol:
- protocol = 'any'
- rule.set_protocol(protocol)
- if not src_net_list:
- src_net_list.append(vnc_api.AddressType(virtual_network = 'any'))
- rule.set_src_addresses(src_net_list)
- if not dst_net_list:
- dst_net_list.append(vnc_api.AddressType(virtual_network = 'any'))
- rule.set_dst_addresses(dst_net_list)
- if not src_port_list:
- src_port_list.append(vnc_api.PortType(
- start_port = -1, end_port = -1))
- rule.set_src_ports(src_port_list)
- if not dst_port_list:
- dst_port_list.append(vnc_api.PortType(
- start_port = -1, end_port = -1))
- rule.set_dst_ports(dst_port_list)
- if not action:
- action_list = vnc_api.ActionListType(simple_action = 'pass')
- elif (action == 'service'):
- action_list = vnc_api.ActionListType(apply_service = service_list)
- else:
- action_list = vnc_api.ActionListType(simple_action = action)
- rule.set_action_list(action_list)
- return rule
-
- def add(self, name, rule_arg_list):
- rule_list = []
- if not rule_arg_list:
- rule = self.rule_add([])
- rule_list.append(rule)
- else:
- for rule_arg in rule_arg_list:
- rule = self.rule_add(rule_arg.split(','))
- rule_list.append(rule)
-
- obj = self.obj_get(name = name)
- if obj:
- rules = obj.get_network_policy_entries()
- if not rules:
- rules = vnc_api.PolicyEntriesType(policy_rule = rule_list)
- else:
- for item in rule_list:
- rules.add_policy_rule(item)
- obj.set_network_policy_entries(rules)
- try:
- self.vnc.network_policy_update(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- else:
- rules = vnc_api.PolicyEntriesType(policy_rule = rule_list)
- obj = vnc_api.NetworkPolicy(name = name,
- parent_obj = self.tenant,
- network_policy_entries = rules)
- try:
- self.vnc.network_policy_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
- def delete(self, name, rule_arg_list):
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- if rule_arg_list:
- rules = obj.get_network_policy_entries()
- if not rules:
- return
- for rule_arg in rule_arg_list:
- for arg in rule_arg.split(','):
- arg_name = arg.split('=')[0]
- arg_val = arg.split('=')[1]
- if (arg_name == 'index'):
- rule = rules.get_policy_rule()[int(arg_val) - 1]
- rules.delete_policy_rule(rule)
- obj.set_network_policy_entries(rules)
- self.vnc.network_policy_update(obj)
- else:
- try:
- self.vnc.network_policy_delete(fq_name = ['default-domain',
- self.tenant.name, name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigSecurityGroup():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.security_groups_list()['security-groups']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == name):
- return self.vnc.security_group_read(id = item['uuid'])
-
- def addr_show(self, addr_list):
- for item in addr_list:
- print ' Security Group: %s' %(item.get_security_group())
- subnet = item.get_subnet()
- if subnet:
- print ' Subnet: %s/%d' %(subnet.get_ip_prefix(), \
- subnet.get_ip_prefix_len())
- else:
- print ' Subnet: None'
-
- def port_show(self, port_list):
- for item in port_list:
- print ' %d:%d' %(item.get_start_port(), item.get_end_port())
-
- def rule_show(self, obj):
- rules_obj = obj.get_security_group_entries()
- if (rules_obj == None):
- return
- list = rules_obj.get_policy_rule()
- count = 1
- for rule in list:
- print 'Rule #%d' %(count)
- print ' Direction: %s' %(rule.get_direction())
- print ' Protocol: %s' %(rule.get_protocol())
- print ' Source Addresses:'
- self.addr_show(rule.get_src_addresses())
- print ' Source Ports:'
- self.port_show(rule.get_src_ports())
- print ' Destination Addresses:'
- self.addr_show(rule.get_dst_addresses())
- print ' Destination Ports:'
- self.port_show(rule.get_dst_ports())
- count += 1
-
- def obj_show(self, obj):
- print 'Security Group'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- self.rule_show(obj)
-
- def show(self, name):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s' %(item['fq_name'][2])
-
- def add(self, name, protocol = None, address = None, port = None,
- direction = None):
- rule = vnc_api.PolicyRuleType()
- rule.set_direction('>')
- if protocol:
- rule.set_protocol(protocol)
- else:
- rule.set_protocol('any')
-
- addr_list = []
- if address:
- for item in address:
- prefix = item.split('/')[0]
- len = item.split('/')[1]
- addr_list.append(vnc_api.AddressType(
- subnet = vnc_api.SubnetType(
- ip_prefix = prefix, ip_prefix_len = int(len))))
- else:
- addr_list.append(vnc_api.AddressType(
- subnet = vnc_api.SubnetType(
- ip_prefix = '0.0.0.0', ip_prefix_len = 0)))
-
- local_addr_list = [vnc_api.AddressType(security_group = 'local')]
-
- port_list = []
- if port:
- for item in port:
- if (item == 'any'):
- port_list.append(vnc_api.PortType(
- start_port = -1, end_port = -1))
- else:
- s_e = item.split(':')
- port_list.append(vnc_api.PortType(
- start_port = int(s_e[0]), end_port = int(s_e[1])))
- else:
- port_list.append(vnc_api.PortType(start_port = -1, end_port = -1))
-
- local_port_list = [vnc_api.PortType(start_port = -1, end_port = -1)]
-
- if (direction == 'ingress'):
- rule.set_src_addresses(addr_list)
- rule.set_src_ports(port_list)
- rule.set_dst_addresses(local_addr_list)
- rule.set_dst_ports(local_port_list)
- else:
- rule.set_src_addresses(local_addr_list)
- rule.set_src_ports(local_port_list)
- rule.set_dst_addresses(addr_list)
- rule.set_dst_ports(port_list)
-
- obj = self.obj_get(name = name)
- if obj:
- rules = obj.get_security_group_entries()
- if not rules:
- rules = vnc_api.PolicyEntriesType(policy_rule = [rule])
- else:
- rules.add_policy_rule(rule)
- try:
- self.vnc.security_group_update(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- else:
- rules = vnc_api.PolicyEntriesType(policy_rule = [rule])
- obj = vnc_api.SecurityGroup(name = name,
- parent_obj = self.tenant,
- security_group_entries = rules)
- try:
- self.vnc.security_group_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
- def rule_del(self, obj, index):
- rules = obj.get_security_group_entries()
- if not rules:
- return
- rule = rules.get_policy_rule()[index - 1]
- rules.delete_policy_rule(rule)
- self.vnc.security_group_update(obj)
-
- def delete(self, name, rule = None):
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- if rule:
- self.rule_del(obj, int(rule))
- else:
- try:
- self.vnc.security_group_delete(fq_name = ['default-domain',
- self.tenant.name, name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigNetwork():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.virtual_networks_list()['virtual-networks']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == name):
- return self.vnc.virtual_network_read(id = item['uuid'])
-
- def prop_route_target_show(self, obj):
- print '[P] Route targets:'
- rt_list = obj.get_route_target_list()
- if not rt_list:
- return
- for rt in rt_list.get_route_target():
- print ' %s' %(rt)
-
- def child_floating_ip_pool_show(self, obj):
- print '[C] Floating IP pools:'
- pool_list = obj.get_floating_ip_pools()
- if not pool_list:
- return
- for pool in pool_list:
- print ' %s' %(pool['to'][3])
- pool_obj = self.vnc.floating_ip_pool_read(id = pool['uuid'])
- ip_list = pool_obj.get_floating_ips()
- if (ip_list != None):
- for ip in ip_list:
- ip_obj = self.vnc.floating_ip_read(id = ip['uuid'])
- print ' %s' %(ip_obj.get_floating_ip_address())
-
- def ref_ipam_show(self, obj):
- print '[R] IPAMs:'
- ipam_list = obj.get_network_ipam_refs()
- if not ipam_list:
- return
- for item in ipam_list:
- print ' %s' %(item['to'][2])
- subnet_list = item['attr'].get_ipam_subnets()
- for subnet in subnet_list:
- print ' subnet: %s/%d, gateway: %s' %(
- subnet.get_subnet().get_ip_prefix(),
- subnet.get_subnet().get_ip_prefix_len(),
- subnet.get_default_gateway())
-
- def ref_policy_show(self, obj):
- print '[R] Policies:'
- policy_list = obj.get_network_policy_refs()
- if not policy_list:
- return
- for item in policy_list:
- print ' %s (%d.%d)' %(item['to'][2],
- item['attr'].get_sequence().get_major(),
- item['attr'].get_sequence().get_minor())
-
- def ref_route_table_show(self, obj):
- print '[R] Route Tables:'
- rt_list = obj.get_route_table_refs()
- if not rt_list:
- return
- for item in rt_list:
- print ' %s' %(item['to'][2])
-
- def obj_show(self, obj):
- print 'Virtual Network'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- self.prop_route_target_show(obj)
- self.child_floating_ip_pool_show(obj)
- self.ref_ipam_show(obj)
- self.ref_policy_show(obj)
- self.ref_route_table_show(obj)
-
- def show(self, name):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s' %(item['fq_name'][2])
-
- def ipam_add(self, obj, name, subnet, gateway = None):
- try:
- ipam_obj = self.vnc.network_ipam_read(fq_name = ['default-domain',
- self.tenant.name, name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- cidr = subnet.split('/')
- subnet = vnc_api.SubnetType(ip_prefix = cidr[0],
- ip_prefix_len = int(cidr[1]))
- ipam_subnet = vnc_api.IpamSubnetType(subnet = subnet,
- default_gateway = gateway)
- obj.add_network_ipam(ref_obj = ipam_obj,
- ref_data = vnc_api.VnSubnetsType([ipam_subnet]))
-
- def ipam_del(self, obj, name):
- try:
- ipam_obj = self.vnc.network_ipam_read(fq_name = ['default-domain',
- self.tenant.name, name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.del_network_ipam(ref_obj = ipam_obj)
-
- def policy_add(self, obj, name):
- try:
- policy_obj = self.vnc.network_policy_read(
- fq_name = ['default-domain', self.tenant.name, name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- seq = vnc_api.SequenceType(major = 0, minor = 0)
- obj.add_network_policy(ref_obj = policy_obj,
- ref_data = vnc_api.VirtualNetworkPolicyType(sequence = seq))
-
- def policy_del(self, obj, name):
- try:
- policy_obj = self.vnc.network_policy_read(
- fq_name = ['default-domain', self.tenant.name, name])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.del_network_policy(ref_obj = policy_obj)
-
- def route_target_add(self, obj, rt):
- rt_list = obj.get_route_target_list()
- if not rt_list:
- rt_list = vnc_api.RouteTargetList()
- obj.set_route_target_list(rt_list)
- rt_list.add_route_target('target:%s' %(rt))
-
- def route_target_del(self, obj, rt):
- rt_list = obj.get_route_target_list()
- if not rt_list:
- return
- rt_list.delete_route_target('target:%s' %(rt))
-
- def route_table_add(self, obj, rt):
- try:
- rt_obj = self.vnc.route_table_read(fq_name = ['default-domain',
- self.tenant.name, rt])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.add_route_table(ref_obj = rt_obj)
-
- def route_table_del(self, obj, rt):
- try:
- rt_obj = self.vnc.route_table_read(fq_name = ['default-domain',
- self.tenant.name, rt])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.del_route_table(ref_obj = rt_obj)
-
- def add(self, name, ipam = None, subnet = None, policy = None,
- route_target = None, route_table = None, shared = None,
- external = None, l2 = None):
- create = False
- obj = self.obj_get(name)
- if not obj:
- obj = vnc_api.VirtualNetwork(name = name,
- parent_obj = self.tenant)
- if l2:
- prop = vnc_api.VirtualNetworkType(forwarding_mode = 'l2')
- obj.set_virtual_network_properties(prop)
- if shared:
- obj.set_is_shared(shared)
- if external:
- obj.set_router_external(external)
- create = True
- if ipam and subnet:
- self.ipam_add(obj, ipam, subnet)
- if policy:
- self.policy_add(obj, policy)
- if route_target:
- self.route_target_add(obj, route_target)
- if route_table:
- self.route_table_add(obj, route_table)
- if create:
- try:
- self.vnc.virtual_network_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- else:
- self.vnc.virtual_network_update(obj)
-
- def delete(self, name, ipam = None, policy = None, route_target = None,
- route_table = None):
- update = False
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- if ipam:
- self.ipam_del(obj, ipam)
- update = True
- if policy:
- self.policy_del(obj, policy)
- update = True
- if route_target:
- self.route_target_del(obj, route_target)
- update = True
- if route_table:
- self.route_table_del(obj, route_table)
- update = True
- if update:
- self.vnc.virtual_network_update(obj)
- else:
- try:
- self.vnc.virtual_network_delete(id = obj.uuid)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigFloatingIpPool():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.floating_ip_pools_list()['floating-ip-pools']
- return list
-
- def obj_get(self, name, network = None):
- for item in self.obj_list():
- if network:
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == network) and \
- (item['fq_name'][3] == name):
- return self.vnc.floating_ip_pool_read(id = item['uuid'])
- else:
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][3] == name):
- return self.vnc.floating_ip_pool_read(id = item['uuid'])
-
- def prop_subnet_show(self, obj):
- print '[P] Subnet:'
- prefixes = obj.get_floating_ip_pool_prefixes()
- if not prefixes:
- return
- for item in prefixes.get_subnet():
- print ' %s/%s' %(item.get_ip_prefix(), item.get_ip_prefix_len())
-
- def child_ip_show(self, obj):
- print '[C] Floating IPs:'
- list = obj.get_floating_ips()
- if not list:
- return
- for ip in list:
- ip_obj = self.vnc.floating_ip_read(id = ip['uuid'])
- print ' %s' %(ip_obj.get_floating_ip_address())
-
- def back_ref_tenant_show(self, obj):
- print '[BR] Tenants:'
- list = obj.get_project_back_refs()
- if not list:
- return
- for item in list:
- print ' %s' %(item['to'][1])
-
- def obj_show(self, obj):
- print 'Floating IP Pool'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- self.prop_subnet_show(obj)
- self.child_ip_show(obj)
- self.back_ref_tenant_show(obj)
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s in network %s' \
- %(item['fq_name'][2], item['fq_name'][3])
-
- def add(self, name, network):
- if not name:
- print 'ERROR: The name of floating IP pool is not specified!'
- return
- if not network:
- print 'ERROR: Network is not specified!'
- return
- try:
- net_obj = self.vnc.virtual_network_read(
- fq_name = ['default-domain', self.tenant.name, network])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj = vnc_api.FloatingIpPool(name = name, parent_obj = net_obj)
- try:
- self.vnc.floating_ip_pool_create(obj)
- self.tenant.add_floating_ip_pool(obj)
- self.vnc.project_update(self.tenant)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
- def fip_delete(self, pool_obj):
- pass
-
- def delete(self, name, network):
- if not name:
- print 'ERROR: The name of floating IP pool is not specified!'
- return
- obj = self.obj_get(name, network)
- if not obj:
- print 'ERROR: Floating IP pool %s in network %s is not found!' \
- %(name, network)
- return
- if obj.get_floating_ips():
- print 'ERROR: There are allocated floating IPs!'
- return
- for tenant_ref in obj.get_project_back_refs():
- tenant = self.vnc.project_read(fq_name = tenant_ref['to'])
- tenant.del_floating_ip_pool(obj)
- self.vnc.project_update(tenant)
- try:
- self.vnc.floating_ip_pool_delete(id = obj.uuid)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigServiceTemplate():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.service_templates_list()['service-templates']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == name):
- return self.vnc.service_template_read(id = item['uuid'])
-
- def obj_show(self, obj):
- print 'Service Template'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- properties = obj.get_service_template_properties()
- print 'Service Mode: %s' %(properties.get_service_mode())
- print 'Service Type: %s' %(properties.get_service_type())
- print 'Service Image: %s' %(properties.get_image_name())
- print 'Service Flavor: %s' %(properties.get_flavor())
- print 'Service Interfaces:'
- for item in properties.get_interface_type():
- print ' %s' %(item.get_service_interface_type())
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- print ' %s' %(item['fq_name'][1])
-
- def add(self, name, mode, type, image, flavor, interface_type,
- scale = None):
- obj = vnc_api.ServiceTemplate(name = name)
- properties = vnc_api.ServiceTemplateType(service_mode = mode,
- service_type = type, image_name = image, flavor = flavor,
- ordered_interfaces = True, availability_zone_enable = True)
- if scale:
- properties.set_service_scaling(scale)
- for item in interface_type:
- if (mode == 'transparent') and \
- ((item == 'left') or (item == 'right')):
- shared_ip = True
- elif (mode == 'in-network') and (item == 'left'):
- shared_ip = True
- else:
- shared_ip = False
- type = vnc_api.ServiceTemplateInterfaceType(
- service_interface_type = item,
- shared_ip = shared_ip,
- static_route_enable = True)
- properties.add_interface_type(type)
- else:
- for item in interface_type:
- type = vnc_api.ServiceTemplateInterfaceType(
- service_interface_type = item,
- static_route_enable = True)
- properties.add_interface_type(type)
- obj.set_service_template_properties(properties)
- try:
- self.vnc.service_template_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
- def delete(self, name):
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- try:
- self.vnc.service_template_delete(id = obj.uuid)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigServiceInstance():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.service_instances_list()['service-instances']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == name):
- return self.vnc.service_instance_read(id = item['uuid'])
-
- def obj_show(self, obj):
- print 'Service Instance'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
-
- def show(self, name):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s' %(item['fq_name'][2])
-
- def add(self, name, template, network_list,
- auto_policy = None, scale_max = None):
- obj = vnc_api.ServiceInstance(name = name, parent_obj = self.tenant)
- properties = vnc_api.ServiceInstanceType(auto_policy = auto_policy)
- for net in network_list:
- net_name = None
- net_route = None
- net_auto = False
- tenant_name = self.tenant.name
- for arg in net.split(','):
- arg_name = arg.split('=')[0]
- arg_val = arg.split('=')[1]
- if (arg_name == 'tenant'):
- tenant_name = arg_val
- elif (arg_name == 'network'):
- if (arg_val == 'auto'):
- net_auto = True
- else:
- net_name = arg_val
- elif (arg_name == 'route'):
- net_route = arg_val
- if net_auto:
- net_fq_name = None
- else:
- net_fq_name = 'default-domain:%s:%s' %(tenant_name, net_name)
- interface = vnc_api.ServiceInstanceInterfaceType(
- virtual_network = net_fq_name)
- if net_route:
- route = vnc_api.RouteType(prefix = net_route)
- route_table = vnc_api.RouteTableType()
- route_table.add_route(route)
- interface.set_static_routes(route_table)
- properties.add_interface_list(interface)
-
- if scale_max:
- scale = vnc_api.ServiceScaleOutType(
- max_instances = int(scale_max),
- auto_scale = True)
- else:
- scale = vnc_api.ServiceScaleOutType()
- properties.set_scale_out(scale)
-
- obj.set_service_instance_properties(properties)
- try:
- template = self.vnc.service_template_read(
- fq_name = ['default-domain', template])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- obj.set_service_template(template)
- try:
- self.vnc.service_instance_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
- def delete(self, name):
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- try:
- self.vnc.service_instance_delete(id = obj.uuid)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigImage():
- def __init__(self, client):
- self.nova = client.nova
-
- def obj_list(self):
- list = self.nova.images.list()
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item.name == name):
- return item
-
- def obj_show(self, obj):
- print 'Image'
- print 'Name: %s' %(obj.name)
- print 'UUID: %s' %(obj.id)
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- print ' %s' %(item.name)
-
- def add(self, name):
- pass
- def delete(self, name):
- pass
-
-
-class ConfigFlavor():
- def __init__(self, client):
- self.nova = client.nova
-
- def obj_list(self):
- list = self.nova.flavors.list()
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item.name == name):
- return item
-
- def obj_show(self, obj):
- print 'Flavor'
- print 'Name: %s' %(obj.name)
- print 'UUID: %s' %(obj.id)
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- print ' %s' %(item.name)
-
- def add(self, name):
- pass
- def delete(self, name):
- pass
-
-
-class ConfigVirtualMachine():
- def __init__(self, client):
- self.vnc = client.vnc
- self.nova = client.nova
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.nova.servers.list()
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item.name == name):
- return item
-
- def obj_show(self, obj):
- print 'Virtual Machine'
- print 'Name: %s' %(obj.name)
- print 'UUID: %s' %(obj.id)
- print 'Status: %s' %(obj.status)
- print 'Addresses:'
- for item in obj.addresses.keys():
- print ' %s %s' %(obj.addresses[item][0]['addr'], item)
-
- def show(self, name):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- print ' %s' %(item.name)
-
- def add(self, name, image, flavor, network, node = None, user_data = None,
- wait = None):
- try:
- image_obj = self.nova.images.find(name = image)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- try:
- flavor_obj = self.nova.flavors.find(name = flavor)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
-
- networks = []
- net_list = self.vnc.virtual_networks_list()['virtual-networks']
- for item in network:
- for vn in net_list:
- if (vn['fq_name'][1] == self.tenant.name) and \
- (vn['fq_name'][2] == item):
- networks.append({'net-id': vn['uuid']})
- break
- else:
- print 'ERROR: Network %s is not found!' %(item)
- return
-
- #if node:
- # zone = self.nova.availability_zones.list()[1]
- # for item in zone.hosts.keys():
- # if (item == node):
- # break
- # else:
- # print 'ERROR: Node %s is not found!' %(name)
- # return
-
- try:
- vm = self.nova.servers.create(name = name, image = image_obj,
- flavor = flavor_obj, availability_zone = node,
- nics = networks, userdata = user_data)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
-
- if wait:
- timeout = 12
- while timeout:
- time.sleep(3)
- vm = self.nova.servers.get(vm.id)
- if vm.status != 'BUILD':
- print 'VM %s is %s' %(vm.name, vm.status)
- break
- timeout -= 1
-
- def delete(self, name):
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- self.nova.servers.delete(obj.id)
-
-
-class ConfigRouteTable():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.route_tables_list()['route-tables']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == name):
- return self.vnc.route_table_read(id = item['uuid'])
-
- def obj_show(self, obj):
- print 'Route Table'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- routes = obj.get_routes()
- if not routes:
- return
- for item in routes.get_route():
- print ' %s next-hop %s' %(item.get_prefix(), item.get_next_hop())
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s' %(item['fq_name'][2])
-
- def route_add(self, obj, route):
- routes = obj.get_routes()
- if not routes:
- routes = vnc_api.RouteTableType()
- obj.set_routes(routes)
- prefix = route.split(':')[0]
- nh = 'default-domain:%s:%s' %(self.tenant.name, route.split(':')[1])
- routes.add_route(vnc_api.RouteType(prefix = prefix, next_hop = nh))
-
- def route_del(self, obj, prefix):
- routes = obj.get_routes()
- if not routes:
- return
- for item in routes.get_route():
- if (item.get_prefix() == prefix):
- routes.delete_route(item)
-
- def add(self, name, route = None):
- create = False
- obj = self.obj_get(name)
- if not obj:
- obj = vnc_api.RouteTable(name = name, parent_obj = self.tenant)
- create = True
- if route:
- for item in route:
- self.route_add(obj, item)
- if create:
- try:
- self.vnc.route_table_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- else:
- self.vnc.route_table_update(obj)
-
- def delete(self, name, route = None):
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- if route:
- for item in route:
- self.route_del(obj, item)
- self.vnc.route_table_update(obj)
- else:
- try:
- self.vnc.route_table_delete(id = obj.uuid)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigInterfaceRouteTable():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.interface_route_tables_list()['interface-route-tables']
- return list
-
- def obj_get(self, name):
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name) and \
- (item['fq_name'][2] == name):
- return self.vnc.interface_route_table_read(id = item['uuid'])
-
- def obj_show(self, obj):
- print 'Interface Route Table'
- print 'Name: %s' %(obj.get_fq_name())
- print 'UUID: %s' %(obj.uuid)
- routes = obj.get_interface_route_table_routes()
- if not routes:
- return
- for item in routes.get_route():
- print ' %s' %(item.get_prefix())
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj)
- else:
- for item in self.obj_list():
- if (item['fq_name'][1] == self.tenant.name):
- print ' %s' %(item['fq_name'][2])
-
- def route_add(self, obj, prefix):
- routes = obj.get_interface_route_table_routes()
- if not routes:
- routes = vnc_api.RouteTableType()
- routes.add_route(vnc_api.RouteType(prefix = prefix))
- obj.set_interface_route_table_routes(routes)
-
- def route_del(self, obj, prefix):
- routes = obj.get_interface_route_table_routes()
- if not routes:
- return
- for item in routes.get_route():
- if (item.get_prefix() == prefix):
- routes.delete_route(item)
- obj.set_interface_route_table_routes(routes)
-
- def add(self, name, route = None):
- create = False
- obj = self.obj_get(name)
- if not obj:
- obj = vnc_api.InterfaceRouteTable(name = name,
- parent_obj = self.tenant)
- create = True
- if route:
- for item in route:
- self.route_add(obj, item)
- if create:
- try:
- self.vnc.interface_route_table_create(obj)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- else:
- self.vnc.interface_route_table_update(obj)
-
- def delete(self, name, route = None):
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- if route:
- for item in route:
- self.route_del(obj, item)
- self.vnc.interface_route_table_update(obj)
- else:
- try:
- self.vnc.interface_route_table_delete(id = obj.uuid)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
-
-
-class ConfigVmInterface():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
- self.nova = client.nova
-
- def obj_list(self, vm_id = None):
- list = []
- if vm_id:
- vm = self.vnc.virtual_machine_read(id = vm_id)
- if_ref_list = vm.get_virtual_machine_interface_back_refs()
- for if_ref in if_ref_list:
- if_obj = self.vnc.virtual_machine_interface_read(
- id = if_ref['uuid'])
- vn_name = if_obj.get_virtual_network_refs()[0]['to'][2]
- list.append({'name':vn_name, 'uuid':if_ref['uuid'],
- 'obj':if_obj})
- else:
- for vm_nova in self.nova.servers.list():
- try:
- vm = self.vnc.virtual_machine_read(id = vm_nova.id)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- continue
- if_ref_list = vm.get_virtual_machine_interface_back_refs()
- for if_ref in if_ref_list:
- if_obj = self.vnc.virtual_machine_interface_read(
- id = if_ref['uuid'])
- vn_name = if_obj.get_virtual_network_refs()[0]['to'][2]
- list.append({'name':'%s:%s' %(vm_nova.name, vn_name),
- 'uuid':if_ref['uuid'], 'obj':if_obj})
- return list
-
- def obj_get(self, name, vm_id = None):
- list = self.obj_list(vm_id)
- for item in list:
- if (item['name'] == name):
- return item['obj']
-
- def prop_mac_show(self, obj):
- print '[P] MAC addresses:'
- mac = obj.get_virtual_machine_interface_mac_addresses()
- if not mac:
- return
- for item in mac.get_mac_address():
- print ' %s' %(item)
-
- def prop_prop_show(self, obj):
- prop = obj.get_virtual_machine_interface_properties()
- if not prop:
- return
- print '[P] Service interface type: %s' \
- %(prop.get_service_interface_type())
- print '[P] Interface mirror: %s' %(prop.get_interface_mirror())
-
- def ref_sg_show(self, obj):
- print '[R] Security groups:'
- refs = obj.get_security_group_refs()
- if refs:
- for item in obj.get_security_group_refs():
- print ' %s' %(item['to'][2])
-
- def ref_net_show(self, obj):
- print '[R] Virtual networks:'
- for item in obj.get_virtual_network_refs():
- print ' %s' %(item['to'][2])
-
- def ref_irt_show(self, obj):
- print '[R] Interface route tables:'
- list = obj.get_interface_route_table_refs()
- if list:
- for item in list:
- print ' %s' %(item['to'][2])
-
- def back_ref_ip_show(self, obj):
- print '[BR] Instance IPs:'
- list = obj.get_instance_ip_back_refs()
- if not list:
- return
- for item in list:
- ip = self.vnc.instance_ip_read(id = item['uuid'])
- print ' %s' %(ip.get_instance_ip_address())
-
- def back_ref_fip_show(self, obj):
- print '[BR] Floating IPs:'
- list = obj.get_floating_ip_back_refs()
- if not list:
- return
- for item in list:
- ip = self.vnc.floating_ip_read(id = item['uuid'])
- print ' %s' %(ip.get_floating_ip_address())
-
- def obj_show(self, obj, name):
- print 'Virtual Machine Interface'
- print 'Name: %s' %(name)
- print 'UUID: %s' %(obj.uuid)
- self.prop_mac_show(obj)
- self.prop_prop_show(obj)
- self.ref_sg_show(obj)
- self.ref_net_show(obj)
- self.ref_irt_show(obj)
- self.back_ref_ip_show(obj)
- self.back_ref_fip_show(obj)
-
- def show(self, name = None):
- if name:
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- self.obj_show(obj, name)
- else:
- for item in self.obj_list():
- print ' %s' %(item['name'])
-
- def sg_add(self, obj, sg):
- try:
- sg_obj = self.vnc.security_group_read(
- fq_name = ['default-domain', self.tenant.name, sg])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.add_security_group(sg_obj)
-
- def addr_add(self, obj, addr):
- id = str(uuid.uuid4())
- ip_obj = vnc_api.InstanceIp(name = id, instance_ip_address = addr)
- ip_obj.uuid = id
- ip_obj.add_virtual_machine_interface(obj)
- vn_id = obj.get_virtual_network_refs()[0]['uuid']
- vn_obj = self.vnc.virtual_network_read(id = vn_id)
- ip_obj.add_virtual_network(vn_obj)
- self.vnc.instance_ip_create(ip_obj)
-
- def irt_add(self, obj, irt):
- try:
- table_obj = self.vnc.interface_route_table_read(
- fq_name = ['default-domain', self.tenant.name, irt])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.add_interface_route_table(table_obj)
-
- def fip_add(self, obj, fip_pool, fip):
- pool_name = fip_pool.split(':')
- pool_name.insert(0, 'default-domain')
- try:
- pool_obj = self.vnc.floating_ip_pool_read(fq_name = pool_name)
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- id = str(uuid.uuid4())
- fip_obj = vnc_api.FloatingIp(name = id, parent_obj = pool_obj)
- fip_obj.uuid = id
- if (fip != 'any'):
- fip_obj.set_floating_ip_address(fip)
- fip_obj.add_project(self.tenant)
- fip_obj.add_virtual_machine_interface(obj)
- self.vnc.floating_ip_create(fip_obj)
- self.tenant.add_floating_ip_pool(pool_obj)
- self.vnc.project_update(self.tenant)
-
- def add(self, name, sg = None, irt = None, addr = None,
- fip_pool = None, fip = None):
- update = False
- obj = self.obj_get(name)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- if sg:
- self.sg_add(obj, sg)
- update = True
- if irt:
- self.irt_add(obj, irt)
- update = True
- if addr:
- self.addr_add(obj, addr)
- update = True
- if fip and fip_pool:
- self.fip_add(obj, fip_pool, fip)
- update = True
- if update:
- self.vnc.virtual_machine_interface_update(obj)
-
- def sg_del(self, obj, sg):
- try:
- sg_obj = self.vnc.security_group_read(
- fq_name = ['default-domain', self.tenant.name, sg])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.del_security_group(sg_obj)
-
- def irt_del(self, obj, irt):
- try:
- table_obj = self.vnc.interface_route_table_read(
- fq_name = ['default-domain', self.tenant.name, irt])
- except Exception as e:
- print 'ERROR: %s' %(str(e))
- return
- obj.del_interface_route_table(table_obj)
-
- def addr_del(self, obj, addr):
- ip_list = obj.get_instance_ip_back_refs()
- for ip in ip_list:
- ip_obj = self.vnc.instance_ip_read(id = ip['uuid'])
- if (ip_obj.get_instance_ip_address() == addr):
- self.vnc.instance_ip_delete(id = ip_obj.uuid)
- break
- else:
- print 'ERROR: IP address %s is not found!' %(addr)
-
- def fip_del(self, obj):
- list = obj.get_floating_ip_back_refs()
- if not list:
- return
- for item in list:
- ip = self.vnc.floating_ip_delete(id = item['uuid'])
-
- def delete(self, name, sg = None, irt = None, addr = None,
- fip = None, vm_id = None):
- update = False
- obj = self.obj_get(name, vm_id)
- if not obj:
- print 'ERROR: Object %s is not found!' %(name)
- return
- if sg:
- self.sg_del(obj, sg)
- update = True
- if irt:
- self.irt_del(obj, irt)
- update = True
- if addr:
- self.addr_del(obj, addr)
- update = True
- if fip:
- self.fip_del(obj)
- update = True
- if update:
- self.vnc.virtual_machine_interface_update(obj)
-
-
-class ConfigGlobalVrouter():
- def __init__(self, client):
- self.vnc = client.vnc
- self.tenant = client.tenant
-
- def obj_list(self):
- list = self.vnc.interface_route_tables_list()['interface-route-tables']
- return list
-
- def obj_get(self, name):
- obj = self.vnc.global_vrouter_config_read(
- fq_name = ['default-global-system-config',
- 'default-global-vrouter-config'])
- return obj
-
- def obj_show(self, obj):
- pass
-
- def show(self, name = None):
- obj = self.obj_get('dummy')
- print 'Link Local Service'
- for item in obj.get_linklocal_services().get_linklocal_service_entry():
- print ' %s %s:%s %s:%s' %(item.get_linklocal_service_name(),
- item.get_linklocal_service_ip(),
- item.get_linklocal_service_port(),
- item.get_ip_fabric_service_ip()[0],
- item.get_ip_fabric_service_port())
-
- def add(self, name, link_local_addr, fabric_addr):
- obj = self.obj_get('dummy')
- list = obj.get_linklocal_services().get_linklocal_service_entry()
- list.append(vnc_api.LinklocalServiceEntryType(
- linklocal_service_name = name,
- linklocal_service_ip = link_local_addr.split(':')[0],
- linklocal_service_port = int(link_local_addr.split(':')[1]),
- ip_fabric_service_ip = [fabric_addr.split(':')[0]],
- ip_fabric_service_port = int(fabric_addr.split(':')[1])))
- self.vnc.global_vrouter_config_update(obj)
-
- def delete(self, name):
- obj = self.obj_get('dummy')
- list = obj.get_linklocal_services().get_linklocal_service_entry()
- for item in list:
- if (item.get_linklocal_service_name() == name):
- list.remove(item)
- break
- self.vnc.global_vrouter_config_update(obj)
-
-class ConfigClient():
- def __init__(self, username, password, tenant, region, api_server):
- self.vnc = vnc_api.VncApi(username = username, password = password,
- tenant_name = tenant, api_server_host = api_server)
- if config_nova:
- self.nova = novaclient.v1_1.client.Client(username = username,
- api_key = password, project_id = tenant,
- region_name = region,
- auth_url = 'http://%s:35357/v2.0' %(api_server))
- else:
- self.nova = None
- self.tenant = self.vnc.project_read(
- fq_name = ['default-domain', tenant])
-
diff --git a/Testcases/config_obj.pyc b/Testcases/config_obj.pyc
deleted file mode 100644
index 3b40b9b..0000000
--- a/Testcases/config_obj.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/config_shell.py b/Testcases/config_shell.py
deleted file mode 100644
index 2fe5ad1..0000000
--- a/Testcases/config_shell.py
+++ /dev/null
@@ -1,379 +0,0 @@
-
-from config_obj import *
-import argparse
-
-class ConfigShell():
-
- def __init__(self):
- self.parser_init()
-
- def env(self, *args, **kwargs):
- for arg in args:
- value = os.environ.get(arg, None)
- if value:
- return value
- return kwargs.get('default', '')
-
- def do_help(self, args):
- if args.obj_parser:
- args.obj_parser.print_help()
- else:
- self.parser.print_help()
-
- def parser_init(self):
- parser = argparse.ArgumentParser()
- parser.add_argument('--username', help = 'User name')
- parser.add_argument('--password', help = 'Password')
- parser.add_argument('--tenant', help = 'Tenant name')
- parser.add_argument('--region', help = 'Region name')
- parser.add_argument('--api-server', help = 'API server address')
-
- parser.add_argument('cmd', choices = ['add', 'show', 'delete', 'help'],
- metavar = '<command>', help = '[ add | show | delete | help ]')
-
- subparsers = parser.add_subparsers(metavar = '<object>')
- self.sub_cmd_dict = {}
-
- sub_parser = subparsers.add_parser('vdns', help = 'Virtual DNS')
- sub_parser.set_defaults(obj_class = ConfigVirtualDns,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of virtual DNS')
- sub_parser.add_argument('--domain-name', metavar = '<name>',
- help = 'The name of DNS domain')
- sub_parser.add_argument('--record-order',
- choices = ['fixed', 'random', 'round-robin'],
- default = 'random', metavar = '<order>',
- help = 'The order of DNS records ' \
- '[ random | fixed | round-robin ]')
- sub_parser.add_argument('--next-dns', metavar = '<name>',
- help = 'The name of next virtual DNS service or ' \
- 'the IP address of DNS server reachable by fabric.')
-
- sub_parser = subparsers.add_parser('ipam', help = 'Network IPAM')
- sub_parser.set_defaults(obj_class = ConfigIpam,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of IPAM')
- sub_parser.add_argument('--dns-type',
- choices = ['none', 'default', 'tenant', 'virtual'],
- metavar = '<type>',
- help = 'The type of DNS service ' \
- '[ none | default | virtual | tenant ]')
- sub_parser.add_argument('--virtual-dns', metavar = '<name>',
- help = 'The name of virtual DNS service')
- sub_parser.add_argument('--tenant-dns', metavar = '<address>',
- action = 'append',
- help = 'The address of tenant DNS')
- sub_parser.add_argument('--domain-name', metavar = '<name>',
- help = 'The name of DNS domain')
- sub_parser.add_argument('--ntp-server', metavar = '<address>',
- help = 'The address of NTP server')
-
- sub_parser = subparsers.add_parser('policy', help = 'Network Policy')
- sub_parser.set_defaults(obj_class = ConfigPolicy,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of policy')
- sub_parser.add_argument('--rule', action = 'append',
- metavar = '<arguments>',
- help = 'Policy rule ' \
- 'direction=[ "<>" | ">" ],' \
- 'protocol=[ any | tcp | udp | icmp ],' \
- 'src-net=[ <name> | any ],' \
- 'dst-net=[ <name> | any ],' \
- 'src-port=[ <start>:<end> | any ],' \
- 'dst-port=[ <start>:<end> | any ],' \
- 'action=[ pass | deny | drop | reject | alert | ' \
- 'log | service ],' \
- 'service=<name>,' \
- 'index=<index>')
-
- sub_parser = subparsers.add_parser('security-group',
- help = 'Security Group')
- sub_parser.set_defaults(obj_class = ConfigSecurityGroup,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of security group')
- sub_parser.add_argument('--rule', metavar = '<index>',
- help = 'Rule index')
- sub_parser.add_argument('--direction',
- choices = ['ingress', 'egress'],
- metavar = '<direction>',
- help = 'Direction [ ingress | egress ]')
- sub_parser.add_argument('--protocol',
- choices = ['any', 'tcp', 'udp', 'icmp'],
- metavar = '<protocol>',
- help = 'Protocol [ any | tcp | udp | icmp ]')
- sub_parser.add_argument('--address', action = 'append',
- metavar = '<prefix>/<length>', help = 'Remote IP address')
- sub_parser.add_argument('--port', action = 'append', type = str,
- metavar = '<start>:<end>', help = 'The range of remote port')
-
- sub_parser = subparsers.add_parser('network',
- help = 'Virtual Network')
- sub_parser.set_defaults(obj_class = ConfigNetwork,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of virtual network')
- sub_parser.add_argument('--ipam', metavar = '<name>',
- help = 'The name of IPAM')
- sub_parser.add_argument('--subnet', metavar = '<prefix>/<length>',
- help = 'Subnet prefix and length')
- sub_parser.add_argument('--gateway', metavar = '<address>',
- help = 'The gateway address of subnet')
- sub_parser.add_argument('--policy', metavar = '<name>',
- help = 'The name of network policy')
- sub_parser.add_argument('--route-target', metavar = '<AS>:<RT>',
- help = 'Route target')
- sub_parser.add_argument('--route-table', metavar = '<name>',
- help = 'The name of route table')
- sub_parser.add_argument('--l2', action = 'store_true',
- help = 'Layer 2 network, layer 2&3 by default')
- sub_parser.add_argument('--shared', action = 'store_true',
- help = 'Enable sharing with other tenants')
- sub_parser.add_argument('--external', action = 'store_true',
- help = 'Enable external access')
-
- sub_parser = subparsers.add_parser('floating-ip-pool',
- help = 'Floating IP Pool')
- sub_parser.set_defaults(obj_class = ConfigFloatingIpPool,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of floating IP pool')
- sub_parser.add_argument('--network', metavar = '<name>',
- help = 'The name of virtual network holding floating IP pool')
- #sub_parser.add_argument('--floating-ip', action = 'store_true',
- # help = 'Floating IP')
-
- sub_parser = subparsers.add_parser('vm',
- help = 'Virtual Machine')
- sub_parser.set_defaults(obj_class = ConfigVirtualMachine,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of virtual machine')
- sub_parser.add_argument('--image', metavar = '<name>',
- help = 'The name of image')
- sub_parser.add_argument('--flavor', metavar = '<name>',
- help = 'The name of flavor')
- sub_parser.add_argument('--network', action = 'append',
- metavar = '<name>',
- help = 'The name of network')
- sub_parser.add_argument('--user-data', metavar = '<name>',
- help = 'Full file name containing user data')
- sub_parser.add_argument('--node', metavar = '<name>',
- help = 'The name of compute node')
- sub_parser.add_argument('--wait', action = 'store_true',
- help = 'Wait till VM is active')
-
- sub_parser = subparsers.add_parser('interface-route-table',
- help = 'Interface Route Table')
- sub_parser.set_defaults(obj_class = ConfigInterfaceRouteTable,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of interface route table')
- sub_parser.add_argument('--route', action = 'append',
- metavar = '<prefix>/<length>', help = 'Route')
-
- sub_parser = subparsers.add_parser('route-table',
- help = 'Network Route Table')
- sub_parser.set_defaults(obj_class = ConfigRouteTable,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of route table')
- sub_parser.add_argument('--route', action = 'append',
- metavar = '<prefix>/<length>:<next-hop>',
- help = 'The route and next-hop')
-
- sub_parser = subparsers.add_parser('vm-interface',
- help = 'Virtual Machine Interface')
- sub_parser.set_defaults(obj_class = ConfigVmInterface,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<VM>:<network>',
- help = 'The name of virtual machine interface')
- sub_parser.add_argument('--interface-route-table', metavar = '<name>',
- help = 'The name of interface route table')
- sub_parser.add_argument('--security-group', metavar = '<name>',
- help = 'The name of security group')
- sub_parser.add_argument('--address',
- metavar = '<address>',
- help = 'IP address')
- sub_parser.add_argument('--floating-ip',
- metavar = '<address>',
- help = 'Floating IP address [ any | <address> ]')
- sub_parser.add_argument('--floating-ip-pool',
- metavar = '<pool>',
- help = 'The floating IP pool to allocate a floating IP from ' \
- '<tenant>:<network>:<floating IP pool>')
-
- sub_parser = subparsers.add_parser('image',
- help = 'Virtual Machine Image')
- self.sub_cmd_dict['image'] = sub_parser
- sub_parser.set_defaults(obj_class = ConfigImage)
- sub_parser.add_argument('name', nargs = '?', default = None)
-
- sub_parser = subparsers.add_parser('flavor',
- help = 'Virtual Machine Flavor')
- self.sub_cmd_dict['flavor'] = sub_parser
- sub_parser.set_defaults(obj_class = ConfigFlavor)
- sub_parser.add_argument('name', nargs = '?', default = None)
-
- sub_parser = subparsers.add_parser('service-template',
- help = 'Service Template')
- sub_parser.set_defaults(obj_class = ConfigServiceTemplate,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of service template')
- sub_parser.add_argument('--mode',
- choices = ['transparent', 'in-network', 'in-network-nat'],
- metavar = '<mode>',
- help = 'Service mode ' \
- '[ transparent | in-network | in-network-nat ]')
- sub_parser.add_argument('--type',
- choices = ['firewall', 'analyzer'],
- metavar = '<type>',
- help = 'Service type [ firewall | analyzer ]')
- sub_parser.add_argument('--image', metavar = '<name>',
- help = 'The name of image')
- sub_parser.add_argument('--flavor', metavar = '<name>',
- help = 'The name of flavor')
- sub_parser.add_argument('--scale', action = 'store_true',
- help = 'Enable service scaling')
- sub_parser.add_argument('--interface',
- choices = ['management', 'left', 'right', 'other'],
- metavar = '<type>',
- action = 'append',
- help = 'Service interface ' \
- '[ management | left | right | other ]')
-
- sub_parser = subparsers.add_parser('service-instance',
- help = 'Service Instance')
- sub_parser.set_defaults(obj_class = ConfigServiceInstance,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of service instance')
- sub_parser.add_argument('--template',
- metavar = '<template>',
- help = 'Service template')
- sub_parser.add_argument('--network', action = 'append',
- metavar = '<arguments>',
- help = 'network=[ <name> | auto ],tenant=<name>,' \
- 'route=<prefix>/<length> ' \
- 'The network order must be the same as interface ' \
- 'order defined in service template.')
- sub_parser.add_argument('--scale-max',
- metavar = '<number>',
- help = 'The maximum number of instances')
- sub_parser.add_argument('--auto-policy', action = 'store_true',
- help = 'Enable automatic policy')
-
- sub_parser = subparsers.add_parser('link-local',
- help = 'Link Local Service')
- sub_parser.set_defaults(obj_class = ConfigGlobalVrouter,
- obj_parser = sub_parser)
- sub_parser.add_argument('name', nargs = '?', default = None,
- metavar = '<name>', help = 'The name of link local service')
- sub_parser.add_argument('--link-local-address',
- metavar = '<address>',
- help = 'Link Local service address and port ' \
- '<link local address>:<link local port>')
- sub_parser.add_argument('--fabric-address',
- metavar = '<address>',
- help = 'Fabric address and port ' \
- '<fabric address>:<fabric port>')
- self.parser = parser
-
- def parse(self, argv = None):
- args = self.parser.parse_args(args = argv)
- return args
-
- def run(self, args, client):
- obj = args.obj_class(client = client)
- if args.cmd == 'help':
- self.do_help(args)
- elif args.cmd == 'show':
- obj.show(args.name)
- elif args.cmd == 'add':
- if (args.obj_class == ConfigVirtualDns):
- obj.add(args.name, args.record_order, args.next_dns)
- elif (args.obj_class == ConfigIpam):
- obj.add(args.name, args.dns_type, args.virtual_dns,
- args.tenant_dns, args.domain_name, args.ntp_server)
- elif (args.obj_class == ConfigPolicy):
- obj.add(args.name, args.rule)
- elif (args.obj_class == ConfigSecurityGroup):
- obj.add(args.name, args.protocol, args.address, args.port,
- args.direction)
- elif (args.obj_class == ConfigNetwork):
- obj.add(args.name, args.ipam, args.subnet, args.policy,
- args.route_target, args.route_table, args.shared,
- args.external, args.l2)
- elif (args.obj_class == ConfigFloatingIpPool):
- obj.add(args.name, args.network)
- elif (args.obj_class == ConfigServiceTemplate):
- obj.add(args.name, args.mode, args.type, args.image,
- args.flavor, args.interface)
- elif (args.obj_class == ConfigServiceInstance):
- obj.add(args.name, args.template, args.network,
- args.auto_policy, args.scale_max)
- elif (args.obj_class == ConfigVirtualMachine):
- obj.add(args.name, args.image, args.flavor, args.network,
- args.node, args.user_data, args.wait)
- elif (args.obj_class == ConfigRouteTable):
- obj.add(args.name, args.route)
- elif (args.obj_class == ConfigInterfaceRouteTable):
- obj.add(args.name, args.route)
- elif (args.obj_class == ConfigVmInterface):
- obj.add(args.name, args.security_group,
- args.interface_route_table, args.address,
- args.floating_ip_pool, args.floating_ip)
- elif (args.obj_class == ConfigGlobalVrouter):
- obj.add(args.name, args.link_local_address,
- args.fabric_address)
- elif args.cmd == 'delete':
- if (args.obj_class == ConfigVirtualDns):
- obj.delete(args.name)
- elif (args.obj_class == ConfigIpam):
- obj.delete(args.name, args.domain_name)
- elif (args.obj_class == ConfigPolicy):
- obj.delete(args.name, args.rule)
- elif (args.obj_class == ConfigSecurityGroup):
- obj.delete(args.name, args.rule)
- elif (args.obj_class == ConfigNetwork):
- obj.delete(args.name, args.ipam, args.policy,
- args.route_target)
- elif (args.obj_class == ConfigFloatingIpPool):
- obj.delete(args.name, args.network)
- elif (args.obj_class == ConfigServiceTemplate):
- obj.delete(args.name)
- elif (args.obj_class == ConfigServiceInstance):
- obj.delete(args.name)
- elif (args.obj_class == ConfigVirtualMachine):
- obj.delete(args.name)
- elif (args.obj_class == ConfigRouteTable):
- obj.delete(args.name, args.route)
- elif (args.obj_class == ConfigInterfaceRouteTable):
- obj.delete(args.name, args.route)
- elif (args.obj_class == ConfigVmInterface):
- obj.delete(args.name, args.security_group,
- args.interface_route_table, args.address,
- args.floating_ip)
- elif (args.obj_class == ConfigGlobalVrouter):
- obj.delete(args.name)
- else:
- print 'Unknown action %s' %(args.cmd)
- return
-
- def main(self):
- args = self.parse()
- #print args
- #return
- client = ConfigClient(args.username, args.password, args.tenant,
- args.region, args.api_server)
- self.run(args, client)
-
-
-if __name__ == '__main__':
- ConfigShell().main()
-
diff --git a/Testcases/config_shell.pyc b/Testcases/config_shell.pyc
deleted file mode 100644
index 0c02e5d..0000000
--- a/Testcases/config_shell.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/configuration.md b/Testcases/configuration.md
deleted file mode 100644
index 7ca3af2..0000000
--- a/Testcases/configuration.md
+++ /dev/null
@@ -1,666 +0,0 @@
-
-
-
-
-<!DOCTYPE html>
-<html lang="en" class="">
- <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#">
- <meta charset='utf-8'>
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta http-equiv="Content-Language" content="en">
- <meta name="viewport" content="width=1020">
-
-
- <title>orch/configuration.md at master · tonyliu0592/orch · GitHub</title>
- <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
- <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
- <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-114.png">
- <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114.png">
- <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-144.png">
- <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144.png">
- <meta property="fb:app_id" content="1401488693436528">
-
- <meta content="@github" name="twitter:site" /><meta content="summary" name="twitter:card" /><meta content="tonyliu0592/orch" name="twitter:title" /><meta content="Contribute to orch development by creating an account on GitHub." name="twitter:description" /><meta content="https://avatars2.githubusercontent.com/u/5355193?v=3&amp;s=400" name="twitter:image:src" />
- <meta content="GitHub" property="og:site_name" /><meta content="object" property="og:type" /><meta content="https://avatars2.githubusercontent.com/u/5355193?v=3&amp;s=400" property="og:image" /><meta content="tonyliu0592/orch" property="og:title" /><meta content="https://github.com/tonyliu0592/orch" property="og:url" /><meta content="Contribute to orch development by creating an account on GitHub." property="og:description" />
- <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
- <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
- <link rel="assets" href="https://assets-cdn.github.com/">
-
- <meta name="pjax-timeout" content="1000">
-
-
- <meta name="msapplication-TileImage" content="/windows-tile.png">
- <meta name="msapplication-TileColor" content="#ffffff">
- <meta name="selected-link" value="repo_source" data-pjax-transient>
-
- <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU">
- <meta name="google-analytics" content="UA-3769691-2">
-
-<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="4281F10B:71AA:2871CE6:56A1141C" name="octolytics-dimension-request_id" />
-<meta content="/&lt;user-name&gt;/&lt;repo-name&gt;/blob/show" data-pjax-transient="true" name="analytics-location" />
-<meta content="Rails, view, blob#show" data-pjax-transient="true" name="analytics-event" />
-
-
- <meta class="js-ga-set" name="dimension1" content="Logged Out">
-
-
-
- <meta name="hostname" content="github.com">
- <meta name="user-login" content="">
-
- <meta name="expected-hostname" content="github.com">
-
- <link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#4078c0">
- <link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
-
- <meta content="57675af6296bdef5a5d3e30ee127f2b790b35ea2" name="form-nonce" />
-
- <link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-e64d783fc73cc815bb639b1ee740d83c08b1a72e2955dbd871b5971946f6f73d.css" media="all" rel="stylesheet" />
- <link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github2-1c37ca748821e6e6c34a8627476defabae0bedd9629ef3720c56ca5cc2fa93bb.css" media="all" rel="stylesheet" />
-
-
-
-
- <meta http-equiv="x-pjax-version" content="415d0d3a23070d855ffb28c07c6e43c4">
-
-
- <meta name="description" content="Contribute to orch development by creating an account on GitHub.">
- <meta name="go-import" content="github.com/tonyliu0592/orch git https://github.com/tonyliu0592/orch.git">
-
- <meta content="5355193" name="octolytics-dimension-user_id" /><meta content="tonyliu0592" name="octolytics-dimension-user_login" /><meta content="21293312" name="octolytics-dimension-repository_id" /><meta content="tonyliu0592/orch" name="octolytics-dimension-repository_nwo" /><meta content="true" name="octolytics-dimension-repository_public" /><meta content="false" name="octolytics-dimension-repository_is_fork" /><meta content="21293312" name="octolytics-dimension-repository_network_root_id" /><meta content="tonyliu0592/orch" name="octolytics-dimension-repository_network_root_nwo" />
- <link href="https://github.com/tonyliu0592/orch/commits/master.atom" rel="alternate" title="Recent Commits to orch:master" type="application/atom+xml">
-
-
- <link rel="canonical" href="https://github.com/tonyliu0592/orch/blob/master/doc/configuration.md" data-pjax-transient>
- </head>
-
-
- <body class="logged_out env-production vis-public page-blob">
- <a href="#start-of-content" tabindex="1" class="accessibility-aid js-skip-to-content">Skip to content</a>
-
-
-
-
-
-
-
-
- <div class="header header-logged-out" role="banner">
- <div class="container clearfix">
-
- <a class="header-logo-wordmark" href="https://github.com/" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark">
- <span aria-hidden="true" class="mega-octicon octicon-logo-github"></span>
- </a>
-
- <div class="header-actions" role="navigation">
- <a class="btn btn-primary" href="/join" data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">Sign up</a>
- <a class="btn" href="/login?return_to=%2Ftonyliu0592%2Forch%2Fblob%2Fmaster%2Fdoc%2Fconfiguration.md" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">Sign in</a>
- </div>
-
- <div class="site-search repo-scope js-site-search" role="search">
- <!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="/tonyliu0592/orch/search" class="js-site-search-form" data-global-search-url="/search" data-repo-search-url="/tonyliu0592/orch/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
- <label class="js-chromeless-input-container form-control">
- <div class="scope-badge">This repository</div>
- <input type="text"
- class="js-site-search-focus js-site-search-field is-clearable chromeless-input"
- data-hotkey="s"
- name="q"
- placeholder="Search"
- aria-label="Search this repository"
- data-global-scope-placeholder="Search GitHub"
- data-repo-scope-placeholder="Search"
- tabindex="1"
- autocapitalize="off">
- </label>
-</form>
- </div>
-
- <ul class="header-nav left" role="navigation">
- <li class="header-nav-item">
- <a class="header-nav-link" href="/explore" data-ga-click="(Logged out) Header, go to explore, text:explore">Explore</a>
- </li>
- <li class="header-nav-item">
- <a class="header-nav-link" href="/features" data-ga-click="(Logged out) Header, go to features, text:features">Features</a>
- </li>
- <li class="header-nav-item">
- <a class="header-nav-link" href="https://enterprise.github.com/" data-ga-click="(Logged out) Header, go to enterprise, text:enterprise">Enterprise</a>
- </li>
- <li class="header-nav-item">
- <a class="header-nav-link" href="/pricing" data-ga-click="(Logged out) Header, go to pricing, text:pricing">Pricing</a>
- </li>
- </ul>
-
- </div>
-</div>
-
-
-
- <div id="start-of-content" class="accessibility-aid"></div>
-
- <div id="js-flash-container">
-</div>
-
-
- <div role="main" class="main-content">
- <div itemscope itemtype="http://schema.org/WebPage">
- <div id="js-repo-pjax-container" class="context-loader-container js-repo-nav-next" data-pjax-container>
-
-<div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav">
- <div class="container repohead-details-container">
-
-
-
-<ul class="pagehead-actions">
-
- <li>
- <a href="/login?return_to=%2Ftonyliu0592%2Forch"
- class="btn btn-sm btn-with-count tooltipped tooltipped-n"
- aria-label="You must be signed in to watch a repository" rel="nofollow">
- <span aria-hidden="true" class="octicon octicon-eye"></span>
- Watch
- </a>
- <a class="social-count" href="/tonyliu0592/orch/watchers">
- 6
- </a>
-
- </li>
-
- <li>
- <a href="/login?return_to=%2Ftonyliu0592%2Forch"
- class="btn btn-sm btn-with-count tooltipped tooltipped-n"
- aria-label="You must be signed in to star a repository" rel="nofollow">
- <span aria-hidden="true" class="octicon octicon-star"></span>
- Star
- </a>
-
- <a class="social-count js-social-count" href="/tonyliu0592/orch/stargazers">
- 9
- </a>
-
- </li>
-
- <li>
- <a href="/login?return_to=%2Ftonyliu0592%2Forch"
- class="btn btn-sm btn-with-count tooltipped tooltipped-n"
- aria-label="You must be signed in to fork a repository" rel="nofollow">
- <span aria-hidden="true" class="octicon octicon-repo-forked"></span>
- Fork
- </a>
-
- <a href="/tonyliu0592/orch/network" class="social-count">
- 5
- </a>
- </li>
-</ul>
-
- <h1 itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title public ">
- <span aria-hidden="true" class="octicon octicon-repo"></span>
- <span class="author"><a href="/tonyliu0592" class="url fn" itemprop="url" rel="author"><span itemprop="title">tonyliu0592</span></a></span><!--
---><span class="path-divider">/</span><!--
---><strong><a href="/tonyliu0592/orch" data-pjax="#js-repo-pjax-container">orch</a></strong>
-
- <span class="page-context-loader">
- <img alt="" height="16" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-32.gif" width="16" />
- </span>
-
-</h1>
-
- </div>
- <div class="container">
-
-<nav class="reponav js-repo-nav js-sidenav-container-pjax js-octicon-loaders"
- role="navigation"
- data-pjax="#js-repo-pjax-container">
-
- <a href="/tonyliu0592/orch" aria-label="Code" aria-selected="true" class="js-selected-navigation-item selected reponav-item" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /tonyliu0592/orch">
- <span aria-hidden="true" class="octicon octicon-code"></span>
- Code
-</a>
- <a href="/tonyliu0592/orch/issues" class="js-selected-navigation-item reponav-item" data-hotkey="g i" data-selected-links="repo_issues repo_labels repo_milestones /tonyliu0592/orch/issues">
- <span aria-hidden="true" class="octicon octicon-issue-opened"></span>
- Issues
- <span class="counter">1</span>
-</a>
- <a href="/tonyliu0592/orch/pulls" class="js-selected-navigation-item reponav-item" data-hotkey="g p" data-selected-links="repo_pulls /tonyliu0592/orch/pulls">
- <span aria-hidden="true" class="octicon octicon-git-pull-request"></span>
- Pull requests
- <span class="counter">0</span>
-</a>
- <a href="/tonyliu0592/orch/wiki" class="js-selected-navigation-item reponav-item" data-hotkey="g w" data-selected-links="repo_wiki /tonyliu0592/orch/wiki">
- <span aria-hidden="true" class="octicon octicon-book"></span>
- Wiki
-</a>
- <a href="/tonyliu0592/orch/pulse" class="js-selected-navigation-item reponav-item" data-selected-links="pulse /tonyliu0592/orch/pulse">
- <span aria-hidden="true" class="octicon octicon-pulse"></span>
- Pulse
-</a>
- <a href="/tonyliu0592/orch/graphs" class="js-selected-navigation-item reponav-item" data-selected-links="repo_graphs repo_contributors /tonyliu0592/orch/graphs">
- <span aria-hidden="true" class="octicon octicon-graph"></span>
- Graphs
-</a>
-
-</nav>
-
- </div>
-</div>
-
-<div class="container new-discussion-timeline experiment-repo-nav">
- <div class="repository-content">
-
-
-
-<a href="/tonyliu0592/orch/blob/6cfa26b93dfefdd661a64dd7e9dc295c652dfb61/doc/configuration.md" class="hidden js-permalink-shortcut" data-hotkey="y">Permalink</a>
-
-<!-- blob contrib key: blob_contributors:v21:85a62aa7de00e6c17c4fabaa95e47968 -->
-
-<div class="file-navigation js-zeroclipboard-container">
-
-<div class="select-menu js-menu-container js-select-menu left">
- <button class="btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w"
- title="master"
- type="button" aria-label="Switch branches or tags" tabindex="0" aria-haspopup="true">
- <i>Branch:</i>
- <span class="js-select-button css-truncate-target">master</span>
- </button>
-
- <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax aria-hidden="true">
-
- <div class="select-menu-modal">
- <div class="select-menu-header">
- <span aria-label="Close" class="octicon octicon-x js-menu-close" role="button"></span>
- <span class="select-menu-title">Switch branches/tags</span>
- </div>
-
- <div class="select-menu-filters">
- <div class="select-menu-text-filter">
- <input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">
- </div>
- <div class="select-menu-tabs">
- <ul>
- <li class="select-menu-tab">
- <a href="#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab" role="tab">Branches</a>
- </li>
- <li class="select-menu-tab">
- <a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a>
- </li>
- </ul>
- </div>
- </div>
-
- <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu">
-
- <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
-
-
- <a class="select-menu-item js-navigation-item js-navigation-open selected"
- href="/tonyliu0592/orch/blob/master/doc/configuration.md"
- data-name="master"
- data-skip-pjax="true"
- rel="nofollow">
- <span aria-hidden="true" class="octicon octicon-check select-menu-item-icon"></span>
- <span class="select-menu-item-text css-truncate-target" title="master">
- master
- </span>
- </a>
- </div>
-
- <div class="select-menu-no-results">Nothing to show</div>
- </div>
-
- <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
- <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
-
-
- </div>
-
- <div class="select-menu-no-results">Nothing to show</div>
- </div>
-
- </div>
- </div>
-</div>
-
- <div class="btn-group right">
- <a href="/tonyliu0592/orch/find/master"
- class="js-show-file-finder btn btn-sm"
- data-pjax
- data-hotkey="t">
- Find file
- </a>
- <button aria-label="Copy file path to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" type="button">Copy path</button>
- </div>
- <div class="breadcrumb js-zeroclipboard-target">
- <span class="repo-root js-repo-root"><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/tonyliu0592/orch" class="" data-branch="master" data-pjax="true" itemscope="url"><span itemprop="title">orch</span></a></span></span><span class="separator">/</span><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/tonyliu0592/orch/tree/master/doc" class="" data-branch="master" data-pjax="true" itemscope="url"><span itemprop="title">doc</span></a></span><span class="separator">/</span><strong class="final-path">configuration.md</strong>
- </div>
-</div>
-
-<include-fragment class="commit-tease" src="/tonyliu0592/orch/contributors/master/doc/configuration.md">
- <div>
- Fetching contributors&hellip;
- </div>
-
- <div class="commit-tease-contributors">
- <img alt="" class="loader-loading left" height="16" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-32-EAF2F5.gif" width="16" />
- <span class="loader-error">Cannot retrieve contributors at this time</span>
- </div>
-</include-fragment>
-<div class="file">
- <div class="file-header">
- <div class="file-actions">
-
- <div class="btn-group">
- <a href="/tonyliu0592/orch/raw/master/doc/configuration.md" class="btn btn-sm " id="raw-url">Raw</a>
- <a href="/tonyliu0592/orch/blame/master/doc/configuration.md" class="btn btn-sm js-update-url-with-hash">Blame</a>
- <a href="/tonyliu0592/orch/commits/master/doc/configuration.md" class="btn btn-sm " rel="nofollow">History</a>
- </div>
-
-
- <button type="button" class="btn-octicon disabled tooltipped tooltipped-nw"
- aria-label="You must be signed in to make or propose changes">
- <span aria-hidden="true" class="octicon octicon-pencil"></span>
- </button>
- <button type="button" class="btn-octicon btn-octicon-danger disabled tooltipped tooltipped-nw"
- aria-label="You must be signed in to make or propose changes">
- <span aria-hidden="true" class="octicon octicon-trashcan"></span>
- </button>
- </div>
-
- <div class="file-info">
- 201 lines (153 sloc)
- <span class="file-info-divider"></span>
- 5.46 KB
- </div>
-</div>
-
-
- <div id="readme" class="blob instapaper_body">
- <article class="markdown-body entry-content" itemprop="mainContentOfPage"><h1><a id="user-content-command-line-utility-to-configure-contrail" class="anchor" href="#command-line-utility-to-configure-contrail" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Command line utility to configure Contrail</h1>
-
-<h2><a id="user-content-files" class="anchor" href="#files" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Files</h2>
-
-<pre><code>config
-config_shell.py
-config_obj.py
-</code></pre>
-
-<h2><a id="user-content-syntax" class="anchor" href="#syntax" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Syntax</h2>
-
-<pre><code>config [access options] &lt;command&gt; &lt;object&gt; [name] [options]
-
- access options:
- Options to access API server of OpenStack and OpenContrail.
- --username &lt;user name&gt;
- --password &lt;user password&gt;
- --region &lt;region name&gt;
- --tenant &lt;tenant name&gt;
- --api-server &lt;API server IP address&gt;
-
- &lt;command&gt; &lt;object&gt; [name] [options]:
-
- add vdns &lt;name&gt;
- --domain-name &lt;name&gt;
- --record-order [ random | fixed | round-robin ]
- --next-dns &lt;name&gt;
-
- show vdns [name]
-
- delete vdns &lt;name&gt;
-
- add ipam &lt;name&gt;
- --dns-type [ none | default | virtual | tenant ]
- --virtual-dns &lt;virtual DNS&gt;
- --tenant-dns &lt;tenant DNS&gt;
- --domain-name &lt;domain name&gt;
- --ntp-server &lt;NTP server&gt;
-
- show ipam [name]
-
- delete ipam &lt;name&gt;
-
- add policy &lt;name&gt;
- --direction [ &lt;&gt; | &gt; ]
- --protocol [any | tcp | udp | icmp]
- --src-net &lt;source network&gt;
- --dst-net &lt;destination network&gt;
- --src-port &lt;start:end&gt;
- --dst-port &lt;start:end&gt;
- --action [ pass | deny | drop | reject | alert | log | service ]
- --service &lt;service&gt;
-
- show policy &lt;name&gt;
-
- delete policy &lt;name&gt;
- --rule &lt;rule index&gt;
-
- add security-group &lt;name&gt;
- --rule &lt;rule index&gt;
- --direction [ ingress | egress ]
- --protocol [any | tcp | udp | icmp]
- --address &lt;prefix/length&gt;
- --port &lt;start:end&gt;
-
- show security-group [name]
-
- delete security-group &lt;name&gt;
-
- add network &lt;name&gt;
- --ipam &lt;IPAM&gt;
- --subnet &lt;prefix/length&gt;
- --gateway &lt;gateway&gt;
- --policy &lt;policy&gt;
- --route-target &lt;route target&gt;
- --route-table &lt;route table&gt;
- --l2
-
- show network [name]
-
- delete network &lt;name&gt;
- --policy &lt;policy&gt;
- --route-target &lt;route target&gt;
- --route-table &lt;route table&gt;
-
- add floating-ip-pool &lt;network&gt;:&lt;pool&gt;
-
- show floating-ip-pool [&lt;network&gt;:&lt;pool&gt;]
-
- delete floating-ip-pool &lt;network&gt;:&lt;pool&gt;
-
- add vm &lt;name&gt;
- --image &lt;image&gt;
- --flavor &lt;flavor&gt;
- --network &lt;network&gt;
- --node &lt;node name&gt;
- --user-data &lt;file name&gt;
- --wait
-
- show vm [name]
-
- delete vm &lt;name&gt;
-
- add interface-route-table &lt;name&gt;
- --route &lt;prefix/length&gt;
-
- show interface-route-table [name]
-
- delete interface-route-table &lt;name&gt;
-
- add vm-interface &lt;VM&gt;:&lt;network&gt;
- --interface-route-table &lt;name&gt;
- --security-group &lt;name&gt;
- --floating-ip-pool &lt;tenant&gt;:&lt;network&gt;:&lt;pool&gt;
- --floating-ip any | &lt;IP&gt;
-
- show vm-interface &lt;VM&gt;:&lt;network&gt;
-
- delete vm-interface &lt;VM&gt;:&lt;network&gt;
- --interface-route-table &lt;name&gt;
- --security-group &lt;name&gt;
- --floating-ip
-
- add route-table &lt;name&gt;
- --route &lt;prefix/length:next-hop&gt;
-
- show route-table [name]
-
- delete route-table &lt;name&gt;
- --route &lt;prefix/length:next-hop&gt;
-
- add service-template &lt;name&gt;
- --mode [ transparent | in-network | in-network-nat ]
- --type [ firewall | analyzer ]
- --image &lt;name&gt;
- --flavor &lt;name&gt;
- --scale
- --interface-type [ management | left | right | other ]
-
- show service-template [name]
-
- delete service-template &lt;name&gt;
-
- add service-instance &lt;name&gt;
- --template &lt;name&gt;
- --management-network &lt;name&gt;
- --left-network &lt;name&gt;
- --left-route &lt;prefix/length&gt;
- --right-network &lt;name&gt;
- --right-route &lt;prefix/length&gt;
- --scale-max &lt;number&gt;
- --auto-policy
-
- show service-instance [name]
-
- delete service-instance &lt;name&gt;
-
- add link-local &lt;name&gt;
- --link-local-address &lt;link local address&gt;:&lt;link local port&gt;
- --fabric-address '&lt;fabric address&gt;:&lt;fabric port&gt;'
-
- show link-local [name]
-
- delete link-local &lt;name&gt;
-
- show image
-
- show flavor
-</code></pre>
-
-<h2><a id="user-content-examples" class="anchor" href="#examples" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Examples</h2>
-
-<h3><a id="user-content-allocate-floating-ip-to-vm-interface" class="anchor" href="#allocate-floating-ip-to-vm-interface" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Allocate floating IP to VM interface.</h3>
-
-<pre><code># config add ipam ipam-default
-# config add policy policy-default
-# config add network front-end --ipam ipam-default --subnet 192.168.1.0/24 --policy policy-default
-# config add network back-end --ipam ipam-default --subnet 192.168.1.0/24 --policy policy-default
-# config add vm server --image "CentOS 6.4 1-6" --flavor m1.small --network front-end
-# config add vm database --image "CentOS 6.4 1-6" --flavor m1.small --network back-end
-</code></pre>
-
-<h3><a id="user-content-allocate-floating-ip-to-vm-interface-1" class="anchor" href="#allocate-floating-ip-to-vm-interface-1" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Allocate floating IP to VM interface.</h3>
-
-<pre><code># config add network public --ipam ipam-default --sbunet 10.8.10.0/24 --route-target 64512:10000
-# config add floating-ip-pool public-pool --network public
-# config add vm-interface server:front-end --floating-ip --floating-ip-pool public-pool
-</code></pre>
-
-<h3><a id="user-content-create-layer-3-service-template-and-service-instance" class="anchor" href="#create-layer-3-service-template-and-service-instance" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Create layer-3 service template and service instance.</h3>
-
-<pre><code># config add service template vsrx-l3 --mode in-network --type firewall --image vsrx-12.1x47 --flavor m1.medium --interface-type management --interface-type left --interface-type right
-# config add service-instance vsrx-l3 --template vsrx-l2 --management-network management --left-network front-end --right-network backend
-# config add policy vsrx-l3 --src-net front-end --dst-net back-end --action service --service vsrx-l3
-# config add network front-end --policy vsrx-l3
-# config add network back-end --policy vsrx-l3
-</code></pre>
-
-<h3><a id="user-content-create-layer-2-service-template-and-service-instance" class="anchor" href="#create-layer-2-service-template-and-service-instance" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Create layer-2 service template and service instance.</h3>
-
-<pre><code># config add service template vsrx-l2 --mode transparent --type firewall --image vsrx-12.1x47 --flavor m1.medium --interface-type management --interface-type left --interface-type right
-# config add service-instance vsrx-l2 --template vsrx-l2 --management-network management
-</code></pre>
-</article>
- </div>
-
-</div>
-
-<a href="#jump-to-line" rel="facebox[.linejump]" data-hotkey="l" style="display:none">Jump to Line</a>
-<div id="jump-to-line" style="display:none">
- <!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="" class="js-jump-to-line-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /></div>
- <input class="linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line&hellip;" aria-label="Jump to line" autofocus>
- <button type="submit" class="btn">Go</button>
-</form></div>
-
- </div>
- <div class="modal-backdrop"></div>
-</div>
-
- </div>
- </div>
-
- </div>
-
- <div class="container">
- <div class="site-footer" role="contentinfo">
- <ul class="site-footer-links right">
- <li><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li>
- <li><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li>
- <li><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li>
- <li><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li>
- <li><a href="https://github.com/blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li>
- <li><a href="https://github.com/about" data-ga-click="Footer, go to about, text:about">About</a></li>
- <li><a href="https://github.com/pricing" data-ga-click="Footer, go to pricing, text:pricing">Pricing</a></li>
-
- </ul>
-
- <a href="https://github.com" aria-label="Homepage">
- <span aria-hidden="true" class="mega-octicon octicon-mark-github" title="GitHub "></span>
-</a>
- <ul class="site-footer-links">
- <li>&copy; 2016 <span title="0.04909s from github-fe122-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
- <li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
- <li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
- <li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
- <li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact</a></li>
- <li><a href="https://help.github.com" data-ga-click="Footer, go to help, text:help">Help</a></li>
- </ul>
- </div>
-</div>
-
-
-
-
-
-
-
- <div id="ajax-error-message" class="flash flash-error">
- <span aria-hidden="true" class="octicon octicon-alert"></span>
- <button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
- <span aria-hidden="true" class="octicon octicon-x"></span>
- </button>
- Something went wrong with that request. Please try again.
- </div>
-
-
- <script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/compat-a0cee5d8d4fb535c0f41971d037b32e852a56ddca5bf67bb2124e426a2d813a5.js"></script>
- <script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-9ee55ceaf87fc34dc86334249fef6cbece88e815478e0fbe81642d57ed0fff89.js"></script>
- <script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-dd514695678bb0ae0bcd4387cff3b88a0c2e8def9cb3cdf8b1a888fb19979467.js"></script>
-
-
-
- <div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner hidden">
- <span aria-hidden="true" class="octicon octicon-alert"></span>
- <span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
- <span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
- </div>
- <div class="facebox" id="facebox" style="display:none;">
- <div class="facebox-popup">
- <div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description">
- </div>
- <button type="button" class="facebox-close js-facebox-close" aria-label="Close modal">
- <span aria-hidden="true" class="octicon octicon-x"></span>
- </button>
- </div>
-</div>
-
- </body>
-</html>
-
diff --git a/Testcases/openstackrc b/Testcases/openstackrc
deleted file mode 100644
index 4253819..0000000
--- a/Testcases/openstackrc
+++ /dev/null
@@ -1,6 +0,0 @@
-export OS_PASSWORD=contrail123
-export OS_AUTH_URL=http://10.10.11.16:5000/v2.0/
-export OS_USERNAME=admin
-export OS_TENANT_NAME=user9
-export OS_NO_CACHE=1
-
diff --git a/Testcases/openstackrc.int b/Testcases/openstackrc.int
deleted file mode 100644
index 9037445..0000000
--- a/Testcases/openstackrc.int
+++ /dev/null
@@ -1,6 +0,0 @@
-export OS_PASSWORD=password
-export OS_AUTH_URL=http://172.16.50.143:5000/v2.0/
-export OS_USERNAME=admin
-export OS_TENANT_NAME=admin
-export OS_NO_CACHE=1
-
diff --git a/Testcases/vnc_api/__init__.py b/Testcases/vnc_api/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/Testcases/vnc_api/__init__.py
+++ /dev/null
diff --git a/Testcases/vnc_api/__init__.pyc b/Testcases/vnc_api/__init__.pyc
deleted file mode 100644
index 94501b0..0000000
--- a/Testcases/vnc_api/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/vnc_api/common/__init__.py b/Testcases/vnc_api/common/__init__.py
deleted file mode 100644
index feaf215..0000000
--- a/Testcases/vnc_api/common/__init__.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-
-import sys
-import re
-
-IP_FABRIC_VN_FQ_NAME = ['default-domain', 'default-project', 'ip-fabric']
-IP_FABRIC_RI_FQ_NAME = IP_FABRIC_VN_FQ_NAME + ['__default__']
-LINK_LOCAL_VN_FQ_NAME = ['default-domain', 'default-project', '__link_local__']
-LINK_LOCAL_RI_FQ_NAME = LINK_LOCAL_VN_FQ_NAME + ['__link_local__']
-SG_NO_RULE_NAME = "__no_rule__"
-SG_NO_RULE_FQ_NAME = ['default-domain', 'default-project', SG_NO_RULE_NAME]
-
-BGP_RTGT_MIN_ID = 8000000
-SGID_MIN_ALLOC = 8000000
-
-def obj_to_json(obj):
- return dict((k, v) for k, v in obj.__dict__.iteritems())
-#end obj_to_json
-
-def json_to_obj(obj):
- pass
-#end json_to_obj
-
-def ignore_exceptions(func):
- def wrapper(*args, **kwargs):
- try:
- return func(*args, **kwargs)
- except Exception as e:
- return None
- return wrapper
-# end ignore_exceptions
-
-_illegal_unichrs = [(0x00, 0x08), (0x0B, 0x0C), (0x0E, 0x1F),
- (0x7F, 0x84), (0x86, 0x9F),
- (0xFDD0, 0xFDDF), (0xFFFE, 0xFFFF)]
-if sys.maxunicode >= 0x10000: # not narrow build
- _illegal_unichrs.extend([(0x1FFFE, 0x1FFFF), (0x2FFFE, 0x2FFFF),
- (0x3FFFE, 0x3FFFF), (0x4FFFE, 0x4FFFF),
- (0x5FFFE, 0x5FFFF), (0x6FFFE, 0x6FFFF),
- (0x7FFFE, 0x7FFFF), (0x8FFFE, 0x8FFFF),
- (0x9FFFE, 0x9FFFF), (0xAFFFE, 0xAFFFF),
- (0xBFFFE, 0xBFFFF), (0xCFFFE, 0xCFFFF),
- (0xDFFFE, 0xDFFFF), (0xEFFFE, 0xEFFFF),
- (0xFFFFE, 0xFFFFF), (0x10FFFE, 0x10FFFF)])
-
-_illegal_ranges = ["%s-%s" % (unichr(low), unichr(high))
- for (low, high) in _illegal_unichrs]
-illegal_xml_chars_RE = re.compile(u'[%s]' % u''.join(_illegal_ranges))
diff --git a/Testcases/vnc_api/common/__init__.pyc b/Testcases/vnc_api/common/__init__.pyc
deleted file mode 100644
index a485c8c..0000000
--- a/Testcases/vnc_api/common/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/vnc_api/common/exceptions.py b/Testcases/vnc_api/common/exceptions.py
deleted file mode 100644
index d9723a4..0000000
--- a/Testcases/vnc_api/common/exceptions.py
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-# Base class of all exceptions in VNC
-
-
-class VncError(Exception):
- pass
-# end class VncError
-
-class ServiceUnavailableError(VncError):
- def __init__(self, code):
- self._reason_code = code
- # end __init__
-
- def __str__(self):
- return 'Service unavailable time out due to: %s' % (str(self._reason_code))
- # end __str__
-# end class ServiceUnavailableError
-
-class TimeOutError(VncError):
- def __init__(self, code):
- self._reason_code = code
- # end __init__
-
- def __str__(self):
- return 'Timed out due to: %s' % (str(self._reason_code))
- # end __str__
-# end class TimeOutError
-
-
-class BadRequest(Exception):
- def __init__(self, status_code, content):
- self.status_code = status_code
- self.content = content
- # end __init__
-
- def __str__(self):
- return 'HTTP Status: %s Content: %s' % (self.status_code, self.content)
- # end __str__
-# end class BadRequest
-
-
-class NoIdError(VncError):
-
- def __init__(self, unknown_id):
- self._unknown_id = unknown_id
- # end __init__
-
- def __str__(self):
- return 'Unknown id: %s' % (self._unknown_id)
- # end __str__
-# end class NoIdError
-
-
-class MaxRabbitPendingError(VncError):
-
- def __init__(self, npending):
- self._npending = npending
- # end __init__
-
- def __str__(self):
- return 'Too many pending updates to RabbitMQ: %s' % (self._npending)
- # end __str__
-# end class MaxRabbitPendingError
-
-class ResourceExistsError(VncError):
- def __init__(self, eexists_fq_name, eexists_id):
- self._eexists_fq_name = eexists_fq_name
- self._eexists_id = eexists_id
- # end __init__
-
- def __str__(self):
- return 'FQ Name: %s exists already with ID: %s' \
- % (self._eexists_fq_name, self._eexists_id)
- # end __str__
-# end class ResourceExistsError
-
-class ResourceTypeUnknownError(VncError):
- def __init__(self, obj_type):
- self._unknown_type = obj_type
- # end __init__
-
- def __str__(self):
- return 'Unknown object type: %s' %(self._unknown_type)
- # end __str__
-# end class ResourceTypeUnknownError
-
-class PermissionDenied(VncError):
- pass
-# end class PermissionDenied
-
-
-class RefsExistError(VncError):
- pass
-# end class RefsExistError
-
-
-class ResourceExhaustionError(VncError):
- pass
-# end class ResourceExhaustionError
-
-
-class NoUserAgentKey(VncError):
- pass
-# end class NoUserAgentKey
-
-
-class UnknownAuthMethod(VncError):
- pass
-# end class UnknownAuthMethod
-
-
-class HttpError(VncError):
-
- def __init__(self, status_code, content):
- self.status_code = status_code
- self.content = content
- # end __init__
-
- def __str__(self):
- return 'HTTP Status: %s Content: %s' % (self.status_code, self.content)
- # end __str__
-# end class HttpError
-
-
-class AmbiguousParentError(VncError):
- pass
-
-
-class InvalidSessionID(VncError):
- pass
-# end InvalidSessionID
diff --git a/Testcases/vnc_api/common/exceptions.pyc b/Testcases/vnc_api/common/exceptions.pyc
deleted file mode 100644
index 972c8fb..0000000
--- a/Testcases/vnc_api/common/exceptions.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/vnc_api/common/rest.py b/Testcases/vnc_api/common/rest.py
deleted file mode 100644
index 7287f8d..0000000
--- a/Testcases/vnc_api/common/rest.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-OP_POST = 1
-OP_GET = 2
-OP_PUT = 3
-OP_DELETE = 4
-
-
-def hdr_client_tenant():
- return 'X-Tenant-Name'
-# end hdr_tenant_client
-
-# TODO transform from client value
-
-
-def hdr_server_tenant():
- return 'HTTP_X_TENANT_NAME'
-# end hdr_tenant_server
-
-
-class LinkObject(object):
-
- def __init__(self, rel, base_url, uri, name):
- self.rel = rel
- self.base_url = base_url
- self.uri = uri
- self.name = name
- # end __init__
-
- def to_dict(self, with_url=None):
- if not with_url:
- url = self.base_url
- else:
- url = with_url
- return {'rel': self.rel,
- 'href': url + self.uri,
- 'name': self.name}
- # end to_dict
-
-# end class LinkObject
diff --git a/Testcases/vnc_api/common/rest.pyc b/Testcases/vnc_api/common/rest.pyc
deleted file mode 100644
index ed5532d..0000000
--- a/Testcases/vnc_api/common/rest.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/vnc_api/gen/__init__.py b/Testcases/vnc_api/gen/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/Testcases/vnc_api/gen/__init__.py
+++ /dev/null
diff --git a/Testcases/vnc_api/gen/__init__.pyc b/Testcases/vnc_api/gen/__init__.pyc
deleted file mode 100644
index 48fbda3..0000000
--- a/Testcases/vnc_api/gen/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/vnc_api/gen/cfixture.py b/Testcases/vnc_api/gen/cfixture.py
deleted file mode 100644
index 6e31f2a..0000000
--- a/Testcases/vnc_api/gen/cfixture.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
-#
-import fixtures
-
-
-class ConrtailLink (object):
-
- def __init__(self, name, _from, _to, _type, fixtr):
- self._type = _type
- self._fixture = fixtr
- self._from = _from
- self._to = _to
- self._name = name
-
- def fixture(self):
- return self._fixture
-
-
-class ContrailFixture (fixtures.Fixture):
-
- def __init__(self):
- self._pdetails = {}
-
- def _get_link_dict(self):
- if '__links__' not in self._pdetails:
- self._pdetails['__links__'] = {}
- return self._pdetails['__links__']
-
- def _update_link_dict(self, lname):
- self._pdetails['__links__'][lname] = []
-
- def links(self):
- return self._get_link_dict().keys()
-
- def get_links(self, lname):
- return self._get_link_dict().get(lname, [])
-
- def add_link(self, lname, link):
- if not self.get_links(lname):
- self._update_link_dict(lname)
-
- return self.get_links(lname).append(link)
-
- def get_link_fixtures(self, lname):
- return map(lambda l: l.fixture(), self.get_links(lname))
diff --git a/Testcases/vnc_api/gen/cfixture.pyc b/Testcases/vnc_api/gen/cfixture.pyc
deleted file mode 100644
index a6310df..0000000
--- a/Testcases/vnc_api/gen/cfixture.pyc
+++ /dev/null
Binary files differ
diff --git a/Testcases/vnc_api/gen/connection_drv_gen.py b/Testcases/vnc_api/gen/connection_drv_gen.py
deleted file mode 100644
index aff1f49..0000000
--- a/Testcases/vnc_api/gen/connection_drv_gen.py
+++ /dev/null
@@ -1,2529 +0,0 @@
-
-# AUTO-GENERATED file from IFMapApiGenerator. Do Not Edit!
-
-import abc
-
-class ConnectionDriverBase(object):
- """
- This class provides type specific methods to create,
- read, update, delete and list objects from the server
- """
-
- __metaclass__ = abc.ABCMeta
-
- @abc.abstractmethod
- def __init__(self):
- pass
- #end __init__
- def domain_create(self, obj):
- """Create new domain.
-
- :param obj: :class:`.Domain` object
-
- """
- raise NotImplementedError, 'domain_create is %s\'s responsibility' % (str(type (self)))
- #end domain_create
-
- def domain_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return domain information.
-
- :param fq_name: Fully qualified name of domain
- :param fq_name_str: Fully qualified name string of domain
- :param id: UUID of domain
- :param ifmap_id: IFMAP id of domain
- :returns: :class:`.Domain` object
-
- """
- raise NotImplementedError, 'domain_read is %s\'s responsibility' % (str(type (self)))
- #end domain_read
-
- def domain_update(self, obj):
- """Update domain.
-
- :param obj: :class:`.Domain` object
-
- """
- raise NotImplementedError, 'domain_update is %s\'s responsibility' % (str(type (self)))
- #end domain_update
-
- def domains_list(self, parent_id = None, parent_fq_name = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all domains.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.Domain` objects
-
- """
- raise NotImplementedError, 'domains_list is %s\'s responsibility' % (str(type (self)))
- #end domains_list
-
- def domain_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete domain from the system.
-
- :param fq_name: Fully qualified name of domain
- :param id: UUID of domain
- :param ifmap_id: IFMAP id of domain
-
- """
- raise NotImplementedError, 'domain_delete is %s\'s responsibility' % (str(type (self)))
- #end domain_delete
-
- def get_default_domain_id(self):
- """Return UUID of default domain."""
- raise NotImplementedError, 'get_default_domain_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_domain_delete
-
- def global_vrouter_config_create(self, obj):
- """Create new global-vrouter-config.
-
- :param obj: :class:`.GlobalVrouterConfig` object
-
- """
- raise NotImplementedError, 'global_vrouter_config_create is %s\'s responsibility' % (str(type (self)))
- #end global_vrouter_config_create
-
- def global_vrouter_config_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return global-vrouter-config information.
-
- :param fq_name: Fully qualified name of global-vrouter-config
- :param fq_name_str: Fully qualified name string of global-vrouter-config
- :param id: UUID of global-vrouter-config
- :param ifmap_id: IFMAP id of global-vrouter-config
- :returns: :class:`.GlobalVrouterConfig` object
-
- """
- raise NotImplementedError, 'global_vrouter_config_read is %s\'s responsibility' % (str(type (self)))
- #end global_vrouter_config_read
-
- def global_vrouter_config_update(self, obj):
- """Update global-vrouter-config.
-
- :param obj: :class:`.GlobalVrouterConfig` object
-
- """
- raise NotImplementedError, 'global_vrouter_config_update is %s\'s responsibility' % (str(type (self)))
- #end global_vrouter_config_update
-
- def global_vrouter_configs_list(self, parent_id = None, parent_fq_name = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all global-vrouter-configs.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.GlobalVrouterConfig` objects
-
- """
- raise NotImplementedError, 'global_vrouter_configs_list is %s\'s responsibility' % (str(type (self)))
- #end global_vrouter_configs_list
-
- def global_vrouter_config_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete global-vrouter-config from the system.
-
- :param fq_name: Fully qualified name of global-vrouter-config
- :param id: UUID of global-vrouter-config
- :param ifmap_id: IFMAP id of global-vrouter-config
-
- """
- raise NotImplementedError, 'global_vrouter_config_delete is %s\'s responsibility' % (str(type (self)))
- #end global_vrouter_config_delete
-
- def get_default_global_vrouter_config_id(self):
- """Return UUID of default global-vrouter-config."""
- raise NotImplementedError, 'get_default_global_vrouter_config_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_global_vrouter_config_delete
-
- def instance_ip_create(self, obj):
- """Create new instance-ip.
-
- :param obj: :class:`.InstanceIp` object
-
- """
- raise NotImplementedError, 'instance_ip_create is %s\'s responsibility' % (str(type (self)))
- #end instance_ip_create
-
- def instance_ip_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return instance-ip information.
-
- :param fq_name: Fully qualified name of instance-ip
- :param fq_name_str: Fully qualified name string of instance-ip
- :param id: UUID of instance-ip
- :param ifmap_id: IFMAP id of instance-ip
- :returns: :class:`.InstanceIp` object
-
- """
- raise NotImplementedError, 'instance_ip_read is %s\'s responsibility' % (str(type (self)))
- #end instance_ip_read
-
- def instance_ip_update(self, obj):
- """Update instance-ip.
-
- :param obj: :class:`.InstanceIp` object
-
- """
- raise NotImplementedError, 'instance_ip_update is %s\'s responsibility' % (str(type (self)))
- #end instance_ip_update
-
- def instance_ips_list(self, back_ref_id = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all instance-ips."""
- raise NotImplementedError, 'instance_ips_list is %s\'s responsibility' % (str(type (self)))
- #end instance_ips_list
-
- def instance_ip_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete instance-ip from the system.
-
- :param fq_name: Fully qualified name of instance-ip
- :param id: UUID of instance-ip
- :param ifmap_id: IFMAP id of instance-ip
-
- """
- raise NotImplementedError, 'instance_ip_delete is %s\'s responsibility' % (str(type (self)))
- #end instance_ip_delete
-
- def get_default_instance_ip_id(self):
- """Return UUID of default instance-ip."""
- raise NotImplementedError, 'get_default_instance_ip_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_instance_ip_delete
-
- def network_policy_create(self, obj):
- """Create new network-policy.
-
- :param obj: :class:`.NetworkPolicy` object
-
- """
- raise NotImplementedError, 'network_policy_create is %s\'s responsibility' % (str(type (self)))
- #end network_policy_create
-
- def network_policy_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return network-policy information.
-
- :param fq_name: Fully qualified name of network-policy
- :param fq_name_str: Fully qualified name string of network-policy
- :param id: UUID of network-policy
- :param ifmap_id: IFMAP id of network-policy
- :returns: :class:`.NetworkPolicy` object
-
- """
- raise NotImplementedError, 'network_policy_read is %s\'s responsibility' % (str(type (self)))
- #end network_policy_read
-
- def network_policy_update(self, obj):
- """Update network-policy.
-
- :param obj: :class:`.NetworkPolicy` object
-
- """
- raise NotImplementedError, 'network_policy_update is %s\'s responsibility' % (str(type (self)))
- #end network_policy_update
-
- def network_policys_list(self, parent_id = None, parent_fq_name = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all network-policys.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.NetworkPolicy` objects
-
- """
- raise NotImplementedError, 'network_policys_list is %s\'s responsibility' % (str(type (self)))
- #end network_policys_list
-
- def network_policy_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete network-policy from the system.
-
- :param fq_name: Fully qualified name of network-policy
- :param id: UUID of network-policy
- :param ifmap_id: IFMAP id of network-policy
-
- """
- raise NotImplementedError, 'network_policy_delete is %s\'s responsibility' % (str(type (self)))
- #end network_policy_delete
-
- def get_default_network_policy_id(self):
- """Return UUID of default network-policy."""
- raise NotImplementedError, 'get_default_network_policy_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_network_policy_delete
-
- def loadbalancer_pool_create(self, obj):
- """Create new loadbalancer-pool.
-
- :param obj: :class:`.LoadbalancerPool` object
-
- """
- raise NotImplementedError, 'loadbalancer_pool_create is %s\'s responsibility' % (str(type (self)))
- #end loadbalancer_pool_create
-
- def loadbalancer_pool_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return loadbalancer-pool information.
-
- :param fq_name: Fully qualified name of loadbalancer-pool
- :param fq_name_str: Fully qualified name string of loadbalancer-pool
- :param id: UUID of loadbalancer-pool
- :param ifmap_id: IFMAP id of loadbalancer-pool
- :returns: :class:`.LoadbalancerPool` object
-
- """
- raise NotImplementedError, 'loadbalancer_pool_read is %s\'s responsibility' % (str(type (self)))
- #end loadbalancer_pool_read
-
- def loadbalancer_pool_update(self, obj):
- """Update loadbalancer-pool.
-
- :param obj: :class:`.LoadbalancerPool` object
-
- """
- raise NotImplementedError, 'loadbalancer_pool_update is %s\'s responsibility' % (str(type (self)))
- #end loadbalancer_pool_update
-
- def loadbalancer_pools_list(self, parent_id = None, parent_fq_name = None, back_ref_id = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all loadbalancer-pools.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.LoadbalancerPool` objects
-
- """
- raise NotImplementedError, 'loadbalancer_pools_list is %s\'s responsibility' % (str(type (self)))
- #end loadbalancer_pools_list
-
- def loadbalancer_pool_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete loadbalancer-pool from the system.
-
- :param fq_name: Fully qualified name of loadbalancer-pool
- :param id: UUID of loadbalancer-pool
- :param ifmap_id: IFMAP id of loadbalancer-pool
-
- """
- raise NotImplementedError, 'loadbalancer_pool_delete is %s\'s responsibility' % (str(type (self)))
- #end loadbalancer_pool_delete
-
- def get_default_loadbalancer_pool_id(self):
- """Return UUID of default loadbalancer-pool."""
- raise NotImplementedError, 'get_default_loadbalancer_pool_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_loadbalancer_pool_delete
-
- def virtual_DNS_record_create(self, obj):
- """Create new virtual-DNS-record.
-
- :param obj: :class:`.VirtualDnsRecord` object
-
- """
- raise NotImplementedError, 'virtual_DNS_record_create is %s\'s responsibility' % (str(type (self)))
- #end virtual_DNS_record_create
-
- def virtual_DNS_record_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return virtual-DNS-record information.
-
- :param fq_name: Fully qualified name of virtual-DNS-record
- :param fq_name_str: Fully qualified name string of virtual-DNS-record
- :param id: UUID of virtual-DNS-record
- :param ifmap_id: IFMAP id of virtual-DNS-record
- :returns: :class:`.VirtualDnsRecord` object
-
- """
- raise NotImplementedError, 'virtual_DNS_record_read is %s\'s responsibility' % (str(type (self)))
- #end virtual_DNS_record_read
-
- def virtual_DNS_record_update(self, obj):
- """Update virtual-DNS-record.
-
- :param obj: :class:`.VirtualDnsRecord` object
-
- """
- raise NotImplementedError, 'virtual_DNS_record_update is %s\'s responsibility' % (str(type (self)))
- #end virtual_DNS_record_update
-
- def virtual_DNS_records_list(self, parent_id = None, parent_fq_name = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all virtual-DNS-records.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.VirtualDnsRecord` objects
-
- """
- raise NotImplementedError, 'virtual_DNS_records_list is %s\'s responsibility' % (str(type (self)))
- #end virtual_DNS_records_list
-
- def virtual_DNS_record_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete virtual-DNS-record from the system.
-
- :param fq_name: Fully qualified name of virtual-DNS-record
- :param id: UUID of virtual-DNS-record
- :param ifmap_id: IFMAP id of virtual-DNS-record
-
- """
- raise NotImplementedError, 'virtual_DNS_record_delete is %s\'s responsibility' % (str(type (self)))
- #end virtual_DNS_record_delete
-
- def get_default_virtual_DNS_record_id(self):
- """Return UUID of default virtual-DNS-record."""
- raise NotImplementedError, 'get_default_virtual_DNS_record_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_virtual_DNS_record_delete
-
- def route_target_create(self, obj):
- """Create new route-target.
-
- :param obj: :class:`.RouteTarget` object
-
- """
- raise NotImplementedError, 'route_target_create is %s\'s responsibility' % (str(type (self)))
- #end route_target_create
-
- def route_target_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return route-target information.
-
- :param fq_name: Fully qualified name of route-target
- :param fq_name_str: Fully qualified name string of route-target
- :param id: UUID of route-target
- :param ifmap_id: IFMAP id of route-target
- :returns: :class:`.RouteTarget` object
-
- """
- raise NotImplementedError, 'route_target_read is %s\'s responsibility' % (str(type (self)))
- #end route_target_read
-
- def route_target_update(self, obj):
- """Update route-target.
-
- :param obj: :class:`.RouteTarget` object
-
- """
- raise NotImplementedError, 'route_target_update is %s\'s responsibility' % (str(type (self)))
- #end route_target_update
-
- def route_targets_list(self, obj_uuids = None, fields = None, detail = False, count = False):
- """List all route-targets."""
- raise NotImplementedError, 'route_targets_list is %s\'s responsibility' % (str(type (self)))
- #end route_targets_list
-
- def route_target_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete route-target from the system.
-
- :param fq_name: Fully qualified name of route-target
- :param id: UUID of route-target
- :param ifmap_id: IFMAP id of route-target
-
- """
- raise NotImplementedError, 'route_target_delete is %s\'s responsibility' % (str(type (self)))
- #end route_target_delete
-
- def get_default_route_target_id(self):
- """Return UUID of default route-target."""
- raise NotImplementedError, 'get_default_route_target_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_route_target_delete
-
- def floating_ip_create(self, obj):
- """Create new floating-ip.
-
- :param obj: :class:`.FloatingIp` object
-
- """
- raise NotImplementedError, 'floating_ip_create is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_create
-
- def floating_ip_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return floating-ip information.
-
- :param fq_name: Fully qualified name of floating-ip
- :param fq_name_str: Fully qualified name string of floating-ip
- :param id: UUID of floating-ip
- :param ifmap_id: IFMAP id of floating-ip
- :returns: :class:`.FloatingIp` object
-
- """
- raise NotImplementedError, 'floating_ip_read is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_read
-
- def floating_ip_update(self, obj):
- """Update floating-ip.
-
- :param obj: :class:`.FloatingIp` object
-
- """
- raise NotImplementedError, 'floating_ip_update is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_update
-
- def floating_ips_list(self, parent_id = None, parent_fq_name = None, back_ref_id = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all floating-ips.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.FloatingIp` objects
-
- """
- raise NotImplementedError, 'floating_ips_list is %s\'s responsibility' % (str(type (self)))
- #end floating_ips_list
-
- def floating_ip_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete floating-ip from the system.
-
- :param fq_name: Fully qualified name of floating-ip
- :param id: UUID of floating-ip
- :param ifmap_id: IFMAP id of floating-ip
-
- """
- raise NotImplementedError, 'floating_ip_delete is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_delete
-
- def get_default_floating_ip_id(self):
- """Return UUID of default floating-ip."""
- raise NotImplementedError, 'get_default_floating_ip_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_floating_ip_delete
-
- def floating_ip_pool_create(self, obj):
- """Create new floating-ip-pool.
-
- :param obj: :class:`.FloatingIpPool` object
-
- """
- raise NotImplementedError, 'floating_ip_pool_create is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_pool_create
-
- def floating_ip_pool_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return floating-ip-pool information.
-
- :param fq_name: Fully qualified name of floating-ip-pool
- :param fq_name_str: Fully qualified name string of floating-ip-pool
- :param id: UUID of floating-ip-pool
- :param ifmap_id: IFMAP id of floating-ip-pool
- :returns: :class:`.FloatingIpPool` object
-
- """
- raise NotImplementedError, 'floating_ip_pool_read is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_pool_read
-
- def floating_ip_pool_update(self, obj):
- """Update floating-ip-pool.
-
- :param obj: :class:`.FloatingIpPool` object
-
- """
- raise NotImplementedError, 'floating_ip_pool_update is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_pool_update
-
- def floating_ip_pools_list(self, parent_id = None, parent_fq_name = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all floating-ip-pools.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.FloatingIpPool` objects
-
- """
- raise NotImplementedError, 'floating_ip_pools_list is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_pools_list
-
- def floating_ip_pool_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete floating-ip-pool from the system.
-
- :param fq_name: Fully qualified name of floating-ip-pool
- :param id: UUID of floating-ip-pool
- :param ifmap_id: IFMAP id of floating-ip-pool
-
- """
- raise NotImplementedError, 'floating_ip_pool_delete is %s\'s responsibility' % (str(type (self)))
- #end floating_ip_pool_delete
-
- def get_default_floating_ip_pool_id(self):
- """Return UUID of default floating-ip-pool."""
- raise NotImplementedError, 'get_default_floating_ip_pool_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_floating_ip_pool_delete
-
- def physical_router_create(self, obj):
- """Create new physical-router.
-
- :param obj: :class:`.PhysicalRouter` object
-
- """
- raise NotImplementedError, 'physical_router_create is %s\'s responsibility' % (str(type (self)))
- #end physical_router_create
-
- def physical_router_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return physical-router information.
-
- :param fq_name: Fully qualified name of physical-router
- :param fq_name_str: Fully qualified name string of physical-router
- :param id: UUID of physical-router
- :param ifmap_id: IFMAP id of physical-router
- :returns: :class:`.PhysicalRouter` object
-
- """
- raise NotImplementedError, 'physical_router_read is %s\'s responsibility' % (str(type (self)))
- #end physical_router_read
-
- def physical_router_update(self, obj):
- """Update physical-router.
-
- :param obj: :class:`.PhysicalRouter` object
-
- """
- raise NotImplementedError, 'physical_router_update is %s\'s responsibility' % (str(type (self)))
- #end physical_router_update
-
- def physical_routers_list(self, parent_id = None, parent_fq_name = None, back_ref_id = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all physical-routers.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.PhysicalRouter` objects
-
- """
- raise NotImplementedError, 'physical_routers_list is %s\'s responsibility' % (str(type (self)))
- #end physical_routers_list
-
- def physical_router_delete(self, fq_name = None, id = None, ifmap_id = None):
- """Delete physical-router from the system.
-
- :param fq_name: Fully qualified name of physical-router
- :param id: UUID of physical-router
- :param ifmap_id: IFMAP id of physical-router
-
- """
- raise NotImplementedError, 'physical_router_delete is %s\'s responsibility' % (str(type (self)))
- #end physical_router_delete
-
- def get_default_physical_router_id(self):
- """Return UUID of default physical-router."""
- raise NotImplementedError, 'get_default_physical_router_delete is %s\'s responsibility' % (str(type (self)))
- #end get_default_physical_router_delete
-
- def bgp_router_create(self, obj):
- """Create new bgp-router.
-
- :param obj: :class:`.BgpRouter` object
-
- """
- raise NotImplementedError, 'bgp_router_create is %s\'s responsibility' % (str(type (self)))
- #end bgp_router_create
-
- def bgp_router_read(self, fq_name = None, fq_name_str = None, id = None, ifmap_id = None):
- """Return bgp-router information.
-
- :param fq_name: Fully qualified name of bgp-router
- :param fq_name_str: Fully qualified name string of bgp-router
- :param id: UUID of bgp-router
- :param ifmap_id: IFMAP id of bgp-router
- :returns: :class:`.BgpRouter` object
-
- """
- raise NotImplementedError, 'bgp_router_read is %s\'s responsibility' % (str(type (self)))
- #end bgp_router_read
-
- def bgp_router_update(self, obj):
- """Update bgp-router.
-
- :param obj: :class:`.BgpRouter` object
-
- """
- raise NotImplementedError, 'bgp_router_update is %s\'s responsibility' % (str(type (self)))
- #end bgp_router_update
-
- def bgp_routers_list(self, parent_id = None, parent_fq_name = None, back_ref_id = None, obj_uuids = None, fields = None, detail = False, count = False):
- """List all bgp-routers.
-
- :param parent_id: UUID of parent as optional search filter
- :param parent_fq_name: full qualified name of parent as optional search filter
- :returns: list of :class:`.BgpRouter` objects
-
- """
- raise NotImplementedError, 'bgp_routers_list is %s\'s responsibility' % (str(type (self)))
- #end bgp_routers_list
-
- def bgp_router_delete(self, fq_name = None, id = None, ifmap_id = None):</