metal-stack-api 0.0.7__py3-none-any.whl → 0.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {metal_stack_api-0.0.7.dist-info → metal_stack_api-0.0.8.dist-info}/METADATA +1 -1
- {metal_stack_api-0.0.7.dist-info → metal_stack_api-0.0.8.dist-info}/RECORD +12 -5
- metalstack/api/v2/switch_pb2.py +124 -0
- metalstack/api/v2/switch_pb2.pyi +133 -0
- metalstack/api/v2/switch_pb2_grpc.py +4 -0
- metalstack/client/client.py +4 -0
- metalstack/infra/v2/switch_connecpy.py +102 -0
- metalstack/infra/v2/switch_pb2.py +45 -0
- metalstack/infra/v2/switch_pb2.pyi +20 -0
- metalstack/infra/v2/switch_pb2_grpc.py +81 -0
- {metal_stack_api-0.0.7.dist-info → metal_stack_api-0.0.8.dist-info}/WHEEL +0 -0
- {metal_stack_api-0.0.7.dist-info → metal_stack_api-0.0.8.dist-info}/top_level.txt +0 -0
|
@@ -79,6 +79,9 @@ metalstack/api/v2/size_connecpy.py,sha256=knKakjI3qD7Pt1thyejU0oGjm3QNRk9ar4y0ED
|
|
|
79
79
|
metalstack/api/v2/size_pb2.py,sha256=O6V47lK-15aPn6IyPhFng-eK8sLn1tia5Okzm6Zmg8E,8370
|
|
80
80
|
metalstack/api/v2/size_pb2.pyi,sha256=ZKSf60gss4MO9ad8bFkt7ECe0HOA2mA791MIt8H_OtU,3825
|
|
81
81
|
metalstack/api/v2/size_pb2_grpc.py,sha256=JFk6O7tPDV79gqWYx5EL9PypOLUXdDJXrG1MOf4V5As,4683
|
|
82
|
+
metalstack/api/v2/switch_pb2.py,sha256=UpEyiJ05s_NsS2fBVEEHpwmNWlgqDpzQOuR373uUMHg,13929
|
|
83
|
+
metalstack/api/v2/switch_pb2.pyi,sha256=SfWNsa1H7bVQbJcRVi6xs8PbOBWuJwt5hiBaSWJuISs,6581
|
|
84
|
+
metalstack/api/v2/switch_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
82
85
|
metalstack/api/v2/tenant_connecpy.py,sha256=h3SRO8qxzYHfDhLJp87RXq0kmSYMjyePYIdC9ZviKQA,36977
|
|
83
86
|
metalstack/api/v2/tenant_pb2.py,sha256=aD8oD-ZCVPWAOwxHaYuPcZZl56ErLSvZvMlbBLI6wTE,17665
|
|
84
87
|
metalstack/api/v2/tenant_pb2.pyi,sha256=fopXmxKCtaDU9aGdM4Ams8wgx63B1DXcE683P3TJNY0,10275
|
|
@@ -96,14 +99,18 @@ metalstack/api/v2/version_pb2.py,sha256=oy4hAYI8KWYbNgr0AVvfKyrG7W9QlhcPC9j4eHej
|
|
|
96
99
|
metalstack/api/v2/version_pb2.pyi,sha256=JfQ_tYwDG6P9aH7y7-iEHmtuWsLKsrpLKAVJIzHehRM,1172
|
|
97
100
|
metalstack/api/v2/version_pb2_grpc.py,sha256=JIdrRIyNyWnQiw7CgCDkpZQv1eSQdGI6ocZOHixY4ao,2947
|
|
98
101
|
metalstack/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
99
|
-
metalstack/client/client.py,sha256=
|
|
102
|
+
metalstack/client/client.py,sha256=puBZBl-2ojHI-yppO8x_nqH1_PzFoNVZXvu4n2HZy7E,5651
|
|
100
103
|
metalstack/infra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
104
|
metalstack/infra/v2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
105
|
metalstack/infra/v2/bmc_connecpy.py,sha256=bSuJccboyftuFFZ63X1eMTv6Xngp9J5gGgPtKzE3OZk,4197
|
|
103
106
|
metalstack/infra/v2/bmc_pb2.py,sha256=maCH4C5cyDGHFt4SJg2ZBk9NeVf5eTGyAZkqx-LlQJM,2701
|
|
104
107
|
metalstack/infra/v2/bmc_pb2.pyi,sha256=e4FGBnDQhg6K_zlhoC170lw-0OSlSdHK3So6r3Reh1E,444
|
|
105
108
|
metalstack/infra/v2/bmc_pb2_grpc.py,sha256=3rDzkvuVS2cltmzRAvTo9f0vyR0ajgInCYixOmH5_7o,2927
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
metalstack/infra/v2/switch_connecpy.py,sha256=dhRy8soyRRsqVlCfzt2lvy80hJGlAY1aFcp9_z8flDU,4392
|
|
110
|
+
metalstack/infra/v2/switch_pb2.py,sha256=8DZpWBwmFPb6TUWkd4vG_JLtbFnsmaEJjhiKM7GrOaA,3068
|
|
111
|
+
metalstack/infra/v2/switch_pb2.pyi,sha256=keDojB2U7IW7kDoEj12ckSrGK3kR8PZhRpepN7HwuB4,890
|
|
112
|
+
metalstack/infra/v2/switch_pb2_grpc.py,sha256=Upgjj1YATjaac6vTK8eAeFH7apuSJTiFPB-4BXxj6rc,3010
|
|
113
|
+
metal_stack_api-0.0.8.dist-info/METADATA,sha256=c6wZLWV_3MI3lc12CgXYmw4zJlWF5bfmpI7g2p5oVFA,831
|
|
114
|
+
metal_stack_api-0.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
115
|
+
metal_stack_api-0.0.8.dist-info/top_level.txt,sha256=EVrYyUiIjmWi5LomfJxKYph7kX6cNdnKbpVLXUKG3M0,15
|
|
116
|
+
metal_stack_api-0.0.8.dist-info/RECORD,,
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: metalstack/api/v2/switch.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'metalstack/api/v2/switch.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
|
|
26
|
+
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
|
|
27
|
+
from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1emetalstack/api/v2/switch.proto\x12\x11metalstack.api.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1emetalstack/api/v2/common.proto\"\xde\x03\n\x06Switch\x12\x1c\n\x02id\x18\x01 \x01(\tB\x0c\xbaH\tr\x07\x10\x02\x18\x80\x01h\x01R\x02id\x12,\n\x0b\x64\x65scription\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0b\x64\x65scription\x12(\n\x07rack_id\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x06rackId\x88\x01\x01\x12(\n\tpartition\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpartition\x12Q\n\x0creplace_mode\x18\x06 \x01(\x0e\x32$.metalstack.api.v2.SwitchReplaceModeB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x0breplaceMode\x12,\n\rmanagement_ip\x18\x07 \x01(\tB\x07\xbaH\x04r\x02p\x01R\x0cmanagementIp\x12\x33\n\x0fmanagement_user\x18\x08 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0emanagementUser\x12\x33\n\x0f\x63onsole_command\x18\t \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x0e\x63onsoleCommand\x12=\n\x0bswitch_nics\x18\n \x03(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\nswitchNicsB\n\n\x08_rack_id\"\xaf\x01\n\x08SwitchOS\x12\x43\n\x06vendor\x18\x01 \x01(\x0e\x32!.metalstack.api.v2.SwitchOSVendorB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06vendor\x12$\n\x07version\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x07version\x12\x38\n\x12metal_core_version\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x10metalCoreVersion\"\xd1\x03\n\tSwitchNic\x12\x1e\n\x04name\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x04name\x12*\n\nidentifier\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\nidentifier\x12P\n\x0bmac_address\x18\x03 \x01(\tB/\xbaH,r*2(^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$R\nmacAddress\x12!\n\x03vrf\x18\x04 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x00R\x03vrf\x88\x01\x01\x12\x45\n\x06\x61\x63tual\x18\x05 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06\x61\x63tual\x12@\n\nbgp_filter\x18\x06 \x01(\x0b\x32\x1c.metalstack.api.v2.BGPFilterH\x01R\tbgpFilter\x88\x01\x01\x12P\n\x0e\x62gp_port_state\x18\x07 \x01(\x0b\x32%.metalstack.api.v2.SwitchBGPPortStateH\x02R\x0c\x62gpPortState\x88\x01\x01\x42\x06\n\x04_vrfB\r\n\x0b_bgp_filterB\x11\n\x0f_bgp_port_state\"\x92\x01\n\tBGPFilter\x12\x14\n\x05\x63idrs\x18\x01 \x03(\tR\x05\x63idrs\x12#\n\x04vnis\x18\x02 \x03(\tB\x0f\xbaH\x0c\x92\x01\t\"\x07r\x05\x10\x02\x18\x80\x01R\x04vnis:J\xbaHG\x1a\x45\n\x05\x63idrs\x12\x19given cidrs must be valid\x1a!this.cidrs.all(m, m.isIpPrefix())\"\x8e\x03\n\x12SwitchBGPPortState\x12&\n\x08neighbor\x18\x01 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x08neighbor\x12)\n\npeer_group\x18\x02 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\tpeerGroup\x12%\n\x08vrf_name\x18\x03 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01R\x07vrfName\x12\x42\n\tbgp_state\x18\x04 \x01(\x0e\x32\x1b.metalstack.api.v2.BGPStateB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x08\x62gpState\x12R\n\x18\x62gp_timer_up_established\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationR\x15\x62gpTimerUpEstablished\x12.\n\x13sent_prefix_counter\x18\x06 \x01(\x04R\x11sentPrefixCounter\x12\x36\n\x17\x61\x63\x63\x65pted_prefix_counter\x18\x07 \x01(\x04R\x15\x61\x63\x63\x65ptedPrefixCounter*\x8b\x02\n\x08\x42GPState\x12\x19\n\x15\x42GP_STATE_UNSPECIFIED\x10\x00\x12\x1c\n\x0e\x42GP_STATE_IDLE\x10\x01\x1a\x08\x82\xb2\x19\x04idle\x12\"\n\x11\x42GP_STATE_CONNECT\x10\x02\x1a\x0b\x82\xb2\x19\x07\x63onnect\x12 \n\x10\x42GP_STATE_ACTIVE\x10\x03\x1a\n\x82\xb2\x19\x06\x61\x63tive\x12&\n\x13\x42GP_STATE_OPEN_SENT\x10\x04\x1a\r\x82\xb2\x19\topen-sent\x12,\n\x16\x42GP_STATE_OPEN_CONFIRM\x10\x05\x1a\x10\x82\xb2\x19\x0copen-confirm\x12*\n\x15\x42GP_STATE_ESTABLISHED\x10\x06\x1a\x0f\x82\xb2\x19\x0b\x65stablished*\x9c\x01\n\x11SwitchReplaceMode\x12#\n\x1fSWITCH_REPLACE_MODE_UNSPECIFIED\x10\x00\x12,\n\x1bSWITCH_REPLACE_MODE_REPLACE\x10\x01\x1a\x0b\x82\xb2\x19\x07replace\x12\x34\n\x1fSWITCH_REPLACE_MODE_OPERATIONAL\x10\x02\x1a\x0f\x82\xb2\x19\x0boperational*\x84\x01\n\x0eSwitchOSVendor\x12 \n\x1cSWITCH_OS_VENDOR_UNSPECIFIED\x10\x00\x12)\n\x18SWITCH_OS_VENDOR_CUMULUS\x10\x01\x1a\x0b\x82\xb2\x19\x07\x63umulus\x12%\n\x16SWITCH_OS_VENDOR_SONIC\x10\x02\x1a\t\x82\xb2\x19\x05sonic*\x80\x01\n\x10SwitchPortStatus\x12\"\n\x1eSWITCH_PORT_STATUS_UNSPECIFIED\x10\x00\x12!\n\x15SWITCH_PORT_STATUS_UP\x10\x01\x1a\x06\x82\xb2\x19\x02up\x12%\n\x17SWITCH_PORT_STATUS_DOWN\x10\x02\x1a\x08\x82\xb2\x19\x04\x64ownB\xc1\x01\n\x15\x63om.metalstack.api.v2B\x0bSwitchProtoP\x01Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\xa2\x02\x03MAX\xaa\x02\x11Metalstack.Api.V2\xca\x02\x11Metalstack\\Api\\V2\xe2\x02\x1dMetalstack\\Api\\V2\\GPBMetadata\xea\x02\x13Metalstack::Api::V2b\x06proto3')
|
|
31
|
+
|
|
32
|
+
_globals = globals()
|
|
33
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
34
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.api.v2.switch_pb2', _globals)
|
|
35
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
36
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
37
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\025com.metalstack.api.v2B\013SwitchProtoP\001Z5github.com/metal-stack/api/go/metalstack/api/v2;apiv2\242\002\003MAX\252\002\021Metalstack.Api.V2\312\002\021Metalstack\\Api\\V2\342\002\035Metalstack\\Api\\V2\\GPBMetadata\352\002\023Metalstack::Api::V2'
|
|
38
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_IDLE"]._loaded_options = None
|
|
39
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_IDLE"]._serialized_options = b'\202\262\031\004idle'
|
|
40
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_CONNECT"]._loaded_options = None
|
|
41
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_CONNECT"]._serialized_options = b'\202\262\031\007connect'
|
|
42
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_ACTIVE"]._loaded_options = None
|
|
43
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_ACTIVE"]._serialized_options = b'\202\262\031\006active'
|
|
44
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_SENT"]._loaded_options = None
|
|
45
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_SENT"]._serialized_options = b'\202\262\031\topen-sent'
|
|
46
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_CONFIRM"]._loaded_options = None
|
|
47
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_OPEN_CONFIRM"]._serialized_options = b'\202\262\031\014open-confirm'
|
|
48
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_ESTABLISHED"]._loaded_options = None
|
|
49
|
+
_globals['_BGPSTATE'].values_by_name["BGP_STATE_ESTABLISHED"]._serialized_options = b'\202\262\031\013established'
|
|
50
|
+
_globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_REPLACE"]._loaded_options = None
|
|
51
|
+
_globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_REPLACE"]._serialized_options = b'\202\262\031\007replace'
|
|
52
|
+
_globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_OPERATIONAL"]._loaded_options = None
|
|
53
|
+
_globals['_SWITCHREPLACEMODE'].values_by_name["SWITCH_REPLACE_MODE_OPERATIONAL"]._serialized_options = b'\202\262\031\013operational'
|
|
54
|
+
_globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_CUMULUS"]._loaded_options = None
|
|
55
|
+
_globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_CUMULUS"]._serialized_options = b'\202\262\031\007cumulus'
|
|
56
|
+
_globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_SONIC"]._loaded_options = None
|
|
57
|
+
_globals['_SWITCHOSVENDOR'].values_by_name["SWITCH_OS_VENDOR_SONIC"]._serialized_options = b'\202\262\031\005sonic'
|
|
58
|
+
_globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_UP"]._loaded_options = None
|
|
59
|
+
_globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_UP"]._serialized_options = b'\202\262\031\002up'
|
|
60
|
+
_globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_DOWN"]._loaded_options = None
|
|
61
|
+
_globals['_SWITCHPORTSTATUS'].values_by_name["SWITCH_PORT_STATUS_DOWN"]._serialized_options = b'\202\262\031\004down'
|
|
62
|
+
_globals['_SWITCH'].fields_by_name['id']._loaded_options = None
|
|
63
|
+
_globals['_SWITCH'].fields_by_name['id']._serialized_options = b'\272H\tr\007\020\002\030\200\001h\001'
|
|
64
|
+
_globals['_SWITCH'].fields_by_name['description']._loaded_options = None
|
|
65
|
+
_globals['_SWITCH'].fields_by_name['description']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
66
|
+
_globals['_SWITCH'].fields_by_name['rack_id']._loaded_options = None
|
|
67
|
+
_globals['_SWITCH'].fields_by_name['rack_id']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
68
|
+
_globals['_SWITCH'].fields_by_name['partition']._loaded_options = None
|
|
69
|
+
_globals['_SWITCH'].fields_by_name['partition']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
70
|
+
_globals['_SWITCH'].fields_by_name['replace_mode']._loaded_options = None
|
|
71
|
+
_globals['_SWITCH'].fields_by_name['replace_mode']._serialized_options = b'\272H\005\202\001\002\020\001'
|
|
72
|
+
_globals['_SWITCH'].fields_by_name['management_ip']._loaded_options = None
|
|
73
|
+
_globals['_SWITCH'].fields_by_name['management_ip']._serialized_options = b'\272H\004r\002p\001'
|
|
74
|
+
_globals['_SWITCH'].fields_by_name['management_user']._loaded_options = None
|
|
75
|
+
_globals['_SWITCH'].fields_by_name['management_user']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
76
|
+
_globals['_SWITCH'].fields_by_name['console_command']._loaded_options = None
|
|
77
|
+
_globals['_SWITCH'].fields_by_name['console_command']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
78
|
+
_globals['_SWITCHOS'].fields_by_name['vendor']._loaded_options = None
|
|
79
|
+
_globals['_SWITCHOS'].fields_by_name['vendor']._serialized_options = b'\272H\005\202\001\002\020\001'
|
|
80
|
+
_globals['_SWITCHOS'].fields_by_name['version']._loaded_options = None
|
|
81
|
+
_globals['_SWITCHOS'].fields_by_name['version']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
82
|
+
_globals['_SWITCHOS'].fields_by_name['metal_core_version']._loaded_options = None
|
|
83
|
+
_globals['_SWITCHOS'].fields_by_name['metal_core_version']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
84
|
+
_globals['_SWITCHNIC'].fields_by_name['name']._loaded_options = None
|
|
85
|
+
_globals['_SWITCHNIC'].fields_by_name['name']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
86
|
+
_globals['_SWITCHNIC'].fields_by_name['identifier']._loaded_options = None
|
|
87
|
+
_globals['_SWITCHNIC'].fields_by_name['identifier']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
88
|
+
_globals['_SWITCHNIC'].fields_by_name['mac_address']._loaded_options = None
|
|
89
|
+
_globals['_SWITCHNIC'].fields_by_name['mac_address']._serialized_options = b'\272H,r*2(^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$'
|
|
90
|
+
_globals['_SWITCHNIC'].fields_by_name['vrf']._loaded_options = None
|
|
91
|
+
_globals['_SWITCHNIC'].fields_by_name['vrf']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
92
|
+
_globals['_SWITCHNIC'].fields_by_name['actual']._loaded_options = None
|
|
93
|
+
_globals['_SWITCHNIC'].fields_by_name['actual']._serialized_options = b'\272H\005\202\001\002\020\001'
|
|
94
|
+
_globals['_BGPFILTER'].fields_by_name['vnis']._loaded_options = None
|
|
95
|
+
_globals['_BGPFILTER'].fields_by_name['vnis']._serialized_options = b'\272H\014\222\001\t\"\007r\005\020\002\030\200\001'
|
|
96
|
+
_globals['_BGPFILTER']._loaded_options = None
|
|
97
|
+
_globals['_BGPFILTER']._serialized_options = b'\272HG\032E\n\005cidrs\022\031given cidrs must be valid\032!this.cidrs.all(m, m.isIpPrefix())'
|
|
98
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['neighbor']._loaded_options = None
|
|
99
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['neighbor']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
100
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['peer_group']._loaded_options = None
|
|
101
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['peer_group']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
102
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['vrf_name']._loaded_options = None
|
|
103
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['vrf_name']._serialized_options = b'\272H\007r\005\020\002\030\200\001'
|
|
104
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['bgp_state']._loaded_options = None
|
|
105
|
+
_globals['_SWITCHBGPPORTSTATE'].fields_by_name['bgp_state']._serialized_options = b'\272H\005\202\001\002\020\001'
|
|
106
|
+
_globals['_BGPSTATE']._serialized_start=1824
|
|
107
|
+
_globals['_BGPSTATE']._serialized_end=2091
|
|
108
|
+
_globals['_SWITCHREPLACEMODE']._serialized_start=2094
|
|
109
|
+
_globals['_SWITCHREPLACEMODE']._serialized_end=2250
|
|
110
|
+
_globals['_SWITCHOSVENDOR']._serialized_start=2253
|
|
111
|
+
_globals['_SWITCHOSVENDOR']._serialized_end=2385
|
|
112
|
+
_globals['_SWITCHPORTSTATUS']._serialized_start=2388
|
|
113
|
+
_globals['_SWITCHPORTSTATUS']._serialized_end=2516
|
|
114
|
+
_globals['_SWITCH']._serialized_start=147
|
|
115
|
+
_globals['_SWITCH']._serialized_end=625
|
|
116
|
+
_globals['_SWITCHOS']._serialized_start=628
|
|
117
|
+
_globals['_SWITCHOS']._serialized_end=803
|
|
118
|
+
_globals['_SWITCHNIC']._serialized_start=806
|
|
119
|
+
_globals['_SWITCHNIC']._serialized_end=1271
|
|
120
|
+
_globals['_BGPFILTER']._serialized_start=1274
|
|
121
|
+
_globals['_BGPFILTER']._serialized_end=1420
|
|
122
|
+
_globals['_SWITCHBGPPORTSTATE']._serialized_start=1423
|
|
123
|
+
_globals['_SWITCHBGPPORTSTATE']._serialized_end=1821
|
|
124
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
|
|
3
|
+
from buf.validate import validate_pb2 as _validate_pb2
|
|
4
|
+
from google.protobuf import duration_pb2 as _duration_pb2
|
|
5
|
+
from metalstack.api.v2 import common_pb2 as _common_pb2
|
|
6
|
+
from google.protobuf.internal import containers as _containers
|
|
7
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
8
|
+
from google.protobuf import descriptor as _descriptor
|
|
9
|
+
from google.protobuf import message as _message
|
|
10
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
11
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
12
|
+
|
|
13
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
14
|
+
|
|
15
|
+
class BGPState(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
16
|
+
__slots__ = ()
|
|
17
|
+
BGP_STATE_UNSPECIFIED: _ClassVar[BGPState]
|
|
18
|
+
BGP_STATE_IDLE: _ClassVar[BGPState]
|
|
19
|
+
BGP_STATE_CONNECT: _ClassVar[BGPState]
|
|
20
|
+
BGP_STATE_ACTIVE: _ClassVar[BGPState]
|
|
21
|
+
BGP_STATE_OPEN_SENT: _ClassVar[BGPState]
|
|
22
|
+
BGP_STATE_OPEN_CONFIRM: _ClassVar[BGPState]
|
|
23
|
+
BGP_STATE_ESTABLISHED: _ClassVar[BGPState]
|
|
24
|
+
|
|
25
|
+
class SwitchReplaceMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
26
|
+
__slots__ = ()
|
|
27
|
+
SWITCH_REPLACE_MODE_UNSPECIFIED: _ClassVar[SwitchReplaceMode]
|
|
28
|
+
SWITCH_REPLACE_MODE_REPLACE: _ClassVar[SwitchReplaceMode]
|
|
29
|
+
SWITCH_REPLACE_MODE_OPERATIONAL: _ClassVar[SwitchReplaceMode]
|
|
30
|
+
|
|
31
|
+
class SwitchOSVendor(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
32
|
+
__slots__ = ()
|
|
33
|
+
SWITCH_OS_VENDOR_UNSPECIFIED: _ClassVar[SwitchOSVendor]
|
|
34
|
+
SWITCH_OS_VENDOR_CUMULUS: _ClassVar[SwitchOSVendor]
|
|
35
|
+
SWITCH_OS_VENDOR_SONIC: _ClassVar[SwitchOSVendor]
|
|
36
|
+
|
|
37
|
+
class SwitchPortStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
38
|
+
__slots__ = ()
|
|
39
|
+
SWITCH_PORT_STATUS_UNSPECIFIED: _ClassVar[SwitchPortStatus]
|
|
40
|
+
SWITCH_PORT_STATUS_UP: _ClassVar[SwitchPortStatus]
|
|
41
|
+
SWITCH_PORT_STATUS_DOWN: _ClassVar[SwitchPortStatus]
|
|
42
|
+
BGP_STATE_UNSPECIFIED: BGPState
|
|
43
|
+
BGP_STATE_IDLE: BGPState
|
|
44
|
+
BGP_STATE_CONNECT: BGPState
|
|
45
|
+
BGP_STATE_ACTIVE: BGPState
|
|
46
|
+
BGP_STATE_OPEN_SENT: BGPState
|
|
47
|
+
BGP_STATE_OPEN_CONFIRM: BGPState
|
|
48
|
+
BGP_STATE_ESTABLISHED: BGPState
|
|
49
|
+
SWITCH_REPLACE_MODE_UNSPECIFIED: SwitchReplaceMode
|
|
50
|
+
SWITCH_REPLACE_MODE_REPLACE: SwitchReplaceMode
|
|
51
|
+
SWITCH_REPLACE_MODE_OPERATIONAL: SwitchReplaceMode
|
|
52
|
+
SWITCH_OS_VENDOR_UNSPECIFIED: SwitchOSVendor
|
|
53
|
+
SWITCH_OS_VENDOR_CUMULUS: SwitchOSVendor
|
|
54
|
+
SWITCH_OS_VENDOR_SONIC: SwitchOSVendor
|
|
55
|
+
SWITCH_PORT_STATUS_UNSPECIFIED: SwitchPortStatus
|
|
56
|
+
SWITCH_PORT_STATUS_UP: SwitchPortStatus
|
|
57
|
+
SWITCH_PORT_STATUS_DOWN: SwitchPortStatus
|
|
58
|
+
|
|
59
|
+
class Switch(_message.Message):
|
|
60
|
+
__slots__ = ("id", "description", "rack_id", "partition", "replace_mode", "management_ip", "management_user", "console_command", "switch_nics")
|
|
61
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
|
62
|
+
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
|
63
|
+
RACK_ID_FIELD_NUMBER: _ClassVar[int]
|
|
64
|
+
PARTITION_FIELD_NUMBER: _ClassVar[int]
|
|
65
|
+
REPLACE_MODE_FIELD_NUMBER: _ClassVar[int]
|
|
66
|
+
MANAGEMENT_IP_FIELD_NUMBER: _ClassVar[int]
|
|
67
|
+
MANAGEMENT_USER_FIELD_NUMBER: _ClassVar[int]
|
|
68
|
+
CONSOLE_COMMAND_FIELD_NUMBER: _ClassVar[int]
|
|
69
|
+
SWITCH_NICS_FIELD_NUMBER: _ClassVar[int]
|
|
70
|
+
id: str
|
|
71
|
+
description: str
|
|
72
|
+
rack_id: str
|
|
73
|
+
partition: str
|
|
74
|
+
replace_mode: SwitchReplaceMode
|
|
75
|
+
management_ip: str
|
|
76
|
+
management_user: str
|
|
77
|
+
console_command: str
|
|
78
|
+
switch_nics: _containers.RepeatedCompositeFieldContainer[SwitchNic]
|
|
79
|
+
def __init__(self, id: _Optional[str] = ..., description: _Optional[str] = ..., rack_id: _Optional[str] = ..., partition: _Optional[str] = ..., replace_mode: _Optional[_Union[SwitchReplaceMode, str]] = ..., management_ip: _Optional[str] = ..., management_user: _Optional[str] = ..., console_command: _Optional[str] = ..., switch_nics: _Optional[_Iterable[_Union[SwitchNic, _Mapping]]] = ...) -> None: ...
|
|
80
|
+
|
|
81
|
+
class SwitchOS(_message.Message):
|
|
82
|
+
__slots__ = ("vendor", "version", "metal_core_version")
|
|
83
|
+
VENDOR_FIELD_NUMBER: _ClassVar[int]
|
|
84
|
+
VERSION_FIELD_NUMBER: _ClassVar[int]
|
|
85
|
+
METAL_CORE_VERSION_FIELD_NUMBER: _ClassVar[int]
|
|
86
|
+
vendor: SwitchOSVendor
|
|
87
|
+
version: str
|
|
88
|
+
metal_core_version: str
|
|
89
|
+
def __init__(self, vendor: _Optional[_Union[SwitchOSVendor, str]] = ..., version: _Optional[str] = ..., metal_core_version: _Optional[str] = ...) -> None: ...
|
|
90
|
+
|
|
91
|
+
class SwitchNic(_message.Message):
|
|
92
|
+
__slots__ = ("name", "identifier", "mac_address", "vrf", "actual", "bgp_filter", "bgp_port_state")
|
|
93
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
94
|
+
IDENTIFIER_FIELD_NUMBER: _ClassVar[int]
|
|
95
|
+
MAC_ADDRESS_FIELD_NUMBER: _ClassVar[int]
|
|
96
|
+
VRF_FIELD_NUMBER: _ClassVar[int]
|
|
97
|
+
ACTUAL_FIELD_NUMBER: _ClassVar[int]
|
|
98
|
+
BGP_FILTER_FIELD_NUMBER: _ClassVar[int]
|
|
99
|
+
BGP_PORT_STATE_FIELD_NUMBER: _ClassVar[int]
|
|
100
|
+
name: str
|
|
101
|
+
identifier: str
|
|
102
|
+
mac_address: str
|
|
103
|
+
vrf: str
|
|
104
|
+
actual: SwitchPortStatus
|
|
105
|
+
bgp_filter: BGPFilter
|
|
106
|
+
bgp_port_state: SwitchBGPPortState
|
|
107
|
+
def __init__(self, name: _Optional[str] = ..., identifier: _Optional[str] = ..., mac_address: _Optional[str] = ..., vrf: _Optional[str] = ..., actual: _Optional[_Union[SwitchPortStatus, str]] = ..., bgp_filter: _Optional[_Union[BGPFilter, _Mapping]] = ..., bgp_port_state: _Optional[_Union[SwitchBGPPortState, _Mapping]] = ...) -> None: ...
|
|
108
|
+
|
|
109
|
+
class BGPFilter(_message.Message):
|
|
110
|
+
__slots__ = ("cidrs", "vnis")
|
|
111
|
+
CIDRS_FIELD_NUMBER: _ClassVar[int]
|
|
112
|
+
VNIS_FIELD_NUMBER: _ClassVar[int]
|
|
113
|
+
cidrs: _containers.RepeatedScalarFieldContainer[str]
|
|
114
|
+
vnis: _containers.RepeatedScalarFieldContainer[str]
|
|
115
|
+
def __init__(self, cidrs: _Optional[_Iterable[str]] = ..., vnis: _Optional[_Iterable[str]] = ...) -> None: ...
|
|
116
|
+
|
|
117
|
+
class SwitchBGPPortState(_message.Message):
|
|
118
|
+
__slots__ = ("neighbor", "peer_group", "vrf_name", "bgp_state", "bgp_timer_up_established", "sent_prefix_counter", "accepted_prefix_counter")
|
|
119
|
+
NEIGHBOR_FIELD_NUMBER: _ClassVar[int]
|
|
120
|
+
PEER_GROUP_FIELD_NUMBER: _ClassVar[int]
|
|
121
|
+
VRF_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
122
|
+
BGP_STATE_FIELD_NUMBER: _ClassVar[int]
|
|
123
|
+
BGP_TIMER_UP_ESTABLISHED_FIELD_NUMBER: _ClassVar[int]
|
|
124
|
+
SENT_PREFIX_COUNTER_FIELD_NUMBER: _ClassVar[int]
|
|
125
|
+
ACCEPTED_PREFIX_COUNTER_FIELD_NUMBER: _ClassVar[int]
|
|
126
|
+
neighbor: str
|
|
127
|
+
peer_group: str
|
|
128
|
+
vrf_name: str
|
|
129
|
+
bgp_state: BGPState
|
|
130
|
+
bgp_timer_up_established: _duration_pb2.Duration
|
|
131
|
+
sent_prefix_counter: int
|
|
132
|
+
accepted_prefix_counter: int
|
|
133
|
+
def __init__(self, neighbor: _Optional[str] = ..., peer_group: _Optional[str] = ..., vrf_name: _Optional[str] = ..., bgp_state: _Optional[_Union[BGPState, str]] = ..., bgp_timer_up_established: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., sent_prefix_counter: _Optional[int] = ..., accepted_prefix_counter: _Optional[int] = ...) -> None: ...
|
metalstack/client/client.py
CHANGED
|
@@ -26,6 +26,7 @@ import metalstack.api.v2.user_connecpy as api_user_connecpy
|
|
|
26
26
|
import metalstack.api.v2.version_connecpy as api_version_connecpy
|
|
27
27
|
|
|
28
28
|
import metalstack.infra.v2.bmc_connecpy as infra_bmc_connecpy
|
|
29
|
+
import metalstack.infra.v2.switch_connecpy as infra_switch_connecpy
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
@@ -137,4 +138,7 @@ class Client:
|
|
|
137
138
|
def bmc(self):
|
|
138
139
|
return infra_bmc_connecpy.BMCServiceClient(address=self._baseurl, session=self._session)
|
|
139
140
|
|
|
141
|
+
def switch(self):
|
|
142
|
+
return infra_switch_connecpy.SwitchServiceClient(address=self._baseurl, session=self._session)
|
|
143
|
+
|
|
140
144
|
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by https://github.com/i2y/connecpy/protoc-gen-connecpy. DO NOT EDIT!
|
|
3
|
+
# source: metalstack/infra/v2/switch.proto
|
|
4
|
+
|
|
5
|
+
from typing import Optional, Protocol, Union
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from connecpy.async_client import AsyncConnecpyClient
|
|
10
|
+
from connecpy.base import Endpoint
|
|
11
|
+
from connecpy.server import ConnecpyServer
|
|
12
|
+
from connecpy.client import ConnecpyClient
|
|
13
|
+
from connecpy.context import ClientContext, ServiceContext
|
|
14
|
+
import metalstack.infra.v2.switch_pb2 as metalstack_dot_infra_dot_v2_dot_switch__pb2
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SwitchService(Protocol):
|
|
18
|
+
async def Register(self, req: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: ...
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class SwitchServiceServer(ConnecpyServer):
|
|
22
|
+
def __init__(self, *, service: SwitchService, server_path_prefix=""):
|
|
23
|
+
super().__init__()
|
|
24
|
+
self._prefix = f"{server_path_prefix}/metalstack.infra.v2.SwitchService"
|
|
25
|
+
self._endpoints = {
|
|
26
|
+
"Register": Endpoint[metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse](
|
|
27
|
+
service_name="SwitchService",
|
|
28
|
+
name="Register",
|
|
29
|
+
function=getattr(service, "Register"),
|
|
30
|
+
input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
|
|
31
|
+
output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
|
|
32
|
+
allowed_methods=("POST",),
|
|
33
|
+
),
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
def serviceName(self):
|
|
37
|
+
return "metalstack.infra.v2.SwitchService"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class SwitchServiceSync(Protocol):
|
|
41
|
+
def Register(self, req: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, ctx: ServiceContext) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse: ...
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class SwitchServiceServerSync(ConnecpyServer):
|
|
45
|
+
def __init__(self, *, service: SwitchServiceSync, server_path_prefix=""):
|
|
46
|
+
super().__init__()
|
|
47
|
+
self._prefix = f"{server_path_prefix}/metalstack.infra.v2.SwitchService"
|
|
48
|
+
self._endpoints = {
|
|
49
|
+
"Register": Endpoint[metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest, metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse](
|
|
50
|
+
service_name="SwitchService",
|
|
51
|
+
name="Register",
|
|
52
|
+
function=getattr(service, "Register"),
|
|
53
|
+
input=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
|
|
54
|
+
output=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
|
|
55
|
+
allowed_methods=("POST",),
|
|
56
|
+
),
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
def serviceName(self):
|
|
60
|
+
return "metalstack.infra.v2.SwitchService"
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class SwitchServiceClient(ConnecpyClient):
|
|
64
|
+
def Register(
|
|
65
|
+
self,
|
|
66
|
+
request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
|
|
67
|
+
*,
|
|
68
|
+
ctx: Optional[ClientContext] = None,
|
|
69
|
+
server_path_prefix: str = "",
|
|
70
|
+
**kwargs,
|
|
71
|
+
) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse:
|
|
72
|
+
method = "POST"
|
|
73
|
+
return self._make_request(
|
|
74
|
+
url=f"{server_path_prefix}/metalstack.infra.v2.SwitchService/Register",
|
|
75
|
+
ctx=ctx,
|
|
76
|
+
request=request,
|
|
77
|
+
response_class=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
|
|
78
|
+
method=method,
|
|
79
|
+
**kwargs,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class AsyncSwitchServiceClient(AsyncConnecpyClient):
|
|
84
|
+
async def Register(
|
|
85
|
+
self,
|
|
86
|
+
request: metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest,
|
|
87
|
+
*,
|
|
88
|
+
ctx: Optional[ClientContext] = None,
|
|
89
|
+
server_path_prefix: str = "",
|
|
90
|
+
session: Union[httpx.AsyncClient, None] = None,
|
|
91
|
+
**kwargs,
|
|
92
|
+
) -> metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse:
|
|
93
|
+
method = "POST"
|
|
94
|
+
return await self._make_request(
|
|
95
|
+
url=f"{server_path_prefix}/metalstack.infra.v2.SwitchService/Register",
|
|
96
|
+
ctx=ctx,
|
|
97
|
+
request=request,
|
|
98
|
+
response_class=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse,
|
|
99
|
+
method=method,
|
|
100
|
+
session=session,
|
|
101
|
+
**kwargs,
|
|
102
|
+
)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: metalstack/infra/v2/switch.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'metalstack/infra/v2/switch.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2
|
|
26
|
+
from metalstack.api.v2 import switch_pb2 as metalstack_dot_api_dot_v2_dot_switch__pb2
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n metalstack/infra/v2/switch.proto\x12\x13metalstack.infra.v2\x1a\x1emetalstack/api/v2/common.proto\x1a\x1emetalstack/api/v2/switch.proto\"Q\n\x1cSwitchServiceRegisterRequest\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"R\n\x1dSwitchServiceRegisterResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch2\x8e\x01\n\rSwitchService\x12}\n\x08Register\x12\x31.metalstack.infra.v2.SwitchServiceRegisterRequest\x1a\x32.metalstack.infra.v2.SwitchServiceRegisterResponse\"\n\xe0\xf3\x18\x02\xea\xf3\x18\x02\x01\x02\x42\xcf\x01\n\x17\x63om.metalstack.infra.v2B\x0bSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\xa2\x02\x03MIX\xaa\x02\x13Metalstack.Infra.V2\xca\x02\x13Metalstack\\Infra\\V2\xe2\x02\x1fMetalstack\\Infra\\V2\\GPBMetadata\xea\x02\x15Metalstack::Infra::V2b\x06proto3')
|
|
30
|
+
|
|
31
|
+
_globals = globals()
|
|
32
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
33
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'metalstack.infra.v2.switch_pb2', _globals)
|
|
34
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
35
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
36
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\027com.metalstack.infra.v2B\013SwitchProtoP\001Z9github.com/metal-stack/api/go/metalstack/infra/v2;infrav2\242\002\003MIX\252\002\023Metalstack.Infra.V2\312\002\023Metalstack\\Infra\\V2\342\002\037Metalstack\\Infra\\V2\\GPBMetadata\352\002\025Metalstack::Infra::V2'
|
|
37
|
+
_globals['_SWITCHSERVICE'].methods_by_name['Register']._loaded_options = None
|
|
38
|
+
_globals['_SWITCHSERVICE'].methods_by_name['Register']._serialized_options = b'\340\363\030\002\352\363\030\002\001\002'
|
|
39
|
+
_globals['_SWITCHSERVICEREGISTERREQUEST']._serialized_start=121
|
|
40
|
+
_globals['_SWITCHSERVICEREGISTERREQUEST']._serialized_end=202
|
|
41
|
+
_globals['_SWITCHSERVICEREGISTERRESPONSE']._serialized_start=204
|
|
42
|
+
_globals['_SWITCHSERVICEREGISTERRESPONSE']._serialized_end=286
|
|
43
|
+
_globals['_SWITCHSERVICE']._serialized_start=289
|
|
44
|
+
_globals['_SWITCHSERVICE']._serialized_end=431
|
|
45
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from metalstack.api.v2 import common_pb2 as _common_pb2
|
|
2
|
+
from metalstack.api.v2 import switch_pb2 as _switch_pb2
|
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
|
4
|
+
from google.protobuf import message as _message
|
|
5
|
+
from collections.abc import Mapping as _Mapping
|
|
6
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
7
|
+
|
|
8
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
9
|
+
|
|
10
|
+
class SwitchServiceRegisterRequest(_message.Message):
|
|
11
|
+
__slots__ = ("switch",)
|
|
12
|
+
SWITCH_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
switch: _switch_pb2.Switch
|
|
14
|
+
def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ...
|
|
15
|
+
|
|
16
|
+
class SwitchServiceRegisterResponse(_message.Message):
|
|
17
|
+
__slots__ = ("switch",)
|
|
18
|
+
SWITCH_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
switch: _switch_pb2.Switch
|
|
20
|
+
def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from metalstack.infra.v2 import switch_pb2 as metalstack_dot_infra_dot_v2_dot_switch__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SwitchServiceStub(object):
|
|
9
|
+
"""SwitchService serves switch related functions
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, channel):
|
|
13
|
+
"""Constructor.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
channel: A grpc.Channel.
|
|
17
|
+
"""
|
|
18
|
+
self.Register = channel.unary_unary(
|
|
19
|
+
'/metalstack.infra.v2.SwitchService/Register',
|
|
20
|
+
request_serializer=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest.SerializeToString,
|
|
21
|
+
response_deserializer=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse.FromString,
|
|
22
|
+
_registered_method=True)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SwitchServiceServicer(object):
|
|
26
|
+
"""SwitchService serves switch related functions
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def Register(self, request, context):
|
|
30
|
+
"""Register a switch
|
|
31
|
+
"""
|
|
32
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
33
|
+
context.set_details('Method not implemented!')
|
|
34
|
+
raise NotImplementedError('Method not implemented!')
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def add_SwitchServiceServicer_to_server(servicer, server):
|
|
38
|
+
rpc_method_handlers = {
|
|
39
|
+
'Register': grpc.unary_unary_rpc_method_handler(
|
|
40
|
+
servicer.Register,
|
|
41
|
+
request_deserializer=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest.FromString,
|
|
42
|
+
response_serializer=metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse.SerializeToString,
|
|
43
|
+
),
|
|
44
|
+
}
|
|
45
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
46
|
+
'metalstack.infra.v2.SwitchService', rpc_method_handlers)
|
|
47
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
48
|
+
server.add_registered_method_handlers('metalstack.infra.v2.SwitchService', rpc_method_handlers)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# This class is part of an EXPERIMENTAL API.
|
|
52
|
+
class SwitchService(object):
|
|
53
|
+
"""SwitchService serves switch related functions
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
@staticmethod
|
|
57
|
+
def Register(request,
|
|
58
|
+
target,
|
|
59
|
+
options=(),
|
|
60
|
+
channel_credentials=None,
|
|
61
|
+
call_credentials=None,
|
|
62
|
+
insecure=False,
|
|
63
|
+
compression=None,
|
|
64
|
+
wait_for_ready=None,
|
|
65
|
+
timeout=None,
|
|
66
|
+
metadata=None):
|
|
67
|
+
return grpc.experimental.unary_unary(
|
|
68
|
+
request,
|
|
69
|
+
target,
|
|
70
|
+
'/metalstack.infra.v2.SwitchService/Register',
|
|
71
|
+
metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterRequest.SerializeToString,
|
|
72
|
+
metalstack_dot_infra_dot_v2_dot_switch__pb2.SwitchServiceRegisterResponse.FromString,
|
|
73
|
+
options,
|
|
74
|
+
channel_credentials,
|
|
75
|
+
insecure,
|
|
76
|
+
call_credentials,
|
|
77
|
+
compression,
|
|
78
|
+
wait_for_ready,
|
|
79
|
+
timeout,
|
|
80
|
+
metadata,
|
|
81
|
+
_registered_method=True)
|
|
File without changes
|
|
File without changes
|