diff --git a/factory_reset/factory_reset.pb.go b/factory_reset/factory_reset.pb.go index d7b05070..90fc5eae 100644 --- a/factory_reset/factory_reset.pb.go +++ b/factory_reset/factory_reset.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.36.8 -// protoc v6.32.0 +// protoc-gen-go v1.36.6 +// protoc v6.31.1 // source: github.com/openconfig/gnoi/factory_reset/factory_reset.proto package factory_reset @@ -22,6 +22,86 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type DecommissionRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + RebootDelay uint64 `protobuf:"varint,1,opt,name=reboot_delay,json=rebootDelay,proto3" json:"reboot_delay,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DecommissionRequest) Reset() { + *x = DecommissionRequest{} + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DecommissionRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecommissionRequest) ProtoMessage() {} + +func (x *DecommissionRequest) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[0] + 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 DecommissionRequest.ProtoReflect.Descriptor instead. +func (*DecommissionRequest) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{0} +} + +func (x *DecommissionRequest) GetRebootDelay() uint64 { + if x != nil { + return x.RebootDelay + } + return 0 +} + +type DecommissionResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DecommissionResponse) Reset() { + *x = DecommissionResponse{} + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DecommissionResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DecommissionResponse) ProtoMessage() {} + +func (x *DecommissionResponse) ProtoReflect() protoreflect.Message { + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[1] + 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 DecommissionResponse.ProtoReflect.Descriptor instead. +func (*DecommissionResponse) Descriptor() ([]byte, []int) { + return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{1} +} + type StartRequest struct { state protoimpl.MessageState `protogen:"open.v1"` FactoryOs bool `protobuf:"varint,1,opt,name=factory_os,json=factoryOs,proto3" json:"factory_os,omitempty"` @@ -33,7 +113,7 @@ type StartRequest struct { func (x *StartRequest) Reset() { *x = StartRequest{} - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[0] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -45,7 +125,7 @@ func (x *StartRequest) String() string { func (*StartRequest) ProtoMessage() {} func (x *StartRequest) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[0] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -58,7 +138,7 @@ func (x *StartRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StartRequest.ProtoReflect.Descriptor instead. func (*StartRequest) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{0} + return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{2} } func (x *StartRequest) GetFactoryOs() bool { @@ -90,7 +170,7 @@ type ResetSuccess struct { func (x *ResetSuccess) Reset() { *x = ResetSuccess{} - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[1] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -102,7 +182,7 @@ func (x *ResetSuccess) String() string { func (*ResetSuccess) ProtoMessage() {} func (x *ResetSuccess) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[1] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -115,7 +195,7 @@ func (x *ResetSuccess) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetSuccess.ProtoReflect.Descriptor instead. func (*ResetSuccess) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{1} + return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{3} } type ResetError struct { @@ -130,7 +210,7 @@ type ResetError struct { func (x *ResetError) Reset() { *x = ResetError{} - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[2] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -142,7 +222,7 @@ func (x *ResetError) String() string { func (*ResetError) ProtoMessage() {} func (x *ResetError) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[2] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -155,7 +235,7 @@ func (x *ResetError) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetError.ProtoReflect.Descriptor instead. func (*ResetError) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{2} + return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{4} } func (x *ResetError) GetFactoryOsUnsupported() bool { @@ -199,7 +279,7 @@ type StartResponse struct { func (x *StartResponse) Reset() { *x = StartResponse{} - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[3] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -211,7 +291,7 @@ func (x *StartResponse) String() string { func (*StartResponse) ProtoMessage() {} func (x *StartResponse) ProtoReflect() protoreflect.Message { - mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[3] + mi := &file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -224,7 +304,7 @@ func (x *StartResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StartResponse.ProtoReflect.Descriptor instead. func (*StartResponse) Descriptor() ([]byte, []int) { - return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{3} + return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZIP(), []int{5} } func (x *StartResponse) GetResponse() isStartResponse_Response { @@ -272,7 +352,10 @@ var File_github_com_openconfig_gnoi_factory_reset_factory_reset_proto protorefle const file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDesc = "" + "\n" + - "\x050.1.0Z(github.com/openconfig/gnoi/factory_resetb\x06proto3" + "\x05Start\x12 .gnoi.factory_reset.StartRequest\x1a!.gnoi.factory_reset.StartResponse\x12a\n" + + "\fDecommission\x12'.gnoi.factory_reset.DecommissionRequest\x1a(.gnoi.factory_reset.DecommissionResponseB2\xd2>\x050.1.0Z(github.com/openconfig/gnoi/factory_resetb\x06proto3" var ( file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescOnce sync.Once @@ -306,20 +390,24 @@ func file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescGZ return file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDescData } -var file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_goTypes = []any{ - (*StartRequest)(nil), // 0: gnoi.factory_reset.StartRequest - (*ResetSuccess)(nil), // 1: gnoi.factory_reset.ResetSuccess - (*ResetError)(nil), // 2: gnoi.factory_reset.ResetError - (*StartResponse)(nil), // 3: gnoi.factory_reset.StartResponse + (*DecommissionRequest)(nil), // 0: gnoi.factory_reset.DecommissionRequest + (*DecommissionResponse)(nil), // 1: gnoi.factory_reset.DecommissionResponse + (*StartRequest)(nil), // 2: gnoi.factory_reset.StartRequest + (*ResetSuccess)(nil), // 3: gnoi.factory_reset.ResetSuccess + (*ResetError)(nil), // 4: gnoi.factory_reset.ResetError + (*StartResponse)(nil), // 5: gnoi.factory_reset.StartResponse } var file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_depIdxs = []int32{ - 1, // 0: gnoi.factory_reset.StartResponse.reset_success:type_name -> gnoi.factory_reset.ResetSuccess - 2, // 1: gnoi.factory_reset.StartResponse.reset_error:type_name -> gnoi.factory_reset.ResetError - 0, // 2: gnoi.factory_reset.FactoryReset.Start:input_type -> gnoi.factory_reset.StartRequest - 3, // 3: gnoi.factory_reset.FactoryReset.Start:output_type -> gnoi.factory_reset.StartResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type + 3, // 0: gnoi.factory_reset.StartResponse.reset_success:type_name -> gnoi.factory_reset.ResetSuccess + 4, // 1: gnoi.factory_reset.StartResponse.reset_error:type_name -> gnoi.factory_reset.ResetError + 2, // 2: gnoi.factory_reset.FactoryReset.Start:input_type -> gnoi.factory_reset.StartRequest + 0, // 3: gnoi.factory_reset.FactoryReset.Decommission:input_type -> gnoi.factory_reset.DecommissionRequest + 5, // 4: gnoi.factory_reset.FactoryReset.Start:output_type -> gnoi.factory_reset.StartResponse + 1, // 5: gnoi.factory_reset.FactoryReset.Decommission:output_type -> gnoi.factory_reset.DecommissionResponse + 4, // [4:6] is the sub-list for method output_type + 2, // [2:4] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name 2, // [2:2] is the sub-list for extension extendee 0, // [0:2] is the sub-list for field type_name @@ -330,7 +418,7 @@ func file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_init() { if File_github_com_openconfig_gnoi_factory_reset_factory_reset_proto != nil { return } - file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[3].OneofWrappers = []any{ + file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_msgTypes[5].OneofWrappers = []any{ (*StartResponse_ResetSuccess)(nil), (*StartResponse_ResetError)(nil), } @@ -340,7 +428,7 @@ func file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDesc), len(file_github_com_openconfig_gnoi_factory_reset_factory_reset_proto_rawDesc)), NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/factory_reset/factory_reset.proto b/factory_reset/factory_reset.proto index a035c636..974f0763 100644 --- a/factory_reset/factory_reset.proto +++ b/factory_reset/factory_reset.proto @@ -26,6 +26,27 @@ service FactoryReset { // code INVALID_ARGUMENT must be returned with the details value set to a // properly populated ResetError message. rpc Start(StartRequest) returns (StartResponse); + + // The Decommission RPC allows the Client to instruct the Target to + // decommission the Target and reboot. + // The Target should not boot back to the OS. + // The decommissioning process is vendor-defined, but may involves removal + // of OS images, persistent storage, licenses, and is more comprehensive + // than the Start RPC, with no options to retain anything. + // To facilitate a response being returned to the caller, the reboot + // component of this RPC is asynchronous and will run after the RPC + // has returned a DecommissionResponse. + rpc Decommission(DecommissionRequest) returns (DecommissionResponse); +} + +message DecommissionRequest{ + // Time (in nanoseconds) that the Target should + // wait before issuing the reboot to complete the decommission. + // If unset, the Target will assume a default of 15000000000 (15 seconds) + uint64 reboot_delay = 1; +} + +message DecommissionResponse{ } message StartRequest { diff --git a/factory_reset/factory_reset_grpc.pb.go b/factory_reset/factory_reset_grpc.pb.go index 31c76d50..7535ba98 100644 --- a/factory_reset/factory_reset_grpc.pb.go +++ b/factory_reset/factory_reset_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v6.32.0 +// - protoc v6.31.1 // source: github.com/openconfig/gnoi/factory_reset/factory_reset.proto package factory_reset @@ -19,7 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - FactoryReset_Start_FullMethodName = "/gnoi.factory_reset.FactoryReset/Start" + FactoryReset_Start_FullMethodName = "/gnoi.factory_reset.FactoryReset/Start" + FactoryReset_Decommission_FullMethodName = "/gnoi.factory_reset.FactoryReset/Decommission" ) // FactoryResetClient is the client API for FactoryReset service. @@ -27,6 +28,7 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type FactoryResetClient interface { Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) + Decommission(ctx context.Context, in *DecommissionRequest, opts ...grpc.CallOption) (*DecommissionResponse, error) } type factoryResetClient struct { @@ -47,11 +49,22 @@ func (c *factoryResetClient) Start(ctx context.Context, in *StartRequest, opts . return out, nil } +func (c *factoryResetClient) Decommission(ctx context.Context, in *DecommissionRequest, opts ...grpc.CallOption) (*DecommissionResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DecommissionResponse) + err := c.cc.Invoke(ctx, FactoryReset_Decommission_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // FactoryResetServer is the server API for FactoryReset service. // All implementations should embed UnimplementedFactoryResetServer // for forward compatibility. type FactoryResetServer interface { Start(context.Context, *StartRequest) (*StartResponse, error) + Decommission(context.Context, *DecommissionRequest) (*DecommissionResponse, error) } // UnimplementedFactoryResetServer should be embedded to have @@ -64,6 +77,9 @@ type UnimplementedFactoryResetServer struct{} func (UnimplementedFactoryResetServer) Start(context.Context, *StartRequest) (*StartResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") } +func (UnimplementedFactoryResetServer) Decommission(context.Context, *DecommissionRequest) (*DecommissionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Decommission not implemented") +} func (UnimplementedFactoryResetServer) testEmbeddedByValue() {} // UnsafeFactoryResetServer may be embedded to opt out of forward compatibility for this service. @@ -102,6 +118,24 @@ func _FactoryReset_Start_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _FactoryReset_Decommission_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DecommissionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FactoryResetServer).Decommission(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: FactoryReset_Decommission_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FactoryResetServer).Decommission(ctx, req.(*DecommissionRequest)) + } + return interceptor(ctx, in, info, handler) +} + // FactoryReset_ServiceDesc is the grpc.ServiceDesc for FactoryReset service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -113,6 +147,10 @@ var FactoryReset_ServiceDesc = grpc.ServiceDesc{ MethodName: "Start", Handler: _FactoryReset_Start_Handler, }, + { + MethodName: "Decommission", + Handler: _FactoryReset_Decommission_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.com/openconfig/gnoi/factory_reset/factory_reset.proto",