diff --git a/fence/README.md b/fence/README.md index 5301c04..1bbfc70 100644 --- a/fence/README.md +++ b/fence/README.md @@ -66,6 +66,11 @@ service FenceController { // ListClusterFence RPC call to provide a list of blocklisted/fenced clients. rpc ListClusterFence(ListClusterFenceRequest) returns (ListClusterFenceResponse){} + + // GetFenceClients RPC calls to get the clients information that needs + // to be fenced. + rpc GetFenceClients(GetFenceClientsRequest) + returns (GetFenceClientsResponse){} } ``` @@ -145,6 +150,40 @@ message CIDR { } ``` +### GetFenceClients + +```protobuf +// GetFenceClientsRequest contains the necessary information to identify +// the clients that need fencing. +message GetFenceClientsRequest { + // Plugin-specific parameters passed in as opaque key-value pairs. + map parameters = 1; + // Secrets required by the plugin to complete the request. + map secrets = 2 [(csi.v1.csi_secret) = true]; +} + +// GetFenceClientsResponse holds the information about clients that require +// fencing. +message GetFenceClientsResponse { + // List of clients that need to be fenced. + repeated ClientDetails clients = 1; +} +``` + +### ClientDetails + +```protobuf +// ClientDetails holds the information about the client that requires fencing. +message ClientDetails { + // id represents the unique identifier of the client. + // Required field. + string id = 1; + // list of IP addresses that represent the client's local addresses. + // Required field. + repeated CIDR addresses = 2; +} +``` + #### Error Scheme | Condition | gRPC Code | Description | Recovery Behavior | diff --git a/fence/fence.proto b/fence/fence.proto index 44cfd95..f2d0565 100644 --- a/fence/fence.proto +++ b/fence/fence.proto @@ -21,6 +21,11 @@ service FenceController { // ListClusterFence RPC call to provide a list of blocklisted/fenced clients. rpc ListClusterFence(ListClusterFenceRequest) returns (ListClusterFenceResponse){} + + // GetFenceClients RPC calls to get the clients information that needs + // to be fenced. + rpc GetFenceClients(GetFenceClientsRequest) + returns (GetFenceClientsResponse){} } // FenceClusterNetworkRequest contains the information needed to identify // the storage cluster so that the appropriate fencing operation can be @@ -78,3 +83,27 @@ message CIDR { // CIDR block string cidr = 1; } +// GetFenceClientsRequest contains the necessary information to identify +// the clients that need fencing. +message GetFenceClientsRequest { + // Plugin-specific parameters passed in as opaque key-value pairs. + map parameters = 1; + // Secrets required by the plugin to complete the request. + map secrets = 2 [(csi.v1.csi_secret) = true]; +} + +// GetFenceClientsResponse holds the information about clients that require +// fencing. +message GetFenceClientsResponse { + // List of clients that need to be fenced. + repeated ClientDetails clients = 1; +} +// ClientDetails holds the information about the client that requires fencing. +message ClientDetails { + // id represents the unique identifier of the client. + // Required field. + string id = 1; + // list of IP addresses that represent the client's local addresses. + // Required field. + repeated CIDR addresses = 2; +} diff --git a/lib/go/fence/fence.pb.go b/lib/go/fence/fence.pb.go index a1cf684..54915db 100644 --- a/lib/go/fence/fence.pb.go +++ b/lib/go/fence/fence.pb.go @@ -402,6 +402,175 @@ func (x *CIDR) GetCidr() string { return "" } +// GetFenceClientsRequest contains the necessary information to identify +// the clients that need fencing. +type GetFenceClientsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Plugin-specific parameters passed in as opaque key-value pairs. + Parameters map[string]string `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Secrets required by the plugin to complete the request. + Secrets map[string]string `protobuf:"bytes,2,rep,name=secrets,proto3" json:"secrets,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GetFenceClientsRequest) Reset() { + *x = GetFenceClientsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_fence_fence_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFenceClientsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFenceClientsRequest) ProtoMessage() {} + +func (x *GetFenceClientsRequest) ProtoReflect() protoreflect.Message { + mi := &file_fence_fence_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFenceClientsRequest.ProtoReflect.Descriptor instead. +func (*GetFenceClientsRequest) Descriptor() ([]byte, []int) { + return file_fence_fence_proto_rawDescGZIP(), []int{7} +} + +func (x *GetFenceClientsRequest) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *GetFenceClientsRequest) GetSecrets() map[string]string { + if x != nil { + return x.Secrets + } + return nil +} + +// GetFenceClientsResponse holds the information about clients that require +// fencing. +type GetFenceClientsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of clients that need to be fenced. + Clients []*ClientDetails `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` +} + +func (x *GetFenceClientsResponse) Reset() { + *x = GetFenceClientsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_fence_fence_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetFenceClientsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetFenceClientsResponse) ProtoMessage() {} + +func (x *GetFenceClientsResponse) ProtoReflect() protoreflect.Message { + mi := &file_fence_fence_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetFenceClientsResponse.ProtoReflect.Descriptor instead. +func (*GetFenceClientsResponse) Descriptor() ([]byte, []int) { + return file_fence_fence_proto_rawDescGZIP(), []int{8} +} + +func (x *GetFenceClientsResponse) GetClients() []*ClientDetails { + if x != nil { + return x.Clients + } + return nil +} + +// ClientDetails holds the information about the client that requires fencing. +type ClientDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id represents the unique identifier of the client. + // Required field. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // list of IP addresses that represent the client's local addresses. + // Required field. + Addresses []*CIDR `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *ClientDetails) Reset() { + *x = ClientDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_fence_fence_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClientDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientDetails) ProtoMessage() {} + +func (x *ClientDetails) ProtoReflect() protoreflect.Message { + mi := &file_fence_fence_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClientDetails.ProtoReflect.Descriptor instead. +func (*ClientDetails) Descriptor() ([]byte, []int) { + return file_fence_fence_proto_rawDescGZIP(), []int{9} +} + +func (x *ClientDetails) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ClientDetails) GetAddresses() []*CIDR { + if x != nil { + return x.Addresses + } + return nil +} + var File_fence_fence_proto protoreflect.FileDescriptor var file_fence_fence_proto_rawDesc = []byte{ @@ -486,29 +655,62 @@ var file_fence_fence_proto_rawDesc = []byte{ 0x32, 0x0b, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x05, 0x63, 0x69, 0x64, 0x72, 0x73, 0x22, 0x1a, 0x0a, 0x04, 0x43, 0x49, 0x44, 0x52, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x69, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x64, 0x72, - 0x32, 0xae, 0x02, 0x0a, 0x0f, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x13, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x21, 0x2e, 0x66, 0x65, - 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, - 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, - 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x15, 0x55, 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, - 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x23, 0x2e, - 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x66, 0x65, 0x6e, - 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, - 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1e, - 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x73, 0x69, 0x2d, 0x61, 0x64, 0x64, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2f, - 0x6c, 0x69, 0x62, 0x2f, 0x67, 0x6f, 0x2f, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0xad, 0x02, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0a, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2d, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x49, 0x0a, 0x07, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x66, 0x65, + 0x6e, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0x98, 0x42, 0x01, 0x52, 0x07, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3a, 0x0a, 0x0c, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0x49, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x66, + 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x0d, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, 0x0a, 0x09, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0b, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x49, 0x44, 0x52, 0x52, 0x09, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x32, 0x82, 0x03, 0x0a, 0x0f, 0x46, 0x65, 0x6e, 0x63, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x13, 0x46, + 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x12, 0x21, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, 0x6e, 0x63, 0x65, + 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x46, 0x65, + 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x15, 0x55, + 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x23, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x55, 0x6e, 0x66, + 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x66, 0x65, 0x6e, 0x63, + 0x65, 0x2e, 0x55, 0x6e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x55, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, + 0x46, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x46, + 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1d, 0x2e, 0x66, 0x65, + 0x6e, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x66, 0x65, 0x6e, + 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x29, 0x5a, 0x27, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x73, 0x69, 0x2d, 0x61, + 0x64, 0x64, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x6c, 0x69, 0x62, 0x2f, 0x67, + 0x6f, 0x2f, 0x66, 0x65, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -523,7 +725,7 @@ func file_fence_fence_proto_rawDescGZIP() []byte { return file_fence_fence_proto_rawDescData } -var file_fence_fence_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_fence_fence_proto_msgTypes = make([]protoimpl.MessageInfo, 18) var file_fence_fence_proto_goTypes = []interface{}{ (*FenceClusterNetworkRequest)(nil), // 0: fence.FenceClusterNetworkRequest (*FenceClusterNetworkResponse)(nil), // 1: fence.FenceClusterNetworkResponse @@ -532,34 +734,45 @@ var file_fence_fence_proto_goTypes = []interface{}{ (*ListClusterFenceRequest)(nil), // 4: fence.ListClusterFenceRequest (*ListClusterFenceResponse)(nil), // 5: fence.ListClusterFenceResponse (*CIDR)(nil), // 6: fence.CIDR - nil, // 7: fence.FenceClusterNetworkRequest.ParametersEntry - nil, // 8: fence.FenceClusterNetworkRequest.SecretsEntry - nil, // 9: fence.UnfenceClusterNetworkRequest.ParametersEntry - nil, // 10: fence.UnfenceClusterNetworkRequest.SecretsEntry - nil, // 11: fence.ListClusterFenceRequest.ParametersEntry - nil, // 12: fence.ListClusterFenceRequest.SecretsEntry + (*GetFenceClientsRequest)(nil), // 7: fence.GetFenceClientsRequest + (*GetFenceClientsResponse)(nil), // 8: fence.GetFenceClientsResponse + (*ClientDetails)(nil), // 9: fence.ClientDetails + nil, // 10: fence.FenceClusterNetworkRequest.ParametersEntry + nil, // 11: fence.FenceClusterNetworkRequest.SecretsEntry + nil, // 12: fence.UnfenceClusterNetworkRequest.ParametersEntry + nil, // 13: fence.UnfenceClusterNetworkRequest.SecretsEntry + nil, // 14: fence.ListClusterFenceRequest.ParametersEntry + nil, // 15: fence.ListClusterFenceRequest.SecretsEntry + nil, // 16: fence.GetFenceClientsRequest.ParametersEntry + nil, // 17: fence.GetFenceClientsRequest.SecretsEntry } var file_fence_fence_proto_depIdxs = []int32{ - 7, // 0: fence.FenceClusterNetworkRequest.parameters:type_name -> fence.FenceClusterNetworkRequest.ParametersEntry - 8, // 1: fence.FenceClusterNetworkRequest.secrets:type_name -> fence.FenceClusterNetworkRequest.SecretsEntry + 10, // 0: fence.FenceClusterNetworkRequest.parameters:type_name -> fence.FenceClusterNetworkRequest.ParametersEntry + 11, // 1: fence.FenceClusterNetworkRequest.secrets:type_name -> fence.FenceClusterNetworkRequest.SecretsEntry 6, // 2: fence.FenceClusterNetworkRequest.cidrs:type_name -> fence.CIDR - 9, // 3: fence.UnfenceClusterNetworkRequest.parameters:type_name -> fence.UnfenceClusterNetworkRequest.ParametersEntry - 10, // 4: fence.UnfenceClusterNetworkRequest.secrets:type_name -> fence.UnfenceClusterNetworkRequest.SecretsEntry + 12, // 3: fence.UnfenceClusterNetworkRequest.parameters:type_name -> fence.UnfenceClusterNetworkRequest.ParametersEntry + 13, // 4: fence.UnfenceClusterNetworkRequest.secrets:type_name -> fence.UnfenceClusterNetworkRequest.SecretsEntry 6, // 5: fence.UnfenceClusterNetworkRequest.cidrs:type_name -> fence.CIDR - 11, // 6: fence.ListClusterFenceRequest.parameters:type_name -> fence.ListClusterFenceRequest.ParametersEntry - 12, // 7: fence.ListClusterFenceRequest.secrets:type_name -> fence.ListClusterFenceRequest.SecretsEntry + 14, // 6: fence.ListClusterFenceRequest.parameters:type_name -> fence.ListClusterFenceRequest.ParametersEntry + 15, // 7: fence.ListClusterFenceRequest.secrets:type_name -> fence.ListClusterFenceRequest.SecretsEntry 6, // 8: fence.ListClusterFenceResponse.cidrs:type_name -> fence.CIDR - 0, // 9: fence.FenceController.FenceClusterNetwork:input_type -> fence.FenceClusterNetworkRequest - 2, // 10: fence.FenceController.UnfenceClusterNetwork:input_type -> fence.UnfenceClusterNetworkRequest - 4, // 11: fence.FenceController.ListClusterFence:input_type -> fence.ListClusterFenceRequest - 1, // 12: fence.FenceController.FenceClusterNetwork:output_type -> fence.FenceClusterNetworkResponse - 3, // 13: fence.FenceController.UnfenceClusterNetwork:output_type -> fence.UnfenceClusterNetworkResponse - 5, // 14: fence.FenceController.ListClusterFence:output_type -> fence.ListClusterFenceResponse - 12, // [12:15] is the sub-list for method output_type - 9, // [9:12] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 16, // 9: fence.GetFenceClientsRequest.parameters:type_name -> fence.GetFenceClientsRequest.ParametersEntry + 17, // 10: fence.GetFenceClientsRequest.secrets:type_name -> fence.GetFenceClientsRequest.SecretsEntry + 9, // 11: fence.GetFenceClientsResponse.clients:type_name -> fence.ClientDetails + 6, // 12: fence.ClientDetails.addresses:type_name -> fence.CIDR + 0, // 13: fence.FenceController.FenceClusterNetwork:input_type -> fence.FenceClusterNetworkRequest + 2, // 14: fence.FenceController.UnfenceClusterNetwork:input_type -> fence.UnfenceClusterNetworkRequest + 4, // 15: fence.FenceController.ListClusterFence:input_type -> fence.ListClusterFenceRequest + 7, // 16: fence.FenceController.GetFenceClients:input_type -> fence.GetFenceClientsRequest + 1, // 17: fence.FenceController.FenceClusterNetwork:output_type -> fence.FenceClusterNetworkResponse + 3, // 18: fence.FenceController.UnfenceClusterNetwork:output_type -> fence.UnfenceClusterNetworkResponse + 5, // 19: fence.FenceController.ListClusterFence:output_type -> fence.ListClusterFenceResponse + 8, // 20: fence.FenceController.GetFenceClients:output_type -> fence.GetFenceClientsResponse + 17, // [17:21] is the sub-list for method output_type + 13, // [13:17] 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 } func init() { file_fence_fence_proto_init() } @@ -652,6 +865,42 @@ func file_fence_fence_proto_init() { return nil } } + file_fence_fence_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFenceClientsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fence_fence_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetFenceClientsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_fence_fence_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClientDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -659,7 +908,7 @@ func file_fence_fence_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_fence_fence_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 18, NumExtensions: 0, NumServices: 1, }, diff --git a/lib/go/fence/fence_grpc.pb.go b/lib/go/fence/fence_grpc.pb.go index 87043d2..1ed32dd 100644 --- a/lib/go/fence/fence_grpc.pb.go +++ b/lib/go/fence/fence_grpc.pb.go @@ -24,6 +24,7 @@ const ( FenceController_FenceClusterNetwork_FullMethodName = "/fence.FenceController/FenceClusterNetwork" FenceController_UnfenceClusterNetwork_FullMethodName = "/fence.FenceController/UnfenceClusterNetwork" FenceController_ListClusterFence_FullMethodName = "/fence.FenceController/ListClusterFence" + FenceController_GetFenceClients_FullMethodName = "/fence.FenceController/GetFenceClients" ) // FenceControllerClient is the client API for FenceController service. @@ -37,6 +38,9 @@ type FenceControllerClient interface { UnfenceClusterNetwork(ctx context.Context, in *UnfenceClusterNetworkRequest, opts ...grpc.CallOption) (*UnfenceClusterNetworkResponse, error) // ListClusterFence RPC call to provide a list of blocklisted/fenced clients. ListClusterFence(ctx context.Context, in *ListClusterFenceRequest, opts ...grpc.CallOption) (*ListClusterFenceResponse, error) + // GetFenceClients RPC calls to get the clients information that needs + // to be fenced. + GetFenceClients(ctx context.Context, in *GetFenceClientsRequest, opts ...grpc.CallOption) (*GetFenceClientsResponse, error) } type fenceControllerClient struct { @@ -74,6 +78,15 @@ func (c *fenceControllerClient) ListClusterFence(ctx context.Context, in *ListCl return out, nil } +func (c *fenceControllerClient) GetFenceClients(ctx context.Context, in *GetFenceClientsRequest, opts ...grpc.CallOption) (*GetFenceClientsResponse, error) { + out := new(GetFenceClientsResponse) + err := c.cc.Invoke(ctx, FenceController_GetFenceClients_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // FenceControllerServer is the server API for FenceController service. // All implementations must embed UnimplementedFenceControllerServer // for forward compatibility @@ -85,6 +98,9 @@ type FenceControllerServer interface { UnfenceClusterNetwork(context.Context, *UnfenceClusterNetworkRequest) (*UnfenceClusterNetworkResponse, error) // ListClusterFence RPC call to provide a list of blocklisted/fenced clients. ListClusterFence(context.Context, *ListClusterFenceRequest) (*ListClusterFenceResponse, error) + // GetFenceClients RPC calls to get the clients information that needs + // to be fenced. + GetFenceClients(context.Context, *GetFenceClientsRequest) (*GetFenceClientsResponse, error) mustEmbedUnimplementedFenceControllerServer() } @@ -101,6 +117,9 @@ func (UnimplementedFenceControllerServer) UnfenceClusterNetwork(context.Context, func (UnimplementedFenceControllerServer) ListClusterFence(context.Context, *ListClusterFenceRequest) (*ListClusterFenceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListClusterFence not implemented") } +func (UnimplementedFenceControllerServer) GetFenceClients(context.Context, *GetFenceClientsRequest) (*GetFenceClientsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFenceClients not implemented") +} func (UnimplementedFenceControllerServer) mustEmbedUnimplementedFenceControllerServer() {} // UnsafeFenceControllerServer may be embedded to opt out of forward compatibility for this service. @@ -168,6 +187,24 @@ func _FenceController_ListClusterFence_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _FenceController_GetFenceClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFenceClientsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FenceControllerServer).GetFenceClients(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: FenceController_GetFenceClients_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FenceControllerServer).GetFenceClients(ctx, req.(*GetFenceClientsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // FenceController_ServiceDesc is the grpc.ServiceDesc for FenceController service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -187,6 +224,10 @@ var FenceController_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListClusterFence", Handler: _FenceController_ListClusterFence_Handler, }, + { + MethodName: "GetFenceClients", + Handler: _FenceController_GetFenceClients_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "fence/fence.proto",