+ -
+ MSwitchServiceConnectedMachinesRequest
+
+
+ -
+ MSwitchServiceConnectedMachinesResponse
+
+
-
MSwitchServiceDeleteRequest
@@ -12798,6 +12814,107 @@
+
+ SwitchNicWithMachine associates a switch port with its connected machine.
+
+
+
+
+ | Field | Type | Label | Description |
+
+
+
+
+ | nic |
+ SwitchNic |
+ |
+ Nic is the switch nic the machine is connected to. |
+
+
+
+ | uuid |
+ string |
+ |
+ Uuid of the machine. |
+
+
+
+ | size |
+ string |
+ |
+ Size of the machine. |
+
+
+
+ | allocation_hostname |
+ string |
+ |
+ AllocationHostname if machine is allocated. |
+
+
+
+ | vpn_connected |
+ bool |
+ |
+ VpnConnected indicated whether the machine is connected to a VPN. |
+
+
+
+ | fru_product_serial |
+ string |
+ |
+ FruProductSerial of the machine. |
+
+
+
+ | fru_chassis_part_serial |
+ string |
+ |
+ FruChassisPartSerial of the machine. |
+
+
+
+ | liveliness |
+ MachineLiveliness |
+ |
+ Liveliness of the machine. |
+
+
+
+ | state |
+ MachineState |
+ |
+ State of the machine. |
+
+
+
+ | failed_reclaim |
+ bool |
+ |
+ FailedReclaim is true if the machine failed to return to the waiting machines pool after deletion. |
+
+
+
+ | crashloop |
+ bool |
+ |
+ Crashloop is true if there was an unexpected event in the provisioning cycle. |
+
+
+
+ | last_error_event_time |
+ google.protobuf.Timestamp |
+ |
+ LastErrorEventTime in case some error happened in the past. |
+
+
+
+
+
+
+
+
+
SwitchOS holds information about the NOS and versions running on the switch.
@@ -12950,6 +13067,51 @@
+
+ SwitchWithMachines contains a mapping from switch ports to connected machines.
+
+
+
+
+ | Field | Type | Label | Description |
+
+
+
+
+ | id |
+ string |
+ |
+ Id of the switch. |
+
+
+
+ | partition |
+ string |
+ |
+ Partition of the switch. |
+
+
+
+ | rack |
+ string |
+ |
+ Rack of the switch. |
+
+
+
+ | connections |
+ SwitchNicWithMachine |
+ repeated |
+ Connections associates switch ports with the machines connected to them. |
+
+
+
+
+
+
+
+
+
@@ -13110,6 +13272,61 @@ <
+
+ SwitchServiceConnectedMachinesRequest.
+
+
+
+
+
+
+
+
+
+ SwitchServiceConnectedMachinesResponse.
+
+
+
+
+ | Field | Type | Label | Description |
+
+
+
+
+ | switches_with_machines |
+ metalstack.api.v2.SwitchWithMachines |
+ repeated |
+ SwitchesWithMachines contains all switches with their machine connections. |
+
+
+
+
+
+
+
+
+
SwitchServiceDeleteRequest.
@@ -13546,6 +13763,13 @@
Port set the port status of a switch port. |
+
+ | ConnectedMachines |
+ SwitchServiceConnectedMachinesRequest |
+ SwitchServiceConnectedMachinesResponse |
+ ConnectedMachines lists all switches with their machine connections. |
+
+
diff --git a/go/metalstack/admin/v2/adminv2connect/switch.connect.go b/go/metalstack/admin/v2/adminv2connect/switch.connect.go
index 8ccc39e2..d83fc052 100644
--- a/go/metalstack/admin/v2/adminv2connect/switch.connect.go
+++ b/go/metalstack/admin/v2/adminv2connect/switch.connect.go
@@ -45,6 +45,9 @@ const (
SwitchServiceMigrateProcedure = "/metalstack.admin.v2.SwitchService/Migrate"
// SwitchServicePortProcedure is the fully-qualified name of the SwitchService's Port RPC.
SwitchServicePortProcedure = "/metalstack.admin.v2.SwitchService/Port"
+ // SwitchServiceConnectedMachinesProcedure is the fully-qualified name of the SwitchService's
+ // ConnectedMachines RPC.
+ SwitchServiceConnectedMachinesProcedure = "/metalstack.admin.v2.SwitchService/ConnectedMachines"
)
// SwitchServiceClient is a client for the metalstack.admin.v2.SwitchService service.
@@ -61,6 +64,8 @@ type SwitchServiceClient interface {
Migrate(context.Context, *v2.SwitchServiceMigrateRequest) (*v2.SwitchServiceMigrateResponse, error)
// Port set the port status of a switch port.
Port(context.Context, *v2.SwitchServicePortRequest) (*v2.SwitchServicePortResponse, error)
+ // ConnectedMachines lists all switches with their machine connections.
+ ConnectedMachines(context.Context, *v2.SwitchServiceConnectedMachinesRequest) (*v2.SwitchServiceConnectedMachinesResponse, error)
}
// NewSwitchServiceClient constructs a client for the metalstack.admin.v2.SwitchService service. By
@@ -110,17 +115,24 @@ func NewSwitchServiceClient(httpClient connect.HTTPClient, baseURL string, opts
connect.WithSchema(switchServiceMethods.ByName("Port")),
connect.WithClientOptions(opts...),
),
+ connectedMachines: connect.NewClient[v2.SwitchServiceConnectedMachinesRequest, v2.SwitchServiceConnectedMachinesResponse](
+ httpClient,
+ baseURL+SwitchServiceConnectedMachinesProcedure,
+ connect.WithSchema(switchServiceMethods.ByName("ConnectedMachines")),
+ connect.WithClientOptions(opts...),
+ ),
}
}
// switchServiceClient implements SwitchServiceClient.
type switchServiceClient struct {
- get *connect.Client[v2.SwitchServiceGetRequest, v2.SwitchServiceGetResponse]
- list *connect.Client[v2.SwitchServiceListRequest, v2.SwitchServiceListResponse]
- update *connect.Client[v2.SwitchServiceUpdateRequest, v2.SwitchServiceUpdateResponse]
- delete *connect.Client[v2.SwitchServiceDeleteRequest, v2.SwitchServiceDeleteResponse]
- migrate *connect.Client[v2.SwitchServiceMigrateRequest, v2.SwitchServiceMigrateResponse]
- port *connect.Client[v2.SwitchServicePortRequest, v2.SwitchServicePortResponse]
+ get *connect.Client[v2.SwitchServiceGetRequest, v2.SwitchServiceGetResponse]
+ list *connect.Client[v2.SwitchServiceListRequest, v2.SwitchServiceListResponse]
+ update *connect.Client[v2.SwitchServiceUpdateRequest, v2.SwitchServiceUpdateResponse]
+ delete *connect.Client[v2.SwitchServiceDeleteRequest, v2.SwitchServiceDeleteResponse]
+ migrate *connect.Client[v2.SwitchServiceMigrateRequest, v2.SwitchServiceMigrateResponse]
+ port *connect.Client[v2.SwitchServicePortRequest, v2.SwitchServicePortResponse]
+ connectedMachines *connect.Client[v2.SwitchServiceConnectedMachinesRequest, v2.SwitchServiceConnectedMachinesResponse]
}
// Get calls metalstack.admin.v2.SwitchService.Get.
@@ -177,6 +189,15 @@ func (c *switchServiceClient) Port(ctx context.Context, req *v2.SwitchServicePor
return nil, err
}
+// ConnectedMachines calls metalstack.admin.v2.SwitchService.ConnectedMachines.
+func (c *switchServiceClient) ConnectedMachines(ctx context.Context, req *v2.SwitchServiceConnectedMachinesRequest) (*v2.SwitchServiceConnectedMachinesResponse, error) {
+ response, err := c.connectedMachines.CallUnary(ctx, connect.NewRequest(req))
+ if response != nil {
+ return response.Msg, err
+ }
+ return nil, err
+}
+
// SwitchServiceHandler is an implementation of the metalstack.admin.v2.SwitchService service.
type SwitchServiceHandler interface {
// Get a switch by ID.
@@ -191,6 +212,8 @@ type SwitchServiceHandler interface {
Migrate(context.Context, *v2.SwitchServiceMigrateRequest) (*v2.SwitchServiceMigrateResponse, error)
// Port set the port status of a switch port.
Port(context.Context, *v2.SwitchServicePortRequest) (*v2.SwitchServicePortResponse, error)
+ // ConnectedMachines lists all switches with their machine connections.
+ ConnectedMachines(context.Context, *v2.SwitchServiceConnectedMachinesRequest) (*v2.SwitchServiceConnectedMachinesResponse, error)
}
// NewSwitchServiceHandler builds an HTTP handler from the service implementation. It returns the
@@ -236,6 +259,12 @@ func NewSwitchServiceHandler(svc SwitchServiceHandler, opts ...connect.HandlerOp
connect.WithSchema(switchServiceMethods.ByName("Port")),
connect.WithHandlerOptions(opts...),
)
+ switchServiceConnectedMachinesHandler := connect.NewUnaryHandlerSimple(
+ SwitchServiceConnectedMachinesProcedure,
+ svc.ConnectedMachines,
+ connect.WithSchema(switchServiceMethods.ByName("ConnectedMachines")),
+ connect.WithHandlerOptions(opts...),
+ )
return "/metalstack.admin.v2.SwitchService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case SwitchServiceGetProcedure:
@@ -250,6 +279,8 @@ func NewSwitchServiceHandler(svc SwitchServiceHandler, opts ...connect.HandlerOp
switchServiceMigrateHandler.ServeHTTP(w, r)
case SwitchServicePortProcedure:
switchServicePortHandler.ServeHTTP(w, r)
+ case SwitchServiceConnectedMachinesProcedure:
+ switchServiceConnectedMachinesHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
@@ -282,3 +313,7 @@ func (UnimplementedSwitchServiceHandler) Migrate(context.Context, *v2.SwitchServ
func (UnimplementedSwitchServiceHandler) Port(context.Context, *v2.SwitchServicePortRequest) (*v2.SwitchServicePortResponse, error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.admin.v2.SwitchService.Port is not implemented"))
}
+
+func (UnimplementedSwitchServiceHandler) ConnectedMachines(context.Context, *v2.SwitchServiceConnectedMachinesRequest) (*v2.SwitchServiceConnectedMachinesResponse, error) {
+ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("metalstack.admin.v2.SwitchService.ConnectedMachines is not implemented"))
+}
diff --git a/go/metalstack/admin/v2/switch.pb.go b/go/metalstack/admin/v2/switch.pb.go
index 4b4eee5d..c5445478 100644
--- a/go/metalstack/admin/v2/switch.pb.go
+++ b/go/metalstack/admin/v2/switch.pb.go
@@ -694,11 +694,112 @@ func (x *SwitchServicePortResponse) GetSwitch() *v2.Switch {
return nil
}
+// SwitchServiceConnectedMachinesRequest.
+type SwitchServiceConnectedMachinesRequest struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Query to filter the switch results.
+ Query *v2.SwitchQuery `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
+ // MachineQuery to filter the machine results.
+ MachineQuery *v2.MachineQuery `protobuf:"bytes,2,opt,name=machine_query,json=machineQuery,proto3" json:"machine_query,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SwitchServiceConnectedMachinesRequest) Reset() {
+ *x = SwitchServiceConnectedMachinesRequest{}
+ mi := &file_metalstack_admin_v2_switch_proto_msgTypes[12]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SwitchServiceConnectedMachinesRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SwitchServiceConnectedMachinesRequest) ProtoMessage() {}
+
+func (x *SwitchServiceConnectedMachinesRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_metalstack_admin_v2_switch_proto_msgTypes[12]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SwitchServiceConnectedMachinesRequest.ProtoReflect.Descriptor instead.
+func (*SwitchServiceConnectedMachinesRequest) Descriptor() ([]byte, []int) {
+ return file_metalstack_admin_v2_switch_proto_rawDescGZIP(), []int{12}
+}
+
+func (x *SwitchServiceConnectedMachinesRequest) GetQuery() *v2.SwitchQuery {
+ if x != nil {
+ return x.Query
+ }
+ return nil
+}
+
+func (x *SwitchServiceConnectedMachinesRequest) GetMachineQuery() *v2.MachineQuery {
+ if x != nil {
+ return x.MachineQuery
+ }
+ return nil
+}
+
+// SwitchServiceConnectedMachinesResponse.
+type SwitchServiceConnectedMachinesResponse struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // SwitchesWithMachines contains all switches with their machine connections.
+ SwitchesWithMachines []*v2.SwitchWithMachines `protobuf:"bytes,1,rep,name=switches_with_machines,json=switchesWithMachines,proto3" json:"switches_with_machines,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SwitchServiceConnectedMachinesResponse) Reset() {
+ *x = SwitchServiceConnectedMachinesResponse{}
+ mi := &file_metalstack_admin_v2_switch_proto_msgTypes[13]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SwitchServiceConnectedMachinesResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SwitchServiceConnectedMachinesResponse) ProtoMessage() {}
+
+func (x *SwitchServiceConnectedMachinesResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_metalstack_admin_v2_switch_proto_msgTypes[13]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SwitchServiceConnectedMachinesResponse.ProtoReflect.Descriptor instead.
+func (*SwitchServiceConnectedMachinesResponse) Descriptor() ([]byte, []int) {
+ return file_metalstack_admin_v2_switch_proto_rawDescGZIP(), []int{13}
+}
+
+func (x *SwitchServiceConnectedMachinesResponse) GetSwitchesWithMachines() []*v2.SwitchWithMachines {
+ if x != nil {
+ return x.SwitchesWithMachines
+ }
+ return nil
+}
+
var File_metalstack_admin_v2_switch_proto protoreflect.FileDescriptor
const file_metalstack_admin_v2_switch_proto_rawDesc = "" +
"\n" +
- " metalstack/admin/v2/switch.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto\"8\n" +
+ " metalstack/admin/v2/switch.proto\x12\x13metalstack.admin.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto\"8\n" +
"\x17SwitchServiceGetRequest\x12\x1d\n" +
"\x02id\x18\x01 \x01(\tB\r\xbaH\n" +
"r\b\xc0\xb3\xae\xb1\x02\x01h\x01R\x02id\"M\n" +
@@ -752,7 +853,12 @@ const file_metalstack_admin_v2_switch_proto_rawDesc = "" +
"\bnic_name\x18\x02 \x01(\tB\v\xbaH\br\x06\xc0\xb3\xae\xb1\x02\x01R\anicName\x12E\n" +
"\x06status\x18\x03 \x01(\x0e2#.metalstack.api.v2.SwitchPortStatusB\b\xbaH\x05\x82\x01\x02\x10\x01R\x06status\"N\n" +
"\x19SwitchServicePortResponse\x121\n" +
- "\x06switch\x18\x01 \x01(\v2\x19.metalstack.api.v2.SwitchR\x06switch2\xbf\x05\n" +
+ "\x06switch\x18\x01 \x01(\v2\x19.metalstack.api.v2.SwitchR\x06switch\"\xa3\x01\n" +
+ "%SwitchServiceConnectedMachinesRequest\x124\n" +
+ "\x05query\x18\x01 \x01(\v2\x1e.metalstack.api.v2.SwitchQueryR\x05query\x12D\n" +
+ "\rmachine_query\x18\x02 \x01(\v2\x1f.metalstack.api.v2.MachineQueryR\fmachineQuery\"\x85\x01\n" +
+ "&SwitchServiceConnectedMachinesResponse\x12[\n" +
+ "\x16switches_with_machines\x18\x01 \x03(\v2%.metalstack.api.v2.SwitchWithMachinesR\x14switchesWithMachines2\xda\x06\n" +
"\rSwitchService\x12n\n" +
"\x03Get\x12,.metalstack.admin.v2.SwitchServiceGetRequest\x1a-.metalstack.admin.v2.SwitchServiceGetResponse\"\n" +
"\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12q\n" +
@@ -761,7 +867,9 @@ const file_metalstack_admin_v2_switch_proto_rawDesc = "" +
"\x06Update\x12/.metalstack.admin.v2.SwitchServiceUpdateRequest\x1a0.metalstack.admin.v2.SwitchServiceUpdateResponse\"\x05\xd2\xf3\x18\x01\x01\x12r\n" +
"\x06Delete\x12/.metalstack.admin.v2.SwitchServiceDeleteRequest\x1a0.metalstack.admin.v2.SwitchServiceDeleteResponse\"\x05\xd2\xf3\x18\x01\x01\x12u\n" +
"\aMigrate\x120.metalstack.admin.v2.SwitchServiceMigrateRequest\x1a1.metalstack.admin.v2.SwitchServiceMigrateResponse\"\x05\xd2\xf3\x18\x01\x01\x12l\n" +
- "\x04Port\x12-.metalstack.admin.v2.SwitchServicePortRequest\x1a..metalstack.admin.v2.SwitchServicePortResponse\"\x05\xd2\xf3\x18\x01\x01B\xcf\x01\n" +
+ "\x04Port\x12-.metalstack.admin.v2.SwitchServicePortRequest\x1a..metalstack.admin.v2.SwitchServicePortResponse\"\x05\xd2\xf3\x18\x01\x01\x12\x98\x01\n" +
+ "\x11ConnectedMachines\x12:.metalstack.admin.v2.SwitchServiceConnectedMachinesRequest\x1a;.metalstack.admin.v2.SwitchServiceConnectedMachinesResponse\"\n" +
+ "\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02B\xcf\x01\n" +
"\x17com.metalstack.admin.v2B\vSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3"
var (
@@ -776,60 +884,69 @@ func file_metalstack_admin_v2_switch_proto_rawDescGZIP() []byte {
return file_metalstack_admin_v2_switch_proto_rawDescData
}
-var file_metalstack_admin_v2_switch_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
+var file_metalstack_admin_v2_switch_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_metalstack_admin_v2_switch_proto_goTypes = []any{
- (*SwitchServiceGetRequest)(nil), // 0: metalstack.admin.v2.SwitchServiceGetRequest
- (*SwitchServiceGetResponse)(nil), // 1: metalstack.admin.v2.SwitchServiceGetResponse
- (*SwitchServiceListRequest)(nil), // 2: metalstack.admin.v2.SwitchServiceListRequest
- (*SwitchServiceListResponse)(nil), // 3: metalstack.admin.v2.SwitchServiceListResponse
- (*SwitchServiceUpdateRequest)(nil), // 4: metalstack.admin.v2.SwitchServiceUpdateRequest
- (*SwitchServiceUpdateResponse)(nil), // 5: metalstack.admin.v2.SwitchServiceUpdateResponse
- (*SwitchServiceDeleteRequest)(nil), // 6: metalstack.admin.v2.SwitchServiceDeleteRequest
- (*SwitchServiceDeleteResponse)(nil), // 7: metalstack.admin.v2.SwitchServiceDeleteResponse
- (*SwitchServiceMigrateRequest)(nil), // 8: metalstack.admin.v2.SwitchServiceMigrateRequest
- (*SwitchServiceMigrateResponse)(nil), // 9: metalstack.admin.v2.SwitchServiceMigrateResponse
- (*SwitchServicePortRequest)(nil), // 10: metalstack.admin.v2.SwitchServicePortRequest
- (*SwitchServicePortResponse)(nil), // 11: metalstack.admin.v2.SwitchServicePortResponse
- (*v2.Switch)(nil), // 12: metalstack.api.v2.Switch
- (*v2.SwitchQuery)(nil), // 13: metalstack.api.v2.SwitchQuery
- (*v2.UpdateMeta)(nil), // 14: metalstack.api.v2.UpdateMeta
- (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp
- (v2.SwitchReplaceMode)(0), // 16: metalstack.api.v2.SwitchReplaceMode
- (*v2.SwitchNic)(nil), // 17: metalstack.api.v2.SwitchNic
- (*v2.SwitchOS)(nil), // 18: metalstack.api.v2.SwitchOS
- (v2.SwitchPortStatus)(0), // 19: metalstack.api.v2.SwitchPortStatus
+ (*SwitchServiceGetRequest)(nil), // 0: metalstack.admin.v2.SwitchServiceGetRequest
+ (*SwitchServiceGetResponse)(nil), // 1: metalstack.admin.v2.SwitchServiceGetResponse
+ (*SwitchServiceListRequest)(nil), // 2: metalstack.admin.v2.SwitchServiceListRequest
+ (*SwitchServiceListResponse)(nil), // 3: metalstack.admin.v2.SwitchServiceListResponse
+ (*SwitchServiceUpdateRequest)(nil), // 4: metalstack.admin.v2.SwitchServiceUpdateRequest
+ (*SwitchServiceUpdateResponse)(nil), // 5: metalstack.admin.v2.SwitchServiceUpdateResponse
+ (*SwitchServiceDeleteRequest)(nil), // 6: metalstack.admin.v2.SwitchServiceDeleteRequest
+ (*SwitchServiceDeleteResponse)(nil), // 7: metalstack.admin.v2.SwitchServiceDeleteResponse
+ (*SwitchServiceMigrateRequest)(nil), // 8: metalstack.admin.v2.SwitchServiceMigrateRequest
+ (*SwitchServiceMigrateResponse)(nil), // 9: metalstack.admin.v2.SwitchServiceMigrateResponse
+ (*SwitchServicePortRequest)(nil), // 10: metalstack.admin.v2.SwitchServicePortRequest
+ (*SwitchServicePortResponse)(nil), // 11: metalstack.admin.v2.SwitchServicePortResponse
+ (*SwitchServiceConnectedMachinesRequest)(nil), // 12: metalstack.admin.v2.SwitchServiceConnectedMachinesRequest
+ (*SwitchServiceConnectedMachinesResponse)(nil), // 13: metalstack.admin.v2.SwitchServiceConnectedMachinesResponse
+ (*v2.Switch)(nil), // 14: metalstack.api.v2.Switch
+ (*v2.SwitchQuery)(nil), // 15: metalstack.api.v2.SwitchQuery
+ (*v2.UpdateMeta)(nil), // 16: metalstack.api.v2.UpdateMeta
+ (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp
+ (v2.SwitchReplaceMode)(0), // 18: metalstack.api.v2.SwitchReplaceMode
+ (*v2.SwitchNic)(nil), // 19: metalstack.api.v2.SwitchNic
+ (*v2.SwitchOS)(nil), // 20: metalstack.api.v2.SwitchOS
+ (v2.SwitchPortStatus)(0), // 21: metalstack.api.v2.SwitchPortStatus
+ (*v2.MachineQuery)(nil), // 22: metalstack.api.v2.MachineQuery
+ (*v2.SwitchWithMachines)(nil), // 23: metalstack.api.v2.SwitchWithMachines
}
var file_metalstack_admin_v2_switch_proto_depIdxs = []int32{
- 12, // 0: metalstack.admin.v2.SwitchServiceGetResponse.switch:type_name -> metalstack.api.v2.Switch
- 13, // 1: metalstack.admin.v2.SwitchServiceListRequest.query:type_name -> metalstack.api.v2.SwitchQuery
- 12, // 2: metalstack.admin.v2.SwitchServiceListResponse.switches:type_name -> metalstack.api.v2.Switch
- 14, // 3: metalstack.admin.v2.SwitchServiceUpdateRequest.update_meta:type_name -> metalstack.api.v2.UpdateMeta
- 15, // 4: metalstack.admin.v2.SwitchServiceUpdateRequest.updated_at:type_name -> google.protobuf.Timestamp
- 16, // 5: metalstack.admin.v2.SwitchServiceUpdateRequest.replace_mode:type_name -> metalstack.api.v2.SwitchReplaceMode
- 17, // 6: metalstack.admin.v2.SwitchServiceUpdateRequest.nics:type_name -> metalstack.api.v2.SwitchNic
- 18, // 7: metalstack.admin.v2.SwitchServiceUpdateRequest.os:type_name -> metalstack.api.v2.SwitchOS
- 12, // 8: metalstack.admin.v2.SwitchServiceUpdateResponse.switch:type_name -> metalstack.api.v2.Switch
- 12, // 9: metalstack.admin.v2.SwitchServiceDeleteResponse.switch:type_name -> metalstack.api.v2.Switch
- 12, // 10: metalstack.admin.v2.SwitchServiceMigrateResponse.switch:type_name -> metalstack.api.v2.Switch
- 19, // 11: metalstack.admin.v2.SwitchServicePortRequest.status:type_name -> metalstack.api.v2.SwitchPortStatus
- 12, // 12: metalstack.admin.v2.SwitchServicePortResponse.switch:type_name -> metalstack.api.v2.Switch
- 0, // 13: metalstack.admin.v2.SwitchService.Get:input_type -> metalstack.admin.v2.SwitchServiceGetRequest
- 2, // 14: metalstack.admin.v2.SwitchService.List:input_type -> metalstack.admin.v2.SwitchServiceListRequest
- 4, // 15: metalstack.admin.v2.SwitchService.Update:input_type -> metalstack.admin.v2.SwitchServiceUpdateRequest
- 6, // 16: metalstack.admin.v2.SwitchService.Delete:input_type -> metalstack.admin.v2.SwitchServiceDeleteRequest
- 8, // 17: metalstack.admin.v2.SwitchService.Migrate:input_type -> metalstack.admin.v2.SwitchServiceMigrateRequest
- 10, // 18: metalstack.admin.v2.SwitchService.Port:input_type -> metalstack.admin.v2.SwitchServicePortRequest
- 1, // 19: metalstack.admin.v2.SwitchService.Get:output_type -> metalstack.admin.v2.SwitchServiceGetResponse
- 3, // 20: metalstack.admin.v2.SwitchService.List:output_type -> metalstack.admin.v2.SwitchServiceListResponse
- 5, // 21: metalstack.admin.v2.SwitchService.Update:output_type -> metalstack.admin.v2.SwitchServiceUpdateResponse
- 7, // 22: metalstack.admin.v2.SwitchService.Delete:output_type -> metalstack.admin.v2.SwitchServiceDeleteResponse
- 9, // 23: metalstack.admin.v2.SwitchService.Migrate:output_type -> metalstack.admin.v2.SwitchServiceMigrateResponse
- 11, // 24: metalstack.admin.v2.SwitchService.Port:output_type -> metalstack.admin.v2.SwitchServicePortResponse
- 19, // [19:25] is the sub-list for method output_type
- 13, // [13:19] is the sub-list for method input_type
- 13, // [13:13] is the sub-list for extension type_name
- 13, // [13:13] is the sub-list for extension extendee
- 0, // [0:13] is the sub-list for field type_name
+ 14, // 0: metalstack.admin.v2.SwitchServiceGetResponse.switch:type_name -> metalstack.api.v2.Switch
+ 15, // 1: metalstack.admin.v2.SwitchServiceListRequest.query:type_name -> metalstack.api.v2.SwitchQuery
+ 14, // 2: metalstack.admin.v2.SwitchServiceListResponse.switches:type_name -> metalstack.api.v2.Switch
+ 16, // 3: metalstack.admin.v2.SwitchServiceUpdateRequest.update_meta:type_name -> metalstack.api.v2.UpdateMeta
+ 17, // 4: metalstack.admin.v2.SwitchServiceUpdateRequest.updated_at:type_name -> google.protobuf.Timestamp
+ 18, // 5: metalstack.admin.v2.SwitchServiceUpdateRequest.replace_mode:type_name -> metalstack.api.v2.SwitchReplaceMode
+ 19, // 6: metalstack.admin.v2.SwitchServiceUpdateRequest.nics:type_name -> metalstack.api.v2.SwitchNic
+ 20, // 7: metalstack.admin.v2.SwitchServiceUpdateRequest.os:type_name -> metalstack.api.v2.SwitchOS
+ 14, // 8: metalstack.admin.v2.SwitchServiceUpdateResponse.switch:type_name -> metalstack.api.v2.Switch
+ 14, // 9: metalstack.admin.v2.SwitchServiceDeleteResponse.switch:type_name -> metalstack.api.v2.Switch
+ 14, // 10: metalstack.admin.v2.SwitchServiceMigrateResponse.switch:type_name -> metalstack.api.v2.Switch
+ 21, // 11: metalstack.admin.v2.SwitchServicePortRequest.status:type_name -> metalstack.api.v2.SwitchPortStatus
+ 14, // 12: metalstack.admin.v2.SwitchServicePortResponse.switch:type_name -> metalstack.api.v2.Switch
+ 15, // 13: metalstack.admin.v2.SwitchServiceConnectedMachinesRequest.query:type_name -> metalstack.api.v2.SwitchQuery
+ 22, // 14: metalstack.admin.v2.SwitchServiceConnectedMachinesRequest.machine_query:type_name -> metalstack.api.v2.MachineQuery
+ 23, // 15: metalstack.admin.v2.SwitchServiceConnectedMachinesResponse.switches_with_machines:type_name -> metalstack.api.v2.SwitchWithMachines
+ 0, // 16: metalstack.admin.v2.SwitchService.Get:input_type -> metalstack.admin.v2.SwitchServiceGetRequest
+ 2, // 17: metalstack.admin.v2.SwitchService.List:input_type -> metalstack.admin.v2.SwitchServiceListRequest
+ 4, // 18: metalstack.admin.v2.SwitchService.Update:input_type -> metalstack.admin.v2.SwitchServiceUpdateRequest
+ 6, // 19: metalstack.admin.v2.SwitchService.Delete:input_type -> metalstack.admin.v2.SwitchServiceDeleteRequest
+ 8, // 20: metalstack.admin.v2.SwitchService.Migrate:input_type -> metalstack.admin.v2.SwitchServiceMigrateRequest
+ 10, // 21: metalstack.admin.v2.SwitchService.Port:input_type -> metalstack.admin.v2.SwitchServicePortRequest
+ 12, // 22: metalstack.admin.v2.SwitchService.ConnectedMachines:input_type -> metalstack.admin.v2.SwitchServiceConnectedMachinesRequest
+ 1, // 23: metalstack.admin.v2.SwitchService.Get:output_type -> metalstack.admin.v2.SwitchServiceGetResponse
+ 3, // 24: metalstack.admin.v2.SwitchService.List:output_type -> metalstack.admin.v2.SwitchServiceListResponse
+ 5, // 25: metalstack.admin.v2.SwitchService.Update:output_type -> metalstack.admin.v2.SwitchServiceUpdateResponse
+ 7, // 26: metalstack.admin.v2.SwitchService.Delete:output_type -> metalstack.admin.v2.SwitchServiceDeleteResponse
+ 9, // 27: metalstack.admin.v2.SwitchService.Migrate:output_type -> metalstack.admin.v2.SwitchServiceMigrateResponse
+ 11, // 28: metalstack.admin.v2.SwitchService.Port:output_type -> metalstack.admin.v2.SwitchServicePortResponse
+ 13, // 29: metalstack.admin.v2.SwitchService.ConnectedMachines:output_type -> metalstack.admin.v2.SwitchServiceConnectedMachinesResponse
+ 23, // [23:30] is the sub-list for method output_type
+ 16, // [16:23] is the sub-list for method input_type
+ 16, // [16:16] is the sub-list for extension type_name
+ 16, // [16:16] is the sub-list for extension extendee
+ 0, // [0:16] is the sub-list for field type_name
}
func init() { file_metalstack_admin_v2_switch_proto_init() }
@@ -844,7 +961,7 @@ func file_metalstack_admin_v2_switch_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_metalstack_admin_v2_switch_proto_rawDesc), len(file_metalstack_admin_v2_switch_proto_rawDesc)),
NumEnums: 0,
- NumMessages: 12,
+ NumMessages: 14,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/go/metalstack/api/v2/switch.pb.go b/go/metalstack/api/v2/switch.pb.go
index e595f447..49744a23 100644
--- a/go/metalstack/api/v2/switch.pb.go
+++ b/go/metalstack/api/v2/switch.pb.go
@@ -1040,11 +1040,229 @@ func (x *SwitchSync) GetError() string {
return ""
}
+// SwitchWithMachines contains a mapping from switch ports to connected machines.
+type SwitchWithMachines struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Id of the switch.
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
+ // Partition of the switch.
+ Partition string `protobuf:"bytes,2,opt,name=partition,proto3" json:"partition,omitempty"`
+ // Rack of the switch.
+ Rack string `protobuf:"bytes,3,opt,name=rack,proto3" json:"rack,omitempty"`
+ // Connections associates switch ports with the machines connected to them.
+ Connections []*SwitchNicWithMachine `protobuf:"bytes,4,rep,name=connections,proto3" json:"connections,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SwitchWithMachines) Reset() {
+ *x = SwitchWithMachines{}
+ mi := &file_metalstack_api_v2_switch_proto_msgTypes[10]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SwitchWithMachines) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SwitchWithMachines) ProtoMessage() {}
+
+func (x *SwitchWithMachines) ProtoReflect() protoreflect.Message {
+ mi := &file_metalstack_api_v2_switch_proto_msgTypes[10]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SwitchWithMachines.ProtoReflect.Descriptor instead.
+func (*SwitchWithMachines) Descriptor() ([]byte, []int) {
+ return file_metalstack_api_v2_switch_proto_rawDescGZIP(), []int{10}
+}
+
+func (x *SwitchWithMachines) GetId() string {
+ if x != nil {
+ return x.Id
+ }
+ return ""
+}
+
+func (x *SwitchWithMachines) GetPartition() string {
+ if x != nil {
+ return x.Partition
+ }
+ return ""
+}
+
+func (x *SwitchWithMachines) GetRack() string {
+ if x != nil {
+ return x.Rack
+ }
+ return ""
+}
+
+func (x *SwitchWithMachines) GetConnections() []*SwitchNicWithMachine {
+ if x != nil {
+ return x.Connections
+ }
+ return nil
+}
+
+// SwitchNicWithMachine associates a switch port with its connected machine.
+type SwitchNicWithMachine struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // Nic is the switch nic the machine is connected to.
+ Nic *SwitchNic `protobuf:"bytes,1,opt,name=nic,proto3" json:"nic,omitempty"`
+ // Uuid of the machine.
+ Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
+ // Size of the machine.
+ Size string `protobuf:"bytes,3,opt,name=size,proto3" json:"size,omitempty"`
+ // AllocationHostname if machine is allocated.
+ AllocationHostname string `protobuf:"bytes,4,opt,name=allocation_hostname,json=allocationHostname,proto3" json:"allocation_hostname,omitempty"`
+ // VpnConnected indicated whether the machine is connected to a VPN.
+ VpnConnected bool `protobuf:"varint,5,opt,name=vpn_connected,json=vpnConnected,proto3" json:"vpn_connected,omitempty"`
+ // FruProductSerial of the machine.
+ FruProductSerial string `protobuf:"bytes,6,opt,name=fru_product_serial,json=fruProductSerial,proto3" json:"fru_product_serial,omitempty"`
+ // FruChassisPartSerial of the machine.
+ FruChassisPartSerial string `protobuf:"bytes,7,opt,name=fru_chassis_part_serial,json=fruChassisPartSerial,proto3" json:"fru_chassis_part_serial,omitempty"`
+ // Liveliness of the machine.
+ Liveliness MachineLiveliness `protobuf:"varint,8,opt,name=liveliness,proto3,enum=metalstack.api.v2.MachineLiveliness" json:"liveliness,omitempty"`
+ // State of the machine.
+ State MachineState `protobuf:"varint,9,opt,name=state,proto3,enum=metalstack.api.v2.MachineState" json:"state,omitempty"`
+ // FailedReclaim is true if the machine failed to return to the waiting machines pool after deletion.
+ FailedReclaim bool `protobuf:"varint,10,opt,name=failed_reclaim,json=failedReclaim,proto3" json:"failed_reclaim,omitempty"`
+ // Crashloop is true if there was an unexpected event in the provisioning cycle.
+ Crashloop bool `protobuf:"varint,11,opt,name=crashloop,proto3" json:"crashloop,omitempty"`
+ // LastErrorEventTime in case some error happened in the past.
+ LastErrorEventTime *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=last_error_event_time,json=lastErrorEventTime,proto3" json:"last_error_event_time,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *SwitchNicWithMachine) Reset() {
+ *x = SwitchNicWithMachine{}
+ mi := &file_metalstack_api_v2_switch_proto_msgTypes[11]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *SwitchNicWithMachine) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SwitchNicWithMachine) ProtoMessage() {}
+
+func (x *SwitchNicWithMachine) ProtoReflect() protoreflect.Message {
+ mi := &file_metalstack_api_v2_switch_proto_msgTypes[11]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SwitchNicWithMachine.ProtoReflect.Descriptor instead.
+func (*SwitchNicWithMachine) Descriptor() ([]byte, []int) {
+ return file_metalstack_api_v2_switch_proto_rawDescGZIP(), []int{11}
+}
+
+func (x *SwitchNicWithMachine) GetNic() *SwitchNic {
+ if x != nil {
+ return x.Nic
+ }
+ return nil
+}
+
+func (x *SwitchNicWithMachine) GetUuid() string {
+ if x != nil {
+ return x.Uuid
+ }
+ return ""
+}
+
+func (x *SwitchNicWithMachine) GetSize() string {
+ if x != nil {
+ return x.Size
+ }
+ return ""
+}
+
+func (x *SwitchNicWithMachine) GetAllocationHostname() string {
+ if x != nil {
+ return x.AllocationHostname
+ }
+ return ""
+}
+
+func (x *SwitchNicWithMachine) GetVpnConnected() bool {
+ if x != nil {
+ return x.VpnConnected
+ }
+ return false
+}
+
+func (x *SwitchNicWithMachine) GetFruProductSerial() string {
+ if x != nil {
+ return x.FruProductSerial
+ }
+ return ""
+}
+
+func (x *SwitchNicWithMachine) GetFruChassisPartSerial() string {
+ if x != nil {
+ return x.FruChassisPartSerial
+ }
+ return ""
+}
+
+func (x *SwitchNicWithMachine) GetLiveliness() MachineLiveliness {
+ if x != nil {
+ return x.Liveliness
+ }
+ return MachineLiveliness_MACHINE_LIVELINESS_UNSPECIFIED
+}
+
+func (x *SwitchNicWithMachine) GetState() MachineState {
+ if x != nil {
+ return x.State
+ }
+ return MachineState_MACHINE_STATE_UNSPECIFIED
+}
+
+func (x *SwitchNicWithMachine) GetFailedReclaim() bool {
+ if x != nil {
+ return x.FailedReclaim
+ }
+ return false
+}
+
+func (x *SwitchNicWithMachine) GetCrashloop() bool {
+ if x != nil {
+ return x.Crashloop
+ }
+ return false
+}
+
+func (x *SwitchNicWithMachine) GetLastErrorEventTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.LastErrorEventTime
+ }
+ return nil
+}
+
var File_metalstack_api_v2_switch_proto protoreflect.FileDescriptor
const file_metalstack_api_v2_switch_proto_rawDesc = "" +
"\n" +
- "\x1emetalstack/api/v2/switch.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xb3\x06\n" +
+ "\x1emetalstack/api/v2/switch.proto\x12\x11metalstack.api.v2\x1a\x1bbuf/validate/validate.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xb3\x06\n" +
"\x06Switch\x12\x1d\n" +
"\x02id\x18\x01 \x01(\tB\r\xbaH\n" +
"r\b\xc0\xb3\xae\xb1\x02\x01h\x01R\x02id\x12+\n" +
@@ -1129,7 +1347,28 @@ const file_metalstack_api_v2_switch_proto_rawDesc = "" +
"\x04time\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x04time\x125\n" +
"\bduration\x18\x02 \x01(\v2\x19.google.protobuf.DurationR\bduration\x12\x19\n" +
"\x05error\x18\x03 \x01(\tH\x00R\x05error\x88\x01\x01B\b\n" +
- "\x06_error*\x89\x02\n" +
+ "\x06_error\"\xa1\x01\n" +
+ "\x12SwitchWithMachines\x12\x0e\n" +
+ "\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n" +
+ "\tpartition\x18\x02 \x01(\tR\tpartition\x12\x12\n" +
+ "\x04rack\x18\x03 \x01(\tR\x04rack\x12I\n" +
+ "\vconnections\x18\x04 \x03(\v2'.metalstack.api.v2.SwitchNicWithMachineR\vconnections\"\xba\x04\n" +
+ "\x14SwitchNicWithMachine\x12.\n" +
+ "\x03nic\x18\x01 \x01(\v2\x1c.metalstack.api.v2.SwitchNicR\x03nic\x12\x12\n" +
+ "\x04uuid\x18\x02 \x01(\tR\x04uuid\x12\x12\n" +
+ "\x04size\x18\x03 \x01(\tR\x04size\x12/\n" +
+ "\x13allocation_hostname\x18\x04 \x01(\tR\x12allocationHostname\x12#\n" +
+ "\rvpn_connected\x18\x05 \x01(\bR\fvpnConnected\x12,\n" +
+ "\x12fru_product_serial\x18\x06 \x01(\tR\x10fruProductSerial\x125\n" +
+ "\x17fru_chassis_part_serial\x18\a \x01(\tR\x14fruChassisPartSerial\x12D\n" +
+ "\n" +
+ "liveliness\x18\b \x01(\x0e2$.metalstack.api.v2.MachineLivelinessR\n" +
+ "liveliness\x125\n" +
+ "\x05state\x18\t \x01(\x0e2\x1f.metalstack.api.v2.MachineStateR\x05state\x12%\n" +
+ "\x0efailed_reclaim\x18\n" +
+ " \x01(\bR\rfailedReclaim\x12\x1c\n" +
+ "\tcrashloop\x18\v \x01(\bR\tcrashloop\x12M\n" +
+ "\x15last_error_event_time\x18\f \x01(\v2\x1a.google.protobuf.TimestampR\x12lastErrorEventTime*\x89\x02\n" +
"\bBGPState\x12\x19\n" +
"\x15BGP_STATE_UNSPECIFIED\x10\x00\x12\x1c\n" +
"\x0eBGP_STATE_IDLE\x10\x01\x1a\b\x82\xb2\x19\x04Idle\x12\"\n" +
@@ -1167,7 +1406,7 @@ func file_metalstack_api_v2_switch_proto_rawDescGZIP() []byte {
}
var file_metalstack_api_v2_switch_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
-var file_metalstack_api_v2_switch_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
+var file_metalstack_api_v2_switch_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_metalstack_api_v2_switch_proto_goTypes = []any{
(BGPState)(0), // 0: metalstack.api.v2.BGPState
(SwitchReplaceMode)(0), // 1: metalstack.api.v2.SwitchReplaceMode
@@ -1183,12 +1422,16 @@ var file_metalstack_api_v2_switch_proto_goTypes = []any{
(*SwitchQuery)(nil), // 11: metalstack.api.v2.SwitchQuery
(*SwitchOSQuery)(nil), // 12: metalstack.api.v2.SwitchOSQuery
(*SwitchSync)(nil), // 13: metalstack.api.v2.SwitchSync
- (*Meta)(nil), // 14: metalstack.api.v2.Meta
- (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp
- (*durationpb.Duration)(nil), // 16: google.protobuf.Duration
+ (*SwitchWithMachines)(nil), // 14: metalstack.api.v2.SwitchWithMachines
+ (*SwitchNicWithMachine)(nil), // 15: metalstack.api.v2.SwitchNicWithMachine
+ (*Meta)(nil), // 16: metalstack.api.v2.Meta
+ (*timestamppb.Timestamp)(nil), // 17: google.protobuf.Timestamp
+ (*durationpb.Duration)(nil), // 18: google.protobuf.Duration
+ (MachineLiveliness)(0), // 19: metalstack.api.v2.MachineLiveliness
+ (MachineState)(0), // 20: metalstack.api.v2.MachineState
}
var file_metalstack_api_v2_switch_proto_depIdxs = []int32{
- 14, // 0: metalstack.api.v2.Switch.meta:type_name -> metalstack.api.v2.Meta
+ 16, // 0: metalstack.api.v2.Switch.meta:type_name -> metalstack.api.v2.Meta
1, // 1: metalstack.api.v2.Switch.replace_mode:type_name -> metalstack.api.v2.SwitchReplaceMode
6, // 2: metalstack.api.v2.Switch.nics:type_name -> metalstack.api.v2.SwitchNic
5, // 3: metalstack.api.v2.Switch.os:type_name -> metalstack.api.v2.SwitchOS
@@ -1200,19 +1443,24 @@ var file_metalstack_api_v2_switch_proto_depIdxs = []int32{
7, // 9: metalstack.api.v2.SwitchNic.bgp_filter:type_name -> metalstack.api.v2.BGPFilter
8, // 10: metalstack.api.v2.SwitchNic.bgp_port_state:type_name -> metalstack.api.v2.SwitchBGPPortState
0, // 11: metalstack.api.v2.SwitchBGPPortState.bgp_state:type_name -> metalstack.api.v2.BGPState
- 15, // 12: metalstack.api.v2.SwitchBGPPortState.bgp_timer_up_established:type_name -> google.protobuf.Timestamp
+ 17, // 12: metalstack.api.v2.SwitchBGPPortState.bgp_timer_up_established:type_name -> google.protobuf.Timestamp
3, // 13: metalstack.api.v2.NicState.desired:type_name -> metalstack.api.v2.SwitchPortStatus
3, // 14: metalstack.api.v2.NicState.actual:type_name -> metalstack.api.v2.SwitchPortStatus
6, // 15: metalstack.api.v2.MachineConnection.nic:type_name -> metalstack.api.v2.SwitchNic
12, // 16: metalstack.api.v2.SwitchQuery.os:type_name -> metalstack.api.v2.SwitchOSQuery
2, // 17: metalstack.api.v2.SwitchOSQuery.vendor:type_name -> metalstack.api.v2.SwitchOSVendor
- 15, // 18: metalstack.api.v2.SwitchSync.time:type_name -> google.protobuf.Timestamp
- 16, // 19: metalstack.api.v2.SwitchSync.duration:type_name -> google.protobuf.Duration
- 20, // [20:20] is the sub-list for method output_type
- 20, // [20:20] is the sub-list for method input_type
- 20, // [20:20] is the sub-list for extension type_name
- 20, // [20:20] is the sub-list for extension extendee
- 0, // [0:20] is the sub-list for field type_name
+ 17, // 18: metalstack.api.v2.SwitchSync.time:type_name -> google.protobuf.Timestamp
+ 18, // 19: metalstack.api.v2.SwitchSync.duration:type_name -> google.protobuf.Duration
+ 15, // 20: metalstack.api.v2.SwitchWithMachines.connections:type_name -> metalstack.api.v2.SwitchNicWithMachine
+ 6, // 21: metalstack.api.v2.SwitchNicWithMachine.nic:type_name -> metalstack.api.v2.SwitchNic
+ 19, // 22: metalstack.api.v2.SwitchNicWithMachine.liveliness:type_name -> metalstack.api.v2.MachineLiveliness
+ 20, // 23: metalstack.api.v2.SwitchNicWithMachine.state:type_name -> metalstack.api.v2.MachineState
+ 17, // 24: metalstack.api.v2.SwitchNicWithMachine.last_error_event_time:type_name -> google.protobuf.Timestamp
+ 25, // [25:25] is the sub-list for method output_type
+ 25, // [25:25] is the sub-list for method input_type
+ 25, // [25:25] is the sub-list for extension type_name
+ 25, // [25:25] is the sub-list for extension extendee
+ 0, // [0:25] is the sub-list for field type_name
}
func init() { file_metalstack_api_v2_switch_proto_init() }
@@ -1221,6 +1469,7 @@ func file_metalstack_api_v2_switch_proto_init() {
return
}
file_metalstack_api_v2_common_proto_init()
+ file_metalstack_api_v2_machine_proto_init()
file_metalstack_api_v2_predefined_rules_proto_init()
file_metalstack_api_v2_switch_proto_msgTypes[0].OneofWrappers = []any{}
file_metalstack_api_v2_switch_proto_msgTypes[2].OneofWrappers = []any{}
@@ -1234,7 +1483,7 @@ func file_metalstack_api_v2_switch_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_metalstack_api_v2_switch_proto_rawDesc), len(file_metalstack_api_v2_switch_proto_rawDesc)),
NumEnums: 4,
- NumMessages: 10,
+ NumMessages: 12,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/go/permissions/servicepermissions.go b/go/permissions/servicepermissions.go
index 060a748f..e995e641 100755
--- a/go/permissions/servicepermissions.go
+++ b/go/permissions/servicepermissions.go
@@ -79,6 +79,7 @@ func GetServicePermissions() *ServicePermissions {
"/metalstack.admin.v2.SwitchService/Delete",
"/metalstack.admin.v2.SwitchService/Migrate",
"/metalstack.admin.v2.SwitchService/Port",
+ "/metalstack.admin.v2.SwitchService/ConnectedMachines",
"/metalstack.admin.v2.TaskService/Get",
"/metalstack.admin.v2.TaskService/Delete",
"/metalstack.admin.v2.TaskService/Queues",
@@ -105,6 +106,7 @@ func GetServicePermissions() *ServicePermissions {
"/metalstack.admin.v2.ProjectService/List",
"/metalstack.admin.v2.SwitchService/Get",
"/metalstack.admin.v2.SwitchService/List",
+ "/metalstack.admin.v2.SwitchService/ConnectedMachines",
"/metalstack.admin.v2.TaskService/Get",
"/metalstack.admin.v2.TaskService/Queues",
"/metalstack.admin.v2.TaskService/List",
@@ -257,6 +259,7 @@ func GetServicePermissions() *ServicePermissions {
"/metalstack.admin.v2.SizeService/Create": true,
"/metalstack.admin.v2.SizeService/Delete": true,
"/metalstack.admin.v2.SizeService/Update": true,
+ "/metalstack.admin.v2.SwitchService/ConnectedMachines": true,
"/metalstack.admin.v2.SwitchService/Delete": true,
"/metalstack.admin.v2.SwitchService/Get": true,
"/metalstack.admin.v2.SwitchService/List": true,
@@ -389,50 +392,51 @@ func GetServicePermissions() *ServicePermissions {
"/metalstack.api.v2.UserService/Get": true,
},
Admin: map[string]bool{
- "/metalstack.admin.v2.FilesystemService/Create": true,
- "/metalstack.admin.v2.FilesystemService/Delete": true,
- "/metalstack.admin.v2.FilesystemService/Update": true,
- "/metalstack.admin.v2.IPService/List": true,
- "/metalstack.admin.v2.ImageService/Create": true,
- "/metalstack.admin.v2.ImageService/Delete": true,
- "/metalstack.admin.v2.ImageService/Update": true,
- "/metalstack.admin.v2.ImageService/Usage": true,
- "/metalstack.admin.v2.MachineService/BMCCommand": true,
- "/metalstack.admin.v2.MachineService/ConsolePassword": true,
- "/metalstack.admin.v2.MachineService/Get": true,
- "/metalstack.admin.v2.MachineService/GetBMC": true,
- "/metalstack.admin.v2.MachineService/List": true,
- "/metalstack.admin.v2.MachineService/ListBMC": true,
- "/metalstack.admin.v2.NetworkService/Create": true,
- "/metalstack.admin.v2.NetworkService/Delete": true,
- "/metalstack.admin.v2.NetworkService/Get": true,
- "/metalstack.admin.v2.NetworkService/List": true,
- "/metalstack.admin.v2.NetworkService/Update": true,
- "/metalstack.admin.v2.PartitionService/Capacity": true,
- "/metalstack.admin.v2.PartitionService/Create": true,
- "/metalstack.admin.v2.PartitionService/Delete": true,
- "/metalstack.admin.v2.PartitionService/Update": true,
- "/metalstack.admin.v2.ProjectService/List": true,
- "/metalstack.admin.v2.SizeService/Create": true,
- "/metalstack.admin.v2.SizeService/Delete": true,
- "/metalstack.admin.v2.SizeService/Update": true,
- "/metalstack.admin.v2.SwitchService/Delete": true,
- "/metalstack.admin.v2.SwitchService/Get": true,
- "/metalstack.admin.v2.SwitchService/List": true,
- "/metalstack.admin.v2.SwitchService/Migrate": true,
- "/metalstack.admin.v2.SwitchService/Port": true,
- "/metalstack.admin.v2.SwitchService/Update": true,
- "/metalstack.admin.v2.TaskService/Delete": true,
- "/metalstack.admin.v2.TaskService/Get": true,
- "/metalstack.admin.v2.TaskService/List": true,
- "/metalstack.admin.v2.TaskService/Queues": true,
- "/metalstack.admin.v2.TenantService/Create": true,
- "/metalstack.admin.v2.TenantService/List": true,
- "/metalstack.admin.v2.TokenService/Create": true,
- "/metalstack.admin.v2.TokenService/List": true,
- "/metalstack.admin.v2.TokenService/Revoke": true,
- "/metalstack.admin.v2.VPNService/AuthKey": true,
- "/metalstack.admin.v2.VPNService/ListNodes": true,
+ "/metalstack.admin.v2.FilesystemService/Create": true,
+ "/metalstack.admin.v2.FilesystemService/Delete": true,
+ "/metalstack.admin.v2.FilesystemService/Update": true,
+ "/metalstack.admin.v2.IPService/List": true,
+ "/metalstack.admin.v2.ImageService/Create": true,
+ "/metalstack.admin.v2.ImageService/Delete": true,
+ "/metalstack.admin.v2.ImageService/Update": true,
+ "/metalstack.admin.v2.ImageService/Usage": true,
+ "/metalstack.admin.v2.MachineService/BMCCommand": true,
+ "/metalstack.admin.v2.MachineService/ConsolePassword": true,
+ "/metalstack.admin.v2.MachineService/Get": true,
+ "/metalstack.admin.v2.MachineService/GetBMC": true,
+ "/metalstack.admin.v2.MachineService/List": true,
+ "/metalstack.admin.v2.MachineService/ListBMC": true,
+ "/metalstack.admin.v2.NetworkService/Create": true,
+ "/metalstack.admin.v2.NetworkService/Delete": true,
+ "/metalstack.admin.v2.NetworkService/Get": true,
+ "/metalstack.admin.v2.NetworkService/List": true,
+ "/metalstack.admin.v2.NetworkService/Update": true,
+ "/metalstack.admin.v2.PartitionService/Capacity": true,
+ "/metalstack.admin.v2.PartitionService/Create": true,
+ "/metalstack.admin.v2.PartitionService/Delete": true,
+ "/metalstack.admin.v2.PartitionService/Update": true,
+ "/metalstack.admin.v2.ProjectService/List": true,
+ "/metalstack.admin.v2.SizeService/Create": true,
+ "/metalstack.admin.v2.SizeService/Delete": true,
+ "/metalstack.admin.v2.SizeService/Update": true,
+ "/metalstack.admin.v2.SwitchService/ConnectedMachines": true,
+ "/metalstack.admin.v2.SwitchService/Delete": true,
+ "/metalstack.admin.v2.SwitchService/Get": true,
+ "/metalstack.admin.v2.SwitchService/List": true,
+ "/metalstack.admin.v2.SwitchService/Migrate": true,
+ "/metalstack.admin.v2.SwitchService/Port": true,
+ "/metalstack.admin.v2.SwitchService/Update": true,
+ "/metalstack.admin.v2.TaskService/Delete": true,
+ "/metalstack.admin.v2.TaskService/Get": true,
+ "/metalstack.admin.v2.TaskService/List": true,
+ "/metalstack.admin.v2.TaskService/Queues": true,
+ "/metalstack.admin.v2.TenantService/Create": true,
+ "/metalstack.admin.v2.TenantService/List": true,
+ "/metalstack.admin.v2.TokenService/Create": true,
+ "/metalstack.admin.v2.TokenService/List": true,
+ "/metalstack.admin.v2.TokenService/Revoke": true,
+ "/metalstack.admin.v2.VPNService/AuthKey": true,
+ "/metalstack.admin.v2.VPNService/ListNodes": true,
},
Infra: map[string]bool{
"/metalstack.infra.v2.BMCService/BMCCommandDone": true,
@@ -521,6 +525,7 @@ func GetServicePermissions() *ServicePermissions {
"/metalstack.admin.v2.SizeService/Create": true,
"/metalstack.admin.v2.SizeService/Delete": true,
"/metalstack.admin.v2.SizeService/Update": true,
+ "/metalstack.admin.v2.SwitchService/ConnectedMachines": false,
"/metalstack.admin.v2.SwitchService/Delete": true,
"/metalstack.admin.v2.SwitchService/Get": false,
"/metalstack.admin.v2.SwitchService/List": false,
diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceClient.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceClient.go
index 9df17d79..2ded97f6 100644
--- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceClient.go
+++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceClient.go
@@ -38,6 +38,74 @@ func (_m *SwitchServiceClient) EXPECT() *SwitchServiceClient_Expecter {
return &SwitchServiceClient_Expecter{mock: &_m.Mock}
}
+// ConnectedMachines provides a mock function for the type SwitchServiceClient
+func (_mock *SwitchServiceClient) ConnectedMachines(context1 context.Context, switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest) (*adminv2.SwitchServiceConnectedMachinesResponse, error) {
+ ret := _mock.Called(context1, switchServiceConnectedMachinesRequest)
+
+ if len(ret) == 0 {
+ panic("no return value specified for ConnectedMachines")
+ }
+
+ var r0 *adminv2.SwitchServiceConnectedMachinesResponse
+ var r1 error
+ if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.SwitchServiceConnectedMachinesRequest) (*adminv2.SwitchServiceConnectedMachinesResponse, error)); ok {
+ return returnFunc(context1, switchServiceConnectedMachinesRequest)
+ }
+ if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.SwitchServiceConnectedMachinesRequest) *adminv2.SwitchServiceConnectedMachinesResponse); ok {
+ r0 = returnFunc(context1, switchServiceConnectedMachinesRequest)
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(*adminv2.SwitchServiceConnectedMachinesResponse)
+ }
+ }
+ if returnFunc, ok := ret.Get(1).(func(context.Context, *adminv2.SwitchServiceConnectedMachinesRequest) error); ok {
+ r1 = returnFunc(context1, switchServiceConnectedMachinesRequest)
+ } else {
+ r1 = ret.Error(1)
+ }
+ return r0, r1
+}
+
+// SwitchServiceClient_ConnectedMachines_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConnectedMachines'
+type SwitchServiceClient_ConnectedMachines_Call struct {
+ *mock.Call
+}
+
+// ConnectedMachines is a helper method to define mock.On call
+// - context1 context.Context
+// - switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest
+func (_e *SwitchServiceClient_Expecter) ConnectedMachines(context1 interface{}, switchServiceConnectedMachinesRequest interface{}) *SwitchServiceClient_ConnectedMachines_Call {
+ return &SwitchServiceClient_ConnectedMachines_Call{Call: _e.mock.On("ConnectedMachines", context1, switchServiceConnectedMachinesRequest)}
+}
+
+func (_c *SwitchServiceClient_ConnectedMachines_Call) Run(run func(context1 context.Context, switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest)) *SwitchServiceClient_ConnectedMachines_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ var arg0 context.Context
+ if args[0] != nil {
+ arg0 = args[0].(context.Context)
+ }
+ var arg1 *adminv2.SwitchServiceConnectedMachinesRequest
+ if args[1] != nil {
+ arg1 = args[1].(*adminv2.SwitchServiceConnectedMachinesRequest)
+ }
+ run(
+ arg0,
+ arg1,
+ )
+ })
+ return _c
+}
+
+func (_c *SwitchServiceClient_ConnectedMachines_Call) Return(switchServiceConnectedMachinesResponse *adminv2.SwitchServiceConnectedMachinesResponse, err error) *SwitchServiceClient_ConnectedMachines_Call {
+ _c.Call.Return(switchServiceConnectedMachinesResponse, err)
+ return _c
+}
+
+func (_c *SwitchServiceClient_ConnectedMachines_Call) RunAndReturn(run func(context1 context.Context, switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest) (*adminv2.SwitchServiceConnectedMachinesResponse, error)) *SwitchServiceClient_ConnectedMachines_Call {
+ _c.Call.Return(run)
+ return _c
+}
+
// Delete provides a mock function for the type SwitchServiceClient
func (_mock *SwitchServiceClient) Delete(context1 context.Context, switchServiceDeleteRequest *adminv2.SwitchServiceDeleteRequest) (*adminv2.SwitchServiceDeleteResponse, error) {
ret := _mock.Called(context1, switchServiceDeleteRequest)
diff --git a/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceHandler.go b/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceHandler.go
index 4b903ed3..2017d906 100644
--- a/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceHandler.go
+++ b/go/tests/mocks/metalstack/admin/v2/adminv2connect/SwitchServiceHandler.go
@@ -38,6 +38,74 @@ func (_m *SwitchServiceHandler) EXPECT() *SwitchServiceHandler_Expecter {
return &SwitchServiceHandler_Expecter{mock: &_m.Mock}
}
+// ConnectedMachines provides a mock function for the type SwitchServiceHandler
+func (_mock *SwitchServiceHandler) ConnectedMachines(context1 context.Context, switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest) (*adminv2.SwitchServiceConnectedMachinesResponse, error) {
+ ret := _mock.Called(context1, switchServiceConnectedMachinesRequest)
+
+ if len(ret) == 0 {
+ panic("no return value specified for ConnectedMachines")
+ }
+
+ var r0 *adminv2.SwitchServiceConnectedMachinesResponse
+ var r1 error
+ if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.SwitchServiceConnectedMachinesRequest) (*adminv2.SwitchServiceConnectedMachinesResponse, error)); ok {
+ return returnFunc(context1, switchServiceConnectedMachinesRequest)
+ }
+ if returnFunc, ok := ret.Get(0).(func(context.Context, *adminv2.SwitchServiceConnectedMachinesRequest) *adminv2.SwitchServiceConnectedMachinesResponse); ok {
+ r0 = returnFunc(context1, switchServiceConnectedMachinesRequest)
+ } else {
+ if ret.Get(0) != nil {
+ r0 = ret.Get(0).(*adminv2.SwitchServiceConnectedMachinesResponse)
+ }
+ }
+ if returnFunc, ok := ret.Get(1).(func(context.Context, *adminv2.SwitchServiceConnectedMachinesRequest) error); ok {
+ r1 = returnFunc(context1, switchServiceConnectedMachinesRequest)
+ } else {
+ r1 = ret.Error(1)
+ }
+ return r0, r1
+}
+
+// SwitchServiceHandler_ConnectedMachines_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConnectedMachines'
+type SwitchServiceHandler_ConnectedMachines_Call struct {
+ *mock.Call
+}
+
+// ConnectedMachines is a helper method to define mock.On call
+// - context1 context.Context
+// - switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest
+func (_e *SwitchServiceHandler_Expecter) ConnectedMachines(context1 interface{}, switchServiceConnectedMachinesRequest interface{}) *SwitchServiceHandler_ConnectedMachines_Call {
+ return &SwitchServiceHandler_ConnectedMachines_Call{Call: _e.mock.On("ConnectedMachines", context1, switchServiceConnectedMachinesRequest)}
+}
+
+func (_c *SwitchServiceHandler_ConnectedMachines_Call) Run(run func(context1 context.Context, switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest)) *SwitchServiceHandler_ConnectedMachines_Call {
+ _c.Call.Run(func(args mock.Arguments) {
+ var arg0 context.Context
+ if args[0] != nil {
+ arg0 = args[0].(context.Context)
+ }
+ var arg1 *adminv2.SwitchServiceConnectedMachinesRequest
+ if args[1] != nil {
+ arg1 = args[1].(*adminv2.SwitchServiceConnectedMachinesRequest)
+ }
+ run(
+ arg0,
+ arg1,
+ )
+ })
+ return _c
+}
+
+func (_c *SwitchServiceHandler_ConnectedMachines_Call) Return(switchServiceConnectedMachinesResponse *adminv2.SwitchServiceConnectedMachinesResponse, err error) *SwitchServiceHandler_ConnectedMachines_Call {
+ _c.Call.Return(switchServiceConnectedMachinesResponse, err)
+ return _c
+}
+
+func (_c *SwitchServiceHandler_ConnectedMachines_Call) RunAndReturn(run func(context1 context.Context, switchServiceConnectedMachinesRequest *adminv2.SwitchServiceConnectedMachinesRequest) (*adminv2.SwitchServiceConnectedMachinesResponse, error)) *SwitchServiceHandler_ConnectedMachines_Call {
+ _c.Call.Return(run)
+ return _c
+}
+
// Delete provides a mock function for the type SwitchServiceHandler
func (_mock *SwitchServiceHandler) Delete(context1 context.Context, switchServiceDeleteRequest *adminv2.SwitchServiceDeleteRequest) (*adminv2.SwitchServiceDeleteResponse, error) {
ret := _mock.Called(context1, switchServiceDeleteRequest)
diff --git a/go/tests/testproto/wrongproject.proto b/go/tests/testproto/wrongproject.proto
index b26aeba3..178c4c53 100644
--- a/go/tests/testproto/wrongproject.proto
+++ b/go/tests/testproto/wrongproject.proto
@@ -11,8 +11,7 @@ service WrongProjectService {
rpc Get(WrongProjectServiceGetRequest) returns (WrongProjectServiceGetResponse) {
option (project_roles) = PROJECT_ROLE_OWNER;
}
- rpc List(WrongProjectServiceListRequest) returns (WrongProjectServiceListResponse) {
- }
+ rpc List(WrongProjectServiceListRequest) returns (WrongProjectServiceListResponse) {}
rpc Update(WrongProjectServiceUpdateRequest) returns (WrongProjectServiceUpdateResponse) {
option (admin_roles) = ADMIN_ROLE_VIEWER;
option (project_roles) = PROJECT_ROLE_OWNER;
@@ -34,40 +33,40 @@ message WrongProjectServiceAddResponse {
string login = 1;
}
message WrongProjectServiceGetRequest {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceGetResponse {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceListRequest {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceListResponse {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceUpdateRequest {
- string uuid = 1;
- string project = 2;
- metalstack.api.v2.Meta meta = 3;
+ string uuid = 1;
+ string project = 2;
+ metalstack.api.v2.Meta meta = 3;
}
message WrongProjectServiceUpdateResponse {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceDeleteRequest {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceDeleteResponse {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceChargeRequest {
- string uuid = 1;
+ string uuid = 1;
}
message WrongProjectServiceChargeResponse {
- string uuid = 1;
-}
\ No newline at end of file
+ string uuid = 1;
+}
diff --git a/proto/metalstack/admin/v2/switch.proto b/proto/metalstack/admin/v2/switch.proto
index 28248294..5fb02794 100644
--- a/proto/metalstack/admin/v2/switch.proto
+++ b/proto/metalstack/admin/v2/switch.proto
@@ -5,6 +5,7 @@ package metalstack.admin.v2;
import "buf/validate/validate.proto";
import "google/protobuf/timestamp.proto";
import "metalstack/api/v2/common.proto";
+import "metalstack/api/v2/machine.proto";
import "metalstack/api/v2/predefined_rules.proto";
import "metalstack/api/v2/switch.proto";
@@ -38,6 +39,12 @@ service SwitchService {
rpc Port(SwitchServicePortRequest) returns (SwitchServicePortResponse) {
option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR;
}
+ // ConnectedMachines lists all switches with their machine connections.
+ rpc ConnectedMachines(SwitchServiceConnectedMachinesRequest) returns (SwitchServiceConnectedMachinesResponse) {
+ option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_EDITOR;
+ option (metalstack.api.v2.admin_roles) = ADMIN_ROLE_VIEWER;
+ option (metalstack.api.v2.auditing) = AUDITING_EXCLUDED;
+ }
}
// SwitchServiceGetRequest.
@@ -156,3 +163,17 @@ message SwitchServicePortResponse {
// Switch after the port status toggle..
metalstack.api.v2.Switch switch = 1;
}
+
+// SwitchServiceConnectedMachinesRequest.
+message SwitchServiceConnectedMachinesRequest {
+ // Query to filter the switch results.
+ metalstack.api.v2.SwitchQuery query = 1;
+ // MachineQuery to filter the machine results.
+ metalstack.api.v2.MachineQuery machine_query = 2;
+}
+
+// SwitchServiceConnectedMachinesResponse.
+message SwitchServiceConnectedMachinesResponse {
+ // SwitchesWithMachines contains all switches with their machine connections.
+ repeated metalstack.api.v2.SwitchWithMachines switches_with_machines = 1;
+}
diff --git a/proto/metalstack/api/v2/switch.proto b/proto/metalstack/api/v2/switch.proto
index 94dbe0ed..41754cd3 100644
--- a/proto/metalstack/api/v2/switch.proto
+++ b/proto/metalstack/api/v2/switch.proto
@@ -6,6 +6,7 @@ import "buf/validate/validate.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "metalstack/api/v2/common.proto";
+import "metalstack/api/v2/machine.proto";
import "metalstack/api/v2/predefined_rules.proto";
// Switch represents a network switch.
@@ -155,6 +156,46 @@ message SwitchSync {
optional string error = 3;
}
+// SwitchWithMachines contains a mapping from switch ports to connected machines.
+message SwitchWithMachines {
+ // Id of the switch.
+ string id = 1;
+ // Partition of the switch.
+ string partition = 2;
+ // Rack of the switch.
+ string rack = 3;
+ // Connections associates switch ports with the machines connected to them.
+ repeated SwitchNicWithMachine connections = 4;
+}
+
+// SwitchNicWithMachine associates a switch port with its connected machine.
+message SwitchNicWithMachine {
+ // Nic is the switch nic the machine is connected to.
+ SwitchNic nic = 1;
+ // Uuid of the machine.
+ string uuid = 2;
+ // Size of the machine.
+ string size = 3;
+ // AllocationHostname if machine is allocated.
+ string allocation_hostname = 4;
+ // VpnConnected indicated whether the machine is connected to a VPN.
+ bool vpn_connected = 5;
+ // FruProductSerial of the machine.
+ string fru_product_serial = 6;
+ // FruChassisPartSerial of the machine.
+ string fru_chassis_part_serial = 7;
+ // Liveliness of the machine.
+ metalstack.api.v2.MachineLiveliness liveliness = 8;
+ // State of the machine.
+ metalstack.api.v2.MachineState state = 9;
+ // FailedReclaim is true if the machine failed to return to the waiting machines pool after deletion.
+ bool failed_reclaim = 10;
+ // Crashloop is true if there was an unexpected event in the provisioning cycle.
+ bool crashloop = 11;
+ // LastErrorEventTime in case some error happened in the past.
+ google.protobuf.Timestamp last_error_event_time = 12;
+}
+
// BGPState represents the state of a BGP session.
enum BGPState {
// BGP_STATE_UNSPECIFIED is not specified.
diff --git a/python/metalstack/admin/v2/switch_connect.py b/python/metalstack/admin/v2/switch_connect.py
index 8bc418b0..698d8264 100644
--- a/python/metalstack/admin/v2/switch_connect.py
+++ b/python/metalstack/admin/v2/switch_connect.py
@@ -34,6 +34,9 @@ async def migrate(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.Swi
async def port(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse:
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
+ async def connected_machines(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse:
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
+
class SwitchServiceASGIApplication(ConnectASGIApplication[SwitchService]):
def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None:
@@ -100,6 +103,16 @@ def __init__(self, service: SwitchService | AsyncGenerator[SwitchService], *, in
),
function=svc.port,
),
+ "/metalstack.admin.v2.SwitchService/ConnectedMachines": Endpoint.unary(
+ method=MethodInfo(
+ name="ConnectedMachines",
+ service_name="metalstack.admin.v2.SwitchService",
+ input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest,
+ output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse,
+ idempotency_level=IdempotencyLevel.UNKNOWN,
+ ),
+ function=svc.connected_machines,
+ ),
},
interceptors=interceptors,
read_max_bytes=read_max_bytes,
@@ -232,6 +245,26 @@ async def port(
timeout_ms=timeout_ms,
)
+ async def connected_machines(
+ self,
+ request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest,
+ *,
+ headers: Headers | Mapping[str, str] | None = None,
+ timeout_ms: int | None = None,
+ ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse:
+ return await self.execute_unary(
+ request=request,
+ method=MethodInfo(
+ name="ConnectedMachines",
+ service_name="metalstack.admin.v2.SwitchService",
+ input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest,
+ output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse,
+ idempotency_level=IdempotencyLevel.UNKNOWN,
+ ),
+ headers=headers,
+ timeout_ms=timeout_ms,
+ )
+
class SwitchServiceSync(Protocol):
def get(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceGetResponse:
@@ -246,6 +279,8 @@ def migrate(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchSer
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
def port(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServicePortResponse:
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
+ def connected_machines(self, request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest, ctx: RequestContext) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse:
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
class SwitchServiceWSGIApplication(ConnectWSGIApplication):
@@ -312,6 +347,16 @@ def __init__(self, service: SwitchServiceSync, interceptors: Iterable[Intercepto
),
function=service.port,
),
+ "/metalstack.admin.v2.SwitchService/ConnectedMachines": EndpointSync.unary(
+ method=MethodInfo(
+ name="ConnectedMachines",
+ service_name="metalstack.admin.v2.SwitchService",
+ input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest,
+ output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse,
+ idempotency_level=IdempotencyLevel.UNKNOWN,
+ ),
+ function=service.connected_machines,
+ ),
},
interceptors=interceptors,
read_max_bytes=read_max_bytes,
@@ -443,3 +488,23 @@ def port(
headers=headers,
timeout_ms=timeout_ms,
)
+
+ def connected_machines(
+ self,
+ request: metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest,
+ *,
+ headers: Headers | Mapping[str, str] | None = None,
+ timeout_ms: int | None = None,
+ ) -> metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse:
+ return self.execute_unary(
+ request=request,
+ method=MethodInfo(
+ name="ConnectedMachines",
+ service_name="metalstack.admin.v2.SwitchService",
+ input=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesRequest,
+ output=metalstack_dot_admin_dot_v2_dot_switch__pb2.SwitchServiceConnectedMachinesResponse,
+ idempotency_level=IdempotencyLevel.UNKNOWN,
+ ),
+ headers=headers,
+ timeout_ms=timeout_ms,
+ )
diff --git a/python/metalstack/admin/v2/switch_pb2.py b/python/metalstack/admin/v2/switch_pb2.py
index a483f362..00e4f301 100644
--- a/python/metalstack/admin/v2/switch_pb2.py
+++ b/python/metalstack/admin/v2/switch_pb2.py
@@ -25,11 +25,12 @@
from buf.validate import validate_pb2 as buf_dot_validate_dot_validate__pb2
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2
+from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2
from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2
from metalstack.api.v2 import switch_pb2 as metalstack_dot_api_dot_v2_dot_switch__pb2
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n metalstack/admin/v2/switch.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto\"8\n\x17SwitchServiceGetRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\"M\n\x18SwitchServiceGetResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"P\n\x18SwitchServiceListRequest\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32\x1e.metalstack.api.v2.SwitchQueryR\x05query\"R\n\x19SwitchServiceListResponse\x12\x35\n\x08switches\x18\x01 \x03(\x0b\x32\x19.metalstack.api.v2.SwitchR\x08switches\"\xb9\x05\n\x1aSwitchServiceUpdateRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12V\n\x0creplace_mode\x18\x05 \x01(\x0e\x32$.metalstack.api.v2.SwitchReplaceModeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\x0breplaceMode\x88\x01\x01\x12\x31\n\rmanagement_ip\x18\x06 \x01(\tB\x07\xbaH\x04r\x02p\x01H\x02R\x0cmanagementIp\x88\x01\x01\x12\x39\n\x0fmanagement_user\x18\x07 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x0emanagementUser\x88\x01\x01\x12\x39\n\x0f\x63onsole_command\x18\x08 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x04R\x0e\x63onsoleCommand\x88\x01\x01\x12\x30\n\x04nics\x18\t \x03(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x04nics\x12\x30\n\x02os\x18\n \x01(\x0b\x32\x1b.metalstack.api.v2.SwitchOSH\x05R\x02os\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0f\n\r_replace_modeB\x10\n\x0e_management_ipB\x12\n\x10_management_userB\x12\n\x10_console_commandB\x05\n\x03_os\"P\n\x1bSwitchServiceUpdateResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"Q\n\x1aSwitchServiceDeleteRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x14\n\x05\x66orce\x18\x02 \x01(\x08R\x05\x66orce\"P\n\x1bSwitchServiceDeleteResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"y\n\x1bSwitchServiceMigrateRequest\x12,\n\nold_switch\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\toldSwitch\x12,\n\nnew_switch\x18\x02 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\tnewSwitch\"Q\n\x1cSwitchServiceMigrateResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"\xa8\x01\n\x18SwitchServicePortRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12&\n\x08nic_name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07nicName\x12\x45\n\x06status\x18\x03 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06status\"N\n\x19SwitchServicePortResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch2\xbf\x05\n\rSwitchService\x12n\n\x03Get\x12,.metalstack.admin.v2.SwitchServiceGetRequest\x1a-.metalstack.admin.v2.SwitchServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12q\n\x04List\x12-.metalstack.admin.v2.SwitchServiceListRequest\x1a..metalstack.admin.v2.SwitchServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12r\n\x06Update\x12/.metalstack.admin.v2.SwitchServiceUpdateRequest\x1a\x30.metalstack.admin.v2.SwitchServiceUpdateResponse\"\x05\xd2\xf3\x18\x01\x01\x12r\n\x06\x44\x65lete\x12/.metalstack.admin.v2.SwitchServiceDeleteRequest\x1a\x30.metalstack.admin.v2.SwitchServiceDeleteResponse\"\x05\xd2\xf3\x18\x01\x01\x12u\n\x07Migrate\x12\x30.metalstack.admin.v2.SwitchServiceMigrateRequest\x1a\x31.metalstack.admin.v2.SwitchServiceMigrateResponse\"\x05\xd2\xf3\x18\x01\x01\x12l\n\x04Port\x12-.metalstack.admin.v2.SwitchServicePortRequest\x1a..metalstack.admin.v2.SwitchServicePortResponse\"\x05\xd2\xf3\x18\x01\x01\x42\xcf\x01\n\x17\x63om.metalstack.admin.v2B\x0bSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n metalstack/admin/v2/switch.proto\x12\x13metalstack.admin.v2\x1a\x1b\x62uf/validate/validate.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\x1a\x1emetalstack/api/v2/switch.proto\"8\n\x17SwitchServiceGetRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\"M\n\x18SwitchServiceGetResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"P\n\x18SwitchServiceListRequest\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32\x1e.metalstack.api.v2.SwitchQueryR\x05query\"R\n\x19SwitchServiceListResponse\x12\x35\n\x08switches\x18\x01 \x03(\x0b\x32\x19.metalstack.api.v2.SwitchR\x08switches\"\xb9\x05\n\x1aSwitchServiceUpdateRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x46\n\x0bupdate_meta\x18\x02 \x01(\x0b\x32\x1d.metalstack.api.v2.UpdateMetaB\x06\xbaH\x03\xc8\x01\x01R\nupdateMeta\x12\x39\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tupdatedAt\x12\x32\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x00R\x0b\x64\x65scription\x88\x01\x01\x12V\n\x0creplace_mode\x18\x05 \x01(\x0e\x32$.metalstack.api.v2.SwitchReplaceModeB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x01R\x0breplaceMode\x88\x01\x01\x12\x31\n\rmanagement_ip\x18\x06 \x01(\tB\x07\xbaH\x04r\x02p\x01H\x02R\x0cmanagementIp\x88\x01\x01\x12\x39\n\x0fmanagement_user\x18\x07 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x03R\x0emanagementUser\x88\x01\x01\x12\x39\n\x0f\x63onsole_command\x18\x08 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01H\x04R\x0e\x63onsoleCommand\x88\x01\x01\x12\x30\n\x04nics\x18\t \x03(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x04nics\x12\x30\n\x02os\x18\n \x01(\x0b\x32\x1b.metalstack.api.v2.SwitchOSH\x05R\x02os\x88\x01\x01\x42\x0e\n\x0c_descriptionB\x0f\n\r_replace_modeB\x10\n\x0e_management_ipB\x12\n\x10_management_userB\x12\n\x10_console_commandB\x05\n\x03_os\"P\n\x1bSwitchServiceUpdateResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"Q\n\x1aSwitchServiceDeleteRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12\x14\n\x05\x66orce\x18\x02 \x01(\x08R\x05\x66orce\"P\n\x1bSwitchServiceDeleteResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"y\n\x1bSwitchServiceMigrateRequest\x12,\n\nold_switch\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\toldSwitch\x12,\n\nnew_switch\x18\x02 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\tnewSwitch\"Q\n\x1cSwitchServiceMigrateResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"\xa8\x01\n\x18SwitchServicePortRequest\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12&\n\x08nic_name\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07nicName\x12\x45\n\x06status\x18\x03 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06status\"N\n\x19SwitchServicePortResponse\x12\x31\n\x06switch\x18\x01 \x01(\x0b\x32\x19.metalstack.api.v2.SwitchR\x06switch\"\xa3\x01\n%SwitchServiceConnectedMachinesRequest\x12\x34\n\x05query\x18\x01 \x01(\x0b\x32\x1e.metalstack.api.v2.SwitchQueryR\x05query\x12\x44\n\rmachine_query\x18\x02 \x01(\x0b\x32\x1f.metalstack.api.v2.MachineQueryR\x0cmachineQuery\"\x85\x01\n&SwitchServiceConnectedMachinesResponse\x12[\n\x16switches_with_machines\x18\x01 \x03(\x0b\x32%.metalstack.api.v2.SwitchWithMachinesR\x14switchesWithMachines2\xda\x06\n\rSwitchService\x12n\n\x03Get\x12,.metalstack.admin.v2.SwitchServiceGetRequest\x1a-.metalstack.admin.v2.SwitchServiceGetResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12q\n\x04List\x12-.metalstack.admin.v2.SwitchServiceListRequest\x1a..metalstack.admin.v2.SwitchServiceListResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x12r\n\x06Update\x12/.metalstack.admin.v2.SwitchServiceUpdateRequest\x1a\x30.metalstack.admin.v2.SwitchServiceUpdateResponse\"\x05\xd2\xf3\x18\x01\x01\x12r\n\x06\x44\x65lete\x12/.metalstack.admin.v2.SwitchServiceDeleteRequest\x1a\x30.metalstack.admin.v2.SwitchServiceDeleteResponse\"\x05\xd2\xf3\x18\x01\x01\x12u\n\x07Migrate\x12\x30.metalstack.admin.v2.SwitchServiceMigrateRequest\x1a\x31.metalstack.admin.v2.SwitchServiceMigrateResponse\"\x05\xd2\xf3\x18\x01\x01\x12l\n\x04Port\x12-.metalstack.admin.v2.SwitchServicePortRequest\x1a..metalstack.admin.v2.SwitchServicePortResponse\"\x05\xd2\xf3\x18\x01\x01\x12\x98\x01\n\x11\x43onnectedMachines\x12:.metalstack.admin.v2.SwitchServiceConnectedMachinesRequest\x1a;.metalstack.admin.v2.SwitchServiceConnectedMachinesResponse\"\n\xd2\xf3\x18\x02\x01\x02\xe0\xf3\x18\x02\x42\xcf\x01\n\x17\x63om.metalstack.admin.v2B\x0bSwitchProtoP\x01Z9github.com/metal-stack/api/go/metalstack/admin/v2;adminv2\xa2\x02\x03MAX\xaa\x02\x13Metalstack.Admin.V2\xca\x02\x13Metalstack\\Admin\\V2\xe2\x02\x1fMetalstack\\Admin\\V2\\GPBMetadata\xea\x02\x15Metalstack::Admin::V2b\x06proto3')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -77,30 +78,36 @@
_globals['_SWITCHSERVICE'].methods_by_name['Migrate']._serialized_options = b'\322\363\030\001\001'
_globals['_SWITCHSERVICE'].methods_by_name['Port']._loaded_options = None
_globals['_SWITCHSERVICE'].methods_by_name['Port']._serialized_options = b'\322\363\030\001\001'
- _globals['_SWITCHSERVICEGETREQUEST']._serialized_start=225
- _globals['_SWITCHSERVICEGETREQUEST']._serialized_end=281
- _globals['_SWITCHSERVICEGETRESPONSE']._serialized_start=283
- _globals['_SWITCHSERVICEGETRESPONSE']._serialized_end=360
- _globals['_SWITCHSERVICELISTREQUEST']._serialized_start=362
- _globals['_SWITCHSERVICELISTREQUEST']._serialized_end=442
- _globals['_SWITCHSERVICELISTRESPONSE']._serialized_start=444
- _globals['_SWITCHSERVICELISTRESPONSE']._serialized_end=526
- _globals['_SWITCHSERVICEUPDATEREQUEST']._serialized_start=529
- _globals['_SWITCHSERVICEUPDATEREQUEST']._serialized_end=1226
- _globals['_SWITCHSERVICEUPDATERESPONSE']._serialized_start=1228
- _globals['_SWITCHSERVICEUPDATERESPONSE']._serialized_end=1308
- _globals['_SWITCHSERVICEDELETEREQUEST']._serialized_start=1310
- _globals['_SWITCHSERVICEDELETEREQUEST']._serialized_end=1391
- _globals['_SWITCHSERVICEDELETERESPONSE']._serialized_start=1393
- _globals['_SWITCHSERVICEDELETERESPONSE']._serialized_end=1473
- _globals['_SWITCHSERVICEMIGRATEREQUEST']._serialized_start=1475
- _globals['_SWITCHSERVICEMIGRATEREQUEST']._serialized_end=1596
- _globals['_SWITCHSERVICEMIGRATERESPONSE']._serialized_start=1598
- _globals['_SWITCHSERVICEMIGRATERESPONSE']._serialized_end=1679
- _globals['_SWITCHSERVICEPORTREQUEST']._serialized_start=1682
- _globals['_SWITCHSERVICEPORTREQUEST']._serialized_end=1850
- _globals['_SWITCHSERVICEPORTRESPONSE']._serialized_start=1852
- _globals['_SWITCHSERVICEPORTRESPONSE']._serialized_end=1930
- _globals['_SWITCHSERVICE']._serialized_start=1933
- _globals['_SWITCHSERVICE']._serialized_end=2636
+ _globals['_SWITCHSERVICE'].methods_by_name['ConnectedMachines']._loaded_options = None
+ _globals['_SWITCHSERVICE'].methods_by_name['ConnectedMachines']._serialized_options = b'\322\363\030\002\001\002\340\363\030\002'
+ _globals['_SWITCHSERVICEGETREQUEST']._serialized_start=258
+ _globals['_SWITCHSERVICEGETREQUEST']._serialized_end=314
+ _globals['_SWITCHSERVICEGETRESPONSE']._serialized_start=316
+ _globals['_SWITCHSERVICEGETRESPONSE']._serialized_end=393
+ _globals['_SWITCHSERVICELISTREQUEST']._serialized_start=395
+ _globals['_SWITCHSERVICELISTREQUEST']._serialized_end=475
+ _globals['_SWITCHSERVICELISTRESPONSE']._serialized_start=477
+ _globals['_SWITCHSERVICELISTRESPONSE']._serialized_end=559
+ _globals['_SWITCHSERVICEUPDATEREQUEST']._serialized_start=562
+ _globals['_SWITCHSERVICEUPDATEREQUEST']._serialized_end=1259
+ _globals['_SWITCHSERVICEUPDATERESPONSE']._serialized_start=1261
+ _globals['_SWITCHSERVICEUPDATERESPONSE']._serialized_end=1341
+ _globals['_SWITCHSERVICEDELETEREQUEST']._serialized_start=1343
+ _globals['_SWITCHSERVICEDELETEREQUEST']._serialized_end=1424
+ _globals['_SWITCHSERVICEDELETERESPONSE']._serialized_start=1426
+ _globals['_SWITCHSERVICEDELETERESPONSE']._serialized_end=1506
+ _globals['_SWITCHSERVICEMIGRATEREQUEST']._serialized_start=1508
+ _globals['_SWITCHSERVICEMIGRATEREQUEST']._serialized_end=1629
+ _globals['_SWITCHSERVICEMIGRATERESPONSE']._serialized_start=1631
+ _globals['_SWITCHSERVICEMIGRATERESPONSE']._serialized_end=1712
+ _globals['_SWITCHSERVICEPORTREQUEST']._serialized_start=1715
+ _globals['_SWITCHSERVICEPORTREQUEST']._serialized_end=1883
+ _globals['_SWITCHSERVICEPORTRESPONSE']._serialized_start=1885
+ _globals['_SWITCHSERVICEPORTRESPONSE']._serialized_end=1963
+ _globals['_SWITCHSERVICECONNECTEDMACHINESREQUEST']._serialized_start=1966
+ _globals['_SWITCHSERVICECONNECTEDMACHINESREQUEST']._serialized_end=2129
+ _globals['_SWITCHSERVICECONNECTEDMACHINESRESPONSE']._serialized_start=2132
+ _globals['_SWITCHSERVICECONNECTEDMACHINESRESPONSE']._serialized_end=2265
+ _globals['_SWITCHSERVICE']._serialized_start=2268
+ _globals['_SWITCHSERVICE']._serialized_end=3126
# @@protoc_insertion_point(module_scope)
diff --git a/python/metalstack/admin/v2/switch_pb2.pyi b/python/metalstack/admin/v2/switch_pb2.pyi
index c30fa375..3fe369a6 100644
--- a/python/metalstack/admin/v2/switch_pb2.pyi
+++ b/python/metalstack/admin/v2/switch_pb2.pyi
@@ -3,6 +3,7 @@ import datetime
from buf.validate import validate_pb2 as _validate_pb2
from google.protobuf import timestamp_pb2 as _timestamp_pb2
from metalstack.api.v2 import common_pb2 as _common_pb2
+from metalstack.api.v2 import machine_pb2 as _machine_pb2
from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2
from metalstack.api.v2 import switch_pb2 as _switch_pb2
from google.protobuf.internal import containers as _containers
@@ -110,3 +111,17 @@ class SwitchServicePortResponse(_message.Message):
SWITCH_FIELD_NUMBER: _ClassVar[int]
switch: _switch_pb2.Switch
def __init__(self, switch: _Optional[_Union[_switch_pb2.Switch, _Mapping]] = ...) -> None: ...
+
+class SwitchServiceConnectedMachinesRequest(_message.Message):
+ __slots__ = ("query", "machine_query")
+ QUERY_FIELD_NUMBER: _ClassVar[int]
+ MACHINE_QUERY_FIELD_NUMBER: _ClassVar[int]
+ query: _switch_pb2.SwitchQuery
+ machine_query: _machine_pb2.MachineQuery
+ def __init__(self, query: _Optional[_Union[_switch_pb2.SwitchQuery, _Mapping]] = ..., machine_query: _Optional[_Union[_machine_pb2.MachineQuery, _Mapping]] = ...) -> None: ...
+
+class SwitchServiceConnectedMachinesResponse(_message.Message):
+ __slots__ = ("switches_with_machines",)
+ SWITCHES_WITH_MACHINES_FIELD_NUMBER: _ClassVar[int]
+ switches_with_machines: _containers.RepeatedCompositeFieldContainer[_switch_pb2.SwitchWithMachines]
+ def __init__(self, switches_with_machines: _Optional[_Iterable[_Union[_switch_pb2.SwitchWithMachines, _Mapping]]] = ...) -> None: ...
diff --git a/python/metalstack/api/v2/switch_pb2.py b/python/metalstack/api/v2/switch_pb2.py
index 3973bb86..55f4775a 100644
--- a/python/metalstack/api/v2/switch_pb2.py
+++ b/python/metalstack/api/v2/switch_pb2.py
@@ -26,10 +26,11 @@
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
from metalstack.api.v2 import common_pb2 as metalstack_dot_api_dot_v2_dot_common__pb2
+from metalstack.api.v2 import machine_pb2 as metalstack_dot_api_dot_v2_dot_machine__pb2
from metalstack.api.v2 import predefined_rules_pb2 as metalstack_dot_api_dot_v2_dot_predefined__rules__pb2
-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\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xb3\x06\n\x06Switch\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12$\n\x04rack\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04rack\x88\x01\x01\x12)\n\tpartition\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\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\x38\n\x0fmanagement_user\x18\x08 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x01R\x0emanagementUser\x88\x01\x01\x12\x38\n\x0f\x63onsole_command\x18\t \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x02R\x0e\x63onsoleCommand\x88\x01\x01\x12\x30\n\x04nics\x18\n \x03(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x04nics\x12+\n\x02os\x18\x0b \x01(\x0b\x32\x1b.metalstack.api.v2.SwitchOSR\x02os\x12U\n\x13machine_connections\x18\x0c \x03(\x0b\x32$.metalstack.api.v2.MachineConnectionR\x12machineConnections\x12:\n\tlast_sync\x18\r \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\x08lastSync\x12\x45\n\x0flast_sync_error\x18\x0e \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\rlastSyncErrorB\x07\n\x05_rackB\x12\n\x10_management_userB\x12\n\x10_console_command\"\xb1\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\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07version\x12\x39\n\x12metal_core_version\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x10metalCoreVersion\"\x9c\x03\n\tSwitchNic\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12+\n\nidentifier\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\nidentifier\x12\x1d\n\x03mac\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x03mac\x12\"\n\x03vrf\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x03vrf\x88\x01\x01\x12\x36\n\x05state\x18\x05 \x01(\x0b\x32\x1b.metalstack.api.v2.NicStateH\x01R\x05state\x88\x01\x01\x12@\n\nbgp_filter\x18\x06 \x01(\x0b\x32\x1c.metalstack.api.v2.BGPFilterH\x02R\tbgpFilter\x88\x01\x01\x12P\n\x0e\x62gp_port_state\x18\x07 \x01(\x0b\x32%.metalstack.api.v2.SwitchBGPPortStateH\x03R\x0c\x62gpPortState\x88\x01\x01\x42\x06\n\x04_vrfB\x08\n\x06_stateB\r\n\x0b_bgp_filterB\x11\n\x0f_bgp_port_state\"T\n\tBGPFilter\x12\"\n\x05\x63idrs\x18\x01 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x05\x63idrs\x12#\n\x04vnis\x18\x02 \x03(\tB\x0f\xbaH\x0c\x92\x01\t\"\x07r\x05\x10\x02\x18\x80\x01R\x04vnis\"\x92\x03\n\x12SwitchBGPPortState\x12\'\n\x08neighbor\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x08neighbor\x12*\n\npeer_group\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\tpeerGroup\x12&\n\x08vrf_name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\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\x12S\n\x18\x62gp_timer_up_established\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\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\"\xab\x01\n\x08NicState\x12L\n\x07\x64\x65sired\x18\x01 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x07\x64\x65sired\x88\x01\x01\x12\x45\n\x06\x61\x63tual\x18\x02 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06\x61\x63tualB\n\n\x08_desired\"b\n\x11MachineConnection\x12\x1d\n\nmachine_id\x18\x01 \x01(\tR\tmachineId\x12.\n\x03nic\x18\x02 \x01(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x03nic\"\xe3\x01\n\x0bSwitchQuery\x12\"\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12.\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x01R\tpartition\x88\x01\x01\x12$\n\x04rack\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x02R\x04rack\x88\x01\x01\x12\x35\n\x02os\x18\x04 \x01(\x0b\x32 .metalstack.api.v2.SwitchOSQueryH\x03R\x02os\x88\x01\x01\x42\x05\n\x03_idB\x0c\n\n_partitionB\x07\n\x05_rackB\x05\n\x03_os\"\x9c\x01\n\rSwitchOSQuery\x12H\n\x06vendor\x18\x01 \x01(\x0e\x32!.metalstack.api.v2.SwitchOSVendorB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x06vendor\x88\x01\x01\x12*\n\x07version\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x07version\x88\x01\x01\x42\t\n\x07_vendorB\n\n\x08_version\"\x98\x01\n\nSwitchSync\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x35\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x08\x64uration\x12\x19\n\x05\x65rror\x18\x03 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_error*\x89\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\x43onnect\x12 \n\x10\x42GP_STATE_ACTIVE\x10\x03\x1a\n\x82\xb2\x19\x06\x41\x63tive\x12%\n\x13\x42GP_STATE_OPEN_SENT\x10\x04\x1a\x0c\x82\xb2\x19\x08OpenSent\x12+\n\x16\x42GP_STATE_OPEN_CONFIRM\x10\x05\x1a\x0f\x82\xb2\x19\x0bOpenConfirm\x12*\n\x15\x42GP_STATE_ESTABLISHED\x10\x06\x1a\x0f\x82\xb2\x19\x0b\x45stablished*\xa2\x01\n\x11SwitchReplaceMode\x12)\n\x1fSWITCH_REPLACE_MODE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\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\x43umulus\x12%\n\x16SWITCH_OS_VENDOR_SONIC\x10\x02\x1a\t\x82\xb2\x19\x05SONiC*\xad\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\x64own\x12+\n\x1aSWITCH_PORT_STATUS_UNKNOWN\x10\x03\x1a\x0b\x82\xb2\x19\x07unknownB\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')
+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\x1fgoogle/protobuf/timestamp.proto\x1a\x1emetalstack/api/v2/common.proto\x1a\x1fmetalstack/api/v2/machine.proto\x1a(metalstack/api/v2/predefined_rules.proto\"\xb3\x06\n\x06Switch\x12\x1d\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01R\x02id\x12+\n\x04meta\x18\x02 \x01(\x0b\x32\x17.metalstack.api.v2.MetaR\x04meta\x12-\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc8\xb3\xae\xb1\x02\x01R\x0b\x64\x65scription\x12$\n\x04rack\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x04rack\x88\x01\x01\x12)\n\tpartition\x18\x05 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\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\x38\n\x0fmanagement_user\x18\x08 \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x01R\x0emanagementUser\x88\x01\x01\x12\x38\n\x0f\x63onsole_command\x18\t \x01(\tB\n\xbaH\x07r\x05\x10\x02\x18\x80\x01H\x02R\x0e\x63onsoleCommand\x88\x01\x01\x12\x30\n\x04nics\x18\n \x03(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x04nics\x12+\n\x02os\x18\x0b \x01(\x0b\x32\x1b.metalstack.api.v2.SwitchOSR\x02os\x12U\n\x13machine_connections\x18\x0c \x03(\x0b\x32$.metalstack.api.v2.MachineConnectionR\x12machineConnections\x12:\n\tlast_sync\x18\r \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\x08lastSync\x12\x45\n\x0flast_sync_error\x18\x0e \x01(\x0b\x32\x1d.metalstack.api.v2.SwitchSyncR\rlastSyncErrorB\x07\n\x05_rackB\x12\n\x10_management_userB\x12\n\x10_console_command\"\xb1\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\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x07version\x12\x39\n\x12metal_core_version\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x10metalCoreVersion\"\x9c\x03\n\tSwitchNic\x12\x1f\n\x04name\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x04name\x12+\n\nidentifier\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\nidentifier\x12\x1d\n\x03mac\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xb8\xb3\xae\xb1\x02\x01R\x03mac\x12\"\n\x03vrf\x18\x04 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x00R\x03vrf\x88\x01\x01\x12\x36\n\x05state\x18\x05 \x01(\x0b\x32\x1b.metalstack.api.v2.NicStateH\x01R\x05state\x88\x01\x01\x12@\n\nbgp_filter\x18\x06 \x01(\x0b\x32\x1c.metalstack.api.v2.BGPFilterH\x02R\tbgpFilter\x88\x01\x01\x12P\n\x0e\x62gp_port_state\x18\x07 \x01(\x0b\x32%.metalstack.api.v2.SwitchBGPPortStateH\x03R\x0c\x62gpPortState\x88\x01\x01\x42\x06\n\x04_vrfB\x08\n\x06_stateB\r\n\x0b_bgp_filterB\x11\n\x0f_bgp_port_state\"T\n\tBGPFilter\x12\"\n\x05\x63idrs\x18\x01 \x03(\tB\x0c\xbaH\t\x92\x01\x06\xb8\xa4\xb3\xb1\x02\x01R\x05\x63idrs\x12#\n\x04vnis\x18\x02 \x03(\tB\x0f\xbaH\x0c\x92\x01\t\"\x07r\x05\x10\x02\x18\x80\x01R\x04vnis\"\x92\x03\n\x12SwitchBGPPortState\x12\'\n\x08neighbor\x18\x01 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\x08neighbor\x12*\n\npeer_group\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01R\tpeerGroup\x12&\n\x08vrf_name\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\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\x12S\n\x18\x62gp_timer_up_established\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\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\"\xab\x01\n\x08NicState\x12L\n\x07\x64\x65sired\x18\x01 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x07\x64\x65sired\x88\x01\x01\x12\x45\n\x06\x61\x63tual\x18\x02 \x01(\x0e\x32#.metalstack.api.v2.SwitchPortStatusB\x08\xbaH\x05\x82\x01\x02\x10\x01R\x06\x61\x63tualB\n\n\x08_desired\"b\n\x11MachineConnection\x12\x1d\n\nmachine_id\x18\x01 \x01(\tR\tmachineId\x12.\n\x03nic\x18\x02 \x01(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x03nic\"\xe3\x01\n\x0bSwitchQuery\x12\"\n\x02id\x18\x01 \x01(\tB\r\xbaH\nr\x08h\x01\xc0\xb3\xae\xb1\x02\x01H\x00R\x02id\x88\x01\x01\x12.\n\tpartition\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xd0\xb3\xae\xb1\x02\x01H\x01R\tpartition\x88\x01\x01\x12$\n\x04rack\x18\x03 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x02R\x04rack\x88\x01\x01\x12\x35\n\x02os\x18\x04 \x01(\x0b\x32 .metalstack.api.v2.SwitchOSQueryH\x03R\x02os\x88\x01\x01\x42\x05\n\x03_idB\x0c\n\n_partitionB\x07\n\x05_rackB\x05\n\x03_os\"\x9c\x01\n\rSwitchOSQuery\x12H\n\x06vendor\x18\x01 \x01(\x0e\x32!.metalstack.api.v2.SwitchOSVendorB\x08\xbaH\x05\x82\x01\x02\x10\x01H\x00R\x06vendor\x88\x01\x01\x12*\n\x07version\x18\x02 \x01(\tB\x0b\xbaH\x08r\x06\xc0\xb3\xae\xb1\x02\x01H\x01R\x07version\x88\x01\x01\x42\t\n\x07_vendorB\n\n\x08_version\"\x98\x01\n\nSwitchSync\x12.\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x04time\x12\x35\n\x08\x64uration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationR\x08\x64uration\x12\x19\n\x05\x65rror\x18\x03 \x01(\tH\x00R\x05\x65rror\x88\x01\x01\x42\x08\n\x06_error\"\xa1\x01\n\x12SwitchWithMachines\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n\tpartition\x18\x02 \x01(\tR\tpartition\x12\x12\n\x04rack\x18\x03 \x01(\tR\x04rack\x12I\n\x0b\x63onnections\x18\x04 \x03(\x0b\x32\'.metalstack.api.v2.SwitchNicWithMachineR\x0b\x63onnections\"\xba\x04\n\x14SwitchNicWithMachine\x12.\n\x03nic\x18\x01 \x01(\x0b\x32\x1c.metalstack.api.v2.SwitchNicR\x03nic\x12\x12\n\x04uuid\x18\x02 \x01(\tR\x04uuid\x12\x12\n\x04size\x18\x03 \x01(\tR\x04size\x12/\n\x13\x61llocation_hostname\x18\x04 \x01(\tR\x12\x61llocationHostname\x12#\n\rvpn_connected\x18\x05 \x01(\x08R\x0cvpnConnected\x12,\n\x12\x66ru_product_serial\x18\x06 \x01(\tR\x10\x66ruProductSerial\x12\x35\n\x17\x66ru_chassis_part_serial\x18\x07 \x01(\tR\x14\x66ruChassisPartSerial\x12\x44\n\nliveliness\x18\x08 \x01(\x0e\x32$.metalstack.api.v2.MachineLivelinessR\nliveliness\x12\x35\n\x05state\x18\t \x01(\x0e\x32\x1f.metalstack.api.v2.MachineStateR\x05state\x12%\n\x0e\x66\x61iled_reclaim\x18\n \x01(\x08R\rfailedReclaim\x12\x1c\n\tcrashloop\x18\x0b \x01(\x08R\tcrashloop\x12M\n\x15last_error_event_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x12lastErrorEventTime*\x89\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\x43onnect\x12 \n\x10\x42GP_STATE_ACTIVE\x10\x03\x1a\n\x82\xb2\x19\x06\x41\x63tive\x12%\n\x13\x42GP_STATE_OPEN_SENT\x10\x04\x1a\x0c\x82\xb2\x19\x08OpenSent\x12+\n\x16\x42GP_STATE_OPEN_CONFIRM\x10\x05\x1a\x0f\x82\xb2\x19\x0bOpenConfirm\x12*\n\x15\x42GP_STATE_ESTABLISHED\x10\x06\x1a\x0f\x82\xb2\x19\x0b\x45stablished*\xa2\x01\n\x11SwitchReplaceMode\x12)\n\x1fSWITCH_REPLACE_MODE_UNSPECIFIED\x10\x00\x1a\x04\x82\xb2\x19\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\x43umulus\x12%\n\x16SWITCH_OS_VENDOR_SONIC\x10\x02\x1a\t\x82\xb2\x19\x05SONiC*\xad\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\x64own\x12+\n\x1aSWITCH_PORT_STATUS_UNKNOWN\x10\x03\x1a\x0b\x82\xb2\x19\x07unknownB\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')
_globals = globals()
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -121,32 +122,36 @@
_globals['_SWITCHOSQUERY'].fields_by_name['vendor']._serialized_options = b'\272H\005\202\001\002\020\001'
_globals['_SWITCHOSQUERY'].fields_by_name['version']._loaded_options = None
_globals['_SWITCHOSQUERY'].fields_by_name['version']._serialized_options = b'\272H\010r\006\300\263\256\261\002\001'
- _globals['_BGPSTATE']._serialized_start=2948
- _globals['_BGPSTATE']._serialized_end=3213
- _globals['_SWITCHREPLACEMODE']._serialized_start=3216
- _globals['_SWITCHREPLACEMODE']._serialized_end=3378
- _globals['_SWITCHOSVENDOR']._serialized_start=3381
- _globals['_SWITCHOSVENDOR']._serialized_end=3513
- _globals['_SWITCHPORTSTATUS']._serialized_start=3516
- _globals['_SWITCHPORTSTATUS']._serialized_end=3689
- _globals['_SWITCH']._serialized_start=222
- _globals['_SWITCH']._serialized_end=1041
- _globals['_SWITCHOS']._serialized_start=1044
- _globals['_SWITCHOS']._serialized_end=1221
- _globals['_SWITCHNIC']._serialized_start=1224
- _globals['_SWITCHNIC']._serialized_end=1636
- _globals['_BGPFILTER']._serialized_start=1638
- _globals['_BGPFILTER']._serialized_end=1722
- _globals['_SWITCHBGPPORTSTATE']._serialized_start=1725
- _globals['_SWITCHBGPPORTSTATE']._serialized_end=2127
- _globals['_NICSTATE']._serialized_start=2130
- _globals['_NICSTATE']._serialized_end=2301
- _globals['_MACHINECONNECTION']._serialized_start=2303
- _globals['_MACHINECONNECTION']._serialized_end=2401
- _globals['_SWITCHQUERY']._serialized_start=2404
- _globals['_SWITCHQUERY']._serialized_end=2631
- _globals['_SWITCHOSQUERY']._serialized_start=2634
- _globals['_SWITCHOSQUERY']._serialized_end=2790
- _globals['_SWITCHSYNC']._serialized_start=2793
- _globals['_SWITCHSYNC']._serialized_end=2945
+ _globals['_BGPSTATE']._serialized_start=3718
+ _globals['_BGPSTATE']._serialized_end=3983
+ _globals['_SWITCHREPLACEMODE']._serialized_start=3986
+ _globals['_SWITCHREPLACEMODE']._serialized_end=4148
+ _globals['_SWITCHOSVENDOR']._serialized_start=4151
+ _globals['_SWITCHOSVENDOR']._serialized_end=4283
+ _globals['_SWITCHPORTSTATUS']._serialized_start=4286
+ _globals['_SWITCHPORTSTATUS']._serialized_end=4459
+ _globals['_SWITCH']._serialized_start=255
+ _globals['_SWITCH']._serialized_end=1074
+ _globals['_SWITCHOS']._serialized_start=1077
+ _globals['_SWITCHOS']._serialized_end=1254
+ _globals['_SWITCHNIC']._serialized_start=1257
+ _globals['_SWITCHNIC']._serialized_end=1669
+ _globals['_BGPFILTER']._serialized_start=1671
+ _globals['_BGPFILTER']._serialized_end=1755
+ _globals['_SWITCHBGPPORTSTATE']._serialized_start=1758
+ _globals['_SWITCHBGPPORTSTATE']._serialized_end=2160
+ _globals['_NICSTATE']._serialized_start=2163
+ _globals['_NICSTATE']._serialized_end=2334
+ _globals['_MACHINECONNECTION']._serialized_start=2336
+ _globals['_MACHINECONNECTION']._serialized_end=2434
+ _globals['_SWITCHQUERY']._serialized_start=2437
+ _globals['_SWITCHQUERY']._serialized_end=2664
+ _globals['_SWITCHOSQUERY']._serialized_start=2667
+ _globals['_SWITCHOSQUERY']._serialized_end=2823
+ _globals['_SWITCHSYNC']._serialized_start=2826
+ _globals['_SWITCHSYNC']._serialized_end=2978
+ _globals['_SWITCHWITHMACHINES']._serialized_start=2981
+ _globals['_SWITCHWITHMACHINES']._serialized_end=3142
+ _globals['_SWITCHNICWITHMACHINE']._serialized_start=3145
+ _globals['_SWITCHNICWITHMACHINE']._serialized_end=3715
# @@protoc_insertion_point(module_scope)
diff --git a/python/metalstack/api/v2/switch_pb2.pyi b/python/metalstack/api/v2/switch_pb2.pyi
index 96ee6444..927ead9f 100644
--- a/python/metalstack/api/v2/switch_pb2.pyi
+++ b/python/metalstack/api/v2/switch_pb2.pyi
@@ -4,6 +4,7 @@ from buf.validate import validate_pb2 as _validate_pb2
from google.protobuf import duration_pb2 as _duration_pb2
from google.protobuf import timestamp_pb2 as _timestamp_pb2
from metalstack.api.v2 import common_pb2 as _common_pb2
+from metalstack.api.v2 import machine_pb2 as _machine_pb2
from metalstack.api.v2 import predefined_rules_pb2 as _predefined_rules_pb2
from google.protobuf.internal import containers as _containers
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
@@ -191,3 +192,43 @@ class SwitchSync(_message.Message):
duration: _duration_pb2.Duration
error: str
def __init__(self, time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., duration: _Optional[_Union[datetime.timedelta, _duration_pb2.Duration, _Mapping]] = ..., error: _Optional[str] = ...) -> None: ...
+
+class SwitchWithMachines(_message.Message):
+ __slots__ = ("id", "partition", "rack", "connections")
+ ID_FIELD_NUMBER: _ClassVar[int]
+ PARTITION_FIELD_NUMBER: _ClassVar[int]
+ RACK_FIELD_NUMBER: _ClassVar[int]
+ CONNECTIONS_FIELD_NUMBER: _ClassVar[int]
+ id: str
+ partition: str
+ rack: str
+ connections: _containers.RepeatedCompositeFieldContainer[SwitchNicWithMachine]
+ def __init__(self, id: _Optional[str] = ..., partition: _Optional[str] = ..., rack: _Optional[str] = ..., connections: _Optional[_Iterable[_Union[SwitchNicWithMachine, _Mapping]]] = ...) -> None: ...
+
+class SwitchNicWithMachine(_message.Message):
+ __slots__ = ("nic", "uuid", "size", "allocation_hostname", "vpn_connected", "fru_product_serial", "fru_chassis_part_serial", "liveliness", "state", "failed_reclaim", "crashloop", "last_error_event_time")
+ NIC_FIELD_NUMBER: _ClassVar[int]
+ UUID_FIELD_NUMBER: _ClassVar[int]
+ SIZE_FIELD_NUMBER: _ClassVar[int]
+ ALLOCATION_HOSTNAME_FIELD_NUMBER: _ClassVar[int]
+ VPN_CONNECTED_FIELD_NUMBER: _ClassVar[int]
+ FRU_PRODUCT_SERIAL_FIELD_NUMBER: _ClassVar[int]
+ FRU_CHASSIS_PART_SERIAL_FIELD_NUMBER: _ClassVar[int]
+ LIVELINESS_FIELD_NUMBER: _ClassVar[int]
+ STATE_FIELD_NUMBER: _ClassVar[int]
+ FAILED_RECLAIM_FIELD_NUMBER: _ClassVar[int]
+ CRASHLOOP_FIELD_NUMBER: _ClassVar[int]
+ LAST_ERROR_EVENT_TIME_FIELD_NUMBER: _ClassVar[int]
+ nic: SwitchNic
+ uuid: str
+ size: str
+ allocation_hostname: str
+ vpn_connected: bool
+ fru_product_serial: str
+ fru_chassis_part_serial: str
+ liveliness: _machine_pb2.MachineLiveliness
+ state: _machine_pb2.MachineState
+ failed_reclaim: bool
+ crashloop: bool
+ last_error_event_time: _timestamp_pb2.Timestamp
+ def __init__(self, nic: _Optional[_Union[SwitchNic, _Mapping]] = ..., uuid: _Optional[str] = ..., size: _Optional[str] = ..., allocation_hostname: _Optional[str] = ..., vpn_connected: _Optional[bool] = ..., fru_product_serial: _Optional[str] = ..., fru_chassis_part_serial: _Optional[str] = ..., liveliness: _Optional[_Union[_machine_pb2.MachineLiveliness, str]] = ..., state: _Optional[_Union[_machine_pb2.MachineState, str]] = ..., failed_reclaim: _Optional[bool] = ..., crashloop: _Optional[bool] = ..., last_error_event_time: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ...) -> None: ...