From 3edd743221ed01b5c12b4d29fce54d042706e52f Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 28 Jan 2021 09:40:29 +0530 Subject: [PATCH 01/11] client list using search API Signed-off-by: Vivek Singh --- api/external/infra_proxy/infra_proxy.pb.gw.go | 18 ++ .../infra_proxy/infra_proxy.swagger.json | 52 +++++ .../infra_proxy/request/clients.pb.go | 211 +++++++++++++----- .../infra_proxy/request/clients.proto | 11 + .../infra_proxy/response/clients.pb.go | 127 ++++++----- .../infra_proxy/response/clients.proto | 4 + .../infra_proxy/request/clients.pb.go | 201 ++++++++++++----- .../infra_proxy/request/clients.proto | 11 + .../infra_proxy/response/clients.pb.go | 125 ++++++----- .../infra_proxy/response/clients.proto | 8 +- .../api/infra_proxy.pb.swagger.go | 52 +++++ .../handler/infra_proxy/clients.go | 7 + .../infra_proxy/infra_proxy.swagger.json | 52 +++++ .../infra-proxy-service/server/clients.go | 97 ++++++-- 14 files changed, 748 insertions(+), 228 deletions(-) diff --git a/api/external/infra_proxy/infra_proxy.pb.gw.go b/api/external/infra_proxy/infra_proxy.pb.gw.go index 3a9d076708d..9e924333ceb 100644 --- a/api/external/infra_proxy/infra_proxy.pb.gw.go +++ b/api/external/infra_proxy/infra_proxy.pb.gw.go @@ -1632,6 +1632,10 @@ func local_request_InfraProxy_UpdateRole_0(ctx context.Context, marshaler runtim } +var ( + filter_InfraProxy_GetClients_0 = &utilities.DoubleArray{Encoding: map[string]int{"server_id": 0, "org_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + func request_InfraProxy_GetClients_0(ctx context.Context, marshaler runtime.Marshaler, client InfraProxyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq request.Clients var metadata runtime.ServerMetadata @@ -1665,6 +1669,13 @@ func request_InfraProxy_GetClients_0(ctx context.Context, marshaler runtime.Mars return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfraProxy_GetClients_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.GetClients(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err @@ -1703,6 +1714,13 @@ func local_request_InfraProxy_GetClients_0(ctx context.Context, marshaler runtim return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) } + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_InfraProxy_GetClients_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := server.GetClients(ctx, &protoReq) return msg, metadata, err diff --git a/api/external/infra_proxy/infra_proxy.swagger.json b/api/external/infra_proxy/infra_proxy.swagger.json index e6f5728b793..906af9d3fc2 100644 --- a/api/external/infra_proxy/infra_proxy.swagger.json +++ b/api/external/infra_proxy/infra_proxy.swagger.json @@ -482,6 +482,29 @@ "in": "path", "required": true, "type": "string" + }, + { + "name": "search_query.q", + "description": "The search query used to identify a list of items.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "search_query.start", + "description": "The number of result pages to return.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "search_query.rows", + "description": "The number of results on each page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" } ], "tags": [ @@ -2183,6 +2206,25 @@ } } }, + "chef.automate.api.infra_proxy.request.SearchQuery": { + "type": "object", + "properties": { + "q": { + "type": "string", + "description": "The search query used to identify a list of items." + }, + "start": { + "type": "integer", + "format": "int32", + "description": "The number of result pages to return." + }, + "rows": { + "type": "integer", + "format": "int32", + "description": "The number of results on each page." + } + } + }, "chef.automate.api.infra_proxy.request.UpdateDataBagItem": { "type": "object", "properties": { @@ -2494,6 +2536,16 @@ "$ref": "#/definitions/chef.automate.api.infra_proxy.response.ClientListItem" }, "description": "Client list." + }, + "total": { + "type": "integer", + "format": "int32", + "description": "Total number of records." + }, + "start": { + "type": "integer", + "format": "int32", + "description": "The number of result pages to return." } } }, diff --git a/api/external/infra_proxy/request/clients.pb.go b/api/external/infra_proxy/request/clients.pb.go index 33ba6346e00..3437b971368 100644 --- a/api/external/infra_proxy/request/clients.pb.go +++ b/api/external/infra_proxy/request/clients.pb.go @@ -25,6 +25,72 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 +type SearchQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The search query used to identify a list of items. + Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty"` + // The number of result pages to return. + Start int32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` + // The number of results on each page. + Rows int32 `protobuf:"varint,3,opt,name=rows,proto3" json:"rows,omitempty"` +} + +func (x *SearchQuery) Reset() { + *x = SearchQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchQuery) ProtoMessage() {} + +func (x *SearchQuery) ProtoReflect() protoreflect.Message { + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] + 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 SearchQuery.ProtoReflect.Descriptor instead. +func (*SearchQuery) Descriptor() ([]byte, []int) { + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} +} + +func (x *SearchQuery) GetQ() string { + if x != nil { + return x.Q + } + return "" +} + +func (x *SearchQuery) GetStart() int32 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *SearchQuery) GetRows() int32 { + if x != nil { + return x.Rows + } + return 0 +} + type Clients struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -34,12 +100,14 @@ type Clients struct { OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` // Chef Infra Server ID. ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` + // Clients search query. + SearchQuery *SearchQuery `protobuf:"bytes,3,opt,name=search_query,json=searchQuery,proto3" json:"search_query,omitempty"` } func (x *Clients) Reset() { *x = Clients{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -52,7 +120,7 @@ func (x *Clients) String() string { func (*Clients) ProtoMessage() {} func (x *Clients) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -65,7 +133,7 @@ func (x *Clients) ProtoReflect() protoreflect.Message { // Deprecated: Use Clients.ProtoReflect.Descriptor instead. func (*Clients) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} } func (x *Clients) GetOrgId() string { @@ -82,6 +150,13 @@ func (x *Clients) GetServerId() string { return "" } +func (x *Clients) GetSearchQuery() *SearchQuery { + if x != nil { + return x.SearchQuery + } + return nil +} + type Client struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -98,7 +173,7 @@ type Client struct { func (x *Client) Reset() { *x = Client{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -111,7 +186,7 @@ func (x *Client) String() string { func (*Client) ProtoMessage() {} func (x *Client) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -124,7 +199,7 @@ func (x *Client) ProtoReflect() protoreflect.Message { // Deprecated: Use Client.ProtoReflect.Descriptor instead. func (*Client) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} } func (x *Client) GetOrgId() string { @@ -168,7 +243,7 @@ type CreateClient struct { func (x *CreateClient) Reset() { *x = CreateClient{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -181,7 +256,7 @@ func (x *CreateClient) String() string { func (*CreateClient) ProtoMessage() {} func (x *CreateClient) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -194,7 +269,7 @@ func (x *CreateClient) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateClient.ProtoReflect.Descriptor instead. func (*CreateClient) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} } func (x *CreateClient) GetOrgId() string { @@ -250,7 +325,7 @@ type ClientKey struct { func (x *ClientKey) Reset() { *x = ClientKey{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -263,7 +338,7 @@ func (x *ClientKey) String() string { func (*ClientKey) ProtoMessage() {} func (x *ClientKey) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -276,7 +351,7 @@ func (x *ClientKey) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientKey.ProtoReflect.Descriptor instead. func (*ClientKey) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{4} } func (x *ClientKey) GetOrgId() string { @@ -315,36 +390,46 @@ var file_external_infra_proxy_request_clients_proto_rawDesc = []byte{ 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, - 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x49, 0x64, 0x22, 0x50, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, - 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, - 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x65, 0x0a, 0x09, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, - 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, - 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x71, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x07, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x55, 0x0a, 0x0c, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x32, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x22, 0x50, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, + 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, + 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x65, 0x0a, 0x09, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -359,19 +444,21 @@ func file_external_infra_proxy_request_clients_proto_rawDescGZIP() []byte { return file_external_infra_proxy_request_clients_proto_rawDescData } -var file_external_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_external_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_external_infra_proxy_request_clients_proto_goTypes = []interface{}{ - (*Clients)(nil), // 0: chef.automate.api.infra_proxy.request.Clients - (*Client)(nil), // 1: chef.automate.api.infra_proxy.request.Client - (*CreateClient)(nil), // 2: chef.automate.api.infra_proxy.request.CreateClient - (*ClientKey)(nil), // 3: chef.automate.api.infra_proxy.request.ClientKey + (*SearchQuery)(nil), // 0: chef.automate.api.infra_proxy.request.SearchQuery + (*Clients)(nil), // 1: chef.automate.api.infra_proxy.request.Clients + (*Client)(nil), // 2: chef.automate.api.infra_proxy.request.Client + (*CreateClient)(nil), // 3: chef.automate.api.infra_proxy.request.CreateClient + (*ClientKey)(nil), // 4: chef.automate.api.infra_proxy.request.ClientKey } var file_external_infra_proxy_request_clients_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 0, // 0: chef.automate.api.infra_proxy.request.Clients.search_query:type_name -> chef.automate.api.infra_proxy.request.SearchQuery + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_external_infra_proxy_request_clients_proto_init() } @@ -381,7 +468,7 @@ func file_external_infra_proxy_request_clients_proto_init() { } if !protoimpl.UnsafeEnabled { file_external_infra_proxy_request_clients_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Clients); i { + switch v := v.(*SearchQuery); i { case 0: return &v.state case 1: @@ -393,7 +480,7 @@ func file_external_infra_proxy_request_clients_proto_init() { } } file_external_infra_proxy_request_clients_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client); i { + switch v := v.(*Clients); i { case 0: return &v.state case 1: @@ -405,7 +492,7 @@ func file_external_infra_proxy_request_clients_proto_init() { } } file_external_infra_proxy_request_clients_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateClient); i { + switch v := v.(*Client); i { case 0: return &v.state case 1: @@ -417,6 +504,18 @@ func file_external_infra_proxy_request_clients_proto_init() { } } file_external_infra_proxy_request_clients_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateClient); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_external_infra_proxy_request_clients_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientKey); i { case 0: return &v.state @@ -435,7 +534,7 @@ func file_external_infra_proxy_request_clients_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_external_infra_proxy_request_clients_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/api/external/infra_proxy/request/clients.proto b/api/external/infra_proxy/request/clients.proto index fe94436a11f..a60d55f1faa 100644 --- a/api/external/infra_proxy/request/clients.proto +++ b/api/external/infra_proxy/request/clients.proto @@ -3,11 +3,22 @@ syntax = "proto3"; package chef.automate.api.infra_proxy.request; option go_package = "github.com/chef/automate/api/external/infra_proxy/request"; +message SearchQuery { + // The search query used to identify a list of items. + string q = 1; + // The number of result pages to return. + int32 start = 2; + // The number of results on each page. + int32 rows = 3; +} + message Clients { // Chef organization ID. string org_id = 1; // Chef Infra Server ID. string server_id = 2; + // Clients search query. + SearchQuery search_query = 3; } message Client { diff --git a/api/external/infra_proxy/response/clients.pb.go b/api/external/infra_proxy/response/clients.pb.go index dd4c9900d62..fd7291447f8 100644 --- a/api/external/infra_proxy/response/clients.pb.go +++ b/api/external/infra_proxy/response/clients.pb.go @@ -32,6 +32,10 @@ type Clients struct { // Client list. Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` + // Total number of records. + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + // The number of result pages to return. + Start int32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` } func (x *Clients) Reset() { @@ -73,6 +77,20 @@ func (x *Clients) GetClients() []*ClientListItem { return nil } +func (x *Clients) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *Clients) GetStart() int32 { + if x != nil { + return x.Start + } + return 0 +} + type ClientListItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -429,59 +447,62 @@ var file_external_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x26, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x73, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8a, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, - 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x74, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, - 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, - 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, + 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, + 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8a, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, + 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, + 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, + 0x65, 0x79, 0x22, 0x74, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x68, 0x65, + 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, + 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/external/infra_proxy/response/clients.proto b/api/external/infra_proxy/response/clients.proto index 5525d405acd..a244bd99a76 100644 --- a/api/external/infra_proxy/response/clients.proto +++ b/api/external/infra_proxy/response/clients.proto @@ -6,6 +6,10 @@ option go_package = "github.com/chef/automate/api/external/infra_proxy/response" message Clients { // Client list. repeated ClientListItem clients = 1; + // Total number of records. + int32 total = 2; + // The number of result pages to return. + int32 start = 3; } message ClientListItem { diff --git a/api/interservice/infra_proxy/request/clients.pb.go b/api/interservice/infra_proxy/request/clients.pb.go index 7a287f91200..341ec7c3a6c 100644 --- a/api/interservice/infra_proxy/request/clients.pb.go +++ b/api/interservice/infra_proxy/request/clients.pb.go @@ -25,6 +25,72 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 +type SearchQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The search query used to identify a list of items. + Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty" toml:"q,omitempty" mapstructure:"q,omitempty"` + // The number of result pages to return. + Start int32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty" toml:"start,omitempty" mapstructure:"start,omitempty"` + // The number of results on each page. + Rows int32 `protobuf:"varint,3,opt,name=rows,proto3" json:"rows,omitempty" toml:"rows,omitempty" mapstructure:"rows,omitempty"` +} + +func (x *SearchQuery) Reset() { + *x = SearchQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchQuery) ProtoMessage() {} + +func (x *SearchQuery) ProtoReflect() protoreflect.Message { + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] + 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 SearchQuery.ProtoReflect.Descriptor instead. +func (*SearchQuery) Descriptor() ([]byte, []int) { + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} +} + +func (x *SearchQuery) GetQ() string { + if x != nil { + return x.Q + } + return "" +} + +func (x *SearchQuery) GetStart() int32 { + if x != nil { + return x.Start + } + return 0 +} + +func (x *SearchQuery) GetRows() int32 { + if x != nil { + return x.Rows + } + return 0 +} + type Clients struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -34,12 +100,14 @@ type Clients struct { OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty" toml:"org_id,omitempty" mapstructure:"org_id,omitempty"` // Chef Infra Server ID. ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty" toml:"server_id,omitempty" mapstructure:"server_id,omitempty"` + // Clients search query. + SearchQuery *SearchQuery `protobuf:"bytes,3,opt,name=search_query,json=searchQuery,proto3" json:"search_query,omitempty" toml:"search_query,omitempty" mapstructure:"search_query,omitempty"` } func (x *Clients) Reset() { *x = Clients{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -52,7 +120,7 @@ func (x *Clients) String() string { func (*Clients) ProtoMessage() {} func (x *Clients) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -65,7 +133,7 @@ func (x *Clients) ProtoReflect() protoreflect.Message { // Deprecated: Use Clients.ProtoReflect.Descriptor instead. func (*Clients) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} } func (x *Clients) GetOrgId() string { @@ -82,6 +150,13 @@ func (x *Clients) GetServerId() string { return "" } +func (x *Clients) GetSearchQuery() *SearchQuery { + if x != nil { + return x.SearchQuery + } + return nil +} + type Client struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -98,7 +173,7 @@ type Client struct { func (x *Client) Reset() { *x = Client{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -111,7 +186,7 @@ func (x *Client) String() string { func (*Client) ProtoMessage() {} func (x *Client) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -124,7 +199,7 @@ func (x *Client) ProtoReflect() protoreflect.Message { // Deprecated: Use Client.ProtoReflect.Descriptor instead. func (*Client) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} } func (x *Client) GetOrgId() string { @@ -168,7 +243,7 @@ type CreateClient struct { func (x *CreateClient) Reset() { *x = CreateClient{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -181,7 +256,7 @@ func (x *CreateClient) String() string { func (*CreateClient) ProtoMessage() {} func (x *CreateClient) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -194,7 +269,7 @@ func (x *CreateClient) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateClient.ProtoReflect.Descriptor instead. func (*CreateClient) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} } func (x *CreateClient) GetOrgId() string { @@ -250,7 +325,7 @@ type ClientKey struct { func (x *ClientKey) Reset() { *x = ClientKey{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -263,7 +338,7 @@ func (x *ClientKey) String() string { func (*ClientKey) ProtoMessage() {} func (x *ClientKey) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -276,7 +351,7 @@ func (x *ClientKey) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientKey.ProtoReflect.Descriptor instead. func (*ClientKey) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{4} } func (x *ClientKey) GetOrgId() string { @@ -315,37 +390,47 @@ var file_interservice_infra_proxy_request_clients_proto_rawDesc = []byte{ 0x73, 0x74, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x28, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x07, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, + 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x0b, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x77, + 0x73, 0x22, 0x97, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, + 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, + 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x58, 0x0a, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, + 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, + 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0x50, 0x0a, 0x06, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x22, 0x50, 0x0a, 0x06, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0c, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, - 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, - 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, - 0x79, 0x22, 0x65, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, + 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, + 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, - 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x22, 0x65, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, + 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -360,19 +445,21 @@ func file_interservice_infra_proxy_request_clients_proto_rawDescGZIP() []byte { return file_interservice_infra_proxy_request_clients_proto_rawDescData } -var file_interservice_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_interservice_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_interservice_infra_proxy_request_clients_proto_goTypes = []interface{}{ - (*Clients)(nil), // 0: chef.automate.domain.infra_proxy.request.Clients - (*Client)(nil), // 1: chef.automate.domain.infra_proxy.request.Client - (*CreateClient)(nil), // 2: chef.automate.domain.infra_proxy.request.CreateClient - (*ClientKey)(nil), // 3: chef.automate.domain.infra_proxy.request.ClientKey + (*SearchQuery)(nil), // 0: chef.automate.domain.infra_proxy.request.SearchQuery + (*Clients)(nil), // 1: chef.automate.domain.infra_proxy.request.Clients + (*Client)(nil), // 2: chef.automate.domain.infra_proxy.request.Client + (*CreateClient)(nil), // 3: chef.automate.domain.infra_proxy.request.CreateClient + (*ClientKey)(nil), // 4: chef.automate.domain.infra_proxy.request.ClientKey } var file_interservice_infra_proxy_request_clients_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name + 0, // 0: chef.automate.domain.infra_proxy.request.Clients.search_query:type_name -> chef.automate.domain.infra_proxy.request.SearchQuery + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_interservice_infra_proxy_request_clients_proto_init() } @@ -382,7 +469,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { } if !protoimpl.UnsafeEnabled { file_interservice_infra_proxy_request_clients_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Clients); i { + switch v := v.(*SearchQuery); i { case 0: return &v.state case 1: @@ -394,7 +481,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { } } file_interservice_infra_proxy_request_clients_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client); i { + switch v := v.(*Clients); i { case 0: return &v.state case 1: @@ -406,7 +493,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { } } file_interservice_infra_proxy_request_clients_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateClient); i { + switch v := v.(*Client); i { case 0: return &v.state case 1: @@ -418,6 +505,18 @@ func file_interservice_infra_proxy_request_clients_proto_init() { } } file_interservice_infra_proxy_request_clients_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateClient); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_interservice_infra_proxy_request_clients_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientKey); i { case 0: return &v.state @@ -436,7 +535,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_interservice_infra_proxy_request_clients_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 5, NumExtensions: 0, NumServices: 0, }, diff --git a/api/interservice/infra_proxy/request/clients.proto b/api/interservice/infra_proxy/request/clients.proto index a587e0f631d..99128605a1d 100644 --- a/api/interservice/infra_proxy/request/clients.proto +++ b/api/interservice/infra_proxy/request/clients.proto @@ -3,11 +3,22 @@ syntax = "proto3"; package chef.automate.domain.infra_proxy.request; option go_package = "github.com/chef/automate/api/interservice/infra_proxy/request"; +message SearchQuery { + // The search query used to identify a list of items. + string q = 1; + // The number of result pages to return. + int32 start = 2; + // The number of results on each page. + int32 rows = 3; +} + message Clients { // Chef organization ID. string org_id = 1; // Chef Infra Server ID. string server_id = 2; + // Clients search query. + SearchQuery search_query = 3; } message Client { diff --git a/api/interservice/infra_proxy/response/clients.pb.go b/api/interservice/infra_proxy/response/clients.pb.go index 5546bba2f03..8aba6dcc1f7 100644 --- a/api/interservice/infra_proxy/response/clients.pb.go +++ b/api/interservice/infra_proxy/response/clients.pb.go @@ -32,6 +32,10 @@ type Clients struct { // Client list. Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty" toml:"clients,omitempty" mapstructure:"clients,omitempty"` + // Total number of records. + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty" toml:"total,omitempty" mapstructure:"total,omitempty"` + // The number of result pages to return. + Start int32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty" toml:"start,omitempty" mapstructure:"start,omitempty"` } func (x *Clients) Reset() { @@ -73,6 +77,20 @@ func (x *Clients) GetClients() []*ClientListItem { return nil } +func (x *Clients) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *Clients) GetStart() int32 { + if x != nil { + return x.Start + } + return 0 +} + type ClientListItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -429,60 +447,63 @@ var file_interservice_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x6e, 0x73, 0x65, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5e, 0x0a, 0x07, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, + 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8a, 0x01, 0x0a, + 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, + 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, + 0x8d, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, + 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x24, 0x0a, 0x0e, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, - 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, - 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, - 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, - 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x68, - 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, - 0x65, 0x79, 0x22, 0x77, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x68, 0x65, - 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, - 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, - 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, + 0x77, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, + 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/interservice/infra_proxy/response/clients.proto b/api/interservice/infra_proxy/response/clients.proto index 106677747af..ba64dda8945 100644 --- a/api/interservice/infra_proxy/response/clients.proto +++ b/api/interservice/infra_proxy/response/clients.proto @@ -4,8 +4,12 @@ package chef.automate.domain.infra_proxy.response; option go_package = "github.com/chef/automate/api/interservice/infra_proxy/response"; message Clients { - // Client list. - repeated ClientListItem clients = 1; + // Client list. + repeated ClientListItem clients = 1; + // Total number of records. + int32 total = 2; + // The number of result pages to return. + int32 start = 3; } message ClientListItem { diff --git a/components/automate-gateway/api/infra_proxy.pb.swagger.go b/components/automate-gateway/api/infra_proxy.pb.swagger.go index f8b40ff52dc..bfe236ad046 100644 --- a/components/automate-gateway/api/infra_proxy.pb.swagger.go +++ b/components/automate-gateway/api/infra_proxy.pb.swagger.go @@ -485,6 +485,29 @@ func init() { "in": "path", "required": true, "type": "string" + }, + { + "name": "search_query.q", + "description": "The search query used to identify a list of items.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "search_query.start", + "description": "The number of result pages to return.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "search_query.rows", + "description": "The number of results on each page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" } ], "tags": [ @@ -2186,6 +2209,25 @@ func init() { } } }, + "chef.automate.api.infra_proxy.request.SearchQuery": { + "type": "object", + "properties": { + "q": { + "type": "string", + "description": "The search query used to identify a list of items." + }, + "start": { + "type": "integer", + "format": "int32", + "description": "The number of result pages to return." + }, + "rows": { + "type": "integer", + "format": "int32", + "description": "The number of results on each page." + } + } + }, "chef.automate.api.infra_proxy.request.UpdateDataBagItem": { "type": "object", "properties": { @@ -2497,6 +2539,16 @@ func init() { "$ref": "#/definitions/chef.automate.api.infra_proxy.response.ClientListItem" }, "description": "Client list." + }, + "total": { + "type": "integer", + "format": "int32", + "description": "Total number of records." + }, + "start": { + "type": "integer", + "format": "int32", + "description": "The number of result pages to return." } } }, diff --git a/components/automate-gateway/handler/infra_proxy/clients.go b/components/automate-gateway/handler/infra_proxy/clients.go index 9b0751a97e4..2ab22a82c8d 100644 --- a/components/automate-gateway/handler/infra_proxy/clients.go +++ b/components/automate-gateway/handler/infra_proxy/clients.go @@ -14,6 +14,11 @@ func (a *InfraProxyServer) GetClients(ctx context.Context, r *gwreq.Clients) (*g req := &infra_req.Clients{ OrgId: r.OrgId, ServerId: r.ServerId, + SearchQuery: &infra_req.SearchQuery{ + Q: r.GetSearchQuery().GetQ(), + Start: r.GetSearchQuery().GetStart(), + Rows: r.GetSearchQuery().GetRows(), + }, } res, err := a.client.GetClients(ctx, req) if err != nil { @@ -22,6 +27,8 @@ func (a *InfraProxyServer) GetClients(ctx context.Context, r *gwreq.Clients) (*g return &gwres.Clients{ Clients: fromUpstreamClients(res.Clients), + Start: res.GetStart(), + Total: res.GetTotal(), }, nil } diff --git a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json index e6f5728b793..906af9d3fc2 100644 --- a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json +++ b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json @@ -482,6 +482,29 @@ "in": "path", "required": true, "type": "string" + }, + { + "name": "search_query.q", + "description": "The search query used to identify a list of items.", + "in": "query", + "required": false, + "type": "string" + }, + { + "name": "search_query.start", + "description": "The number of result pages to return.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "search_query.rows", + "description": "The number of results on each page.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" } ], "tags": [ @@ -2183,6 +2206,25 @@ } } }, + "chef.automate.api.infra_proxy.request.SearchQuery": { + "type": "object", + "properties": { + "q": { + "type": "string", + "description": "The search query used to identify a list of items." + }, + "start": { + "type": "integer", + "format": "int32", + "description": "The number of result pages to return." + }, + "rows": { + "type": "integer", + "format": "int32", + "description": "The number of results on each page." + } + } + }, "chef.automate.api.infra_proxy.request.UpdateDataBagItem": { "type": "object", "properties": { @@ -2494,6 +2536,16 @@ "$ref": "#/definitions/chef.automate.api.infra_proxy.response.ClientListItem" }, "description": "Client list." + }, + "total": { + "type": "integer", + "format": "int32", + "description": "Total number of records." + }, + "start": { + "type": "integer", + "format": "int32", + "description": "The number of result pages to return." } } }, diff --git a/components/infra-proxy-service/server/clients.go b/components/infra-proxy-service/server/clients.go index 9b6a30ef7c2..e971e99c268 100644 --- a/components/infra-proxy-service/server/clients.go +++ b/components/infra-proxy-service/server/clients.go @@ -3,7 +3,6 @@ package server import ( "context" "fmt" - "sort" chef "github.com/go-chef/chef" @@ -20,6 +19,20 @@ type AccessKeyReq struct { CreateKey bool `json:"create_key,omitempty"` } +// Client represents api client struct. +type Client struct { + Name string `json:"name"` + ClientName string `json:"clientname"` + OrgName string `json:"orgname"` +} + +// ClientResult list result from Search API +type ClientResult struct { + Total int `json:"total"` + Start int `json:"start"` + Rows []*Client `json:"rows"` +} + // GetClients get clients list func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*response.Clients, error) { c, err := s.createClient(ctx, req.OrgId, req.ServerId) @@ -27,17 +40,80 @@ func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*respons return nil, err } - clients, err := c.client.Clients.List() + res, err := c.SearchClients(req.SearchQuery) if err != nil { return nil, ParseAPIError(err) } return &response.Clients{ - Clients: fromAPIToListClients(clients), + Clients: fromAPIToListClients(res.Rows), + Start: int32(res.Start), + Total: int32(res.Total), }, nil } -// GetClient gets the client +// SearchClients gets client list from Chef Infra Server search API. +func (c *ChefClient) SearchClients(searchQuery *request.SearchQuery) (ClientResult, error) { + var result ClientResult + var searchAll bool + inc := 1000 + var query chef.SearchQuery + + if searchQuery == nil || searchQuery.Q == "" { + searchAll = true + query = chef.SearchQuery{ + Index: "client", + Query: "*:*", + Start: 0, + Rows: inc, + } + } else { + query = chef.SearchQuery{ + Index: "client", + Query: searchQuery.GetQ(), + Start: int(searchQuery.GetStart()), + Rows: int(searchQuery.GetRows()), + } + } + + fullURL := fmt.Sprintf("search/%s", query) + newReq, err := c.client.NewRequest("GET", fullURL, nil) + + if err != nil { + return result, ParseAPIError(err) + } + + res, err := c.client.Do(newReq, &result) + if err != nil { + return result, ParseAPIError(err) + } + + defer res.Body.Close() // nolint: errcheck + + if searchAll { + var searchResult ClientResult + start := result.Start + // the total rows available for this query across all pages + total := result.Total + for start+inc <= total { + query.Start = query.Start + inc + fullURL = fmt.Sprintf("search/%s", query) + + res1, err := c.client.Do(newReq, &searchResult) + if err != nil { + return result, ParseAPIError(err) + } + + defer res1.Body.Close() // nolint: errcheck + + // add this page of results to the primary SearchResult instance + result.Rows = append(result.Rows, searchResult.Rows...) + } + } + return result, nil +} + +// GetClient get client func (s *Server) GetClient(ctx context.Context, req *request.Client) (*response.Client, error) { c, err := s.createClient(ctx, req.OrgId, req.ServerId) if err != nil { @@ -204,20 +280,13 @@ func (s *Server) ResetClientKey(ctx context.Context, req *request.ClientKey) (*r } // fromAPIToListClients a response.Clients from a struct of ClientList -func fromAPIToListClients(al chef.ApiClientListResult) []*response.ClientListItem { +func fromAPIToListClients(al []*Client) []*response.ClientListItem { cl := make([]*response.ClientListItem, len(al)) - - index := 0 - for c := range al { + for index, c := range al { cl[index] = &response.ClientListItem{ - Name: c, + Name: c.Name, } index++ } - - sort.Slice(cl, func(i, j int) bool { - return cl[i].Name < cl[j].Name - }) - return cl } From 5e2352aa2f870b1a2b7dcea670bba4b45eadc92e Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 28 Jan 2021 14:42:21 +0530 Subject: [PATCH 02/11] default rows count if not provided Signed-off-by: Vivek Singh --- components/infra-proxy-service/server/clients.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/infra-proxy-service/server/clients.go b/components/infra-proxy-service/server/clients.go index e971e99c268..0973de1b1cb 100644 --- a/components/infra-proxy-service/server/clients.go +++ b/components/infra-proxy-service/server/clients.go @@ -68,11 +68,16 @@ func (c *ChefClient) SearchClients(searchQuery *request.SearchQuery) (ClientResu Rows: inc, } } else { + perPage := int(searchQuery.GetRows()) + if perPage == 0 { + perPage = 1000 + } + query = chef.SearchQuery{ Index: "client", Query: searchQuery.GetQ(), Start: int(searchQuery.GetStart()), - Rows: int(searchQuery.GetRows()), + Rows: perPage, } } From f502826381abf6462b1e03eec5d88102817774f8 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Wed, 3 Feb 2021 09:21:19 +0530 Subject: [PATCH 03/11] Use search query interface Signed-off-by: Vivek Singh --- .../infra-proxy-service/server/clients.go | 107 ++++-------------- 1 file changed, 20 insertions(+), 87 deletions(-) diff --git a/components/infra-proxy-service/server/clients.go b/components/infra-proxy-service/server/clients.go index 0973de1b1cb..055bbbe259e 100644 --- a/components/infra-proxy-service/server/clients.go +++ b/components/infra-proxy-service/server/clients.go @@ -19,20 +19,6 @@ type AccessKeyReq struct { CreateKey bool `json:"create_key,omitempty"` } -// Client represents api client struct. -type Client struct { - Name string `json:"name"` - ClientName string `json:"clientname"` - OrgName string `json:"orgname"` -} - -// ClientResult list result from Search API -type ClientResult struct { - Total int `json:"total"` - Start int `json:"start"` - Rows []*Client `json:"rows"` -} - // GetClients get clients list func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*response.Clients, error) { c, err := s.createClient(ctx, req.OrgId, req.ServerId) @@ -40,82 +26,29 @@ func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*respons return nil, err } - res, err := c.SearchClients(req.SearchQuery) - if err != nil { - return nil, ParseAPIError(err) - } - - return &response.Clients{ - Clients: fromAPIToListClients(res.Rows), - Start: int32(res.Start), - Total: int32(res.Total), - }, nil -} - -// SearchClients gets client list from Chef Infra Server search API. -func (c *ChefClient) SearchClients(searchQuery *request.SearchQuery) (ClientResult, error) { - var result ClientResult - var searchAll bool - inc := 1000 - var query chef.SearchQuery - - if searchQuery == nil || searchQuery.Q == "" { - searchAll = true - query = chef.SearchQuery{ - Index: "client", - Query: "*:*", - Start: 0, - Rows: inc, - } - } else { - perPage := int(searchQuery.GetRows()) - if perPage == 0 { - perPage = 1000 - } - - query = chef.SearchQuery{ - Index: "client", - Query: searchQuery.GetQ(), - Start: int(searchQuery.GetStart()), - Rows: perPage, - } + perPage := int(req.GetSearchQuery().GetRows()) + if perPage == 0 { + perPage = 1000 } - fullURL := fmt.Sprintf("search/%s", query) - newReq, err := c.client.NewRequest("GET", fullURL, nil) - - if err != nil { - return result, ParseAPIError(err) + searchStr := string(req.GetSearchQuery().GetQ()) + if searchStr == "" { + searchStr = "*:*" } + query, err := c.client.Search.NewQuery("client", searchStr) + query.Rows = perPage + query.Start = int(req.GetSearchQuery().GetStart()) - res, err := c.client.Do(newReq, &result) + res1, err := query.Do(c.client) if err != nil { - return result, ParseAPIError(err) + return nil, ParseAPIError(err) } - defer res.Body.Close() // nolint: errcheck - - if searchAll { - var searchResult ClientResult - start := result.Start - // the total rows available for this query across all pages - total := result.Total - for start+inc <= total { - query.Start = query.Start + inc - fullURL = fmt.Sprintf("search/%s", query) - - res1, err := c.client.Do(newReq, &searchResult) - if err != nil { - return result, ParseAPIError(err) - } - - defer res1.Body.Close() // nolint: errcheck - - // add this page of results to the primary SearchResult instance - result.Rows = append(result.Rows, searchResult.Rows...) - } - } - return result, nil + return &response.Clients{ + Clients: fromAPIToListClients(res1.Rows), + Start: int32(res1.Start), + Total: int32(res1.Total), + }, nil } // GetClient get client @@ -284,14 +217,14 @@ func (s *Server) ResetClientKey(ctx context.Context, req *request.ClientKey) (*r } -// fromAPIToListClients a response.Clients from a struct of ClientList -func fromAPIToListClients(al []*Client) []*response.ClientListItem { +// fromAPIToListClients a response ClientListItems from a result map interface +func fromAPIToListClients(al []interface{}) []*response.ClientListItem { cl := make([]*response.ClientListItem, len(al)) for index, c := range al { cl[index] = &response.ClientListItem{ - Name: c.Name, + Name: SafeStringFromMap(c.(map[string]interface{}), "name"), } - index++ } + return cl } From 8ecdb38041c4a08be1484390b3f4340997a002b6 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Wed, 3 Feb 2021 09:25:41 +0530 Subject: [PATCH 04/11] fixes tabs to spaces Signed-off-by: Vivek Singh --- api/external/infra_proxy/request/clients.proto | 12 ++++++------ api/external/infra_proxy/response/clients.proto | 8 ++++---- components/infra-proxy-service/server/clients.go | 8 ++++---- components/infra-proxy-service/server/roles_test.go | 13 +++++++++++++ 4 files changed, 27 insertions(+), 14 deletions(-) create mode 100644 components/infra-proxy-service/server/roles_test.go diff --git a/api/external/infra_proxy/request/clients.proto b/api/external/infra_proxy/request/clients.proto index a60d55f1faa..a81114cbd57 100644 --- a/api/external/infra_proxy/request/clients.proto +++ b/api/external/infra_proxy/request/clients.proto @@ -4,12 +4,12 @@ package chef.automate.api.infra_proxy.request; option go_package = "github.com/chef/automate/api/external/infra_proxy/request"; message SearchQuery { - // The search query used to identify a list of items. - string q = 1; - // The number of result pages to return. - int32 start = 2; - // The number of results on each page. - int32 rows = 3; + // The search query used to identify a list of items. + string q = 1; + // The number of result pages to return. + int32 start = 2; + // The number of results on each page. + int32 rows = 3; } message Clients { diff --git a/api/external/infra_proxy/response/clients.proto b/api/external/infra_proxy/response/clients.proto index a244bd99a76..c47abf96168 100644 --- a/api/external/infra_proxy/response/clients.proto +++ b/api/external/infra_proxy/response/clients.proto @@ -6,10 +6,10 @@ option go_package = "github.com/chef/automate/api/external/infra_proxy/response" message Clients { // Client list. repeated ClientListItem clients = 1; - // Total number of records. - int32 total = 2; - // The number of result pages to return. - int32 start = 3; + // Total number of records. + int32 total = 2; + // The number of result pages to return. + int32 start = 3; } message ClientListItem { diff --git a/components/infra-proxy-service/server/clients.go b/components/infra-proxy-service/server/clients.go index 055bbbe259e..1ae59b810be 100644 --- a/components/infra-proxy-service/server/clients.go +++ b/components/infra-proxy-service/server/clients.go @@ -39,15 +39,15 @@ func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*respons query.Rows = perPage query.Start = int(req.GetSearchQuery().GetStart()) - res1, err := query.Do(c.client) + res, err := query.Do(c.client) if err != nil { return nil, ParseAPIError(err) } return &response.Clients{ - Clients: fromAPIToListClients(res1.Rows), - Start: int32(res1.Start), - Total: int32(res1.Total), + Clients: fromAPIToListClients(res.Rows), + Start: int32(res.Start), + Total: int32(res.Total), }, nil } diff --git a/components/infra-proxy-service/server/roles_test.go b/components/infra-proxy-service/server/roles_test.go new file mode 100644 index 00000000000..8cb22fff318 --- /dev/null +++ b/components/infra-proxy-service/server/roles_test.go @@ -0,0 +1,13 @@ +package server_test + +import ( + "fmt" + "testing" +) + +func Test(t *testing.T) { + var result RoleListResult + + a := fromAPIToListRoles(result) + fmt.Fprint(a) +} From ec465fc1197a2694cc0a41c8314b93139f3cecf5 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Wed, 3 Feb 2021 09:29:12 +0530 Subject: [PATCH 05/11] tabs to spaces Signed-off-by: Vivek Singh --- api/interservice/infra_proxy/request/clients.proto | 12 ++++++------ api/interservice/infra_proxy/response/clients.proto | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/interservice/infra_proxy/request/clients.proto b/api/interservice/infra_proxy/request/clients.proto index 99128605a1d..79a7be87e25 100644 --- a/api/interservice/infra_proxy/request/clients.proto +++ b/api/interservice/infra_proxy/request/clients.proto @@ -4,12 +4,12 @@ package chef.automate.domain.infra_proxy.request; option go_package = "github.com/chef/automate/api/interservice/infra_proxy/request"; message SearchQuery { - // The search query used to identify a list of items. - string q = 1; - // The number of result pages to return. - int32 start = 2; - // The number of results on each page. - int32 rows = 3; + // The search query used to identify a list of items. + string q = 1; + // The number of result pages to return. + int32 start = 2; + // The number of results on each page. + int32 rows = 3; } message Clients { diff --git a/api/interservice/infra_proxy/response/clients.proto b/api/interservice/infra_proxy/response/clients.proto index ba64dda8945..b8fcee61dff 100644 --- a/api/interservice/infra_proxy/response/clients.proto +++ b/api/interservice/infra_proxy/response/clients.proto @@ -4,12 +4,12 @@ package chef.automate.domain.infra_proxy.response; option go_package = "github.com/chef/automate/api/interservice/infra_proxy/response"; message Clients { - // Client list. - repeated ClientListItem clients = 1; - // Total number of records. - int32 total = 2; - // The number of result pages to return. - int32 start = 3; + // Client list. + repeated ClientListItem clients = 1; + // Total number of records. + int32 total = 2; + // The number of result pages to return. + int32 start = 3; } message ClientListItem { From f599cf812a45f011f49ed7b130b5e62b153e60f6 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 4 Feb 2021 10:33:16 +0530 Subject: [PATCH 06/11] Renamed start & rows with page and per_page search params Signed-off-by: Vivek Singh --- .../infra_proxy/infra_proxy.swagger.json | 13 +- .../infra_proxy/request/clients.pb.go | 203 ++++++------------ .../infra_proxy/request/clients.proto | 9 +- api/external/infra_proxy/request/common.pb.go | 175 +++++++++++++++ api/external/infra_proxy/request/common.proto | 13 ++ .../infra_proxy/response/clients.pb.go | 120 +++++------ .../infra_proxy/response/clients.proto | 3 +- .../infra_proxy/request/clients.pb.go | 199 ++++++----------- .../infra_proxy/request/clients.proto | 9 +- .../infra_proxy/request/common.pb.go | 175 +++++++++++++++ .../infra_proxy/request/common.proto | 14 ++ .../infra_proxy/response/clients.pb.go | 116 +++++----- .../infra_proxy/response/clients.proto | 2 - .../api/infra_proxy.pb.swagger.go | 13 +- .../handler/infra_proxy/clients.go | 8 +- .../infra_proxy/infra_proxy.swagger.json | 13 +- .../infra-proxy-service/server/clients.go | 7 +- 17 files changed, 629 insertions(+), 463 deletions(-) create mode 100644 api/external/infra_proxy/request/common.pb.go create mode 100644 api/external/infra_proxy/request/common.proto create mode 100644 api/interservice/infra_proxy/request/common.pb.go create mode 100644 api/interservice/infra_proxy/request/common.proto diff --git a/api/external/infra_proxy/infra_proxy.swagger.json b/api/external/infra_proxy/infra_proxy.swagger.json index 906af9d3fc2..3cc7f403032 100644 --- a/api/external/infra_proxy/infra_proxy.swagger.json +++ b/api/external/infra_proxy/infra_proxy.swagger.json @@ -491,7 +491,7 @@ "type": "string" }, { - "name": "search_query.start", + "name": "search_query.page", "description": "The number of result pages to return.", "in": "query", "required": false, @@ -499,7 +499,7 @@ "format": "int32" }, { - "name": "search_query.rows", + "name": "search_query.per_page", "description": "The number of results on each page.", "in": "query", "required": false, @@ -2213,12 +2213,12 @@ "type": "string", "description": "The search query used to identify a list of items." }, - "start": { + "page": { "type": "integer", "format": "int32", "description": "The number of result pages to return." }, - "rows": { + "per_page": { "type": "integer", "format": "int32", "description": "The number of results on each page." @@ -2541,11 +2541,6 @@ "type": "integer", "format": "int32", "description": "Total number of records." - }, - "start": { - "type": "integer", - "format": "int32", - "description": "The number of result pages to return." } } }, diff --git a/api/external/infra_proxy/request/clients.pb.go b/api/external/infra_proxy/request/clients.pb.go index 3437b971368..13773dd7efa 100644 --- a/api/external/infra_proxy/request/clients.pb.go +++ b/api/external/infra_proxy/request/clients.pb.go @@ -25,72 +25,6 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 -type SearchQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The search query used to identify a list of items. - Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty"` - // The number of result pages to return. - Start int32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty"` - // The number of results on each page. - Rows int32 `protobuf:"varint,3,opt,name=rows,proto3" json:"rows,omitempty"` -} - -func (x *SearchQuery) Reset() { - *x = SearchQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchQuery) ProtoMessage() {} - -func (x *SearchQuery) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] - 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 SearchQuery.ProtoReflect.Descriptor instead. -func (*SearchQuery) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} -} - -func (x *SearchQuery) GetQ() string { - if x != nil { - return x.Q - } - return "" -} - -func (x *SearchQuery) GetStart() int32 { - if x != nil { - return x.Start - } - return 0 -} - -func (x *SearchQuery) GetRows() int32 { - if x != nil { - return x.Rows - } - return 0 -} - type Clients struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -107,7 +41,7 @@ type Clients struct { func (x *Clients) Reset() { *x = Clients{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -120,7 +54,7 @@ func (x *Clients) String() string { func (*Clients) ProtoMessage() {} func (x *Clients) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -133,7 +67,7 @@ func (x *Clients) ProtoReflect() protoreflect.Message { // Deprecated: Use Clients.ProtoReflect.Descriptor instead. func (*Clients) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} } func (x *Clients) GetOrgId() string { @@ -173,7 +107,7 @@ type Client struct { func (x *Client) Reset() { *x = Client{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -186,7 +120,7 @@ func (x *Client) String() string { func (*Client) ProtoMessage() {} func (x *Client) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -199,7 +133,7 @@ func (x *Client) ProtoReflect() protoreflect.Message { // Deprecated: Use Client.ProtoReflect.Descriptor instead. func (*Client) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} } func (x *Client) GetOrgId() string { @@ -243,7 +177,7 @@ type CreateClient struct { func (x *CreateClient) Reset() { *x = CreateClient{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -256,7 +190,7 @@ func (x *CreateClient) String() string { func (*CreateClient) ProtoMessage() {} func (x *CreateClient) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -269,7 +203,7 @@ func (x *CreateClient) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateClient.ProtoReflect.Descriptor instead. func (*CreateClient) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} } func (x *CreateClient) GetOrgId() string { @@ -325,7 +259,7 @@ type ClientKey struct { func (x *ClientKey) Reset() { *x = ClientKey{} if protoimpl.UnsafeEnabled { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[4] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -338,7 +272,7 @@ func (x *ClientKey) String() string { func (*ClientKey) ProtoMessage() {} func (x *ClientKey) ProtoReflect() protoreflect.Message { - mi := &file_external_infra_proxy_request_clients_proto_msgTypes[4] + mi := &file_external_infra_proxy_request_clients_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -351,7 +285,7 @@ func (x *ClientKey) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientKey.ProtoReflect.Descriptor instead. func (*ClientKey) Descriptor() ([]byte, []int) { - return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{4} + return file_external_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} } func (x *ClientKey) GetOrgId() string { @@ -390,46 +324,44 @@ var file_external_infra_proxy_request_clients_proto_rawDesc = []byte{ 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x71, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x94, 0x01, 0x0a, 0x07, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x55, 0x0a, 0x0c, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x32, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x22, 0x50, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, - 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, - 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x65, 0x0a, 0x09, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, - 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, + 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x94, + 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, + 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x55, + 0x0a, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, + 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0x50, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x65, 0x0a, + 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, + 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x42, 0x3b, 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, + 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -444,16 +376,16 @@ func file_external_infra_proxy_request_clients_proto_rawDescGZIP() []byte { return file_external_infra_proxy_request_clients_proto_rawDescData } -var file_external_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_external_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_external_infra_proxy_request_clients_proto_goTypes = []interface{}{ - (*SearchQuery)(nil), // 0: chef.automate.api.infra_proxy.request.SearchQuery - (*Clients)(nil), // 1: chef.automate.api.infra_proxy.request.Clients - (*Client)(nil), // 2: chef.automate.api.infra_proxy.request.Client - (*CreateClient)(nil), // 3: chef.automate.api.infra_proxy.request.CreateClient - (*ClientKey)(nil), // 4: chef.automate.api.infra_proxy.request.ClientKey + (*Clients)(nil), // 0: chef.automate.api.infra_proxy.request.Clients + (*Client)(nil), // 1: chef.automate.api.infra_proxy.request.Client + (*CreateClient)(nil), // 2: chef.automate.api.infra_proxy.request.CreateClient + (*ClientKey)(nil), // 3: chef.automate.api.infra_proxy.request.ClientKey + (*SearchQuery)(nil), // 4: chef.automate.api.infra_proxy.request.SearchQuery } var file_external_infra_proxy_request_clients_proto_depIdxs = []int32{ - 0, // 0: chef.automate.api.infra_proxy.request.Clients.search_query:type_name -> chef.automate.api.infra_proxy.request.SearchQuery + 4, // 0: chef.automate.api.infra_proxy.request.Clients.search_query:type_name -> chef.automate.api.infra_proxy.request.SearchQuery 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -466,20 +398,9 @@ func file_external_infra_proxy_request_clients_proto_init() { if File_external_infra_proxy_request_clients_proto != nil { return } + file_external_infra_proxy_request_common_proto_init() if !protoimpl.UnsafeEnabled { file_external_infra_proxy_request_clients_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_external_infra_proxy_request_clients_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Clients); i { case 0: return &v.state @@ -491,7 +412,7 @@ func file_external_infra_proxy_request_clients_proto_init() { return nil } } - file_external_infra_proxy_request_clients_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_external_infra_proxy_request_clients_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Client); i { case 0: return &v.state @@ -503,7 +424,7 @@ func file_external_infra_proxy_request_clients_proto_init() { return nil } } - file_external_infra_proxy_request_clients_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_external_infra_proxy_request_clients_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateClient); i { case 0: return &v.state @@ -515,7 +436,7 @@ func file_external_infra_proxy_request_clients_proto_init() { return nil } } - file_external_infra_proxy_request_clients_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_external_infra_proxy_request_clients_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientKey); i { case 0: return &v.state @@ -534,7 +455,7 @@ func file_external_infra_proxy_request_clients_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_external_infra_proxy_request_clients_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/external/infra_proxy/request/clients.proto b/api/external/infra_proxy/request/clients.proto index a81114cbd57..07bd679604b 100644 --- a/api/external/infra_proxy/request/clients.proto +++ b/api/external/infra_proxy/request/clients.proto @@ -3,14 +3,7 @@ syntax = "proto3"; package chef.automate.api.infra_proxy.request; option go_package = "github.com/chef/automate/api/external/infra_proxy/request"; -message SearchQuery { - // The search query used to identify a list of items. - string q = 1; - // The number of result pages to return. - int32 start = 2; - // The number of results on each page. - int32 rows = 3; -} +import "external/infra_proxy/request/common.proto"; message Clients { // Chef organization ID. diff --git a/api/external/infra_proxy/request/common.pb.go b/api/external/infra_proxy/request/common.pb.go new file mode 100644 index 00000000000..16e909dd10e --- /dev/null +++ b/api/external/infra_proxy/request/common.pb.go @@ -0,0 +1,175 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: external/infra_proxy/request/common.proto + +package request + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type SearchQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The search query used to identify a list of items. + Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty"` + // The number of result pages to return. + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + // The number of results on each page. + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` +} + +func (x *SearchQuery) Reset() { + *x = SearchQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_external_infra_proxy_request_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchQuery) ProtoMessage() {} + +func (x *SearchQuery) ProtoReflect() protoreflect.Message { + mi := &file_external_infra_proxy_request_common_proto_msgTypes[0] + 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 SearchQuery.ProtoReflect.Descriptor instead. +func (*SearchQuery) Descriptor() ([]byte, []int) { + return file_external_infra_proxy_request_common_proto_rawDescGZIP(), []int{0} +} + +func (x *SearchQuery) GetQ() string { + if x != nil { + return x.Q + } + return "" +} + +func (x *SearchQuery) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *SearchQuery) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +var File_external_infra_proxy_request_common_proto protoreflect.FileDescriptor + +var file_external_infra_proxy_request_common_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, + 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x25, 0x63, 0x68, 0x65, + 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, + 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x4a, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x71, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, + 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, 0x72, 0x50, 0x61, 0x67, 0x65, 0x42, 0x3b, + 0x5a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, + 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_external_infra_proxy_request_common_proto_rawDescOnce sync.Once + file_external_infra_proxy_request_common_proto_rawDescData = file_external_infra_proxy_request_common_proto_rawDesc +) + +func file_external_infra_proxy_request_common_proto_rawDescGZIP() []byte { + file_external_infra_proxy_request_common_proto_rawDescOnce.Do(func() { + file_external_infra_proxy_request_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_external_infra_proxy_request_common_proto_rawDescData) + }) + return file_external_infra_proxy_request_common_proto_rawDescData +} + +var file_external_infra_proxy_request_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_external_infra_proxy_request_common_proto_goTypes = []interface{}{ + (*SearchQuery)(nil), // 0: chef.automate.api.infra_proxy.request.SearchQuery +} +var file_external_infra_proxy_request_common_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_external_infra_proxy_request_common_proto_init() } +func file_external_infra_proxy_request_common_proto_init() { + if File_external_infra_proxy_request_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_external_infra_proxy_request_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchQuery); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_external_infra_proxy_request_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_external_infra_proxy_request_common_proto_goTypes, + DependencyIndexes: file_external_infra_proxy_request_common_proto_depIdxs, + MessageInfos: file_external_infra_proxy_request_common_proto_msgTypes, + }.Build() + File_external_infra_proxy_request_common_proto = out.File + file_external_infra_proxy_request_common_proto_rawDesc = nil + file_external_infra_proxy_request_common_proto_goTypes = nil + file_external_infra_proxy_request_common_proto_depIdxs = nil +} diff --git a/api/external/infra_proxy/request/common.proto b/api/external/infra_proxy/request/common.proto new file mode 100644 index 00000000000..92ed5377973 --- /dev/null +++ b/api/external/infra_proxy/request/common.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package chef.automate.api.infra_proxy.request; +option go_package = "github.com/chef/automate/api/external/infra_proxy/request"; + +message SearchQuery { + // The search query used to identify a list of items. + string q = 1; + // The number of result pages to return. + int32 page = 2; + // The number of results on each page. + int32 per_page = 3; +} diff --git a/api/external/infra_proxy/response/clients.pb.go b/api/external/infra_proxy/response/clients.pb.go index fd7291447f8..64b077eb028 100644 --- a/api/external/infra_proxy/response/clients.pb.go +++ b/api/external/infra_proxy/response/clients.pb.go @@ -34,8 +34,6 @@ type Clients struct { Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` // Total number of records. Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` - // The number of result pages to return. - Start int32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty"` } func (x *Clients) Reset() { @@ -84,13 +82,6 @@ func (x *Clients) GetTotal() int32 { return 0 } -func (x *Clients) GetStart() int32 { - if x != nil { - return x.Start - } - return 0 -} - type ClientListItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -447,62 +438,61 @@ var file_external_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x26, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x73, 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, - 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, - 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, - 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8a, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, - 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, - 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, - 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, - 0x65, 0x79, 0x22, 0x74, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x68, 0x65, - 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, - 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, - 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x71, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, + 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8a, + 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, + 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, + 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, + 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x74, 0x0a, 0x0c, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x50, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, + 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, + 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/external/infra_proxy/response/clients.proto b/api/external/infra_proxy/response/clients.proto index c47abf96168..7c96ca18acf 100644 --- a/api/external/infra_proxy/response/clients.proto +++ b/api/external/infra_proxy/response/clients.proto @@ -3,13 +3,12 @@ syntax = "proto3"; package chef.automate.api.infra_proxy.response; option go_package = "github.com/chef/automate/api/external/infra_proxy/response"; + message Clients { // Client list. repeated ClientListItem clients = 1; // Total number of records. int32 total = 2; - // The number of result pages to return. - int32 start = 3; } message ClientListItem { diff --git a/api/interservice/infra_proxy/request/clients.pb.go b/api/interservice/infra_proxy/request/clients.pb.go index 341ec7c3a6c..d83d83e1f71 100644 --- a/api/interservice/infra_proxy/request/clients.pb.go +++ b/api/interservice/infra_proxy/request/clients.pb.go @@ -25,72 +25,6 @@ const ( // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 -type SearchQuery struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The search query used to identify a list of items. - Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty" toml:"q,omitempty" mapstructure:"q,omitempty"` - // The number of result pages to return. - Start int32 `protobuf:"varint,2,opt,name=start,proto3" json:"start,omitempty" toml:"start,omitempty" mapstructure:"start,omitempty"` - // The number of results on each page. - Rows int32 `protobuf:"varint,3,opt,name=rows,proto3" json:"rows,omitempty" toml:"rows,omitempty" mapstructure:"rows,omitempty"` -} - -func (x *SearchQuery) Reset() { - *x = SearchQuery{} - if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchQuery) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchQuery) ProtoMessage() {} - -func (x *SearchQuery) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] - 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 SearchQuery.ProtoReflect.Descriptor instead. -func (*SearchQuery) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} -} - -func (x *SearchQuery) GetQ() string { - if x != nil { - return x.Q - } - return "" -} - -func (x *SearchQuery) GetStart() int32 { - if x != nil { - return x.Start - } - return 0 -} - -func (x *SearchQuery) GetRows() int32 { - if x != nil { - return x.Rows - } - return 0 -} - type Clients struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -107,7 +41,7 @@ type Clients struct { func (x *Clients) Reset() { *x = Clients{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -120,7 +54,7 @@ func (x *Clients) String() string { func (*Clients) ProtoMessage() {} func (x *Clients) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -133,7 +67,7 @@ func (x *Clients) ProtoReflect() protoreflect.Message { // Deprecated: Use Clients.ProtoReflect.Descriptor instead. func (*Clients) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{0} } func (x *Clients) GetOrgId() string { @@ -173,7 +107,7 @@ type Client struct { func (x *Client) Reset() { *x = Client{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -186,7 +120,7 @@ func (x *Client) String() string { func (*Client) ProtoMessage() {} func (x *Client) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -199,7 +133,7 @@ func (x *Client) ProtoReflect() protoreflect.Message { // Deprecated: Use Client.ProtoReflect.Descriptor instead. func (*Client) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{1} } func (x *Client) GetOrgId() string { @@ -243,7 +177,7 @@ type CreateClient struct { func (x *CreateClient) Reset() { *x = CreateClient{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -256,7 +190,7 @@ func (x *CreateClient) String() string { func (*CreateClient) ProtoMessage() {} func (x *CreateClient) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -269,7 +203,7 @@ func (x *CreateClient) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateClient.ProtoReflect.Descriptor instead. func (*CreateClient) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{2} } func (x *CreateClient) GetOrgId() string { @@ -325,7 +259,7 @@ type ClientKey struct { func (x *ClientKey) Reset() { *x = ClientKey{} if protoimpl.UnsafeEnabled { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[4] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -338,7 +272,7 @@ func (x *ClientKey) String() string { func (*ClientKey) ProtoMessage() {} func (x *ClientKey) ProtoReflect() protoreflect.Message { - mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[4] + mi := &file_interservice_infra_proxy_request_clients_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -351,7 +285,7 @@ func (x *ClientKey) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientKey.ProtoReflect.Descriptor instead. func (*ClientKey) Descriptor() ([]byte, []int) { - return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{4} + return file_interservice_infra_proxy_request_clients_proto_rawDescGZIP(), []int{3} } func (x *ClientKey) GetOrgId() string { @@ -390,47 +324,45 @@ var file_interservice_infra_proxy_request_clients_proto_rawDesc = []byte{ 0x73, 0x74, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x28, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x0b, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x72, 0x6f, 0x77, - 0x73, 0x22, 0x97, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, + 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x07, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x58, 0x0a, 0x0c, 0x73, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x35, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, + 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x22, 0x50, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x58, 0x0a, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, - 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, - 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x0b, - 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0x50, 0x0a, 0x06, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, - 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, - 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x22, 0x65, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, - 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, - 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, 0x1b, 0x0a, + 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x65, 0x0a, 0x09, 0x43, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x6f, 0x72, 0x67, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x72, 0x67, 0x49, 0x64, 0x12, + 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -445,16 +377,16 @@ func file_interservice_infra_proxy_request_clients_proto_rawDescGZIP() []byte { return file_interservice_infra_proxy_request_clients_proto_rawDescData } -var file_interservice_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_interservice_infra_proxy_request_clients_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_interservice_infra_proxy_request_clients_proto_goTypes = []interface{}{ - (*SearchQuery)(nil), // 0: chef.automate.domain.infra_proxy.request.SearchQuery - (*Clients)(nil), // 1: chef.automate.domain.infra_proxy.request.Clients - (*Client)(nil), // 2: chef.automate.domain.infra_proxy.request.Client - (*CreateClient)(nil), // 3: chef.automate.domain.infra_proxy.request.CreateClient - (*ClientKey)(nil), // 4: chef.automate.domain.infra_proxy.request.ClientKey + (*Clients)(nil), // 0: chef.automate.domain.infra_proxy.request.Clients + (*Client)(nil), // 1: chef.automate.domain.infra_proxy.request.Client + (*CreateClient)(nil), // 2: chef.automate.domain.infra_proxy.request.CreateClient + (*ClientKey)(nil), // 3: chef.automate.domain.infra_proxy.request.ClientKey + (*SearchQuery)(nil), // 4: chef.automate.domain.infra_proxy.request.SearchQuery } var file_interservice_infra_proxy_request_clients_proto_depIdxs = []int32{ - 0, // 0: chef.automate.domain.infra_proxy.request.Clients.search_query:type_name -> chef.automate.domain.infra_proxy.request.SearchQuery + 4, // 0: chef.automate.domain.infra_proxy.request.Clients.search_query:type_name -> chef.automate.domain.infra_proxy.request.SearchQuery 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -467,20 +399,9 @@ func file_interservice_infra_proxy_request_clients_proto_init() { if File_interservice_infra_proxy_request_clients_proto != nil { return } + file_interservice_infra_proxy_request_common_proto_init() if !protoimpl.UnsafeEnabled { file_interservice_infra_proxy_request_clients_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchQuery); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_interservice_infra_proxy_request_clients_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Clients); i { case 0: return &v.state @@ -492,7 +413,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { return nil } } - file_interservice_infra_proxy_request_clients_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_interservice_infra_proxy_request_clients_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Client); i { case 0: return &v.state @@ -504,7 +425,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { return nil } } - file_interservice_infra_proxy_request_clients_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_interservice_infra_proxy_request_clients_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateClient); i { case 0: return &v.state @@ -516,7 +437,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { return nil } } - file_interservice_infra_proxy_request_clients_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_interservice_infra_proxy_request_clients_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClientKey); i { case 0: return &v.state @@ -535,7 +456,7 @@ func file_interservice_infra_proxy_request_clients_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_interservice_infra_proxy_request_clients_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, diff --git a/api/interservice/infra_proxy/request/clients.proto b/api/interservice/infra_proxy/request/clients.proto index 79a7be87e25..da12cf6ceda 100644 --- a/api/interservice/infra_proxy/request/clients.proto +++ b/api/interservice/infra_proxy/request/clients.proto @@ -3,14 +3,7 @@ syntax = "proto3"; package chef.automate.domain.infra_proxy.request; option go_package = "github.com/chef/automate/api/interservice/infra_proxy/request"; -message SearchQuery { - // The search query used to identify a list of items. - string q = 1; - // The number of result pages to return. - int32 start = 2; - // The number of results on each page. - int32 rows = 3; -} +import "interservice/infra_proxy/request/common.proto"; message Clients { // Chef organization ID. diff --git a/api/interservice/infra_proxy/request/common.pb.go b/api/interservice/infra_proxy/request/common.pb.go new file mode 100644 index 00000000000..5f28a472172 --- /dev/null +++ b/api/interservice/infra_proxy/request/common.pb.go @@ -0,0 +1,175 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: interservice/infra_proxy/request/common.proto + +package request + +import ( + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type SearchQuery struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The search query used to identify a list of items. + Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty" toml:"q,omitempty" mapstructure:"q,omitempty"` + // The number of result pages to return. + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty" toml:"page,omitempty" mapstructure:"page,omitempty"` + // The number of results on each page. + PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty" toml:"per_page,omitempty" mapstructure:"per_page,omitempty"` +} + +func (x *SearchQuery) Reset() { + *x = SearchQuery{} + if protoimpl.UnsafeEnabled { + mi := &file_interservice_infra_proxy_request_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchQuery) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchQuery) ProtoMessage() {} + +func (x *SearchQuery) ProtoReflect() protoreflect.Message { + mi := &file_interservice_infra_proxy_request_common_proto_msgTypes[0] + 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 SearchQuery.ProtoReflect.Descriptor instead. +func (*SearchQuery) Descriptor() ([]byte, []int) { + return file_interservice_infra_proxy_request_common_proto_rawDescGZIP(), []int{0} +} + +func (x *SearchQuery) GetQ() string { + if x != nil { + return x.Q + } + return "" +} + +func (x *SearchQuery) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *SearchQuery) GetPerPage() int32 { + if x != nil { + return x.PerPage + } + return 0 +} + +var File_interservice_infra_proxy_request_common_proto protoreflect.FileDescriptor + +var file_interservice_infra_proxy_request_common_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, + 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x28, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4a, 0x0a, 0x0b, 0x53, 0x65, 0x61, + 0x72, 0x63, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x71, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x01, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x65, + 0x72, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x65, + 0x72, 0x50, 0x61, 0x67, 0x65, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, + 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_interservice_infra_proxy_request_common_proto_rawDescOnce sync.Once + file_interservice_infra_proxy_request_common_proto_rawDescData = file_interservice_infra_proxy_request_common_proto_rawDesc +) + +func file_interservice_infra_proxy_request_common_proto_rawDescGZIP() []byte { + file_interservice_infra_proxy_request_common_proto_rawDescOnce.Do(func() { + file_interservice_infra_proxy_request_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_interservice_infra_proxy_request_common_proto_rawDescData) + }) + return file_interservice_infra_proxy_request_common_proto_rawDescData +} + +var file_interservice_infra_proxy_request_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_interservice_infra_proxy_request_common_proto_goTypes = []interface{}{ + (*SearchQuery)(nil), // 0: chef.automate.domain.infra_proxy.request.SearchQuery +} +var file_interservice_infra_proxy_request_common_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_interservice_infra_proxy_request_common_proto_init() } +func file_interservice_infra_proxy_request_common_proto_init() { + if File_interservice_infra_proxy_request_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_interservice_infra_proxy_request_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SearchQuery); 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{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_interservice_infra_proxy_request_common_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_interservice_infra_proxy_request_common_proto_goTypes, + DependencyIndexes: file_interservice_infra_proxy_request_common_proto_depIdxs, + MessageInfos: file_interservice_infra_proxy_request_common_proto_msgTypes, + }.Build() + File_interservice_infra_proxy_request_common_proto = out.File + file_interservice_infra_proxy_request_common_proto_rawDesc = nil + file_interservice_infra_proxy_request_common_proto_goTypes = nil + file_interservice_infra_proxy_request_common_proto_depIdxs = nil +} diff --git a/api/interservice/infra_proxy/request/common.proto b/api/interservice/infra_proxy/request/common.proto new file mode 100644 index 00000000000..9e041ae8ec5 --- /dev/null +++ b/api/interservice/infra_proxy/request/common.proto @@ -0,0 +1,14 @@ + +syntax = "proto3"; + +package chef.automate.domain.infra_proxy.request; +option go_package = "github.com/chef/automate/api/interservice/infra_proxy/request"; + +message SearchQuery { + // The search query used to identify a list of items. + string q = 1; + // The number of result pages to return. + int32 page = 2; + // The number of results on each page. + int32 per_page = 3; +} diff --git a/api/interservice/infra_proxy/response/clients.pb.go b/api/interservice/infra_proxy/response/clients.pb.go index 8aba6dcc1f7..067e12ce756 100644 --- a/api/interservice/infra_proxy/response/clients.pb.go +++ b/api/interservice/infra_proxy/response/clients.pb.go @@ -34,8 +34,6 @@ type Clients struct { Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty" toml:"clients,omitempty" mapstructure:"clients,omitempty"` // Total number of records. Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty" toml:"total,omitempty" mapstructure:"total,omitempty"` - // The number of result pages to return. - Start int32 `protobuf:"varint,3,opt,name=start,proto3" json:"start,omitempty" toml:"start,omitempty" mapstructure:"start,omitempty"` } func (x *Clients) Reset() { @@ -84,13 +82,6 @@ func (x *Clients) GetTotal() int32 { return 0 } -func (x *Clients) GetStart() int32 { - if x != nil { - return x.Start - } - return 0 -} - type ClientListItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -447,63 +438,62 @@ var file_interservice_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x6e, 0x73, 0x65, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x8a, 0x01, 0x0a, - 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, - 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, - 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x8d, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, - 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, + 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x74, 0x0a, 0x07, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, - 0x77, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, + 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, + 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a, + 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, + 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x77, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0a, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x34, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, + 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, + 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, + 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, - 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, - 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, - 0x74, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, - 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, + 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, + 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/interservice/infra_proxy/response/clients.proto b/api/interservice/infra_proxy/response/clients.proto index b8fcee61dff..737ade253e4 100644 --- a/api/interservice/infra_proxy/response/clients.proto +++ b/api/interservice/infra_proxy/response/clients.proto @@ -8,8 +8,6 @@ message Clients { repeated ClientListItem clients = 1; // Total number of records. int32 total = 2; - // The number of result pages to return. - int32 start = 3; } message ClientListItem { diff --git a/components/automate-gateway/api/infra_proxy.pb.swagger.go b/components/automate-gateway/api/infra_proxy.pb.swagger.go index bfe236ad046..a6c0712b412 100644 --- a/components/automate-gateway/api/infra_proxy.pb.swagger.go +++ b/components/automate-gateway/api/infra_proxy.pb.swagger.go @@ -494,7 +494,7 @@ func init() { "type": "string" }, { - "name": "search_query.start", + "name": "search_query.page", "description": "The number of result pages to return.", "in": "query", "required": false, @@ -502,7 +502,7 @@ func init() { "format": "int32" }, { - "name": "search_query.rows", + "name": "search_query.per_page", "description": "The number of results on each page.", "in": "query", "required": false, @@ -2216,12 +2216,12 @@ func init() { "type": "string", "description": "The search query used to identify a list of items." }, - "start": { + "page": { "type": "integer", "format": "int32", "description": "The number of result pages to return." }, - "rows": { + "per_page": { "type": "integer", "format": "int32", "description": "The number of results on each page." @@ -2544,11 +2544,6 @@ func init() { "type": "integer", "format": "int32", "description": "Total number of records." - }, - "start": { - "type": "integer", - "format": "int32", - "description": "The number of result pages to return." } } }, diff --git a/components/automate-gateway/handler/infra_proxy/clients.go b/components/automate-gateway/handler/infra_proxy/clients.go index 2ab22a82c8d..86b9fed7477 100644 --- a/components/automate-gateway/handler/infra_proxy/clients.go +++ b/components/automate-gateway/handler/infra_proxy/clients.go @@ -15,9 +15,9 @@ func (a *InfraProxyServer) GetClients(ctx context.Context, r *gwreq.Clients) (*g OrgId: r.OrgId, ServerId: r.ServerId, SearchQuery: &infra_req.SearchQuery{ - Q: r.GetSearchQuery().GetQ(), - Start: r.GetSearchQuery().GetStart(), - Rows: r.GetSearchQuery().GetRows(), + Q: r.GetSearchQuery().GetQ(), + Page: r.GetSearchQuery().GetPage(), + PerPage: r.GetSearchQuery().GetPerPage(), }, } res, err := a.client.GetClients(ctx, req) @@ -27,7 +27,6 @@ func (a *InfraProxyServer) GetClients(ctx context.Context, r *gwreq.Clients) (*g return &gwres.Clients{ Clients: fromUpstreamClients(res.Clients), - Start: res.GetStart(), Total: res.GetTotal(), }, nil } @@ -123,7 +122,6 @@ func (a *InfraProxyServer) ResetClientKey(ctx context.Context, r *gwreq.ClientKe func fromUpstreamClients(clients []*infra_res.ClientListItem) []*gwres.ClientListItem { ts := make([]*gwres.ClientListItem, len(clients)) - for i, c := range clients { ts[i] = &gwres.ClientListItem{ Name: c.GetName(), diff --git a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json index 906af9d3fc2..3cc7f403032 100644 --- a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json +++ b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json @@ -491,7 +491,7 @@ "type": "string" }, { - "name": "search_query.start", + "name": "search_query.page", "description": "The number of result pages to return.", "in": "query", "required": false, @@ -499,7 +499,7 @@ "format": "int32" }, { - "name": "search_query.rows", + "name": "search_query.per_page", "description": "The number of results on each page.", "in": "query", "required": false, @@ -2213,12 +2213,12 @@ "type": "string", "description": "The search query used to identify a list of items." }, - "start": { + "page": { "type": "integer", "format": "int32", "description": "The number of result pages to return." }, - "rows": { + "per_page": { "type": "integer", "format": "int32", "description": "The number of results on each page." @@ -2541,11 +2541,6 @@ "type": "integer", "format": "int32", "description": "Total number of records." - }, - "start": { - "type": "integer", - "format": "int32", - "description": "The number of result pages to return." } } }, diff --git a/components/infra-proxy-service/server/clients.go b/components/infra-proxy-service/server/clients.go index 1ae59b810be..cde62f7147f 100644 --- a/components/infra-proxy-service/server/clients.go +++ b/components/infra-proxy-service/server/clients.go @@ -26,7 +26,7 @@ func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*respons return nil, err } - perPage := int(req.GetSearchQuery().GetRows()) + perPage := int(req.GetSearchQuery().GetPerPage()) if perPage == 0 { perPage = 1000 } @@ -37,7 +37,9 @@ func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*respons } query, err := c.client.Search.NewQuery("client", searchStr) query.Rows = perPage - query.Start = int(req.GetSearchQuery().GetStart()) + + // Query accepts start param, The row at which return results begin. + query.Start = int(req.GetSearchQuery().GetPage()) * perPage res, err := query.Do(c.client) if err != nil { @@ -46,7 +48,6 @@ func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*respons return &response.Clients{ Clients: fromAPIToListClients(res.Rows), - Start: int32(res.Start), Total: int32(res.Total), }, nil } From 8bc33a1266ef9c2009eb256b48f5dad3e3aa3041 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 4 Feb 2021 10:36:30 +0530 Subject: [PATCH 07/11] remove untracked file pushed Signed-off-by: Vivek Singh --- components/infra-proxy-service/server/roles_test.go | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 components/infra-proxy-service/server/roles_test.go diff --git a/components/infra-proxy-service/server/roles_test.go b/components/infra-proxy-service/server/roles_test.go deleted file mode 100644 index 8cb22fff318..00000000000 --- a/components/infra-proxy-service/server/roles_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package server_test - -import ( - "fmt" - "testing" -) - -func Test(t *testing.T) { - var result RoleListResult - - a := fromAPIToListRoles(result) - fmt.Fprint(a) -} From 2ae2e23defa502c74e7e5dd847d2d91390d532a3 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 11 Feb 2021 10:46:57 +0530 Subject: [PATCH 08/11] Added client list search test cases Signed-off-by: Vivek Singh --- .../infra_proxy/infra_proxy.swagger.json | 5 ++ .../infra_proxy/response/clients.pb.go | 41 ++++++++- .../infra_proxy/response/clients.proto | 4 +- .../infra_proxy/response/clients.pb.go | 42 ++++++++- .../infra_proxy/response/clients.proto | 4 +- .../api/infra_proxy.pb.swagger.go | 5 ++ .../handler/infra_proxy/clients.go | 1 + .../infra_proxy/infra_proxy.swagger.json | 5 ++ .../integration_test/clients_test.go | 86 ++++++++++++++++++- .../infra-proxy-service/server/clients.go | 10 ++- .../infra/chef-repo/clients/chef-load-3.json | 7 ++ .../infra/chef-repo/clients/chef-load-4.json | 7 ++ .../infra/chef-repo/clients/chef-load-5.json | 7 ++ .../infra/chef-repo/clients/chef-load-6.json | 7 ++ .../infra/chef-repo/clients/chef-load-7.json | 7 ++ .../infra/chef-repo/clients/chef-load-8.json | 7 ++ .../infra/chef-repo/clients/chef-load-9.json | 7 ++ 17 files changed, 242 insertions(+), 10 deletions(-) create mode 100644 dev-docs/adding-data/infra/chef-repo/clients/chef-load-3.json create mode 100644 dev-docs/adding-data/infra/chef-repo/clients/chef-load-4.json create mode 100644 dev-docs/adding-data/infra/chef-repo/clients/chef-load-5.json create mode 100644 dev-docs/adding-data/infra/chef-repo/clients/chef-load-6.json create mode 100644 dev-docs/adding-data/infra/chef-repo/clients/chef-load-7.json create mode 100644 dev-docs/adding-data/infra/chef-repo/clients/chef-load-8.json create mode 100644 dev-docs/adding-data/infra/chef-repo/clients/chef-load-9.json diff --git a/api/external/infra_proxy/infra_proxy.swagger.json b/api/external/infra_proxy/infra_proxy.swagger.json index 3cc7f403032..70f3dc22c74 100644 --- a/api/external/infra_proxy/infra_proxy.swagger.json +++ b/api/external/infra_proxy/infra_proxy.swagger.json @@ -2537,6 +2537,11 @@ }, "description": "Client list." }, + "page": { + "type": "integer", + "format": "int32", + "title": "Records page number" + }, "total": { "type": "integer", "format": "int32", diff --git a/api/external/infra_proxy/response/clients.pb.go b/api/external/infra_proxy/response/clients.pb.go index 64b077eb028..2738027785a 100644 --- a/api/external/infra_proxy/response/clients.pb.go +++ b/api/external/infra_proxy/response/clients.pb.go @@ -32,8 +32,10 @@ type Clients struct { // Client list. Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` + // Records page number + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // Total number of records. - Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` } func (x *Clients) Reset() { @@ -75,6 +77,13 @@ func (x *Clients) GetClients() []*ClientListItem { return nil } +func (x *Clients) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + func (x *Clients) GetTotal() int32 { if x != nil { return x.Total @@ -438,6 +447,7 @@ var file_external_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x26, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, +<<<<<<< HEAD 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x71, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, @@ -493,6 +503,35 @@ var file_external_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +======= + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, + 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, + 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x24, 0x0a, + 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0xb2, 0x01, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, + 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, + 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, + 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +>>>>>>> Added client list search test cases } var ( diff --git a/api/external/infra_proxy/response/clients.proto b/api/external/infra_proxy/response/clients.proto index 7c96ca18acf..8f08ffba1da 100644 --- a/api/external/infra_proxy/response/clients.proto +++ b/api/external/infra_proxy/response/clients.proto @@ -7,8 +7,10 @@ option go_package = "github.com/chef/automate/api/external/infra_proxy/response" message Clients { // Client list. repeated ClientListItem clients = 1; + // Records page number + int32 page = 2; // Total number of records. - int32 total = 2; + int32 total = 3; } message ClientListItem { diff --git a/api/interservice/infra_proxy/response/clients.pb.go b/api/interservice/infra_proxy/response/clients.pb.go index 067e12ce756..af0af512ddd 100644 --- a/api/interservice/infra_proxy/response/clients.pb.go +++ b/api/interservice/infra_proxy/response/clients.pb.go @@ -32,8 +32,10 @@ type Clients struct { // Client list. Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty" toml:"clients,omitempty" mapstructure:"clients,omitempty"` + // Records page number + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty" toml:"page,omitempty" mapstructure:"page,omitempty"` // Total number of records. - Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty" toml:"total,omitempty" mapstructure:"total,omitempty"` + Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty" toml:"total,omitempty" mapstructure:"total,omitempty"` } func (x *Clients) Reset() { @@ -75,6 +77,13 @@ func (x *Clients) GetClients() []*ClientListItem { return nil } +func (x *Clients) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + func (x *Clients) GetTotal() int32 { if x != nil { return x.Total @@ -438,6 +447,7 @@ var file_interservice_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x6e, 0x73, 0x65, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, +<<<<<<< HEAD 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x74, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, @@ -494,6 +504,36 @@ var file_interservice_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +======= + 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x88, 0x01, 0x0a, + 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, + 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, + 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb2, 0x01, + 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, + 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, + 0x70, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, + 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +>>>>>>> Added client list search test cases } var ( diff --git a/api/interservice/infra_proxy/response/clients.proto b/api/interservice/infra_proxy/response/clients.proto index 737ade253e4..77558d2d503 100644 --- a/api/interservice/infra_proxy/response/clients.proto +++ b/api/interservice/infra_proxy/response/clients.proto @@ -6,8 +6,10 @@ option go_package = "github.com/chef/automate/api/interservice/infra_proxy/respo message Clients { // Client list. repeated ClientListItem clients = 1; + // Records page number + int32 page = 2; // Total number of records. - int32 total = 2; + int32 total = 3; } message ClientListItem { diff --git a/components/automate-gateway/api/infra_proxy.pb.swagger.go b/components/automate-gateway/api/infra_proxy.pb.swagger.go index a6c0712b412..094225e9590 100644 --- a/components/automate-gateway/api/infra_proxy.pb.swagger.go +++ b/components/automate-gateway/api/infra_proxy.pb.swagger.go @@ -2540,6 +2540,11 @@ func init() { }, "description": "Client list." }, + "page": { + "type": "integer", + "format": "int32", + "title": "Records page number" + }, "total": { "type": "integer", "format": "int32", diff --git a/components/automate-gateway/handler/infra_proxy/clients.go b/components/automate-gateway/handler/infra_proxy/clients.go index 86b9fed7477..0acaa0a55d4 100644 --- a/components/automate-gateway/handler/infra_proxy/clients.go +++ b/components/automate-gateway/handler/infra_proxy/clients.go @@ -27,6 +27,7 @@ func (a *InfraProxyServer) GetClients(ctx context.Context, r *gwreq.Clients) (*g return &gwres.Clients{ Clients: fromUpstreamClients(res.Clients), + Page: res.GetPage(), Total: res.GetTotal(), }, nil } diff --git a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json index 3cc7f403032..70f3dc22c74 100644 --- a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json +++ b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json @@ -2537,6 +2537,11 @@ }, "description": "Client list." }, + "page": { + "type": "integer", + "format": "int32", + "title": "Records page number" + }, "total": { "type": "integer", "format": "int32", diff --git a/components/infra-proxy-service/integration_test/clients_test.go b/components/infra-proxy-service/integration_test/clients_test.go index 767bb5d8100..5e8792591d5 100644 --- a/components/infra-proxy-service/integration_test/clients_test.go +++ b/components/infra-proxy-service/integration_test/clients_test.go @@ -9,16 +9,94 @@ import ( ) func TestGetClients(t *testing.T) { + // Pre-populated that has been added by scripts + // Validating the clients search based on these records. // rpc GetClients (request.Clients) returns (response.Clients) ctx := context.Background() req := &request.Clients{ ServerId: autoDeployedChefServerID, OrgId: autoDeployedChefOrganizationID, } - res, err := infraProxy.GetClients(ctx, req) - assert.NoError(t, err) - assert.NotNil(t, res) - assert.Equal(t, 3, len(res.GetClients())) + + t.Run("Clients list without a search params", func(t *testing.T) { + // Default per_page 1000 is set in backend + perPage := int32(1000) + res, err := infraProxy.GetClients(ctx, req) + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, int(res.Page), 0) + if res.Total <= perPage { + assert.Equal(t, int(res.Total), len(res.Clients)) + } else { + assert.Equal(t, perPage, len(res.Clients)) + } + }) + + t.Run("Clients list with a per_page search param", func(t *testing.T) { + req.SearchQuery = &request.SearchQuery{ + PerPage: 5, + } + res, err := infraProxy.GetClients(ctx, req) + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, 0, int(res.Page)) + assert.Equal(t, 5, len(res.Clients)) + }) + + t.Run("Clients list with a page search param", func(t *testing.T) { + req.SearchQuery = &request.SearchQuery{ + Q: "*:*", + Page: 1, + PerPage: 5, + } + res, err := infraProxy.GetClients(ctx, req) + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, 1, int(res.Page)) + assert.Equal(t, 5, len(res.Clients)) + }) + + t.Run("Clients list with an invalid query search param", func(t *testing.T) { + req.SearchQuery = &request.SearchQuery{ + Q: "NO_KEY:NO_VALUE", + Page: 0, + PerPage: 5, + } + res, err := infraProxy.GetClients(ctx, req) + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, 0, int(res.Page)) + assert.Equal(t, 0, int(res.Total)) + assert.Equal(t, 0, len(res.Clients)) + }) + + t.Run("Clients list with an invalid query search param", func(t *testing.T) { + req.SearchQuery = &request.SearchQuery{ + Q: "INVALID_QUERY", + Page: 0, + PerPage: 5, + } + res, err := infraProxy.GetClients(ctx, req) + assert.NoError(t, err) + assert.Equal(t, 0, int(res.Page)) + assert.Equal(t, 0, int(res.Total)) + assert.Equal(t, 0, len(res.Clients)) + }) + + t.Run("Clients list with a valid query search param", func(t *testing.T) { + req.SearchQuery = &request.SearchQuery{ + Q: "name:chef-load-1", + Page: 0, + PerPage: 5, + } + res, err := infraProxy.GetClients(ctx, req) + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, 0, int(res.Page)) + assert.Equal(t, 1, int(res.Total)) + assert.Equal(t, "chef-load-1", res.Clients[0].GetName()) + }) + } func TestGetClient(t *testing.T) { diff --git a/components/infra-proxy-service/server/clients.go b/components/infra-proxy-service/server/clients.go index cde62f7147f..145c6a9bac9 100644 --- a/components/infra-proxy-service/server/clients.go +++ b/components/infra-proxy-service/server/clients.go @@ -19,7 +19,7 @@ type AccessKeyReq struct { CreateKey bool `json:"create_key,omitempty"` } -// GetClients get clients list +// GetClients gets clients list func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*response.Clients, error) { c, err := s.createClient(ctx, req.OrgId, req.ServerId) if err != nil { @@ -46,13 +46,19 @@ func (s *Server) GetClients(ctx context.Context, req *request.Clients) (*respons return nil, ParseAPIError(err) } + page := res.Start + if page != 0 { + page = page / perPage + } + return &response.Clients{ Clients: fromAPIToListClients(res.Rows), + Page: int32(page), Total: int32(res.Total), }, nil } -// GetClient get client +// GetClient gets client func (s *Server) GetClient(ctx context.Context, req *request.Client) (*response.Client, error) { c, err := s.createClient(ctx, req.OrgId, req.ServerId) if err != nil { diff --git a/dev-docs/adding-data/infra/chef-repo/clients/chef-load-3.json b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-3.json new file mode 100644 index 00000000000..64deff3907f --- /dev/null +++ b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-3.json @@ -0,0 +1,7 @@ +{ + "name": "chef-load-3", + "validator": false, + "admin": false, + "chef_type": "client", + "create_key": false +} diff --git a/dev-docs/adding-data/infra/chef-repo/clients/chef-load-4.json b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-4.json new file mode 100644 index 00000000000..3b6e300ffad --- /dev/null +++ b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-4.json @@ -0,0 +1,7 @@ +{ + "name": "chef-load-4", + "validator": false, + "admin": false, + "chef_type": "client", + "create_key": false +} diff --git a/dev-docs/adding-data/infra/chef-repo/clients/chef-load-5.json b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-5.json new file mode 100644 index 00000000000..8ddcf60d38b --- /dev/null +++ b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-5.json @@ -0,0 +1,7 @@ +{ + "name": "chef-load-5", + "validator": false, + "admin": false, + "chef_type": "client", + "create_key": false +} diff --git a/dev-docs/adding-data/infra/chef-repo/clients/chef-load-6.json b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-6.json new file mode 100644 index 00000000000..7e3eddb1b35 --- /dev/null +++ b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-6.json @@ -0,0 +1,7 @@ +{ + "name": "chef-load-6", + "validator": false, + "admin": false, + "chef_type": "client", + "create_key": false +} diff --git a/dev-docs/adding-data/infra/chef-repo/clients/chef-load-7.json b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-7.json new file mode 100644 index 00000000000..b502b309248 --- /dev/null +++ b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-7.json @@ -0,0 +1,7 @@ +{ + "name": "chef-load-7", + "validator": false, + "admin": false, + "chef_type": "client", + "create_key": false +} diff --git a/dev-docs/adding-data/infra/chef-repo/clients/chef-load-8.json b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-8.json new file mode 100644 index 00000000000..0e981bd2f8d --- /dev/null +++ b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-8.json @@ -0,0 +1,7 @@ +{ + "name": "chef-load-8", + "validator": false, + "admin": false, + "chef_type": "client", + "create_key": false +} diff --git a/dev-docs/adding-data/infra/chef-repo/clients/chef-load-9.json b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-9.json new file mode 100644 index 00000000000..b709b73bfe7 --- /dev/null +++ b/dev-docs/adding-data/infra/chef-repo/clients/chef-load-9.json @@ -0,0 +1,7 @@ +{ + "name": "chef-load-9", + "validator": false, + "admin": false, + "chef_type": "client", + "create_key": false +} From 000845a0523c13a67e604b6e9ae9707402dc2b04 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 11 Feb 2021 11:33:40 +0530 Subject: [PATCH 09/11] proto comments update Signed-off-by: Vivek Singh --- api/external/infra_proxy/infra_proxy.swagger.json | 4 ++-- api/external/infra_proxy/request/common.pb.go | 2 +- api/external/infra_proxy/request/common.proto | 2 +- api/interservice/infra_proxy/request/common.pb.go | 2 +- api/interservice/infra_proxy/request/common.proto | 2 +- components/automate-gateway/api/infra_proxy.pb.swagger.go | 4 ++-- .../api_chef_automate/infra_proxy/infra_proxy.swagger.json | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/external/infra_proxy/infra_proxy.swagger.json b/api/external/infra_proxy/infra_proxy.swagger.json index 70f3dc22c74..884c95dc959 100644 --- a/api/external/infra_proxy/infra_proxy.swagger.json +++ b/api/external/infra_proxy/infra_proxy.swagger.json @@ -492,7 +492,7 @@ }, { "name": "search_query.page", - "description": "The number of result pages to return.", + "description": "Starting page for the results.", "in": "query", "required": false, "type": "integer", @@ -2216,7 +2216,7 @@ "page": { "type": "integer", "format": "int32", - "description": "The number of result pages to return." + "description": "Starting page for the results." }, "per_page": { "type": "integer", diff --git a/api/external/infra_proxy/request/common.pb.go b/api/external/infra_proxy/request/common.pb.go index 16e909dd10e..8cf8565ea78 100644 --- a/api/external/infra_proxy/request/common.pb.go +++ b/api/external/infra_proxy/request/common.pb.go @@ -32,7 +32,7 @@ type SearchQuery struct { // The search query used to identify a list of items. Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty"` - // The number of result pages to return. + // Starting page for the results. Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // The number of results on each page. PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty"` diff --git a/api/external/infra_proxy/request/common.proto b/api/external/infra_proxy/request/common.proto index 92ed5377973..f624997399e 100644 --- a/api/external/infra_proxy/request/common.proto +++ b/api/external/infra_proxy/request/common.proto @@ -6,7 +6,7 @@ option go_package = "github.com/chef/automate/api/external/infra_proxy/request"; message SearchQuery { // The search query used to identify a list of items. string q = 1; - // The number of result pages to return. + // Starting page for the results. int32 page = 2; // The number of results on each page. int32 per_page = 3; diff --git a/api/interservice/infra_proxy/request/common.pb.go b/api/interservice/infra_proxy/request/common.pb.go index 5f28a472172..8bfa490a8af 100644 --- a/api/interservice/infra_proxy/request/common.pb.go +++ b/api/interservice/infra_proxy/request/common.pb.go @@ -32,7 +32,7 @@ type SearchQuery struct { // The search query used to identify a list of items. Q string `protobuf:"bytes,1,opt,name=q,proto3" json:"q,omitempty" toml:"q,omitempty" mapstructure:"q,omitempty"` - // The number of result pages to return. + // Starting page for the results. Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty" toml:"page,omitempty" mapstructure:"page,omitempty"` // The number of results on each page. PerPage int32 `protobuf:"varint,3,opt,name=per_page,json=perPage,proto3" json:"per_page,omitempty" toml:"per_page,omitempty" mapstructure:"per_page,omitempty"` diff --git a/api/interservice/infra_proxy/request/common.proto b/api/interservice/infra_proxy/request/common.proto index 9e041ae8ec5..eeb3f95e0fa 100644 --- a/api/interservice/infra_proxy/request/common.proto +++ b/api/interservice/infra_proxy/request/common.proto @@ -7,7 +7,7 @@ option go_package = "github.com/chef/automate/api/interservice/infra_proxy/reque message SearchQuery { // The search query used to identify a list of items. string q = 1; - // The number of result pages to return. + // Starting page for the results. int32 page = 2; // The number of results on each page. int32 per_page = 3; diff --git a/components/automate-gateway/api/infra_proxy.pb.swagger.go b/components/automate-gateway/api/infra_proxy.pb.swagger.go index 094225e9590..f2c81ad0602 100644 --- a/components/automate-gateway/api/infra_proxy.pb.swagger.go +++ b/components/automate-gateway/api/infra_proxy.pb.swagger.go @@ -495,7 +495,7 @@ func init() { }, { "name": "search_query.page", - "description": "The number of result pages to return.", + "description": "Starting page for the results.", "in": "query", "required": false, "type": "integer", @@ -2219,7 +2219,7 @@ func init() { "page": { "type": "integer", "format": "int32", - "description": "The number of result pages to return." + "description": "Starting page for the results." }, "per_page": { "type": "integer", diff --git a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json index 70f3dc22c74..884c95dc959 100644 --- a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json +++ b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json @@ -492,7 +492,7 @@ }, { "name": "search_query.page", - "description": "The number of result pages to return.", + "description": "Starting page for the results.", "in": "query", "required": false, "type": "integer", @@ -2216,7 +2216,7 @@ "page": { "type": "integer", "format": "int32", - "description": "The number of result pages to return." + "description": "Starting page for the results." }, "per_page": { "type": "integer", From 5b984155ec9b5291749028a1b70acd2b0f6b11af Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 11 Feb 2021 11:56:52 +0530 Subject: [PATCH 10/11] minor updates Signed-off-by: Vivek Singh --- api/external/infra_proxy/infra_proxy.swagger.json | 2 +- api/external/infra_proxy/request/common.proto | 6 +++--- api/external/infra_proxy/response/clients.pb.go | 2 +- api/external/infra_proxy/response/clients.proto | 2 +- api/interservice/infra_proxy/request/common.proto | 6 +++--- api/interservice/infra_proxy/response/clients.pb.go | 2 +- api/interservice/infra_proxy/response/clients.proto | 4 ++-- components/automate-gateway/api/infra_proxy.pb.swagger.go | 2 +- .../api_chef_automate/infra_proxy/infra_proxy.swagger.json | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/external/infra_proxy/infra_proxy.swagger.json b/api/external/infra_proxy/infra_proxy.swagger.json index 884c95dc959..19a7d9531a8 100644 --- a/api/external/infra_proxy/infra_proxy.swagger.json +++ b/api/external/infra_proxy/infra_proxy.swagger.json @@ -2540,7 +2540,7 @@ "page": { "type": "integer", "format": "int32", - "title": "Records page number" + "description": "Starting page for the results." }, "total": { "type": "integer", diff --git a/api/external/infra_proxy/request/common.proto b/api/external/infra_proxy/request/common.proto index f624997399e..2182706bedc 100644 --- a/api/external/infra_proxy/request/common.proto +++ b/api/external/infra_proxy/request/common.proto @@ -7,7 +7,7 @@ message SearchQuery { // The search query used to identify a list of items. string q = 1; // Starting page for the results. - int32 page = 2; - // The number of results on each page. - int32 per_page = 3; + int32 page = 2; + // The number of results on each page. + int32 per_page = 3; } diff --git a/api/external/infra_proxy/response/clients.pb.go b/api/external/infra_proxy/response/clients.pb.go index 2738027785a..73e35169bbc 100644 --- a/api/external/infra_proxy/response/clients.pb.go +++ b/api/external/infra_proxy/response/clients.pb.go @@ -32,7 +32,7 @@ type Clients struct { // Client list. Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"` - // Records page number + // Starting page for the results. Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // Total number of records. Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` diff --git a/api/external/infra_proxy/response/clients.proto b/api/external/infra_proxy/response/clients.proto index 8f08ffba1da..37240e5b5d2 100644 --- a/api/external/infra_proxy/response/clients.proto +++ b/api/external/infra_proxy/response/clients.proto @@ -7,7 +7,7 @@ option go_package = "github.com/chef/automate/api/external/infra_proxy/response" message Clients { // Client list. repeated ClientListItem clients = 1; - // Records page number + // Starting page for the results. int32 page = 2; // Total number of records. int32 total = 3; diff --git a/api/interservice/infra_proxy/request/common.proto b/api/interservice/infra_proxy/request/common.proto index eeb3f95e0fa..c0dd3a4919e 100644 --- a/api/interservice/infra_proxy/request/common.proto +++ b/api/interservice/infra_proxy/request/common.proto @@ -8,7 +8,7 @@ message SearchQuery { // The search query used to identify a list of items. string q = 1; // Starting page for the results. - int32 page = 2; - // The number of results on each page. - int32 per_page = 3; + int32 page = 2; + // The number of results on each page. + int32 per_page = 3; } diff --git a/api/interservice/infra_proxy/response/clients.pb.go b/api/interservice/infra_proxy/response/clients.pb.go index af0af512ddd..42f08416157 100644 --- a/api/interservice/infra_proxy/response/clients.pb.go +++ b/api/interservice/infra_proxy/response/clients.pb.go @@ -32,7 +32,7 @@ type Clients struct { // Client list. Clients []*ClientListItem `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty" toml:"clients,omitempty" mapstructure:"clients,omitempty"` - // Records page number + // Starting page for the results. Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty" toml:"page,omitempty" mapstructure:"page,omitempty"` // Total number of records. Total int32 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty" toml:"total,omitempty" mapstructure:"total,omitempty"` diff --git a/api/interservice/infra_proxy/response/clients.proto b/api/interservice/infra_proxy/response/clients.proto index 77558d2d503..2c34312443c 100644 --- a/api/interservice/infra_proxy/response/clients.proto +++ b/api/interservice/infra_proxy/response/clients.proto @@ -6,8 +6,8 @@ option go_package = "github.com/chef/automate/api/interservice/infra_proxy/respo message Clients { // Client list. repeated ClientListItem clients = 1; - // Records page number - int32 page = 2; + // Starting page for the results. + int32 page = 2; // Total number of records. int32 total = 3; } diff --git a/components/automate-gateway/api/infra_proxy.pb.swagger.go b/components/automate-gateway/api/infra_proxy.pb.swagger.go index f2c81ad0602..3bb7fa5bc12 100644 --- a/components/automate-gateway/api/infra_proxy.pb.swagger.go +++ b/components/automate-gateway/api/infra_proxy.pb.swagger.go @@ -2543,7 +2543,7 @@ func init() { "page": { "type": "integer", "format": "int32", - "title": "Records page number" + "description": "Starting page for the results." }, "total": { "type": "integer", diff --git a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json index 884c95dc959..19a7d9531a8 100644 --- a/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json +++ b/components/docs-chef-io/data/automate/api_chef_automate/infra_proxy/infra_proxy.swagger.json @@ -2540,7 +2540,7 @@ "page": { "type": "integer", "format": "int32", - "title": "Records page number" + "description": "Starting page for the results." }, "total": { "type": "integer", From 0372e2e150b58bb6bc58b19b93a2460a3e0e08ca Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Thu, 11 Feb 2021 20:06:09 +0530 Subject: [PATCH 11/11] proto changes Signed-off-by: Vivek Singh --- .../infra_proxy/response/clients.pb.go | 99 ++++++----------- .../infra_proxy/response/clients.pb.go | 100 ++++++------------ 2 files changed, 70 insertions(+), 129 deletions(-) diff --git a/api/external/infra_proxy/response/clients.pb.go b/api/external/infra_proxy/response/clients.pb.go index 73e35169bbc..da51006267a 100644 --- a/api/external/infra_proxy/response/clients.pb.go +++ b/api/external/infra_proxy/response/clients.pb.go @@ -447,63 +447,6 @@ var file_external_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x26, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, -<<<<<<< HEAD - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x71, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, - 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, - 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8a, - 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, - 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, - 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, - 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, - 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, - 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, - 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x74, 0x0a, 0x0c, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x50, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, - 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, - 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, - 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -======= 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, @@ -515,7 +458,7 @@ var file_external_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0xb2, 0x01, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, + 0x61, 0x6d, 0x65, 0x22, 0x8a, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4e, @@ -526,12 +469,40 @@ var file_external_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, - 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ->>>>>>> Added client list search test cases + 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x56, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x63, + 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, + 0x22, 0x74, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x50, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, + 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x69, 0x6e, 0x66, + 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, + 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/interservice/infra_proxy/response/clients.pb.go b/api/interservice/infra_proxy/response/clients.pb.go index 42f08416157..bc33d6c9251 100644 --- a/api/interservice/infra_proxy/response/clients.pb.go +++ b/api/interservice/infra_proxy/response/clients.pb.go @@ -447,64 +447,6 @@ var file_interservice_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x6e, 0x73, 0x65, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x29, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, -<<<<<<< HEAD - 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x74, 0x0a, 0x07, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, - 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, - 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, - 0x74, 0x65, 0x6d, 0x52, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, - 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, - 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, - 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x59, 0x0a, - 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, - 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x77, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0a, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x34, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, - 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, - 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x6d, 0x0a, 0x0f, - 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, - 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, - 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -======= 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x07, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x07, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x68, 0x65, 0x66, @@ -516,7 +458,7 @@ var file_interservice_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x24, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xb2, 0x01, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x8d, 0x02, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -528,12 +470,40 @@ var file_interservice_infra_proxy_response_clients_proto_rawDesc = []byte{ 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x66, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x68, 0x65, 0x66, 0x54, 0x79, - 0x70, 0x65, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, - 0x69, 0x6e, 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, ->>>>>>> Added client list search test cases + 0x70, 0x65, 0x12, 0x59, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, + 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, + 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, + 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x77, 0x0a, + 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x68, 0x65, 0x66, 0x2e, 0x61, 0x75, 0x74, + 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x69, 0x6e, 0x66, + 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x09, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, 0x0a, 0x09, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, + 0x79, 0x22, 0x6d, 0x0a, 0x0f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, 0x69, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x65, + 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, + 0x68, 0x65, 0x66, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, + 0x66, 0x72, 0x61, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (