From aa1a179bd3334130c20b67e7a12482734d95079a Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Mon, 23 Mar 2020 02:43:08 +0530 Subject: [PATCH] [infra-proxy-service] Add Environments gRPC & HTTP API (#2985) * [infra-proxy-service] Add Environments gRPC & HTTP API Signed-off-by: Vivek Singh * [infra-proxy-service] Add default and override attributes Signed-off-by: Vivek Singh * [infra-proxy-service] handle default & orderride attribute json marshal err Signed-off-by: Vivek Singh --- api/external/infra_proxy/infra_proxy.pb.go | 245 ++++++++++------ api/external/infra_proxy/infra_proxy.pb.gw.go | 262 ++++++++++++++++++ .../infra_proxy/infra_proxy.pb.policy-v1.go | 32 +++ .../infra_proxy/infra_proxy.pb.policy-v2.go | 32 +++ api/external/infra_proxy/infra_proxy.proto | 17 ++ .../infra_proxy/infra_proxy.swagger.json | 128 +++++++++ .../infra_proxy/request/environments.pb.go | 154 ++++++++++ .../infra_proxy/request/environments.proto | 20 ++ .../infra_proxy/response/environments.pb.go | 230 +++++++++++++++ .../infra_proxy/response/environments.proto | 31 +++ .../infra_proxy/request/environments.pb.go | 154 ++++++++++ .../infra_proxy/request/environments.proto | 20 ++ .../infra_proxy/response/environments.pb.go | 230 +++++++++++++++ .../infra_proxy/response/environments.proto | 31 +++ .../infra_proxy/service/infra_proxy.pb.go | 158 ++++++++--- .../infra_proxy/service/infra_proxy.proto | 5 + .../api/infra_proxy.pb.swagger.go | 128 +++++++++ .../handler/infra_proxy/environments.go | 59 ++++ .../server/v1/environments.go | 94 +++++++ 19 files changed, 1905 insertions(+), 125 deletions(-) create mode 100644 api/external/infra_proxy/request/environments.pb.go create mode 100644 api/external/infra_proxy/request/environments.proto create mode 100644 api/external/infra_proxy/response/environments.pb.go create mode 100644 api/external/infra_proxy/response/environments.proto create mode 100644 api/interservice/infra_proxy/request/environments.pb.go create mode 100644 api/interservice/infra_proxy/request/environments.proto create mode 100644 api/interservice/infra_proxy/response/environments.pb.go create mode 100644 api/interservice/infra_proxy/response/environments.proto create mode 100644 components/automate-gateway/handler/infra_proxy/environments.go create mode 100644 components/infra-proxy-service/server/v1/environments.go diff --git a/api/external/infra_proxy/infra_proxy.pb.go b/api/external/infra_proxy/infra_proxy.pb.go index 2f9b7effc3c..ccb0249c5e5 100644 --- a/api/external/infra_proxy/infra_proxy.pb.go +++ b/api/external/infra_proxy/infra_proxy.pb.go @@ -35,89 +35,96 @@ func init() { } var fileDescriptor_8898095cc3dd9190 = []byte{ - // 1307 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x99, 0x3d, 0x6c, 0xe4, 0x44, - 0x14, 0xc7, 0xb5, 0x0e, 0x0a, 0xc9, 0x10, 0x38, 0x78, 0x97, 0xcb, 0x39, 0x4e, 0x72, 0xc7, 0x19, - 0x2e, 0x40, 0x2e, 0x6b, 0xef, 0x26, 0x81, 0x13, 0x2b, 0x21, 0x48, 0x02, 0x8a, 0xae, 0x39, 0x50, - 0xf8, 0x28, 0x28, 0x88, 0x1c, 0xef, 0xec, 0x9e, 0x15, 0xaf, 0x67, 0xcf, 0xf6, 0x46, 0x17, 0x4e, - 0x57, 0xb0, 0xe5, 0x82, 0x68, 0xa0, 0xa2, 0x38, 0x09, 0x28, 0xa0, 0x03, 0x21, 0xb9, 0x44, 0xa2, - 0xa1, 0x3a, 0x51, 0x45, 0x48, 0x54, 0x14, 0x08, 0x10, 0x05, 0x05, 0x05, 0x54, 0x34, 0x68, 0x3c, - 0xb6, 0xd7, 0xf6, 0x7e, 0x78, 0xe6, 0x38, 0x29, 0x57, 0x65, 0xb5, 0x7e, 0xff, 0xf1, 0xfc, 0x7f, - 0xf3, 0xde, 0x9b, 0x9d, 0x09, 0x5a, 0x31, 0xda, 0x96, 0x8e, 0x6f, 0xf8, 0xd8, 0x75, 0x0c, 0x5b, - 0xb7, 0x9c, 0x86, 0x6b, 0xec, 0xb5, 0x5d, 0x72, 0xe3, 0x28, 0xfd, 0x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 0x6d, 0x24, 0x1b, 0x8b, 0xfb, 0xb8, 0xcb, 0xc2, 0xf9, 0xcf, 0x74, 0x2c, 0x5e, - 0x3d, 0x3e, 0x29, 0x78, 0x8b, 0xa0, 0x8c, 0x80, 0x17, 0x27, 0xe0, 0xf3, 0x70, 0x59, 0x94, 0x5d, - 0x94, 0x82, 0x5b, 0xeb, 0x6f, 0x57, 0x9b, 0x96, 0x7f, 0xad, 0xb3, 0xaf, 0x99, 0xa4, 0xa5, 0x53, - 0x22, 0xc9, 0x4d, 0xff, 0xc8, 0xff, 0x4d, 0xec, 0x4f, 0x86, 0x97, 0xfb, 0xeb, 0xff, 0x05, 0x00, - 0x00, 0xff, 0xff, 0x29, 0xab, 0xde, 0x9b, 0xd5, 0x1a, 0x00, 0x00, + // 1422 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x99, 0x4d, 0x6c, 0xdc, 0x44, + 0x14, 0xc7, 0xb5, 0x2e, 0x0a, 0xcd, 0x10, 0x5a, 0x78, 0xfd, 0x72, 0xdd, 0xa6, 0xa5, 0x6e, 0x1b, + 0x20, 0xed, 0xda, 0xd9, 0x6c, 0xa0, 0x60, 0x54, 0x41, 0x1a, 0xaa, 0xaa, 0x97, 0x16, 0xb5, 0xc0, + 0x81, 0x03, 0x91, 0xe3, 0xcc, 0x6e, 0xad, 0xee, 0x7a, 0xb6, 0xb6, 0x37, 0x6a, 0xa8, 0x7a, 0x60, + 0x8f, 0x0b, 0xe2, 0x02, 0x27, 0x0e, 0x48, 0xc0, 0x01, 0x6e, 0x20, 0x24, 0x1f, 0x91, 0xb8, 0x70, + 0xaa, 0x38, 0x55, 0x48, 0x9c, 0x38, 0x20, 0x40, 0x1c, 0x0a, 0x42, 0x08, 0x4e, 0x48, 0x08, 0x8d, + 0xc7, 0xf6, 0x8e, 0xbd, 0x1f, 0x9e, 0x09, 0x48, 0xcd, 0x29, 0xd1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b5, 0x5a, 0xd3, 0x0d, 0xaf, 0x75, 0xd7, 0x0c, 0x87, + 0xb4, 0x4d, 0x3a, 0x5d, 0xf6, 0x25, 0x6b, 0xec, 0x17, 0xbb, 0xb5, 0xa9, 0xf8, 0xe3, 0x55, 0xfd, + 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0xe7, 0x43, 0x44, 0x20, 0x1e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -153,6 +160,8 @@ type InfraProxyClient interface { GetRole(ctx context.Context, in *request.Role, opts ...grpc.CallOption) (*response.Role, error) GetClients(ctx context.Context, in *request.Clients, opts ...grpc.CallOption) (*response.Clients, error) GetClient(ctx context.Context, in *request.Client, opts ...grpc.CallOption) (*response.Client, error) + GetEnvironments(ctx context.Context, in *request.Environments, opts ...grpc.CallOption) (*response.Environments, error) + GetEnvironment(ctx context.Context, in *request.Environment, opts ...grpc.CallOption) (*response.Environment, error) } type infraProxyClient struct { @@ -352,6 +361,24 @@ func (c *infraProxyClient) GetClient(ctx context.Context, in *request.Client, op return out, nil } +func (c *infraProxyClient) GetEnvironments(ctx context.Context, in *request.Environments, opts ...grpc.CallOption) (*response.Environments, error) { + out := new(response.Environments) + err := c.cc.Invoke(ctx, "/chef.automate.api.infra_proxy.InfraProxy/GetEnvironments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infraProxyClient) GetEnvironment(ctx context.Context, in *request.Environment, opts ...grpc.CallOption) (*response.Environment, error) { + out := new(response.Environment) + err := c.cc.Invoke(ctx, "/chef.automate.api.infra_proxy.InfraProxy/GetEnvironment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // InfraProxyServer is the server API for InfraProxy service. type InfraProxyServer interface { GetVersion(context.Context, *version.VersionInfoRequest) (*version.VersionInfo, error) @@ -375,6 +402,8 @@ type InfraProxyServer interface { GetRole(context.Context, *request.Role) (*response.Role, error) GetClients(context.Context, *request.Clients) (*response.Clients, error) GetClient(context.Context, *request.Client) (*response.Client, error) + GetEnvironments(context.Context, *request.Environments) (*response.Environments, error) + GetEnvironment(context.Context, *request.Environment) (*response.Environment, error) } // UnimplementedInfraProxyServer can be embedded to have forward compatible implementations. @@ -444,6 +473,12 @@ func (*UnimplementedInfraProxyServer) GetClients(ctx context.Context, req *reque func (*UnimplementedInfraProxyServer) GetClient(ctx context.Context, req *request.Client) (*response.Client, error) { return nil, status.Errorf(codes.Unimplemented, "method GetClient not implemented") } +func (*UnimplementedInfraProxyServer) GetEnvironments(ctx context.Context, req *request.Environments) (*response.Environments, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEnvironments not implemented") +} +func (*UnimplementedInfraProxyServer) GetEnvironment(ctx context.Context, req *request.Environment) (*response.Environment, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEnvironment not implemented") +} func RegisterInfraProxyServer(s *grpc.Server, srv InfraProxyServer) { s.RegisterService(&_InfraProxy_serviceDesc, srv) @@ -827,6 +862,42 @@ func _InfraProxy_GetClient_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _InfraProxy_GetEnvironments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(request.Environments) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfraProxyServer).GetEnvironments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/chef.automate.api.infra_proxy.InfraProxy/GetEnvironments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfraProxyServer).GetEnvironments(ctx, req.(*request.Environments)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfraProxy_GetEnvironment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(request.Environment) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfraProxyServer).GetEnvironment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/chef.automate.api.infra_proxy.InfraProxy/GetEnvironment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfraProxyServer).GetEnvironment(ctx, req.(*request.Environment)) + } + return interceptor(ctx, in, info, handler) +} + var _InfraProxy_serviceDesc = grpc.ServiceDesc{ ServiceName: "chef.automate.api.infra_proxy.InfraProxy", HandlerType: (*InfraProxyServer)(nil), @@ -915,6 +986,14 @@ var _InfraProxy_serviceDesc = grpc.ServiceDesc{ MethodName: "GetClient", Handler: _InfraProxy_GetClient_Handler, }, + { + MethodName: "GetEnvironments", + Handler: _InfraProxy_GetEnvironments_Handler, + }, + { + MethodName: "GetEnvironment", + Handler: _InfraProxy_GetEnvironment_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/external/infra_proxy/infra_proxy.proto", diff --git a/api/external/infra_proxy/infra_proxy.pb.gw.go b/api/external/infra_proxy/infra_proxy.pb.gw.go index 84bb9efd552..fe8ebcc68ea 100644 --- a/api/external/infra_proxy/infra_proxy.pb.gw.go +++ b/api/external/infra_proxy/infra_proxy.pb.gw.go @@ -1534,6 +1534,180 @@ func local_request_InfraProxy_GetClient_0(ctx context.Context, marshaler runtime } +func request_InfraProxy_GetEnvironments_0(ctx context.Context, marshaler runtime.Marshaler, client InfraProxyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq request.Environments + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["server_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server_id") + } + + protoReq.ServerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server_id", err) + } + + val, ok = pathParams["org_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") + } + + protoReq.OrgId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) + } + + msg, err := client.GetEnvironments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfraProxy_GetEnvironments_0(ctx context.Context, marshaler runtime.Marshaler, server InfraProxyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq request.Environments + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["server_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server_id") + } + + protoReq.ServerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server_id", err) + } + + val, ok = pathParams["org_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") + } + + protoReq.OrgId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) + } + + msg, err := server.GetEnvironments(ctx, &protoReq) + return msg, metadata, err + +} + +func request_InfraProxy_GetEnvironment_0(ctx context.Context, marshaler runtime.Marshaler, client InfraProxyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq request.Environment + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["server_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server_id") + } + + protoReq.ServerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server_id", err) + } + + val, ok = pathParams["org_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") + } + + protoReq.OrgId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) + } + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.GetEnvironment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_InfraProxy_GetEnvironment_0(ctx context.Context, marshaler runtime.Marshaler, server InfraProxyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq request.Environment + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["server_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "server_id") + } + + protoReq.ServerId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "server_id", err) + } + + val, ok = pathParams["org_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id") + } + + protoReq.OrgId, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err) + } + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.GetEnvironment(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterInfraProxyHandlerServer registers the http handlers for service InfraProxy to "mux". // UnaryRPC :call InfraProxyServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1959,6 +2133,46 @@ func RegisterInfraProxyHandlerServer(ctx context.Context, mux *runtime.ServeMux, }) + mux.Handle("GET", pattern_InfraProxy_GetEnvironments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfraProxy_GetEnvironments_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfraProxy_GetEnvironments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfraProxy_GetEnvironment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_InfraProxy_GetEnvironment_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfraProxy_GetEnvironment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2420,6 +2634,46 @@ func RegisterInfraProxyHandlerClient(ctx context.Context, mux *runtime.ServeMux, }) + mux.Handle("GET", pattern_InfraProxy_GetEnvironments_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfraProxy_GetEnvironments_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfraProxy_GetEnvironments_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_InfraProxy_GetEnvironment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_InfraProxy_GetEnvironment_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_InfraProxy_GetEnvironment_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -2465,6 +2719,10 @@ var ( pattern_InfraProxy_GetClients_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"infra", "servers", "server_id", "orgs", "org_id", "clients"}, "", runtime.AssumeColonVerbOpt(true))) pattern_InfraProxy_GetClient_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"infra", "servers", "server_id", "orgs", "org_id", "clients", "name"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_InfraProxy_GetEnvironments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"infra", "servers", "server_id", "orgs", "org_id", "environments"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_InfraProxy_GetEnvironment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"infra", "servers", "server_id", "orgs", "org_id", "environment", "name"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -2509,4 +2767,8 @@ var ( forward_InfraProxy_GetClients_0 = runtime.ForwardResponseMessage forward_InfraProxy_GetClient_0 = runtime.ForwardResponseMessage + + forward_InfraProxy_GetEnvironments_0 = runtime.ForwardResponseMessage + + forward_InfraProxy_GetEnvironment_0 = runtime.ForwardResponseMessage ) diff --git a/api/external/infra_proxy/infra_proxy.pb.policy-v1.go b/api/external/infra_proxy/infra_proxy.pb.policy-v1.go index 43207b135e9..be504be2981 100644 --- a/api/external/infra_proxy/infra_proxy.pb.policy-v1.go +++ b/api/external/infra_proxy/infra_proxy.pb.policy-v1.go @@ -326,4 +326,36 @@ func init() { } return "" }) + policy.MapMethodTo("/chef.automate.api.infra_proxy.InfraProxy/GetEnvironments", "infra:chefServers:{server_id}:orgs:{org_id}/environments", "read", "GET", "/infra/servers/{server_id}/orgs/{org_id}/environments", func(unexpandedResource string, input interface{}) string { + if m, ok := input.(*request.Environments); ok { + return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string { + switch want { + case "org_id": + return m.OrgId + case "server_id": + return m.ServerId + default: + return "" + } + }) + } + return "" + }) + policy.MapMethodTo("/chef.automate.api.infra_proxy.InfraProxy/GetEnvironment", "infra:chefServers:{server_id}:orgs:{org_id}/environments", "read", "GET", "/infra/servers/{server_id}/orgs/{org_id}/environment/{name}", func(unexpandedResource string, input interface{}) string { + if m, ok := input.(*request.Environment); ok { + return policy.ExpandParameterizedResource(unexpandedResource, func(want string) string { + switch want { + case "org_id": + return m.OrgId + case "server_id": + return m.ServerId + case "name": + return m.Name + default: + return "" + } + }) + } + return "" + }) } diff --git a/api/external/infra_proxy/infra_proxy.pb.policy-v2.go b/api/external/infra_proxy/infra_proxy.pb.policy-v2.go index 8297c9bf154..96d75ada289 100644 --- a/api/external/infra_proxy/infra_proxy.pb.policy-v2.go +++ b/api/external/infra_proxy/infra_proxy.pb.policy-v2.go @@ -326,4 +326,36 @@ func init() { } return "" }) + policyv2.MapMethodTo("/chef.automate.api.infra_proxy.InfraProxy/GetEnvironments", "infra:chefServers:{server_id}:orgs:{org_id}:environments", "infra:chefServerOrgEnvironments:list", "GET", "/infra/servers/{server_id}/orgs/{org_id}/environments", func(unexpandedResource string, input interface{}) string { + if m, ok := input.(*request.Environments); ok { + return policyv2.ExpandParameterizedResource(unexpandedResource, func(want string) string { + switch want { + case "org_id": + return m.OrgId + case "server_id": + return m.ServerId + default: + return "" + } + }) + } + return "" + }) + policyv2.MapMethodTo("/chef.automate.api.infra_proxy.InfraProxy/GetEnvironment", "infra:chefServers:{server_id}:orgs:{org_id}:environments", "infra:chefServerOrgEnvironments:get", "GET", "/infra/servers/{server_id}/orgs/{org_id}/environment/{name}", func(unexpandedResource string, input interface{}) string { + if m, ok := input.(*request.Environment); ok { + return policyv2.ExpandParameterizedResource(unexpandedResource, func(want string) string { + switch want { + case "org_id": + return m.OrgId + case "server_id": + return m.ServerId + case "name": + return m.Name + default: + return "" + } + }) + } + return "" + }) } diff --git a/api/external/infra_proxy/infra_proxy.proto b/api/external/infra_proxy/infra_proxy.proto index 9e54948fbb3..72b945c332e 100644 --- a/api/external/infra_proxy/infra_proxy.proto +++ b/api/external/infra_proxy/infra_proxy.proto @@ -10,12 +10,14 @@ import "api/external/infra_proxy/request/servers.proto"; import "api/external/infra_proxy/request/cookbooks.proto"; import "api/external/infra_proxy/request/roles.proto"; import "api/external/infra_proxy/request/clients.proto"; +import "api/external/infra_proxy/request/environments.proto"; import "api/external/infra_proxy/response/orgs.proto"; import "api/external/infra_proxy/response/servers.proto"; import "api/external/infra_proxy/response/cookbooks.proto"; import "api/external/infra_proxy/response/roles.proto"; import "api/external/infra_proxy/response/clients.proto"; +import "api/external/infra_proxy/response/environments.proto"; import "api/external/common/version/version.proto"; @@ -180,5 +182,20 @@ service InfraProxy { option (chef.automate.api.policy).action = "read"; option (chef.automate.api.iam.policy).resource = "infra:servers:{server_id}:orgs:{org_id}:clients"; option (chef.automate.api.iam.policy).action = "infra:serverOrgClients:get"; + } + + rpc GetEnvironments (infra_proxy.request.Environments) returns (infra_proxy.response.Environments) { + option (google.api.http).get = "/infra/servers/{server_id}/orgs/{org_id}/environments"; + option (chef.automate.api.policy).resource = "infra:chefServers:{server_id}:orgs:{org_id}/environments"; + option (chef.automate.api.policy).action = "read"; + option (chef.automate.api.iam.policy).resource = "infra:chefServers:{server_id}:orgs:{org_id}:environments"; + option (chef.automate.api.iam.policy).action = "infra:chefServerOrgEnvironments:list"; + }; + rpc GetEnvironment (infra_proxy.request.Environment) returns (infra_proxy.response.Environment) { + option (google.api.http).get = "/infra/servers/{server_id}/orgs/{org_id}/environment/{name}"; + option (chef.automate.api.policy).resource = "infra:chefServers:{server_id}:orgs:{org_id}/environments"; + option (chef.automate.api.policy).action = "read"; + option (chef.automate.api.iam.policy).resource = "infra:chefServers:{server_id}:orgs:{org_id}:environments"; + option (chef.automate.api.iam.policy).action = "infra:chefServerOrgEnvironments:get"; }; } diff --git a/api/external/infra_proxy/infra_proxy.swagger.json b/api/external/infra_proxy/infra_proxy.swagger.json index c03c169c58c..5feca872a06 100644 --- a/api/external/infra_proxy/infra_proxy.swagger.json +++ b/api/external/infra_proxy/infra_proxy.swagger.json @@ -545,6 +545,77 @@ ] } }, + "/infra/servers/{server_id}/orgs/{org_id}/environment/{name}": { + "get": { + "operationId": "GetEnvironment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.Environment" + } + } + }, + "parameters": [ + { + "name": "server_id", + "description": "Id of the Server.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "org_id", + "description": "Id of the Org.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "name", + "description": "Name of the environment.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "InfraProxy" + ] + } + }, + "/infra/servers/{server_id}/orgs/{org_id}/environments": { + "get": { + "operationId": "GetEnvironments", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.Environments" + } + } + }, + "parameters": [ + { + "name": "server_id", + "description": "Id of the Server.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "org_id", + "description": "Id of the Org.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "InfraProxy" + ] + } + }, "/infra/servers/{server_id}/orgs/{org_id}/roles": { "get": { "operationId": "GetRoles", @@ -1027,6 +1098,63 @@ } } }, + "chef.automate.api.infra_proxy.response.Environment": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Environment." + }, + "chef_type": { + "type": "string", + "description": "Type of the object." + }, + "description": { + "type": "string", + "description": "Description of the node." + }, + "json_class": { + "type": "string", + "description": "Name of the class." + }, + "cookbook_versions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of versioned cookbooks" + }, + "default_attributes": { + "type": "string", + "description": "Stringified json of the default attributes." + }, + "override_attributes": { + "type": "string", + "description": "Stringified json of the override attributes." + } + } + }, + "chef.automate.api.infra_proxy.response.EnvironmentListItem": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Environment." + } + } + }, + "chef.automate.api.infra_proxy.response.Environments": { + "type": "object", + "properties": { + "environments": { + "type": "array", + "items": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.EnvironmentListItem" + }, + "description": "List of the EnvironmentListItem." + } + } + }, "chef.automate.api.infra_proxy.response.GetOrg": { "type": "object", "properties": { diff --git a/api/external/infra_proxy/request/environments.pb.go b/api/external/infra_proxy/request/environments.pb.go new file mode 100644 index 00000000000..21a560cd090 --- /dev/null +++ b/api/external/infra_proxy/request/environments.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api/external/infra_proxy/request/environments.proto + +package request + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type Environments struct { + // Id of the Org. + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + // Id of the Server. + ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Environments) Reset() { *m = Environments{} } +func (m *Environments) String() string { return proto.CompactTextString(m) } +func (*Environments) ProtoMessage() {} +func (*Environments) Descriptor() ([]byte, []int) { + return fileDescriptor_566debf9ea619076, []int{0} +} + +func (m *Environments) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environments.Unmarshal(m, b) +} +func (m *Environments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environments.Marshal(b, m, deterministic) +} +func (m *Environments) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environments.Merge(m, src) +} +func (m *Environments) XXX_Size() int { + return xxx_messageInfo_Environments.Size(m) +} +func (m *Environments) XXX_DiscardUnknown() { + xxx_messageInfo_Environments.DiscardUnknown(m) +} + +var xxx_messageInfo_Environments proto.InternalMessageInfo + +func (m *Environments) GetOrgId() string { + if m != nil { + return m.OrgId + } + return "" +} + +func (m *Environments) GetServerId() string { + if m != nil { + return m.ServerId + } + return "" +} + +type Environment struct { + // Id of the Org. + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty"` + // Id of the Server. + ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"` + // Name of the environment. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Environment) Reset() { *m = Environment{} } +func (m *Environment) String() string { return proto.CompactTextString(m) } +func (*Environment) ProtoMessage() {} +func (*Environment) Descriptor() ([]byte, []int) { + return fileDescriptor_566debf9ea619076, []int{1} +} + +func (m *Environment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environment.Unmarshal(m, b) +} +func (m *Environment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environment.Marshal(b, m, deterministic) +} +func (m *Environment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environment.Merge(m, src) +} +func (m *Environment) XXX_Size() int { + return xxx_messageInfo_Environment.Size(m) +} +func (m *Environment) XXX_DiscardUnknown() { + xxx_messageInfo_Environment.DiscardUnknown(m) +} + +var xxx_messageInfo_Environment proto.InternalMessageInfo + +func (m *Environment) GetOrgId() string { + if m != nil { + return m.OrgId + } + return "" +} + +func (m *Environment) GetServerId() string { + if m != nil { + return m.ServerId + } + return "" +} + +func (m *Environment) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*Environments)(nil), "chef.automate.api.infra_proxy.request.Environments") + proto.RegisterType((*Environment)(nil), "chef.automate.api.infra_proxy.request.Environment") +} + +func init() { + proto.RegisterFile("api/external/infra_proxy/request/environments.proto", fileDescriptor_566debf9ea619076) +} + +var fileDescriptor_566debf9ea619076 = []byte{ + // 204 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4e, 0x2c, 0xc8, 0xd4, + 0x4f, 0xad, 0x28, 0x49, 0x2d, 0xca, 0x4b, 0xcc, 0xd1, 0xcf, 0xcc, 0x4b, 0x2b, 0x4a, 0x8c, 0x2f, + 0x28, 0xca, 0xaf, 0xa8, 0xd4, 0x2f, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0xd1, 0x4f, 0xcd, 0x2b, + 0xcb, 0x2c, 0xca, 0xcf, 0xcb, 0x4d, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x52, 0x4d, 0xce, 0x48, 0x4d, 0xd3, 0x4b, 0x2c, 0x2d, 0xc9, 0xcf, 0x4d, 0x2c, 0x49, 0xd5, 0x4b, + 0x2c, 0xc8, 0xd4, 0x43, 0xd2, 0xa9, 0x07, 0xd5, 0xa9, 0xe4, 0xc4, 0xc5, 0xe3, 0x8a, 0xa4, 0x59, + 0x48, 0x94, 0x8b, 0x2d, 0xbf, 0x28, 0x3d, 0x3e, 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0x33, + 0x88, 0x35, 0xbf, 0x28, 0xdd, 0x33, 0x45, 0x48, 0x9a, 0x8b, 0xb3, 0x38, 0xb5, 0xa8, 0x2c, 0xb5, + 0x08, 0x24, 0xc3, 0x04, 0x96, 0xe1, 0x80, 0x08, 0x78, 0xa6, 0x28, 0x85, 0x72, 0x71, 0x23, 0x99, + 0x41, 0x8e, 0x11, 0x42, 0x42, 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0xcc, 0x60, 0x71, 0x30, + 0xdb, 0xc9, 0x3a, 0xca, 0x32, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x1f, + 0xe4, 0x1d, 0x7d, 0x98, 0x77, 0xf4, 0x09, 0x85, 0x48, 0x12, 0x1b, 0x38, 0x14, 0x8c, 0x01, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x44, 0x40, 0x9f, 0x76, 0x3c, 0x01, 0x00, 0x00, +} diff --git a/api/external/infra_proxy/request/environments.proto b/api/external/infra_proxy/request/environments.proto new file mode 100644 index 00000000000..177ae4d1342 --- /dev/null +++ b/api/external/infra_proxy/request/environments.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package chef.automate.api.infra_proxy.request; +option go_package = "github.com/chef/automate/api/external/infra_proxy/request"; + +message Environments { + // Id of the Org. + string org_id = 1; + // Id of the Server. + string server_id = 2; +} + +message Environment { + // Id of the Org. + string org_id = 1; + // Id of the Server. + string server_id = 2; + // Name of the environment. + string name = 3; +} diff --git a/api/external/infra_proxy/response/environments.pb.go b/api/external/infra_proxy/response/environments.pb.go new file mode 100644 index 00000000000..fc1ae26c37a --- /dev/null +++ b/api/external/infra_proxy/response/environments.pb.go @@ -0,0 +1,230 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api/external/infra_proxy/response/environments.proto + +package response + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type Environments struct { + // List of the EnvironmentListItem. + Environments []*EnvironmentListItem `protobuf:"bytes,1,rep,name=environments,proto3" json:"environments,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Environments) Reset() { *m = Environments{} } +func (m *Environments) String() string { return proto.CompactTextString(m) } +func (*Environments) ProtoMessage() {} +func (*Environments) Descriptor() ([]byte, []int) { + return fileDescriptor_b6cb2a4fff0e747c, []int{0} +} + +func (m *Environments) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environments.Unmarshal(m, b) +} +func (m *Environments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environments.Marshal(b, m, deterministic) +} +func (m *Environments) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environments.Merge(m, src) +} +func (m *Environments) XXX_Size() int { + return xxx_messageInfo_Environments.Size(m) +} +func (m *Environments) XXX_DiscardUnknown() { + xxx_messageInfo_Environments.DiscardUnknown(m) +} + +var xxx_messageInfo_Environments proto.InternalMessageInfo + +func (m *Environments) GetEnvironments() []*EnvironmentListItem { + if m != nil { + return m.Environments + } + return nil +} + +type EnvironmentListItem struct { + // Name of the Environment. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvironmentListItem) Reset() { *m = EnvironmentListItem{} } +func (m *EnvironmentListItem) String() string { return proto.CompactTextString(m) } +func (*EnvironmentListItem) ProtoMessage() {} +func (*EnvironmentListItem) Descriptor() ([]byte, []int) { + return fileDescriptor_b6cb2a4fff0e747c, []int{1} +} + +func (m *EnvironmentListItem) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EnvironmentListItem.Unmarshal(m, b) +} +func (m *EnvironmentListItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EnvironmentListItem.Marshal(b, m, deterministic) +} +func (m *EnvironmentListItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvironmentListItem.Merge(m, src) +} +func (m *EnvironmentListItem) XXX_Size() int { + return xxx_messageInfo_EnvironmentListItem.Size(m) +} +func (m *EnvironmentListItem) XXX_DiscardUnknown() { + xxx_messageInfo_EnvironmentListItem.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvironmentListItem proto.InternalMessageInfo + +func (m *EnvironmentListItem) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type Environment struct { + // Name of the Environment. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Type of the object. + ChefType string `protobuf:"bytes,2,opt,name=chef_type,json=chefType,proto3" json:"chef_type,omitempty"` + // Description of the node. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Name of the class. + JsonClass string `protobuf:"bytes,5,opt,name=json_class,json=jsonClass,proto3" json:"json_class,omitempty"` + // List of versioned cookbooks + CookbookVersions []string `protobuf:"bytes,6,rep,name=cookbook_versions,json=cookbookVersions,proto3" json:"cookbook_versions,omitempty"` + // Stringified json of the default attributes. + DefaultAttributes string `protobuf:"bytes,7,opt,name=default_attributes,json=defaultAttributes,proto3" json:"default_attributes,omitempty"` + // Stringified json of the override attributes. + OverrideAttributes string `protobuf:"bytes,8,opt,name=override_attributes,json=overrideAttributes,proto3" json:"override_attributes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Environment) Reset() { *m = Environment{} } +func (m *Environment) String() string { return proto.CompactTextString(m) } +func (*Environment) ProtoMessage() {} +func (*Environment) Descriptor() ([]byte, []int) { + return fileDescriptor_b6cb2a4fff0e747c, []int{2} +} + +func (m *Environment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environment.Unmarshal(m, b) +} +func (m *Environment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environment.Marshal(b, m, deterministic) +} +func (m *Environment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environment.Merge(m, src) +} +func (m *Environment) XXX_Size() int { + return xxx_messageInfo_Environment.Size(m) +} +func (m *Environment) XXX_DiscardUnknown() { + xxx_messageInfo_Environment.DiscardUnknown(m) +} + +var xxx_messageInfo_Environment proto.InternalMessageInfo + +func (m *Environment) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Environment) GetChefType() string { + if m != nil { + return m.ChefType + } + return "" +} + +func (m *Environment) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Environment) GetJsonClass() string { + if m != nil { + return m.JsonClass + } + return "" +} + +func (m *Environment) GetCookbookVersions() []string { + if m != nil { + return m.CookbookVersions + } + return nil +} + +func (m *Environment) GetDefaultAttributes() string { + if m != nil { + return m.DefaultAttributes + } + return "" +} + +func (m *Environment) GetOverrideAttributes() string { + if m != nil { + return m.OverrideAttributes + } + return "" +} + +func init() { + proto.RegisterType((*Environments)(nil), "chef.automate.api.infra_proxy.response.Environments") + proto.RegisterType((*EnvironmentListItem)(nil), "chef.automate.api.infra_proxy.response.EnvironmentListItem") + proto.RegisterType((*Environment)(nil), "chef.automate.api.infra_proxy.response.Environment") +} + +func init() { + proto.RegisterFile("api/external/infra_proxy/response/environments.proto", fileDescriptor_b6cb2a4fff0e747c) +} + +var fileDescriptor_b6cb2a4fff0e747c = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x4b, 0xeb, 0x40, + 0x14, 0x85, 0x69, 0xfb, 0x5e, 0x5f, 0x33, 0xed, 0xe2, 0x75, 0xba, 0x09, 0x88, 0x10, 0xba, 0x90, + 0x8a, 0x38, 0x03, 0xea, 0x4a, 0xdd, 0xa8, 0xb8, 0x10, 0x5c, 0x15, 0x71, 0xe1, 0x26, 0x4c, 0xd2, + 0x5b, 0x3b, 0xb6, 0x99, 0x3b, 0xcc, 0xdc, 0x94, 0xf6, 0x3f, 0xf8, 0xa3, 0x25, 0xa1, 0xd1, 0x11, + 0x0a, 0xba, 0x0b, 0xe7, 0xfb, 0xce, 0x21, 0x21, 0x97, 0x5d, 0x28, 0xab, 0x25, 0x6c, 0x08, 0x9c, + 0x51, 0x2b, 0xa9, 0xcd, 0x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, 0x67, 0x25, 0x81, 0x8f, 0xff, 0xd5, + 0x9b, 0xc3, 0x1d, 0xb9, 0xf9, 0x04, 0x5c, 0xb2, 0x11, 0xae, 0xc1, 0x39, 0x3d, 0x83, 0xd0, 0xef, + 0xd5, 0x3e, 0x6f, 0xd0, 0x57, 0xe1, 0xf6, 0xfa, 0xe5, 0xf2, 0x55, 0xd3, 0xa2, 0xcc, 0x44, 0x8e, + 0x85, 0xac, 0x3e, 0x52, 0x36, 0x3f, 0x44, 0xfe, 0x78, 0x23, 0x59, 0xb7, 0xbe, 0x8b, 0xf3, 0x8f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0x5b, 0xb3, 0xc8, 0x4f, 0x02, 0x00, 0x00, +} diff --git a/api/external/infra_proxy/response/environments.proto b/api/external/infra_proxy/response/environments.proto new file mode 100644 index 00000000000..2ad16669186 --- /dev/null +++ b/api/external/infra_proxy/response/environments.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package chef.automate.api.infra_proxy.response; +option go_package = "github.com/chef/automate/api/external/infra_proxy/response"; + +message Environments { + // List of the EnvironmentListItem. + repeated EnvironmentListItem environments = 1; +} + +message EnvironmentListItem { + // Name of the Environment. + string name = 1; +} + +message Environment { + // Name of the Environment. + string name = 1; + // Type of the object. + string chef_type = 2; + // Description of the node. + string description = 3; + // Name of the class. + string json_class = 5; + // List of versioned cookbooks + repeated string cookbook_versions = 6; + // Stringified json of the default attributes. + string default_attributes = 7; + // Stringified json of the override attributes. + string override_attributes = 8; +} diff --git a/api/interservice/infra_proxy/request/environments.pb.go b/api/interservice/infra_proxy/request/environments.pb.go new file mode 100644 index 00000000000..1251f776389 --- /dev/null +++ b/api/interservice/infra_proxy/request/environments.pb.go @@ -0,0 +1,154 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api/interservice/infra_proxy/request/environments.proto + +package request + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type Environments struct { + // Id of the Org. + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty" toml:"org_id,omitempty" mapstructure:"org_id,omitempty"` + // Id of the Server. + ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty" toml:"server_id,omitempty" mapstructure:"server_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_unrecognized []byte `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_sizecache int32 `json:"-" toml:"-" mapstructure:"-,omitempty"` +} + +func (m *Environments) Reset() { *m = Environments{} } +func (m *Environments) String() string { return proto.CompactTextString(m) } +func (*Environments) ProtoMessage() {} +func (*Environments) Descriptor() ([]byte, []int) { + return fileDescriptor_e190c707558fe428, []int{0} +} + +func (m *Environments) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environments.Unmarshal(m, b) +} +func (m *Environments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environments.Marshal(b, m, deterministic) +} +func (m *Environments) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environments.Merge(m, src) +} +func (m *Environments) XXX_Size() int { + return xxx_messageInfo_Environments.Size(m) +} +func (m *Environments) XXX_DiscardUnknown() { + xxx_messageInfo_Environments.DiscardUnknown(m) +} + +var xxx_messageInfo_Environments proto.InternalMessageInfo + +func (m *Environments) GetOrgId() string { + if m != nil { + return m.OrgId + } + return "" +} + +func (m *Environments) GetServerId() string { + if m != nil { + return m.ServerId + } + return "" +} + +type Environment struct { + // Id of the Org. + OrgId string `protobuf:"bytes,1,opt,name=org_id,json=orgId,proto3" json:"org_id,omitempty" toml:"org_id,omitempty" mapstructure:"org_id,omitempty"` + // Id of the Server. + ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty" toml:"server_id,omitempty" mapstructure:"server_id,omitempty"` + // Name of the environment. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty" mapstructure:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_unrecognized []byte `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_sizecache int32 `json:"-" toml:"-" mapstructure:"-,omitempty"` +} + +func (m *Environment) Reset() { *m = Environment{} } +func (m *Environment) String() string { return proto.CompactTextString(m) } +func (*Environment) ProtoMessage() {} +func (*Environment) Descriptor() ([]byte, []int) { + return fileDescriptor_e190c707558fe428, []int{1} +} + +func (m *Environment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environment.Unmarshal(m, b) +} +func (m *Environment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environment.Marshal(b, m, deterministic) +} +func (m *Environment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environment.Merge(m, src) +} +func (m *Environment) XXX_Size() int { + return xxx_messageInfo_Environment.Size(m) +} +func (m *Environment) XXX_DiscardUnknown() { + xxx_messageInfo_Environment.DiscardUnknown(m) +} + +var xxx_messageInfo_Environment proto.InternalMessageInfo + +func (m *Environment) GetOrgId() string { + if m != nil { + return m.OrgId + } + return "" +} + +func (m *Environment) GetServerId() string { + if m != nil { + return m.ServerId + } + return "" +} + +func (m *Environment) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*Environments)(nil), "chef.automate.domain.infra_proxy.request.Environments") + proto.RegisterType((*Environment)(nil), "chef.automate.domain.infra_proxy.request.Environment") +} + +func init() { + proto.RegisterFile("api/interservice/infra_proxy/request/environments.proto", fileDescriptor_e190c707558fe428) +} + +var fileDescriptor_e190c707558fe428 = []byte{ + // 208 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x90, 0x3f, 0x6b, 0x84, 0x40, + 0x10, 0xc5, 0x31, 0x7f, 0x24, 0x6e, 0x52, 0x2d, 0x04, 0x84, 0x34, 0xc1, 0xca, 0x6a, 0xb7, 0x48, + 0x91, 0x2a, 0x04, 0x84, 0x14, 0xb6, 0x81, 0x34, 0x69, 0x64, 0x75, 0x47, 0x9d, 0x62, 0x77, 0xcc, + 0xb8, 0x4a, 0xf2, 0xed, 0x83, 0x7b, 0x77, 0x60, 0x79, 0x5c, 0x37, 0xbc, 0xc7, 0xef, 0x31, 0xef, + 0x89, 0x57, 0x33, 0xa1, 0x46, 0x1f, 0x80, 0x67, 0xe0, 0x15, 0x3b, 0xd0, 0xe8, 0x7b, 0x36, 0xcd, + 0xc4, 0xf4, 0xfb, 0xa7, 0x19, 0x7e, 0x16, 0x98, 0x83, 0x06, 0xbf, 0x22, 0x93, 0x77, 0xe0, 0xc3, + 0xac, 0x26, 0xa6, 0x40, 0xb2, 0xec, 0x46, 0xe8, 0x95, 0x59, 0x02, 0x39, 0x13, 0x40, 0x59, 0x72, + 0x06, 0xbd, 0xda, 0xc1, 0xea, 0x08, 0x17, 0x95, 0x78, 0xf8, 0xd8, 0xf1, 0xf2, 0x51, 0xa4, 0xc4, + 0x43, 0x83, 0x36, 0x4f, 0x9e, 0x93, 0x32, 0xfb, 0xbc, 0x25, 0x1e, 0x6a, 0x2b, 0x9f, 0x44, 0xb6, + 0xbd, 0x00, 0xbc, 0x39, 0x57, 0xd1, 0xb9, 0x3b, 0x08, 0xb5, 0x2d, 0xbe, 0xc4, 0xfd, 0x2e, 0xe3, + 0x92, 0x08, 0x29, 0xc5, 0x8d, 0x37, 0x0e, 0xf2, 0xeb, 0xa8, 0xc7, 0xbb, 0x7a, 0xff, 0x7e, 0x1b, + 0x30, 0x8c, 0x4b, 0xab, 0x3a, 0x72, 0x7a, 0x6b, 0xa4, 0x4f, 0x8d, 0xf4, 0x39, 0xc3, 0xb4, 0x69, + 0x1c, 0xe3, 0xe5, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x31, 0x00, 0x9b, 0x47, 0x01, 0x00, 0x00, +} diff --git a/api/interservice/infra_proxy/request/environments.proto b/api/interservice/infra_proxy/request/environments.proto new file mode 100644 index 00000000000..85bf866859f --- /dev/null +++ b/api/interservice/infra_proxy/request/environments.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +package chef.automate.domain.infra_proxy.request; +option go_package = "github.com/chef/automate/api/interservice/infra_proxy/request"; + +message Environments { + // Id of the Org. + string org_id = 1; + // Id of the Server. + string server_id = 2; +} + +message Environment { + // Id of the Org. + string org_id = 1; + // Id of the Server. + string server_id = 2; + // Name of the environment. + string name = 3; +} diff --git a/api/interservice/infra_proxy/response/environments.pb.go b/api/interservice/infra_proxy/response/environments.pb.go new file mode 100644 index 00000000000..74b4c85653e --- /dev/null +++ b/api/interservice/infra_proxy/response/environments.pb.go @@ -0,0 +1,230 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: api/interservice/infra_proxy/response/environments.proto + +package response + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type Environments struct { + // List of the EnvironmentListItem. + Environments []*EnvironmentListItem `protobuf:"bytes,1,rep,name=environments,proto3" json:"environments,omitempty" toml:"environments,omitempty" mapstructure:"environments,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_unrecognized []byte `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_sizecache int32 `json:"-" toml:"-" mapstructure:"-,omitempty"` +} + +func (m *Environments) Reset() { *m = Environments{} } +func (m *Environments) String() string { return proto.CompactTextString(m) } +func (*Environments) ProtoMessage() {} +func (*Environments) Descriptor() ([]byte, []int) { + return fileDescriptor_a2042db7d30336eb, []int{0} +} + +func (m *Environments) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environments.Unmarshal(m, b) +} +func (m *Environments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environments.Marshal(b, m, deterministic) +} +func (m *Environments) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environments.Merge(m, src) +} +func (m *Environments) XXX_Size() int { + return xxx_messageInfo_Environments.Size(m) +} +func (m *Environments) XXX_DiscardUnknown() { + xxx_messageInfo_Environments.DiscardUnknown(m) +} + +var xxx_messageInfo_Environments proto.InternalMessageInfo + +func (m *Environments) GetEnvironments() []*EnvironmentListItem { + if m != nil { + return m.Environments + } + return nil +} + +type EnvironmentListItem struct { + // Name of the Environment. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty" mapstructure:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_unrecognized []byte `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_sizecache int32 `json:"-" toml:"-" mapstructure:"-,omitempty"` +} + +func (m *EnvironmentListItem) Reset() { *m = EnvironmentListItem{} } +func (m *EnvironmentListItem) String() string { return proto.CompactTextString(m) } +func (*EnvironmentListItem) ProtoMessage() {} +func (*EnvironmentListItem) Descriptor() ([]byte, []int) { + return fileDescriptor_a2042db7d30336eb, []int{1} +} + +func (m *EnvironmentListItem) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EnvironmentListItem.Unmarshal(m, b) +} +func (m *EnvironmentListItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EnvironmentListItem.Marshal(b, m, deterministic) +} +func (m *EnvironmentListItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvironmentListItem.Merge(m, src) +} +func (m *EnvironmentListItem) XXX_Size() int { + return xxx_messageInfo_EnvironmentListItem.Size(m) +} +func (m *EnvironmentListItem) XXX_DiscardUnknown() { + xxx_messageInfo_EnvironmentListItem.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvironmentListItem proto.InternalMessageInfo + +func (m *EnvironmentListItem) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type Environment struct { + // Name of the Environment. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty" mapstructure:"name,omitempty"` + // Type of the object. + ChefType string `protobuf:"bytes,2,opt,name=chef_type,json=chefType,proto3" json:"chef_type,omitempty" toml:"chef_type,omitempty" mapstructure:"chef_type,omitempty"` + // Description of the node. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty" toml:"description,omitempty" mapstructure:"description,omitempty"` + // Name of the class. + JsonClass string `protobuf:"bytes,5,opt,name=json_class,json=jsonClass,proto3" json:"json_class,omitempty" toml:"json_class,omitempty" mapstructure:"json_class,omitempty"` + // List of versioned cookbooks + CookbookVersions []string `protobuf:"bytes,6,rep,name=cookbook_versions,json=cookbookVersions,proto3" json:"cookbook_versions,omitempty" toml:"cookbook_versions,omitempty" mapstructure:"cookbook_versions,omitempty"` + // Stringified json of the default attributes. + DefaultAttributes string `protobuf:"bytes,7,opt,name=default_attributes,json=defaultAttributes,proto3" json:"default_attributes,omitempty" toml:"default_attributes,omitempty" mapstructure:"default_attributes,omitempty"` + // Stringified json of the override attributes. + OverrideAttributes string `protobuf:"bytes,8,opt,name=override_attributes,json=overrideAttributes,proto3" json:"override_attributes,omitempty" toml:"override_attributes,omitempty" mapstructure:"override_attributes,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_unrecognized []byte `json:"-" toml:"-" mapstructure:"-,omitempty"` + XXX_sizecache int32 `json:"-" toml:"-" mapstructure:"-,omitempty"` +} + +func (m *Environment) Reset() { *m = Environment{} } +func (m *Environment) String() string { return proto.CompactTextString(m) } +func (*Environment) ProtoMessage() {} +func (*Environment) Descriptor() ([]byte, []int) { + return fileDescriptor_a2042db7d30336eb, []int{2} +} + +func (m *Environment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Environment.Unmarshal(m, b) +} +func (m *Environment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Environment.Marshal(b, m, deterministic) +} +func (m *Environment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Environment.Merge(m, src) +} +func (m *Environment) XXX_Size() int { + return xxx_messageInfo_Environment.Size(m) +} +func (m *Environment) XXX_DiscardUnknown() { + xxx_messageInfo_Environment.DiscardUnknown(m) +} + +var xxx_messageInfo_Environment proto.InternalMessageInfo + +func (m *Environment) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Environment) GetChefType() string { + if m != nil { + return m.ChefType + } + return "" +} + +func (m *Environment) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Environment) GetJsonClass() string { + if m != nil { + return m.JsonClass + } + return "" +} + +func (m *Environment) GetCookbookVersions() []string { + if m != nil { + return m.CookbookVersions + } + return nil +} + +func (m *Environment) GetDefaultAttributes() string { + if m != nil { + return m.DefaultAttributes + } + return "" +} + +func (m *Environment) GetOverrideAttributes() string { + if m != nil { + return m.OverrideAttributes + } + return "" +} + +func init() { + proto.RegisterType((*Environments)(nil), "chef.automate.domain.infra_proxy.response.Environments") + proto.RegisterType((*EnvironmentListItem)(nil), "chef.automate.domain.infra_proxy.response.EnvironmentListItem") + proto.RegisterType((*Environment)(nil), "chef.automate.domain.infra_proxy.response.Environment") +} + +func init() { + proto.RegisterFile("api/interservice/infra_proxy/response/environments.proto", fileDescriptor_a2042db7d30336eb) +} + +var fileDescriptor_a2042db7d30336eb = []byte{ + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x6b, 0xf3, 0x30, + 0x10, 0xc6, 0x49, 0xf2, 0xbe, 0x69, 0xac, 0x64, 0x68, 0x94, 0xc5, 0x50, 0x0a, 0x26, 0x53, 0x42, + 0xa9, 0x04, 0xed, 0xd2, 0x29, 0xf4, 0x0f, 0x1d, 0x0a, 0x9d, 0x42, 0xe9, 0xd0, 0xc5, 0xc8, 0xf6, + 0xa5, 0x51, 0x13, 0xeb, 0x8c, 0x74, 0x36, 0xcd, 0x77, 0xe8, 0x87, 0x2e, 0x36, 0x71, 0xab, 0x42, + 0x86, 0x6c, 0xe2, 0x79, 0x7e, 0xf7, 0x43, 0x42, 0xc7, 0x6e, 0x54, 0xa1, 0xa5, 0x36, 0x04, 0xd6, + 0x81, 0xad, 0x74, 0x0a, 0x52, 0x9b, 0x95, 0x55, 0x71, 0x61, 0xf1, 0x73, 0x27, 0x2d, 0xb8, 0x02, + 0x8d, 0x03, 0x09, 0xa6, 0xd2, 0x16, 0x4d, 0x0e, 0x86, 0x9c, 0x28, 0x2c, 0x12, 0xf2, 0x79, 0xba, + 0x86, 0x95, 0x50, 0x25, 0x61, 0xae, 0x08, 0x44, 0x86, 0xb9, 0xd2, 0x46, 0x78, 0xd3, 0xa2, 0x9d, + 0x9e, 0x5a, 0x36, 0x7a, 0xf4, 0x04, 0x3c, 0x61, 0x23, 0x5f, 0x18, 0x76, 0xa2, 0xde, 0x6c, 0x78, + 0xb5, 0x10, 0x47, 0x1b, 0x85, 0xa7, 0x7b, 0xd6, 0x8e, 0x9e, 0x08, 0xf2, 0xe5, 0x1f, 0xe7, 0x74, + 0xce, 0x26, 0x07, 0x20, 0xce, 0xd9, 0x3f, 0xa3, 0x72, 0x08, 0x3b, 0x51, 0x67, 0x16, 0x2c, 0x9b, + 0xf3, 0xf4, 0xab, 0xcb, 0x86, 0x1e, 0x7b, 0x88, 0xe1, 0x67, 0x2c, 0xa8, 0x6f, 0x17, 0xd3, 0xae, + 0x80, 0xb0, 0xdb, 0x14, 0x83, 0x3a, 0x78, 0xd9, 0x15, 0xc0, 0x23, 0x36, 0xcc, 0xc0, 0xa5, 0x56, + 0x17, 0xa4, 0xd1, 0x84, 0xbd, 0xa6, 0xf6, 0x23, 0x7e, 0xce, 0xd8, 0x87, 0x43, 0x13, 0xa7, 0x5b, + 0xe5, 0x5c, 0xf8, 0xbf, 0x01, 0x82, 0x3a, 0x79, 0xa8, 0x03, 0x7e, 0xc1, 0xc6, 0x29, 0xe2, 0x26, + 0x41, 0xdc, 0xc4, 0x15, 0x58, 0xa7, 0xd1, 0xb8, 0xb0, 0x1f, 0xf5, 0x66, 0xc1, 0xf2, 0xb4, 0x2d, + 0x5e, 0xf7, 0x39, 0xbf, 0x64, 0x3c, 0x83, 0x95, 0x2a, 0xb7, 0x14, 0x2b, 0x22, 0xab, 0x93, 0x92, + 0xc0, 0x85, 0x27, 0x8d, 0x73, 0xbc, 0x6f, 0xee, 0x7e, 0x0a, 0x2e, 0xd9, 0x04, 0x2b, 0xb0, 0x56, + 0x67, 0xe0, 0xf3, 0x83, 0x86, 0xe7, 0x6d, 0xf5, 0x3b, 0x70, 0x7f, 0xfb, 0xb6, 0x78, 0xd7, 0xb4, + 0x2e, 0x13, 0x91, 0x62, 0x2e, 0xeb, 0x47, 0xca, 0xf6, 0x4f, 0xe4, 0x51, 0xdb, 0x92, 0xf4, 0x9b, + 0x0d, 0xb9, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xce, 0x37, 0x78, 0xcf, 0x5d, 0x02, 0x00, 0x00, +} diff --git a/api/interservice/infra_proxy/response/environments.proto b/api/interservice/infra_proxy/response/environments.proto new file mode 100644 index 00000000000..48270b53218 --- /dev/null +++ b/api/interservice/infra_proxy/response/environments.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package chef.automate.domain.infra_proxy.response; +option go_package = "github.com/chef/automate/api/interservice/infra_proxy/response"; + +message Environments { + // List of the EnvironmentListItem. + repeated EnvironmentListItem environments = 1; +} + +message EnvironmentListItem { + // Name of the Environment. + string name = 1; +} + +message Environment { + // Name of the Environment. + string name = 1; + // Type of the object. + string chef_type = 2; + // Description of the node. + string description = 3; + // Name of the class. + string json_class = 5; + // List of versioned cookbooks + repeated string cookbook_versions = 6; + // Stringified json of the default attributes. + string default_attributes = 7; + // Stringified json of the override attributes. + string override_attributes = 8; +} diff --git a/api/interservice/infra_proxy/service/infra_proxy.pb.go b/api/interservice/infra_proxy/service/infra_proxy.pb.go index d37e90e70dc..5c26ac6944f 100644 --- a/api/interservice/infra_proxy/service/infra_proxy.pb.go +++ b/api/interservice/infra_proxy/service/infra_proxy.pb.go @@ -32,48 +32,50 @@ func init() { } var fileDescriptor_59a1fd4cbd8b9945 = []byte{ - // 641 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x97, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0xd3, 0xcb, 0x60, 0x66, 0x12, 0xd2, 0x13, 0x07, 0x64, 0x89, 0x4b, 0x4e, 0x70, 0x20, - 0xe9, 0xda, 0xae, 0x88, 0x03, 0x82, 0xad, 0x43, 0xd5, 0x2e, 0x1b, 0x1a, 0x82, 0x03, 0x17, 0x94, - 0xa6, 0xaf, 0x5d, 0xb4, 0x34, 0x0e, 0xb6, 0x5b, 0x75, 0xe2, 0x84, 0xc4, 0x27, 0xe0, 0x83, 0xf0, - 0xa1, 0xf8, 0x24, 0x28, 0x76, 0x92, 0xa6, 0x2b, 0xda, 0xf2, 0xcc, 0xa9, 0x75, 0xe5, 0x9f, 0xff, - 0xff, 0xbc, 0xfc, 0xfd, 0xec, 0xb2, 0x61, 0x94, 0x27, 0x61, 0x92, 0x69, 0x94, 0x0a, 0xe5, 0x2a, - 0x89, 0x31, 0x4c, 0xb2, 0x99, 0x8c, 0xbe, 0xe6, 0x52, 0xac, 0x6f, 0xc2, 0x7f, 0xfc, 0x16, 0xe4, - 0x52, 0x68, 0x01, 0xcf, 0xe3, 0x2b, 0x9c, 0x05, 0xd1, 0x52, 0x8b, 0x45, 0xa4, 0x31, 0x98, 0x8a, - 0x45, 0x94, 0x64, 0x41, 0x73, 0x5e, 0xc9, 0xf2, 0x17, 0x85, 0x02, 0xae, 0x35, 0xca, 0x2c, 0x4a, - 0xc3, 0x58, 0x2c, 0x16, 0x22, 0x0b, 0x57, 0x28, 0x55, 0xb2, 0xf9, 0xb4, 0x8b, 0xf2, 0xde, 0x9d, - 0x66, 0x24, 0x7e, 0x5b, 0xa2, 0xd2, 0xc6, 0x14, 0x4a, 0x55, 0x32, 0x61, 0x2b, 0x46, 0xc8, 0x79, - 0x05, 0x0c, 0x5a, 0x01, 0xb1, 0x10, 0xd7, 0x13, 0x21, 0xae, 0x2b, 0xaa, 0xdb, 0x8a, 0x92, 0x22, - 0x45, 0x45, 0x7a, 0x98, 0x38, 0x4d, 0x30, 0xd3, 0x15, 0xd3, 0xbf, 0x87, 0x51, 0xb9, 0xc8, 0x14, - 0xde, 0xaa, 0x40, 0xb7, 0x1d, 0xd4, 0x28, 0xc1, 0x51, 0x3b, 0xe2, 0x76, 0x0d, 0x0e, 0xdb, 0x61, - 0xcd, 0x22, 0xb4, 0x7c, 0xa0, 0xad, 0x2a, 0xf4, 0xfe, 0x3c, 0x61, 0xec, 0xac, 0x98, 0xf6, 0xa1, - 0x98, 0x05, 0x8a, 0xb1, 0x31, 0xea, 0xcf, 0x36, 0x29, 0x30, 0x08, 0xb6, 0x93, 0x17, 0xe5, 0x49, - 0x60, 0x43, 0x15, 0x54, 0x61, 0x2a, 0xa7, 0x9e, 0x65, 0x33, 0x71, 0x69, 0xcb, 0xcc, 0x5f, 0x92, - 0x28, 0xdf, 0x83, 0x1f, 0x1d, 0x76, 0x30, 0x92, 0x18, 0x69, 0xfc, 0x68, 0x8a, 0x0d, 0xc3, 0xe0, -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 0xf2, 0x3d, 0xf8, 0xdd, 0x61, 0xcf, 0x9a, 0xea, 0xc7, - 0xab, 0x28, 0x49, 0xa3, 0x49, 0x8a, 0xe5, 0xe9, 0xa3, 0xe0, 0xd4, 0xc1, 0xce, 0xce, 0x2a, 0xfc, - 0xbd, 0x8b, 0xbf, 0x9d, 0x65, 0xcc, 0x4e, 0x78, 0xd4, 0xf0, 0x0b, 0x3d, 0xba, 0x3b, 0xde, 0x77, - 0xf0, 0xe2, 0x7b, 0xf0, 0xab, 0xc3, 0x9e, 0x36, 0xa4, 0x8f, 0x67, 0x33, 0x8c, 0x35, 0x4e, 0xcf, - 0xc5, 0x14, 0x95, 0x93, 0x8f, 0x77, 0x0e, 0x3e, 0xb6, 0x54, 0xcd, 0x56, 0x79, 0x38, 0x46, 0x7d, - 0x59, 0xdc, 0x70, 0x20, 0x6c, 0xef, 0xc1, 0x00, 0xbc, 0x4b, 0x30, 0x60, 0x08, 0xdf, 0x83, 0xd4, - 0xf4, 0x83, 0x62, 0x04, 0x01, 0x4d, 0x8f, 0x87, 0x44, 0x39, 0xdf, 0x83, 0xa5, 0x39, 0x69, 0x47, - 0xf6, 0x36, 0x46, 0x69, 0x40, 0x25, 0x42, 0x6a, 0x40, 0x25, 0x63, 0x9a, 0xde, 0x7e, 0x2d, 0x4b, - 0xe9, 0x41, 0x96, 0x20, 0xb5, 0x01, 0x8b, 0xf8, 0xde, 0xc9, 0xdb, 0x2f, 0x6f, 0xe6, 0x89, 0xbe, - 0x5a, 0x4e, 0x8a, 0x7b, 0x60, 0x58, 0x2c, 0x10, 0x56, 0x0b, 0x84, 0x6d, 0xfe, 0x13, 0x4d, 0xf6, - 0xcc, 0x65, 0xb5, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0x39, 0xab, 0xcc, 0x0f, 0x42, 0x0d, 0x00, - 0x00, + // 685 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x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0xa8, 0xcb, + 0xaa, 0x37, 0xa2, 0xb1, 0xbb, 0x07, 0x0d, 0xb0, 0x2e, 0xc2, 0x80, 0x26, 0xc2, 0x80, 0x66, 0xfa, + 0x3e, 0xa8, 0x46, 0x34, 0xc2, 0xe9, 0xb1, 0x18, 0x29, 0x17, 0x06, 0x74, 0xae, 0x5f, 0xda, 0x63, + 0xd3, 0xc7, 0x61, 0x2e, 0xa0, 0x1a, 0x41, 0x5d, 0x40, 0x35, 0xa3, 0x2f, 0xbd, 0xed, 0x56, 0x16, + 0x73, 0x07, 0x19, 0x02, 0x75, 0x0d, 0x18, 0x64, 0xf5, 0xba, 0x9e, 0x5a, 0xed, 0x27, 0xe6, 0x1e, + 0xb2, 0x39, 0x54, 0x6f, 0x63, 0x83, 0xa6, 0xbf, 0x7a, 0xbc, 0x6e, 0x83, 0xee, 0x7b, 0xb9, 0x60, + 0x03, 0x3f, 0x13, 0x61, 0x70, 0xf4, 0xee, 0xcb, 0xdb, 0x59, 0xaa, 0xae, 0xe6, 0xa3, 0xaa, 0x25, + 0x8e, 0xab, 0x55, 0xe2, 0x66, 0x95, 0xd8, 0xe5, 0x3f, 0xd2, 0xd1, 0x96, 0xee, 0xdb, 0xfb, 0x7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0xa3, 0xd1, 0x7c, 0x7f, 0xc0, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -109,6 +111,8 @@ type InfraProxyClient interface { GetRole(ctx context.Context, in *request.Role, opts ...grpc.CallOption) (*response.Role, error) GetClients(ctx context.Context, in *request.Clients, opts ...grpc.CallOption) (*response.Clients, error) GetClient(ctx context.Context, in *request.Client, opts ...grpc.CallOption) (*response.Client, error) + GetEnvironments(ctx context.Context, in *request.Environments, opts ...grpc.CallOption) (*response.Environments, error) + GetEnvironment(ctx context.Context, in *request.Environment, opts ...grpc.CallOption) (*response.Environment, error) } type infraProxyClient struct { @@ -308,6 +312,24 @@ func (c *infraProxyClient) GetClient(ctx context.Context, in *request.Client, op return out, nil } +func (c *infraProxyClient) GetEnvironments(ctx context.Context, in *request.Environments, opts ...grpc.CallOption) (*response.Environments, error) { + out := new(response.Environments) + err := c.cc.Invoke(ctx, "/chef.automate.domain.infra_proxy.service.InfraProxy/GetEnvironments", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *infraProxyClient) GetEnvironment(ctx context.Context, in *request.Environment, opts ...grpc.CallOption) (*response.Environment, error) { + out := new(response.Environment) + err := c.cc.Invoke(ctx, "/chef.automate.domain.infra_proxy.service.InfraProxy/GetEnvironment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // InfraProxyServer is the server API for InfraProxy service. type InfraProxyServer interface { GetVersion(context.Context, *version.VersionInfoRequest) (*version.VersionInfo, error) @@ -331,6 +353,8 @@ type InfraProxyServer interface { GetRole(context.Context, *request.Role) (*response.Role, error) GetClients(context.Context, *request.Clients) (*response.Clients, error) GetClient(context.Context, *request.Client) (*response.Client, error) + GetEnvironments(context.Context, *request.Environments) (*response.Environments, error) + GetEnvironment(context.Context, *request.Environment) (*response.Environment, error) } // UnimplementedInfraProxyServer can be embedded to have forward compatible implementations. @@ -400,6 +424,12 @@ func (*UnimplementedInfraProxyServer) GetClients(ctx context.Context, req *reque func (*UnimplementedInfraProxyServer) GetClient(ctx context.Context, req *request.Client) (*response.Client, error) { return nil, status.Errorf(codes.Unimplemented, "method GetClient not implemented") } +func (*UnimplementedInfraProxyServer) GetEnvironments(ctx context.Context, req *request.Environments) (*response.Environments, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEnvironments not implemented") +} +func (*UnimplementedInfraProxyServer) GetEnvironment(ctx context.Context, req *request.Environment) (*response.Environment, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEnvironment not implemented") +} func RegisterInfraProxyServer(s *grpc.Server, srv InfraProxyServer) { s.RegisterService(&_InfraProxy_serviceDesc, srv) @@ -783,6 +813,42 @@ func _InfraProxy_GetClient_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _InfraProxy_GetEnvironments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(request.Environments) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfraProxyServer).GetEnvironments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/chef.automate.domain.infra_proxy.service.InfraProxy/GetEnvironments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfraProxyServer).GetEnvironments(ctx, req.(*request.Environments)) + } + return interceptor(ctx, in, info, handler) +} + +func _InfraProxy_GetEnvironment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(request.Environment) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InfraProxyServer).GetEnvironment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/chef.automate.domain.infra_proxy.service.InfraProxy/GetEnvironment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InfraProxyServer).GetEnvironment(ctx, req.(*request.Environment)) + } + return interceptor(ctx, in, info, handler) +} + var _InfraProxy_serviceDesc = grpc.ServiceDesc{ ServiceName: "chef.automate.domain.infra_proxy.service.InfraProxy", HandlerType: (*InfraProxyServer)(nil), @@ -871,6 +937,14 @@ var _InfraProxy_serviceDesc = grpc.ServiceDesc{ MethodName: "GetClient", Handler: _InfraProxy_GetClient_Handler, }, + { + MethodName: "GetEnvironments", + Handler: _InfraProxy_GetEnvironments_Handler, + }, + { + MethodName: "GetEnvironment", + Handler: _InfraProxy_GetEnvironment_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/interservice/infra_proxy/service/infra_proxy.proto", diff --git a/api/interservice/infra_proxy/service/infra_proxy.proto b/api/interservice/infra_proxy/service/infra_proxy.proto index 82fc5d49083..4d4eea502e7 100644 --- a/api/interservice/infra_proxy/service/infra_proxy.proto +++ b/api/interservice/infra_proxy/service/infra_proxy.proto @@ -9,12 +9,14 @@ import "api/interservice/infra_proxy/request/orgs.proto"; import "api/interservice/infra_proxy/request/cookbooks.proto"; import "api/interservice/infra_proxy/request/roles.proto"; import "api/interservice/infra_proxy/request/clients.proto"; +import "api/interservice/infra_proxy/request/environments.proto"; import "api/interservice/infra_proxy/response/servers.proto"; import "api/interservice/infra_proxy/response/orgs.proto"; import "api/interservice/infra_proxy/response/cookbooks.proto"; import "api/interservice/infra_proxy/response/roles.proto"; import "api/interservice/infra_proxy/response/clients.proto"; +import "api/interservice/infra_proxy/response/environments.proto"; service InfraProxy { rpc GetVersion (chef.automate.api.common.version.VersionInfoRequest) returns (chef.automate.api.common.version.VersionInfo) {}; @@ -43,4 +45,7 @@ service InfraProxy { rpc GetClients (chef.automate.domain.infra_proxy.request.Clients) returns (chef.automate.domain.infra_proxy.response.Clients) {}; rpc GetClient (chef.automate.domain.infra_proxy.request.Client) returns (chef.automate.domain.infra_proxy.response.Client) {}; + + rpc GetEnvironments (chef.automate.domain.infra_proxy.request.Environments) returns (chef.automate.domain.infra_proxy.response.Environments) {}; + rpc GetEnvironment (chef.automate.domain.infra_proxy.request.Environment) returns (chef.automate.domain.infra_proxy.response.Environment) {}; } diff --git a/components/automate-gateway/api/infra_proxy.pb.swagger.go b/components/automate-gateway/api/infra_proxy.pb.swagger.go index 74dd659e568..d79242638f5 100644 --- a/components/automate-gateway/api/infra_proxy.pb.swagger.go +++ b/components/automate-gateway/api/infra_proxy.pb.swagger.go @@ -548,6 +548,77 @@ func init() { ] } }, + "/infra/servers/{server_id}/orgs/{org_id}/environment/{name}": { + "get": { + "operationId": "GetEnvironment", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.Environment" + } + } + }, + "parameters": [ + { + "name": "server_id", + "description": "Id of the Server.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "org_id", + "description": "Id of the Org.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "name", + "description": "Name of the environment.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "InfraProxy" + ] + } + }, + "/infra/servers/{server_id}/orgs/{org_id}/environments": { + "get": { + "operationId": "GetEnvironments", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.Environments" + } + } + }, + "parameters": [ + { + "name": "server_id", + "description": "Id of the Server.", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "org_id", + "description": "Id of the Org.", + "in": "path", + "required": true, + "type": "string" + } + ], + "tags": [ + "InfraProxy" + ] + } + }, "/infra/servers/{server_id}/orgs/{org_id}/roles": { "get": { "operationId": "GetRoles", @@ -1030,6 +1101,63 @@ func init() { } } }, + "chef.automate.api.infra_proxy.response.Environment": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Environment." + }, + "chef_type": { + "type": "string", + "description": "Type of the object." + }, + "description": { + "type": "string", + "description": "Description of the node." + }, + "json_class": { + "type": "string", + "description": "Name of the class." + }, + "cookbook_versions": { + "type": "array", + "items": { + "type": "string" + }, + "title": "List of versioned cookbooks" + }, + "default_attributes": { + "type": "string", + "description": "Stringified json of the default attributes." + }, + "override_attributes": { + "type": "string", + "description": "Stringified json of the override attributes." + } + } + }, + "chef.automate.api.infra_proxy.response.EnvironmentListItem": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the Environment." + } + } + }, + "chef.automate.api.infra_proxy.response.Environments": { + "type": "object", + "properties": { + "environments": { + "type": "array", + "items": { + "$ref": "#/definitions/chef.automate.api.infra_proxy.response.EnvironmentListItem" + }, + "description": "List of the EnvironmentListItem." + } + } + }, "chef.automate.api.infra_proxy.response.GetOrg": { "type": "object", "properties": { diff --git a/components/automate-gateway/handler/infra_proxy/environments.go b/components/automate-gateway/handler/infra_proxy/environments.go new file mode 100644 index 00000000000..ecebb6597c1 --- /dev/null +++ b/components/automate-gateway/handler/infra_proxy/environments.go @@ -0,0 +1,59 @@ +package infra_proxy + +import ( + "context" + + gwreq "github.com/chef/automate/api/external/infra_proxy/request" + gwres "github.com/chef/automate/api/external/infra_proxy/response" + infra_req "github.com/chef/automate/api/interservice/infra_proxy/request" + infra_res "github.com/chef/automate/api/interservice/infra_proxy/response" +) + +// GetEnvironments fetches an array of existing environments +func (a *InfraProxyServer) GetEnvironments(ctx context.Context, r *gwreq.Environments) (*gwres.Environments, error) { + req := &infra_req.Environments{ + OrgId: r.OrgId, + } + res, err := a.client.GetEnvironments(ctx, req) + if err != nil { + return nil, err + } + + return &gwres.Environments{ + Environments: fromUpstreamEnvironments(res.Environments), + }, nil +} + +// GetEnvironment fetch a infra role +func (a *InfraProxyServer) GetEnvironment(ctx context.Context, r *gwreq.Environment) (*gwres.Environment, error) { + req := &infra_req.Environment{ + OrgId: r.OrgId, + Name: r.Name, + } + res, err := a.client.GetEnvironment(ctx, req) + if err != nil { + return nil, err + } + + return &gwres.Environment{ + Name: res.GetName(), + ChefType: res.GetChefType(), + Description: res.GetDescription(), + CookbookVersions: res.GetCookbookVersions(), + JsonClass: res.GetJsonClass(), + DefaultAttributes: res.GetDefaultAttributes(), + OverrideAttributes: res.GetOverrideAttributes(), + }, nil +} + +func fromUpstreamEnvironments(environments []*infra_res.EnvironmentListItem) []*gwres.EnvironmentListItem { + ts := make([]*gwres.EnvironmentListItem, len(environments)) + + for i, e := range environments { + ts[i] = &gwres.EnvironmentListItem{ + Name: e.GetName(), + } + } + + return ts +} diff --git a/components/infra-proxy-service/server/v1/environments.go b/components/infra-proxy-service/server/v1/environments.go new file mode 100644 index 00000000000..3c41a78fe41 --- /dev/null +++ b/components/infra-proxy-service/server/v1/environments.go @@ -0,0 +1,94 @@ +package v1 + +import ( + "context" + "encoding/json" + "sort" + + chef "github.com/chef/go-chef" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/chef/automate/api/interservice/infra_proxy/request" + "github.com/chef/automate/api/interservice/infra_proxy/response" +) + +// GetEnvironments get environments list +func (s *Server) GetEnvironments(ctx context.Context, req *request.Environments) (*response.Environments, error) { + + client, err := s.createClient(ctx, req.OrgId) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid org id: %s", err.Error()) + } + + environments, err := client.Environments.List() + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + return &response.Environments{ + Environments: fromAPIToListEnvironments(*environments), + }, nil +} + +// GetEnvironment get data bag +func (s *Server) GetEnvironment(ctx context.Context, req *request.Environment) (*response.Environment, error) { + client, err := s.createClient(ctx, req.OrgId) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid org id: %s", err.Error()) + } + + en, err := client.Environments.Get(req.Name) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + defaultAttributes, err := json.Marshal(en.DefaultAttributes) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + overrideAttributes, err := json.Marshal(en.OverrideAttributes) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &response.Environment{ + Name: en.Name, + ChefType: en.ChefType, + Description: en.Description, + CookbookVersions: fromAPIToListEnvCookbookVersions(en.CookbookVersions), + JsonClass: en.JsonClass, + DefaultAttributes: string(defaultAttributes), + OverrideAttributes: string(overrideAttributes), + }, nil + +} + +// fromAPIToListEnvironments a response.Environments from a struct of Environments +func fromAPIToListEnvironments(al chef.EnvironmentResult) []*response.EnvironmentListItem { + cl := make([]*response.EnvironmentListItem, len(al)) + + index := 0 + for c := range al { + cl[index] = &response.EnvironmentListItem{ + Name: c, + } + index++ + } + + sort.Slice(cl, func(i, j int) bool { + return cl[i].Name < cl[j].Name + }) + + return cl +} + +func fromAPIToListEnvCookbookVersions(cookbooks map[string]string) []string { + cl := make([]string, len(cookbooks)) + + for i, c := range cl { + cl[i] = c + } + return cl +}