-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[APIT-892] Flink's Private Networking for ESKU (#2850)
- Loading branch information
Showing
20 changed files
with
199 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package flink | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var fields = []string{"private", "public"} | ||
|
||
func (c *command) newConnectivityTypeCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "connectivity-type", | ||
Short: "Manage Flink connectivity type.", | ||
} | ||
|
||
cmd.AddCommand(c.newUseCommand()) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package flink | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/confluentinc/cli/v3/pkg/errors" | ||
"github.com/confluentinc/cli/v3/pkg/output" | ||
"github.com/confluentinc/cli/v3/pkg/resource" | ||
) | ||
|
||
func (c *command) newUseCommand() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "use <region-access>", | ||
Short: "Select a Flink connectivity type.", | ||
Long: "Select a Flink connectivity type for the current environment as \"public\" or \"private\". If unspecified, the CLI will default to the connectivity type that was set at the organization level.", | ||
Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs), | ||
ValidArgs: fields, | ||
RunE: c.ConnectivityTypeUse, | ||
} | ||
} | ||
func (c *command) ConnectivityTypeUse(_ *cobra.Command, args []string) error { | ||
if err := c.Context.SetCurrentFlinkAccessType(args[0]); err != nil { | ||
return err | ||
} | ||
if err := c.Config.Save(); err != nil { | ||
return err | ||
} | ||
output.Printf(c.Config.EnableColor, errors.UsingResourceMsg, resource.FlinkConnectivityType, args[0]) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Manage Flink connectivity type. | ||
|
||
Usage: | ||
confluent flink connectivity-type [command] | ||
|
||
Available Commands: | ||
use Select a Flink connectivity type. | ||
|
||
Global Flags: | ||
-h, --help Show help for this command. | ||
--unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. | ||
-v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). | ||
|
||
Use "confluent flink connectivity-type [command] --help" for more information about a command. |
1 change: 1 addition & 0 deletions
1
test/fixtures/output/flink/connectivity-type/list-private-windows.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Error: Get "http://127.0.0.1:1028/sql/v1/organizations/abc-123/environments/env-596/statements?page_size=100&spec.compute_pool_id=lfcp-123456": GET http://127.0.0.1:1028/sql/v1/organizations/abc-123/environments/env-596/statements?page_size=100&spec.compute_pool_id=lfcp-123456 giving up after 1 attempt(s): Get "http://127.0.0.1:1028/sql/v1/organizations/abc-123/environments/env-596/statements?page_size=100&spec.compute_pool_id=lfcp-123456": dial tcp 127.0.0.1:1028: connectex: No connection could be made because the target machine actively refused it. |
1 change: 1 addition & 0 deletions
1
test/fixtures/output/flink/connectivity-type/list-private.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Error: Get "http://127.0.0.1:1028/sql/v1/organizations/abc-123/environments/env-596/statements?page_size=100&spec.compute_pool_id=lfcp-123456": GET http://127.0.0.1:1028/sql/v1/organizations/abc-123/environments/env-596/statements?page_size=100&spec.compute_pool_id=lfcp-123456 giving up after 1 attempt(s): Get "http://127.0.0.1:1028/sql/v1/organizations/abc-123/environments/env-596/statements?page_size=100&spec.compute_pool_id=lfcp-123456": dial tcp 127.0.0.1:1028: connect: connection refused |
4 changes: 4 additions & 0 deletions
4
test/fixtures/output/flink/connectivity-type/list-public.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Creation Date | Name | Statement | Compute Pool | Status | Status Detail | ||
--------------------------------+----------------------+--------------------+--------------+-----------+----------------------------- | ||
2022-01-01 00:00:00 +0000 UTC | 22222222-2222-2222-2 | CREATE TABLE test; | lfcp-123456 | COMPLETED | SQL statement is completed | ||
2023-01-01 00:00:00 +0000 UTC | 11111111-1111-1111-1 | CREATE TABLE test; | lfcp-123456 | COMPLETED | SQL statement is completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Select a Flink connectivity type for the current environment as "public" or "private". If unspecified, the CLI will default to the connectivity type that was set at the organization level. | ||
|
||
Usage: | ||
confluent flink connectivity-type use <region-access> [flags] | ||
|
||
Global Flags: | ||
-h, --help Show help for this command. | ||
--unsafe-trace Equivalent to -vvvv, but also log HTTP requests and responses which might contain plaintext secrets. | ||
-v, --verbose count Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace). |
1 change: 1 addition & 0 deletions
1
test/fixtures/output/flink/connectivity-type/use-private.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Using Flink connectivity type "private". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Using Flink connectivity type "public". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.