diff --git a/cmd/meroxa/root/connectors/list_test.go b/cmd/meroxa/root/connectors/list_test.go index f983205a7..14b7d44da 100644 --- a/cmd/meroxa/root/connectors/list_test.go +++ b/cmd/meroxa/root/connectors/list_test.go @@ -40,6 +40,13 @@ func getConnectors(pipelineID int) []*meroxa.Connector { return connectors } +func getConnectorsWithEnvironment(pipelineID int) []*meroxa.Connector { + var connectors []*meroxa.Connector + c := utils.GenerateConnectorWithEnvironment(pipelineID, "", "my-env") + connectors = append(connectors, &c) + return connectors +} + func TestListConnectorsFlags(t *testing.T) { expectedFlags := []struct { name string @@ -74,6 +81,7 @@ func TestListConnectorsExecution(t *testing.T) { logger := log.NewTestLogger() connectors := getConnectors(1) + connectors = append(connectors, getConnectorsWithEnvironment(1)...) client. EXPECT(). diff --git a/cmd/meroxa/root/pipelines/create.go b/cmd/meroxa/root/pipelines/create.go index 2da54ee4b..823089032 100644 --- a/cmd/meroxa/root/pipelines/create.go +++ b/cmd/meroxa/root/pipelines/create.go @@ -76,7 +76,7 @@ func (c *Create) Execute(ctx context.Context) error { if c.flags.Environment != "" { env = c.flags.Environment - p.Environment = &meroxa.PipelineEnvironment{} + p.Environment = &meroxa.EnvironmentIdentifier{} _, err := uuid.Parse(c.flags.Environment) diff --git a/cmd/meroxa/root/pipelines/create_test.go b/cmd/meroxa/root/pipelines/create_test.go index 3bd24692a..343bb89c9 100644 --- a/cmd/meroxa/root/pipelines/create_test.go +++ b/cmd/meroxa/root/pipelines/create_test.go @@ -166,13 +166,13 @@ func TestCreatePipelineWithEnvironmentExecution(t *testing.T) { pi := &meroxa.CreatePipelineInput{ Name: pName, - Environment: &meroxa.PipelineEnvironment{Name: env}, + Environment: &meroxa.EnvironmentIdentifier{Name: env}, } p := &meroxa.Pipeline{ ID: 1, Name: pName, - Environment: &meroxa.PipelineEnvironment{ + Environment: &meroxa.EnvironmentIdentifier{ UUID: "2560fbcc-b9ee-461a-a959-fa5656422dc2", Name: env, }, diff --git a/cmd/meroxa/root/resources/create.go b/cmd/meroxa/root/resources/create.go index d8bd3c7fe..1a3b2f317 100644 --- a/cmd/meroxa/root/resources/create.go +++ b/cmd/meroxa/root/resources/create.go @@ -122,7 +122,7 @@ func (c *Create) Execute(ctx context.Context) error { } if c.flags.Environment != "" { - input.Environment = &meroxa.ResourceEnvironment{} + input.Environment = &meroxa.EnvironmentIdentifier{} env = c.flags.Environment _, err := uuid.Parse(c.flags.Environment) diff --git a/cmd/meroxa/root/resources/create_test.go b/cmd/meroxa/root/resources/create_test.go index aa1d6ce16..58d06f46e 100644 --- a/cmd/meroxa/root/resources/create_test.go +++ b/cmd/meroxa/root/resources/create_test.go @@ -156,7 +156,7 @@ func TestCreateResourceExecutionWithEnvironmentName(t *testing.T) { URL: "https://foo.url", Credentials: nil, Metadata: nil, - Environment: &meroxa.ResourceEnvironment{ + Environment: &meroxa.EnvironmentIdentifier{ Name: cr.Environment.Name, }, } @@ -218,7 +218,7 @@ func TestCreateResourceExecutionWithEnvironmentUUID(t *testing.T) { URL: "https://foo.url", Credentials: nil, Metadata: nil, - Environment: &meroxa.ResourceEnvironment{ + Environment: &meroxa.EnvironmentIdentifier{ UUID: cr.Environment.UUID, }, } diff --git a/etc/man/man1/meroxa-api.1 b/etc/man/man1/meroxa-api.1 index 704283235..9c0fceee6 100644 --- a/etc/man/man1/meroxa-api.1 +++ b/etc/man/man1/meroxa-api.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-auth-login.1 b/etc/man/man1/meroxa-auth-login.1 index bc5ebd5d0..267459cdd 100644 --- a/etc/man/man1/meroxa-auth-login.1 +++ b/etc/man/man1/meroxa-auth-login.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-auth-logout.1 b/etc/man/man1/meroxa-auth-logout.1 index ce9bf1931..d87cf5a91 100644 --- a/etc/man/man1/meroxa-auth-logout.1 +++ b/etc/man/man1/meroxa-auth-logout.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-auth-whoami.1 b/etc/man/man1/meroxa-auth-whoami.1 index 6030247e5..313e7f062 100644 --- a/etc/man/man1/meroxa-auth-whoami.1 +++ b/etc/man/man1/meroxa-auth-whoami.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-auth.1 b/etc/man/man1/meroxa-auth.1 index 9cfa83b1b..2ebbc6754 100644 --- a/etc/man/man1/meroxa-auth.1 +++ b/etc/man/man1/meroxa-auth.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-billing.1 b/etc/man/man1/meroxa-billing.1 index bf20c95d1..ee72be076 100644 --- a/etc/man/man1/meroxa-billing.1 +++ b/etc/man/man1/meroxa-billing.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-completion.1 b/etc/man/man1/meroxa-completion.1 index 02766ec1b..9f6fd0c75 100644 --- a/etc/man/man1/meroxa-completion.1 +++ b/etc/man/man1/meroxa-completion.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-config-describe.1 b/etc/man/man1/meroxa-config-describe.1 index ac138d71e..28f0d09a0 100644 --- a/etc/man/man1/meroxa-config-describe.1 +++ b/etc/man/man1/meroxa-config-describe.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-config.1 b/etc/man/man1/meroxa-config.1 index 6446af6e0..926a5284d 100644 --- a/etc/man/man1/meroxa-config.1 +++ b/etc/man/man1/meroxa-config.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connect.1 b/etc/man/man1/meroxa-connect.1 index f2703307f..4da290a39 100644 --- a/etc/man/man1/meroxa-connect.1 +++ b/etc/man/man1/meroxa-connect.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connectors-create.1 b/etc/man/man1/meroxa-connectors-create.1 index 1068864f9..1b79bbe0c 100644 --- a/etc/man/man1/meroxa-connectors-create.1 +++ b/etc/man/man1/meroxa-connectors-create.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connectors-describe.1 b/etc/man/man1/meroxa-connectors-describe.1 index 47fc8b4f4..ace89341a 100644 --- a/etc/man/man1/meroxa-connectors-describe.1 +++ b/etc/man/man1/meroxa-connectors-describe.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connectors-list.1 b/etc/man/man1/meroxa-connectors-list.1 index e7f2702e3..1b0ec0d30 100644 --- a/etc/man/man1/meroxa-connectors-list.1 +++ b/etc/man/man1/meroxa-connectors-list.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connectors-logs.1 b/etc/man/man1/meroxa-connectors-logs.1 index 398c55bc1..0e00f1f83 100644 --- a/etc/man/man1/meroxa-connectors-logs.1 +++ b/etc/man/man1/meroxa-connectors-logs.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connectors-remove.1 b/etc/man/man1/meroxa-connectors-remove.1 index f4d80e4c9..e22c15b71 100644 --- a/etc/man/man1/meroxa-connectors-remove.1 +++ b/etc/man/man1/meroxa-connectors-remove.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connectors-update.1 b/etc/man/man1/meroxa-connectors-update.1 index 7061948a4..3e82ffd7f 100644 --- a/etc/man/man1/meroxa-connectors-update.1 +++ b/etc/man/man1/meroxa-connectors-update.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-connectors.1 b/etc/man/man1/meroxa-connectors.1 index ef1df9357..2d042635f 100644 --- a/etc/man/man1/meroxa-connectors.1 +++ b/etc/man/man1/meroxa-connectors.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-endpoints-create.1 b/etc/man/man1/meroxa-endpoints-create.1 index 032cc11a6..8be922214 100644 --- a/etc/man/man1/meroxa-endpoints-create.1 +++ b/etc/man/man1/meroxa-endpoints-create.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-endpoints-describe.1 b/etc/man/man1/meroxa-endpoints-describe.1 index aaf38db9d..d6e2b393e 100644 --- a/etc/man/man1/meroxa-endpoints-describe.1 +++ b/etc/man/man1/meroxa-endpoints-describe.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-endpoints-list.1 b/etc/man/man1/meroxa-endpoints-list.1 index 66afaf06e..90c60d083 100644 --- a/etc/man/man1/meroxa-endpoints-list.1 +++ b/etc/man/man1/meroxa-endpoints-list.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-endpoints-remove.1 b/etc/man/man1/meroxa-endpoints-remove.1 index 58cfcd4c4..9a424416e 100644 --- a/etc/man/man1/meroxa-endpoints-remove.1 +++ b/etc/man/man1/meroxa-endpoints-remove.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-endpoints.1 b/etc/man/man1/meroxa-endpoints.1 index f901927ee..53d48301c 100644 --- a/etc/man/man1/meroxa-endpoints.1 +++ b/etc/man/man1/meroxa-endpoints.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-login.1 b/etc/man/man1/meroxa-login.1 index 6003ee276..3800c8cf8 100644 --- a/etc/man/man1/meroxa-login.1 +++ b/etc/man/man1/meroxa-login.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-logout.1 b/etc/man/man1/meroxa-logout.1 index 130f4260c..ffa54cb10 100644 --- a/etc/man/man1/meroxa-logout.1 +++ b/etc/man/man1/meroxa-logout.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-open-billing.1 b/etc/man/man1/meroxa-open-billing.1 index fbc072fd1..111c983cf 100644 --- a/etc/man/man1/meroxa-open-billing.1 +++ b/etc/man/man1/meroxa-open-billing.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-open.1 b/etc/man/man1/meroxa-open.1 index 64752e2b8..c817c0865 100644 --- a/etc/man/man1/meroxa-open.1 +++ b/etc/man/man1/meroxa-open.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-pipelines-create.1 b/etc/man/man1/meroxa-pipelines-create.1 index bde50a58a..ef7c780a4 100644 --- a/etc/man/man1/meroxa-pipelines-create.1 +++ b/etc/man/man1/meroxa-pipelines-create.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-pipelines-describe.1 b/etc/man/man1/meroxa-pipelines-describe.1 index 28843770a..bc5c588c1 100644 --- a/etc/man/man1/meroxa-pipelines-describe.1 +++ b/etc/man/man1/meroxa-pipelines-describe.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-pipelines-list.1 b/etc/man/man1/meroxa-pipelines-list.1 index 75c610026..2bf6bea9f 100644 --- a/etc/man/man1/meroxa-pipelines-list.1 +++ b/etc/man/man1/meroxa-pipelines-list.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-pipelines-remove.1 b/etc/man/man1/meroxa-pipelines-remove.1 index 03280c01c..bf4381371 100644 --- a/etc/man/man1/meroxa-pipelines-remove.1 +++ b/etc/man/man1/meroxa-pipelines-remove.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-pipelines-update.1 b/etc/man/man1/meroxa-pipelines-update.1 index 2f11a0222..39ada8fdc 100644 --- a/etc/man/man1/meroxa-pipelines-update.1 +++ b/etc/man/man1/meroxa-pipelines-update.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-pipelines.1 b/etc/man/man1/meroxa-pipelines.1 index d67e3cd86..723dcd866 100644 --- a/etc/man/man1/meroxa-pipelines.1 +++ b/etc/man/man1/meroxa-pipelines.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources-create.1 b/etc/man/man1/meroxa-resources-create.1 index 85b877dcd..8a7468009 100644 --- a/etc/man/man1/meroxa-resources-create.1 +++ b/etc/man/man1/meroxa-resources-create.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources-describe.1 b/etc/man/man1/meroxa-resources-describe.1 index 7d3d7a84f..66e559825 100644 --- a/etc/man/man1/meroxa-resources-describe.1 +++ b/etc/man/man1/meroxa-resources-describe.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources-list.1 b/etc/man/man1/meroxa-resources-list.1 index 75e6a932f..0e122e389 100644 --- a/etc/man/man1/meroxa-resources-list.1 +++ b/etc/man/man1/meroxa-resources-list.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources-remove.1 b/etc/man/man1/meroxa-resources-remove.1 index e9f5b40cd..cb8eeafa0 100644 --- a/etc/man/man1/meroxa-resources-remove.1 +++ b/etc/man/man1/meroxa-resources-remove.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources-rotate-tunnel-key.1 b/etc/man/man1/meroxa-resources-rotate-tunnel-key.1 index 1781349e9..2bae39dc9 100644 --- a/etc/man/man1/meroxa-resources-rotate-tunnel-key.1 +++ b/etc/man/man1/meroxa-resources-rotate-tunnel-key.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources-update.1 b/etc/man/man1/meroxa-resources-update.1 index 8ef317bf4..ad55814c5 100644 --- a/etc/man/man1/meroxa-resources-update.1 +++ b/etc/man/man1/meroxa-resources-update.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources-validate.1 b/etc/man/man1/meroxa-resources-validate.1 index 50a63c897..7526854a6 100644 --- a/etc/man/man1/meroxa-resources-validate.1 +++ b/etc/man/man1/meroxa-resources-validate.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-resources.1 b/etc/man/man1/meroxa-resources.1 index 7e12a7064..13cee72c8 100644 --- a/etc/man/man1/meroxa-resources.1 +++ b/etc/man/man1/meroxa-resources.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-transforms-list.1 b/etc/man/man1/meroxa-transforms-list.1 index 1257f5062..da2f484a6 100644 --- a/etc/man/man1/meroxa-transforms-list.1 +++ b/etc/man/man1/meroxa-transforms-list.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-transforms.1 b/etc/man/man1/meroxa-transforms.1 index b992025f0..f55d995d7 100644 --- a/etc/man/man1/meroxa-transforms.1 +++ b/etc/man/man1/meroxa-transforms.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-version.1 b/etc/man/man1/meroxa-version.1 index f50c8ea22..993ea2a76 100644 --- a/etc/man/man1/meroxa-version.1 +++ b/etc/man/man1/meroxa-version.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa-whoami.1 b/etc/man/man1/meroxa-whoami.1 index d43dc3eee..a27c0ca94 100644 --- a/etc/man/man1/meroxa-whoami.1 +++ b/etc/man/man1/meroxa-whoami.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/etc/man/man1/meroxa.1 b/etc/man/man1/meroxa.1 index 1aeb6a1ff..8094ec974 100644 --- a/etc/man/man1/meroxa.1 +++ b/etc/man/man1/meroxa.1 @@ -1,5 +1,5 @@ .nh -.TH "Meroxa" "1" "Nov 2021" "Meroxa CLI " "Meroxa Manual" +.TH "Meroxa" "1" "Dec 2021" "Meroxa CLI " "Meroxa Manual" .SH NAME .PP diff --git a/go.mod b/go.mod index 09df73643..3a8e3a336 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/manifoldco/promptui v0.8.0 github.com/mattn/go-colorable v0.1.8 // indirect github.com/mattn/go-runewidth v0.0.10 // indirect - github.com/meroxa/meroxa-go v0.0.0-20211129120745-db529ae4ef81 + github.com/meroxa/meroxa-go v0.0.0-20211201105336-fe1f1bcf8764 github.com/nirasan/go-oauth-pkce-code-verifier v0.0.0-20170819232839-0fbfe93532da github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 github.com/rivo/uniseg v0.2.0 // indirect diff --git a/go.sum b/go.sum index 13643fce8..a39e8531a 100644 --- a/go.sum +++ b/go.sum @@ -223,8 +223,8 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.10 h1:CoZ3S2P7pvtP45xOtBw+/mDL2z0RKI576gSkzRRpdGg= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/meroxa/meroxa-go v0.0.0-20211129120745-db529ae4ef81 h1:/XY4BLcUE5GXMmjiLAtbJAIg3v9L2U6/NIwaY7i44rc= -github.com/meroxa/meroxa-go v0.0.0-20211129120745-db529ae4ef81/go.mod h1:HDFszURCM1cOpKE699o5Hs0T2tEIXqY+vFcsur3RiwY= +github.com/meroxa/meroxa-go v0.0.0-20211201105336-fe1f1bcf8764 h1:DRjjwhtxG8VAEYIole15SP9DluTDMxcBsTnmru59r2o= +github.com/meroxa/meroxa-go v0.0.0-20211201105336-fe1f1bcf8764/go.mod h1:HDFszURCM1cOpKE699o5Hs0T2tEIXqY+vFcsur3RiwY= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= diff --git a/utils/display.go b/utils/display.go index 6bdc275f9..14b2758d5 100644 --- a/utils/display.go +++ b/utils/display.go @@ -268,6 +268,10 @@ func TransformsTable(transforms []*meroxa.Transform, hideHeaders bool) string { func ConnectorTable(connector *meroxa.Connector) string { mainTable := simpletable.New() mainTable.Body.Cells = [][]*simpletable.Cell{ + { + {Align: simpletable.AlignRight, Text: "UUID:"}, + {Text: connector.UUID}, + }, { {Align: simpletable.AlignRight, Text: "ID:"}, {Text: fmt.Sprintf("%d", connector.ID)}, @@ -300,6 +304,17 @@ func ConnectorTable(connector *meroxa.Connector) string { {Text: connector.Trace}, }) } + var env string + if connector.Environment != nil && connector.Environment.Name != "" { + env = connector.Environment.Name + } else { + env = string(meroxa.EnvironmentTypeCommon) + } + mainTable.Body.Cells = append(mainTable.Body.Cells, []*simpletable.Cell{ + {Align: simpletable.AlignRight, Text: "Environment:"}, + {Text: env}, + }) + mainTable.SetStyle(simpletable.StyleCompact) return mainTable.String() @@ -312,25 +327,37 @@ func ConnectorsTable(connectors []*meroxa.Connector, hideHeaders bool) string { if !hideHeaders { table.Header = &simpletable.Header{ Cells: []*simpletable.Cell{ + {Align: simpletable.AlignCenter, Text: "UUID"}, {Align: simpletable.AlignCenter, Text: "ID"}, {Align: simpletable.AlignCenter, Text: "NAME"}, {Align: simpletable.AlignCenter, Text: "TYPE"}, {Align: simpletable.AlignCenter, Text: "STREAMS"}, {Align: simpletable.AlignCenter, Text: "STATE"}, {Align: simpletable.AlignCenter, Text: "PIPELINE"}, + {Align: simpletable.AlignCenter, Text: "ENVIRONMENT"}, }, } } for _, conn := range connectors { + var env string + + if conn.Environment != nil && conn.Environment.Name != "" { + env = conn.Environment.Name + } else { + env = string(meroxa.EnvironmentTypeCommon) + } + streamStr := formatStreams(conn.Streams) r := []*simpletable.Cell{ + {Align: simpletable.AlignRight, Text: conn.UUID}, {Align: simpletable.AlignRight, Text: fmt.Sprintf("%d", conn.ID)}, {Text: conn.Name}, {Text: string(conn.Type)}, {Text: streamStr}, {Text: string(conn.State)}, {Text: conn.PipelineName}, + {Text: env}, } table.Body.Cells = append(table.Body.Cells, r) diff --git a/utils/display_test.go b/utils/display_test.go index c746d8fc3..81686f4f6 100644 --- a/utils/display_test.go +++ b/utils/display_test.go @@ -202,9 +202,10 @@ func TestConnectorRunningTable(t *testing.T) { "dynamic": "false", "output": []interface{}{"output-foo", "output-bar"}, }, - State: "running", - Trace: "", - PipelineID: 1, + State: "running", + Trace: "", + PipelineID: 1, + Environment: &meroxa.EnvironmentIdentifier{Name: "my-env"}, } failedConnector := &meroxa.Connector{} deepCopy(connector, failedConnector) @@ -216,7 +217,7 @@ func TestConnectorRunningTable(t *testing.T) { "failed": failedConnector, } - tableHeaders := []string{"ID", "Name", "Type", "Streams", "State", "Pipeline"} + tableHeaders := []string{"UUID", "ID", "Name", "Type", "Streams", "State", "Pipeline", "Environment"} for name, connector := range tests { t.Run(name, func(t *testing.T) { @@ -232,6 +233,9 @@ func TestConnectorRunningTable(t *testing.T) { switch name { case "running": + if !strings.Contains(out, connector.UUID) { + t.Errorf("%s, not found", connector.UUID) + } if !strings.Contains(out, connector.Name) { t.Errorf("%s, not found", connector.Name) } @@ -239,6 +243,9 @@ func TestConnectorRunningTable(t *testing.T) { t.Errorf("%d, not found", connector.ID) } case "failed": + if !strings.Contains(out, connector.UUID) { + t.Errorf("%s, not found", connector.UUID) + } if !strings.Contains(out, connector.Name) { t.Errorf("%s, not found", connector.Name) } @@ -267,9 +274,10 @@ func TestConnectorsTable(t *testing.T) { "dynamic": "false", "output": []interface{}{"output-foo", "output-bar"}, }, - State: "running", - Trace: "", - PipelineID: 1, + State: "running", + Trace: "", + PipelineID: 1, + Environment: &meroxa.EnvironmentIdentifier{UUID: "2c5326ac-041f-4679-b446-d6d95b91f497"}, } deepCopy(connection, connectionIDAlign) @@ -290,7 +298,7 @@ func TestConnectorsTable(t *testing.T) { "Input_Output": {connection, connectionInputOutput}, } - tableHeaders := []string{"ID", "NAME", "TYPE", "STREAMS", "STATE", "PIPELINE"} + tableHeaders := []string{"UUID", "ID", "NAME", "TYPE", "STREAMS", "STATE", "PIPELINE", "ENVIRONMENT"} for name, connections := range tests { t.Run(name, func(t *testing.T) { @@ -306,6 +314,9 @@ func TestConnectorsTable(t *testing.T) { switch name { case "Base": + if !strings.Contains(out, connection.UUID) { + t.Errorf("%s, not found", connection.UUID) + } if !strings.Contains(out, connection.Name) { t.Errorf("%s, not found", connection.Name) } @@ -351,7 +362,7 @@ func TestConnectorsTableWithoutHeaders(t *testing.T) { PipelineID: 1, } - tableHeaders := []string{"ID", "NAME", "TYPE", "STREAMS", "STATE", "PIPELINE"} + tableHeaders := []string{"UUID", "ID", "NAME", "TYPE", "STREAMS", "STATE", "PIPELINE", "ENVIRONMENT"} var connections []*meroxa.Connector connections = append(connections, connection) @@ -365,7 +376,9 @@ func TestConnectorsTableWithoutHeaders(t *testing.T) { t.Errorf("%s header should not be displayed", header) } } - + if !strings.Contains(out, connection.UUID) { + t.Errorf("%s, not found", connection.UUID) + } if !strings.Contains(out, connection.Name) { t.Errorf("%s, not found", connection.Name) } @@ -390,7 +403,7 @@ func TestPipelinesTable(t *testing.T) { deepCopy(pipelineBase, pipelineWithEnv) pipelineWithEnv.UUID = "038de172-c4b0-49d8-a1d9-26fbeaa2f726" - pipelineWithEnv.Environment = &meroxa.PipelineEnvironment{ + pipelineWithEnv.Environment = &meroxa.EnvironmentIdentifier{ UUID: "e56b1b2e-b6d7-455d-887e-84a0823d84a8", Name: "my-environment", } @@ -455,7 +468,7 @@ func TestPipelineTable(t *testing.T) { deepCopy(pipelineBase, pipelineWithEnv) pipelineWithEnv.UUID = "038de172-c4b0-49d8-a1d9-26fbeaa2f726" - pipelineWithEnv.Environment = &meroxa.PipelineEnvironment{ + pipelineWithEnv.Environment = &meroxa.EnvironmentIdentifier{ UUID: "e56b1b2e-b6d7-455d-887e-84a0823d84a8", Name: "my-environment", } diff --git a/utils/tests.go b/utils/tests.go index 723583df4..f74f27317 100644 --- a/utils/tests.go +++ b/utils/tests.go @@ -6,6 +6,7 @@ import ( "math/rand" "os" + "github.com/google/uuid" "github.com/spf13/pflag" "github.com/meroxa/meroxa-go/pkg/meroxa" @@ -22,7 +23,7 @@ func GeneratePipeline() meroxa.Pipeline { func GeneratePipelineWithEnvironment() meroxa.Pipeline { p := GeneratePipeline() - p.Environment = &meroxa.PipelineEnvironment{ + p.Environment = &meroxa.EnvironmentIdentifier{ UUID: "236d6e81-6a22-4805-b64f-3fa0a57fdbdc", Name: "my-env", } @@ -43,7 +44,7 @@ func GenerateResource() meroxa.Resource { func GenerateResourceWithEnvironment() meroxa.Resource { r := GenerateResource() - r.Environment = &meroxa.ResourceEnvironment{ + r.Environment = &meroxa.EnvironmentIdentifier{ UUID: "424ec647-9f0f-45a5-8e4b-3e0441f12444", Name: "my-environment", } @@ -71,6 +72,36 @@ func GenerateConnector(pipelineID int, connectorName string) meroxa.Connector { } } +func GenerateConnectorWithEnvironment(pipelineID int, connectorName, envNameOrUUID string) meroxa.Connector { + if pipelineID == 0 { + pipelineID = rand.Intn(10000) + } + + if connectorName == "" { + connectorName = "connector-1234" + } + + var env meroxa.EnvironmentIdentifier + _, err := uuid.Parse(envNameOrUUID) + if err == nil { + env.UUID = envNameOrUUID + } else { + env.Name = envNameOrUUID + } + + return meroxa.Connector{ + ID: 1, + Type: meroxa.ConnectorTypeSource, + Name: connectorName, + State: meroxa.ConnectorStateRunning, + PipelineID: pipelineID, + Streams: map[string]interface{}{ + "output": []interface{}{"my-resource.Table"}, + }, + Environment: &env, + } +} + func GenerateEndpoint() meroxa.Endpoint { return meroxa.Endpoint{ Name: "endpoint", diff --git a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/connector.go b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/connector.go index 768b94ec1..6941d7501 100644 --- a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/connector.go +++ b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/connector.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "net/http" + "time" ) const connectorsBasePath = "/v1/connectors" @@ -36,16 +37,20 @@ const ( ) type Connector struct { - ID int `json:"id"` - Type ConnectorType `json:"type"` - Name string `json:"name"` Configuration map[string]interface{} `json:"config"` + CreatedAt time.Time `json:"created_at"` + Environment *EnvironmentIdentifier `json:"environment,omitempty"` + ID int `json:"id"` Metadata map[string]interface{} `json:"metadata"` + Name string `json:"name"` + PipelineID int `json:"pipeline_id"` + PipelineName string `json:"pipeline_name"` Streams map[string]interface{} `json:"streams"` State ConnectorState `json:"state"` Trace string `json:"trace,omitempty"` - PipelineID int `json:"pipeline_id"` - PipelineName string `json:"pipeline_name"` + Type ConnectorType `json:"type"` + UpdatedAt time.Time `json:"updated_at"` + UUID string `json:"uuid"` } type CreateConnectorInput struct { diff --git a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/meroxa.go b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/meroxa.go index deda012d1..b5dc8ea95 100644 --- a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/meroxa.go +++ b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/meroxa.go @@ -16,6 +16,12 @@ const ( textContentType = "text/plain" ) +// EnvironmentIdentifier represents either value as a unique key for a Meroxa Environment +type EnvironmentIdentifier struct { + UUID string `json:"uuid,omitempty"` + Name string `json:"name,omitempty"` +} + // client represents the Meroxa API Client type client struct { baseURL *url.URL diff --git a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/pipeline.go b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/pipeline.go index 23ef33219..d0e723fe0 100644 --- a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/pipeline.go +++ b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/pipeline.go @@ -20,7 +20,7 @@ const ( // Pipeline represents the Meroxa Pipeline type within the Meroxa API type Pipeline struct { CreatedAt time.Time `json:"created_at"` - Environment *PipelineEnvironment `json:"environment,omitempty"` + Environment *EnvironmentIdentifier `json:"environment,omitempty"` ID int `json:"id"` Metadata map[string]interface{} `json:"metadata,omitempty"` // @TODO metadata is unused in Platform-API, so deprecate over time Name string `json:"name"` @@ -33,7 +33,7 @@ type Pipeline struct { type CreatePipelineInput struct { Name string `json:"name"` Metadata map[string]interface{} `json:"metadata,omitempty"` - Environment *PipelineEnvironment `json:"environment,omitempty"` + Environment *EnvironmentIdentifier `json:"environment,omitempty"` } // UpdatePipelineInput represents the input when updating a Meroxa Pipeline @@ -42,12 +42,6 @@ type UpdatePipelineInput struct { Metadata map[string]interface{} `json:"metadata,omitempty"` } -// PipelineEnvironment represents the input for a Meroxa Environment created within a Meroxa Pipeline -type PipelineEnvironment struct { - UUID string `json:"uuid,omitempty"` - Name string `json:"name,omitempty"` -} - // ComponentKind enum for Component "kinds" within Pipeline stages type ComponentKind int diff --git a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/resource.go b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/resource.go index eb6c3052f..c32c38c72 100644 --- a/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/resource.go +++ b/vendor/github.com/meroxa/meroxa-go/pkg/meroxa/resource.go @@ -38,7 +38,7 @@ type Credentials struct { // CreateResourceInput represents the input for a Meroxa Resource type we're creating within the Meroxa API type CreateResourceInput struct { Credentials *Credentials `json:"credentials,omitempty"` - Environment *ResourceEnvironment `json:"environment,omitempty"` + Environment *EnvironmentIdentifier `json:"environment,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` Name string `json:"name,omitempty"` SSHTunnel *ResourceSSHTunnelInput `json:"ssh_tunnel,omitempty"` @@ -56,11 +56,6 @@ type ResourceSSHTunnel struct { PublicKey string `json:"public_key"` } -type ResourceEnvironment struct { - UUID string `json:"uuid,omitempty"` - Name string `json:"name,omitempty"` -} - type ResourceStatus struct { State ResourceState `json:"state"` Details string `json:"details"` @@ -76,7 +71,7 @@ type Resource struct { Credentials *Credentials `json:"credentials,omitempty"` Metadata map[string]interface{} `json:"metadata,omitempty"` SSHTunnel *ResourceSSHTunnel `json:"ssh_tunnel,omitempty"` - Environment *ResourceEnvironment `json:"environment,omitempty"` + Environment *EnvironmentIdentifier `json:"environment,omitempty"` Status ResourceStatus `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` diff --git a/vendor/modules.txt b/vendor/modules.txt index e8229877a..1ae540665 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -84,7 +84,7 @@ github.com/mattn/go-isatty # github.com/mattn/go-runewidth v0.0.10 ## explicit; go 1.9 github.com/mattn/go-runewidth -# github.com/meroxa/meroxa-go v0.0.0-20211129120745-db529ae4ef81 +# github.com/meroxa/meroxa-go v0.0.0-20211201105336-fe1f1bcf8764 ## explicit; go 1.17 github.com/meroxa/meroxa-go/pkg/meroxa github.com/meroxa/meroxa-go/pkg/mock