From ec78470a82548f027efcd725f0b19e59d950ac36 Mon Sep 17 00:00:00 2001 From: Alexandru Claudius Virtopeanu Date: Thu, 9 Jan 2025 12:05:16 +0200 Subject: [PATCH] fix: merge conflicts --- commands/cloudapi-v6/completer/ids.go | 2 +- commands/vpn/ipsec/completer/completer.go | 11 ---- commands/vpn/ipsec/tunnel/delete.go | 2 +- commands/vpn/ipsec/tunnel/get.go | 2 +- commands/vpn/ipsec/tunnel/update.go | 2 +- commands/vpn/wireguard/completer/completer.go | 11 ---- commands/vpn/wireguard/peer/delete.go | 2 +- commands/vpn/wireguard/peer/get.go | 2 +- commands/vpn/wireguard/peer/update.go | 2 +- docs/subcommands/Kafka/cluster/create.md | 58 ------------------- docs/subcommands/Kafka/cluster/delete.md | 54 ----------------- docs/subcommands/Kafka/cluster/get.md | 53 ----------------- docs/subcommands/Kafka/cluster/list.md | 54 ----------------- docs/subcommands/Kafka/topic/create.md | 58 ------------------- docs/subcommands/Kafka/topic/delete.md | 55 ------------------ docs/subcommands/Kafka/topic/get.md | 54 ----------------- docs/subcommands/Kafka/topic/list.md | 54 ----------------- .../VPN Gateway/ipsec/gateway/create.md | 4 +- .../VPN Gateway/ipsec/gateway/delete.md | 4 +- .../VPN Gateway/ipsec/gateway/get.md | 4 +- .../VPN Gateway/ipsec/gateway/list.md | 4 +- .../VPN Gateway/ipsec/gateway/update.md | 4 +- .../VPN Gateway/ipsec/tunnel/create.md | 4 +- .../VPN Gateway/ipsec/tunnel/delete.md | 4 +- .../VPN Gateway/ipsec/tunnel/get.md | 6 +- .../VPN Gateway/ipsec/tunnel/list.md | 4 +- .../VPN Gateway/ipsec/tunnel/update.md | 6 +- .../VPN Gateway/wireguard/gateway/create.md | 4 +- .../VPN Gateway/wireguard/gateway/delete.md | 4 +- .../VPN Gateway/wireguard/gateway/get.md | 4 +- .../VPN Gateway/wireguard/gateway/list.md | 4 +- .../VPN Gateway/wireguard/gateway/update.md | 4 +- .../VPN Gateway/wireguard/peer/create.md | 4 +- .../VPN Gateway/wireguard/peer/delete.md | 4 +- .../VPN Gateway/wireguard/peer/get.md | 6 +- .../VPN Gateway/wireguard/peer/list.md | 6 +- .../VPN Gateway/wireguard/peer/update.md | 6 +- docs/summary.md | 11 ---- go.mod | 1 + internal/config/config.go | 15 +++-- internal/core/command.go | 12 +++- internal/core/flag-option.go | 4 +- 42 files changed, 78 insertions(+), 531 deletions(-) delete mode 100644 docs/subcommands/Kafka/cluster/create.md delete mode 100644 docs/subcommands/Kafka/cluster/delete.md delete mode 100644 docs/subcommands/Kafka/cluster/get.md delete mode 100644 docs/subcommands/Kafka/cluster/list.md delete mode 100644 docs/subcommands/Kafka/topic/create.md delete mode 100644 docs/subcommands/Kafka/topic/delete.md delete mode 100644 docs/subcommands/Kafka/topic/get.md delete mode 100644 docs/subcommands/Kafka/topic/list.md diff --git a/commands/cloudapi-v6/completer/ids.go b/commands/cloudapi-v6/completer/ids.go index 5e97781d6..5dd7c8664 100644 --- a/commands/cloudapi-v6/completer/ids.go +++ b/commands/cloudapi-v6/completer/ids.go @@ -83,7 +83,7 @@ func DatacenterIdsFilterLocation(loc string) []string { return dcIds } -func DataCentersIds() []string { +func DataCentersIds(filters ...func(datacenter ionoscloud.Datacenter) bool) []string { datacenterSvc := resources.NewDataCenterService(client.Must(), context.Background()) datacenters, _, err := datacenterSvc.List(resources.ListQueryParams{}) if err != nil { diff --git a/commands/vpn/ipsec/completer/completer.go b/commands/vpn/ipsec/completer/completer.go index 1c636bd74..d5bdfccec 100644 --- a/commands/vpn/ipsec/completer/completer.go +++ b/commands/vpn/ipsec/completer/completer.go @@ -4,11 +4,8 @@ import ( "context" "github.com/ionos-cloud/ionosctl/v6/internal/client" - "github.com/ionos-cloud/ionosctl/v6/internal/config" - "github.com/ionos-cloud/ionosctl/v6/internal/constants" "github.com/ionos-cloud/ionosctl/v6/pkg/functional" vpn "github.com/ionos-cloud/sdk-go-vpn" - "github.com/spf13/viper" ) // -- GATEWAYS @@ -24,10 +21,6 @@ func GatewaysProperty[V any](f func(gateway vpn.IPSecGatewayRead) V, fs ...Gatew // Gateways returns all distributions matching the given filters func Gateways(fs ...GatewayFilter) (vpn.IPSecGatewayReadList, error) { - if url := config.GetServerUrl(); url == constants.DefaultApiURL || url == "" { - viper.Set(constants.ArgServerUrl, constants.DefaultVPNApiURL) - } - req := client.Must().VPNClient.IPSecGatewaysApi.IpsecgatewaysGet(context.Background()) for _, f := range fs { var err error @@ -57,10 +50,6 @@ func TunnelsProperty[V any](gatewayID string, f func(tunnel vpn.IPSecTunnelRead) // Tunnels returns all distributions matching the given filters func Tunnels(gatewayID string, fs ...TunnelFilter) (vpn.IPSecTunnelReadList, error) { - if url := config.GetServerUrl(); url == constants.DefaultApiURL || url == "" { - viper.Set(constants.ArgServerUrl, constants.DefaultVPNApiURL) - } - req := client.Must().VPNClient.IPSecTunnelsApi.IpsecgatewaysTunnelsGet(context.Background(), gatewayID) for _, f := range fs { var err error diff --git a/commands/vpn/ipsec/tunnel/delete.go b/commands/vpn/ipsec/tunnel/delete.go index bce1b741c..b24df4f77 100644 --- a/commands/vpn/ipsec/tunnel/delete.go +++ b/commands/vpn/ipsec/tunnel/delete.go @@ -54,7 +54,7 @@ func Delete() *core.Command { }, }) - cmd.AddStringFlag(constants.FlagGatewayID, constants.FlagIdShort, "", "The ID of the IPSec Gateway", + cmd.AddStringFlag(constants.FlagGatewayID, "", "", "The ID of the IPSec Gateway", core.RequiredFlagOption(), core.WithCompletion(completer.GatewayIDs, constants.VPNApiRegionalURL), ) diff --git a/commands/vpn/ipsec/tunnel/get.go b/commands/vpn/ipsec/tunnel/get.go index 648bc90c3..d0702f875 100644 --- a/commands/vpn/ipsec/tunnel/get.go +++ b/commands/vpn/ipsec/tunnel/get.go @@ -49,7 +49,7 @@ func Get() *core.Command { InitClient: true, }) - cmd.AddStringFlag(constants.FlagGatewayID, constants.FlagIdShort, "", "The ID of the IPSec Gateway", + cmd.AddStringFlag(constants.FlagGatewayID, "", "", "The ID of the IPSec Gateway", core.RequiredFlagOption(), core.WithCompletion(completer.GatewayIDs, constants.VPNApiRegionalURL), ) diff --git a/commands/vpn/ipsec/tunnel/update.go b/commands/vpn/ipsec/tunnel/update.go index b419d3e29..1a8aa9a8c 100644 --- a/commands/vpn/ipsec/tunnel/update.go +++ b/commands/vpn/ipsec/tunnel/update.go @@ -39,7 +39,7 @@ func Update() *core.Command { }, }) - cmd.AddStringFlag(constants.FlagGatewayID, constants.FlagIdShort, "", "The ID of the IPSec Gateway", + cmd.AddStringFlag(constants.FlagGatewayID, "", "", "The ID of the IPSec Gateway", core.RequiredFlagOption(), core.WithCompletion(completer.GatewayIDs, constants.VPNApiRegionalURL), ) diff --git a/commands/vpn/wireguard/completer/completer.go b/commands/vpn/wireguard/completer/completer.go index 29e732d0b..09c279dd1 100644 --- a/commands/vpn/wireguard/completer/completer.go +++ b/commands/vpn/wireguard/completer/completer.go @@ -4,11 +4,8 @@ import ( "context" "github.com/ionos-cloud/ionosctl/v6/internal/client" - "github.com/ionos-cloud/ionosctl/v6/internal/config" - "github.com/ionos-cloud/ionosctl/v6/internal/constants" "github.com/ionos-cloud/ionosctl/v6/pkg/functional" vpn "github.com/ionos-cloud/sdk-go-vpn" - "github.com/spf13/viper" ) // -- GATEWAYS @@ -24,10 +21,6 @@ func GatewaysProperty[V any](f func(gateway vpn.WireguardGatewayRead) V, fs ...G // Gateways returns all distributions matching the given filters func Gateways(fs ...GatewayFilter) (vpn.WireguardGatewayReadList, error) { - if url := config.GetServerUrl(); url == constants.DefaultApiURL || url == "" { - viper.Set(constants.ArgServerUrl, constants.DefaultVPNApiURL) - } - req := client.Must().VPNClient.WireguardGatewaysApi.WireguardgatewaysGet(context.Background()) for _, f := range fs { var err error @@ -59,10 +52,6 @@ func PeersProperty[V any](gatewayID string, f func(peer vpn.WireguardPeerRead) V // Peers returns all distributions matching the given filters func Peers(gatewayID string, fs ...PeerFilter) (vpn.WireguardPeerReadList, error) { - if url := config.GetServerUrl(); url == constants.DefaultApiURL || url == "" { - viper.Set(constants.ArgServerUrl, constants.DefaultVPNApiURL) - } - req := client.Must().VPNClient.WireguardPeersApi.WireguardgatewaysPeersGet(context.Background(), gatewayID) for _, f := range fs { var err error diff --git a/commands/vpn/wireguard/peer/delete.go b/commands/vpn/wireguard/peer/delete.go index f0be2f4e3..b10752e71 100644 --- a/commands/vpn/wireguard/peer/delete.go +++ b/commands/vpn/wireguard/peer/delete.go @@ -54,7 +54,7 @@ func Delete() *core.Command { }, }) - cmd.AddStringFlag(constants.FlagGatewayID, constants.FlagIdShort, "", "The ID of the WireGuard Gateway", + cmd.AddStringFlag(constants.FlagGatewayID, "", "", "The ID of the WireGuard Gateway", core.RequiredFlagOption(), core.WithCompletion(completer.GatewayIDs, constants.VPNApiRegionalURL), ) diff --git a/commands/vpn/wireguard/peer/get.go b/commands/vpn/wireguard/peer/get.go index 297c5d776..767884892 100644 --- a/commands/vpn/wireguard/peer/get.go +++ b/commands/vpn/wireguard/peer/get.go @@ -49,7 +49,7 @@ func Get() *core.Command { InitClient: true, }) - cmd.AddStringFlag(constants.FlagGatewayID, constants.FlagIdShort, "", "The ID of the WireGuard Gateway", + cmd.AddStringFlag(constants.FlagGatewayID, "", "", "The ID of the WireGuard Gateway", core.RequiredFlagOption(), core.WithCompletion(completer.GatewayIDs, constants.VPNApiRegionalURL), ) diff --git a/commands/vpn/wireguard/peer/update.go b/commands/vpn/wireguard/peer/update.go index 22ede52c4..7bd118ae6 100644 --- a/commands/vpn/wireguard/peer/update.go +++ b/commands/vpn/wireguard/peer/update.go @@ -84,7 +84,7 @@ func Update() *core.Command { }, }) - cmd.AddStringFlag(constants.FlagGatewayID, constants.FlagIdShort, "", "The ID of the WireGuard Gateway", + cmd.AddStringFlag(constants.FlagGatewayID, "", "", "The ID of the WireGuard Gateway", core.RequiredFlagOption(), core.WithCompletion(completer.GatewayIDs, constants.VPNApiRegionalURL), ) diff --git a/docs/subcommands/Kafka/cluster/create.md b/docs/subcommands/Kafka/cluster/create.md deleted file mode 100644 index 62e8fab47..000000000 --- a/docs/subcommands/Kafka/cluster/create.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -description: "Create a kafka cluster. Wiki: https://docs.ionos.com/cloud/data-analytics/kafka/api-howtos/create-kafka" ---- - -# KafkaClusterCreate - -## Usage - -```text -ionosctl kafka cluster create [flags] -``` - -## Aliases - -For `cluster` command: - -```text -[cl] -``` - -For `create` command: - -```text -[c post] -``` - -## Description - -Create a kafka cluster. Wiki: https://docs.ionos.com/cloud/data-analytics/kafka/api-howtos/create-kafka - -## Options - -```text - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - --broker-addresses strings The list of broker addresses (required) - --cols strings Set of columns to be printed on output - Available columns: [Id Name Version Size DatacenterId LanId BrokerAddresses State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - --datacenter-id string The ID of the datacenter (required) - -f, --force Force command to execute without user input - -h, --help Print usage - --lan-id string The ID of the LAN (required) - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --name string The name of the kafka cluster (required) - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - -q, --quiet Quiet output - --size string The size of the kafka cluster. Can be one of: XS, S, M, L, XL (required) - -v, --verbose Print step-by-step process when running command - --version string The version of the kafka cluster (required) -``` - -## Examples - -```text -ionosctl kafka cl create --name my-cluster --version 3.7.0 --size S --location de/txl --datacenter-id DATACENTER_ID --lan-id LAN_ID --broker-addresses 127.0.0.1/24,127.0.0.2/24,127.0.0.3/24 -``` - diff --git a/docs/subcommands/Kafka/cluster/delete.md b/docs/subcommands/Kafka/cluster/delete.md deleted file mode 100644 index 4d7698c89..000000000 --- a/docs/subcommands/Kafka/cluster/delete.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -description: "Delete a cluster" ---- - -# KafkaClusterDelete - -## Usage - -```text -ionosctl kafka cluster delete [flags] -``` - -## Aliases - -For `cluster` command: - -```text -[cl] -``` - -For `delete` command: - -```text -[del d] -``` - -## Description - -Delete a cluster - -## Options - -```text - -a, --all Delete all records if set (required) - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - -i, --cluster-id string The ID of the cluster you want to retrieve (required) - --cols strings Set of columns to be printed on output - Available columns: [Id Name Version Size DatacenterId LanId BrokerAddresses State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - -f, --force Force command to execute without user input - -h, --help Print usage - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - -q, --quiet Quiet output - -v, --verbose Print step-by-step process when running command -``` - -## Examples - -```text -ionosctl kafka cl delete --cluster-id ID -``` - diff --git a/docs/subcommands/Kafka/cluster/get.md b/docs/subcommands/Kafka/cluster/get.md deleted file mode 100644 index 388ee6abc..000000000 --- a/docs/subcommands/Kafka/cluster/get.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -description: "Retrieve a cluster" ---- - -# KafkaClusterGet - -## Usage - -```text -ionosctl kafka cluster get [flags] -``` - -## Aliases - -For `cluster` command: - -```text -[cl] -``` - -For `get` command: - -```text -[g] -``` - -## Description - -Retrieve a cluster - -## Options - -```text - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - -i, --cluster-id string The ID of the cluster you want to retrieve (required) - --cols strings Set of columns to be printed on output - Available columns: [Id Name Version Size DatacenterId LanId BrokerAddresses State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - -f, --force Force command to execute without user input - -h, --help Print usage - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - -q, --quiet Quiet output - -v, --verbose Print step-by-step process when running command -``` - -## Examples - -```text -ionosctl kafka cl get --cluster-id ID -``` - diff --git a/docs/subcommands/Kafka/cluster/list.md b/docs/subcommands/Kafka/cluster/list.md deleted file mode 100644 index cd423f2e5..000000000 --- a/docs/subcommands/Kafka/cluster/list.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -description: "Retrieve all clusters using pagination and optional filters" ---- - -# KafkaClusterList - -## Usage - -```text -ionosctl kafka cluster list [flags] -``` - -## Aliases - -For `cluster` command: - -```text -[cl] -``` - -For `list` command: - -```text -[ls] -``` - -## Description - -Retrieve all clusters using pagination and optional filters - -## Options - -```text - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - --cols strings Set of columns to be printed on output - Available columns: [Id Name Version Size DatacenterId LanId BrokerAddresses State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - -f, --force Force command to execute without user input - -h, --help Print usage - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --name string Filter used to fetch only the records that contain specified name. - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - -q, --quiet Quiet output - --state string Filter used to fetch only the records that contain specified state.. Can be one of: AVAILABLE, BUSY, DEPLOYING, UPDATING, FAILED_UPDATING, FAILED, DESTROYING - -v, --verbose Print step-by-step process when running command -``` - -## Examples - -```text -ionosctl kafka c list --location de/txl -``` - diff --git a/docs/subcommands/Kafka/topic/create.md b/docs/subcommands/Kafka/topic/create.md deleted file mode 100644 index 645a30b5b..000000000 --- a/docs/subcommands/Kafka/topic/create.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -description: "Create a kafka topic" ---- - -# KafkaTopicCreate - -## Usage - -```text -ionosctl kafka topic create [flags] -``` - -## Aliases - -For `topic` command: - -```text -[cl] -``` - -For `create` command: - -```text -[c post] -``` - -## Description - -Create a kafka topic - -## Options - -```text - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - --cluster-id string The ID of the cluster (required) - --cols strings Set of columns to be printed on output - Available columns: [Id Name ReplicationFactor NumberOfPartitions RetentionTime SegmentByes State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - -f, --force Force command to execute without user input - -h, --help Print usage - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --name string The name of the topic (required) - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - --partitions int32 The number of partitions (default 3) - -q, --quiet Quiet output - --replication-factor int32 The replication factor (default 3) - --retention-time int32 The retention time in milliseconds (default 604800000) - --segment-bytes int32 The segment bytes (default 1073741824) - -v, --verbose Print step-by-step process when running command -``` - -## Examples - -```text -ionosctl kafka topic create --location LOCATION --name my-topic --cluster-id CLUSTER_ID --partitions 1 --replication-factor 1 -``` - diff --git a/docs/subcommands/Kafka/topic/delete.md b/docs/subcommands/Kafka/topic/delete.md deleted file mode 100644 index adafc58ea..000000000 --- a/docs/subcommands/Kafka/topic/delete.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -description: "Delete a kafka topic" ---- - -# KafkaTopicDelete - -## Usage - -```text -ionosctl kafka topic delete [flags] -``` - -## Aliases - -For `topic` command: - -```text -[cl] -``` - -For `delete` command: - -```text -[d] -``` - -## Description - -Delete a kafka topic - -## Options - -```text - -a, --all Delete all topics - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - --cluster-id string The ID of the cluster (required) - --cols strings Set of columns to be printed on output - Available columns: [Id Name ReplicationFactor NumberOfPartitions RetentionTime SegmentByes State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - -f, --force Force command to execute without user input - -h, --help Print usage - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - -q, --quiet Quiet output - --topic-id string The ID of the topic (required) - -v, --verbose Print step-by-step process when running command -``` - -## Examples - -```text -ionosctl kafka topic delete --location LOCATION --topic-id TOPIC_ID -``` - diff --git a/docs/subcommands/Kafka/topic/get.md b/docs/subcommands/Kafka/topic/get.md deleted file mode 100644 index 201cf1dff..000000000 --- a/docs/subcommands/Kafka/topic/get.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -description: "Get a kafka topic" ---- - -# KafkaTopicGet - -## Usage - -```text -ionosctl kafka topic get [flags] -``` - -## Aliases - -For `topic` command: - -```text -[cl] -``` - -For `get` command: - -```text -[g] -``` - -## Description - -Get a kafka topic - -## Options - -```text - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - --cluster-id string The ID of the cluster (required) - --cols strings Set of columns to be printed on output - Available columns: [Id Name ReplicationFactor NumberOfPartitions RetentionTime SegmentByes State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - -f, --force Force command to execute without user input - -h, --help Print usage - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - -q, --quiet Quiet output - --topic-id string The ID of the topic (required) - -v, --verbose Print step-by-step process when running command -``` - -## Examples - -```text -ionosctl kafka topic get --location LOCATION --cluster-id CLUSTER_ID --topic-id TOPIC_ID -``` - diff --git a/docs/subcommands/Kafka/topic/list.md b/docs/subcommands/Kafka/topic/list.md deleted file mode 100644 index f51c4fd1b..000000000 --- a/docs/subcommands/Kafka/topic/list.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -description: "List all kafka topics" ---- - -# KafkaTopicList - -## Usage - -```text -ionosctl kafka topic list [flags] -``` - -## Aliases - -For `topic` command: - -```text -[cl] -``` - -For `list` command: - -```text -[ls] -``` - -## Description - -List all kafka topics - -## Options - -```text - -u, --api-url string Override default host URL (default "https://kafka.de-fra.ionos.com") - --cluster-id string The ID of the cluster (required) - --cols strings Set of columns to be printed on output - Available columns: [Id Name ReplicationFactor NumberOfPartitions RetentionTime SegmentByes State] - -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") - -f, --force Force command to execute without user input - -h, --help Print usage - -l, --location string Location of the resource to operate on. Can be one of: de/fra, de/txl - --no-headers Don't print table headers when table output is used - -o, --output string Desired output format [text|json|api-json] (default "text") - -q, --quiet Quiet output - -v, --verbose Print step-by-step process when running command -``` - -## Examples - -```text -ionosctl kafka topic list --location LOCATION -ionosctl kafka topic list --location LOCATION --cluster-id CLUSTER_ID -``` - diff --git a/docs/subcommands/VPN Gateway/ipsec/gateway/create.md b/docs/subcommands/VPN Gateway/ipsec/gateway/create.md index 23d509a74..5f8cbbe13 100644 --- a/docs/subcommands/VPN Gateway/ipsec/gateway/create.md +++ b/docs/subcommands/VPN Gateway/ipsec/gateway/create.md @@ -31,7 +31,7 @@ Create a IPSec Gateway ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description GatewayIP DatacenterId LanId ConnectionIPv4 ConnectionIPv6 Version Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") @@ -42,7 +42,7 @@ Create a IPSec Gateway --gateway-ip string The IP of an IPBlock in the same location as the provided datacenter (required) -h, --help Print usage --lan-id string The numeric LAN ID to connect your VPN Gateway to (required) - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -n, --name string Name of the IPSec Gateway (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") diff --git a/docs/subcommands/VPN Gateway/ipsec/gateway/delete.md b/docs/subcommands/VPN Gateway/ipsec/gateway/delete.md index 346411ac6..e1d87bd5a 100644 --- a/docs/subcommands/VPN Gateway/ipsec/gateway/delete.md +++ b/docs/subcommands/VPN Gateway/ipsec/gateway/delete.md @@ -32,14 +32,14 @@ Delete a gateway ```text -a, --all Delete all gateways. Required or --gateway-id - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description GatewayIP DatacenterId LanId ConnectionIPv4 ConnectionIPv6 Version Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input -i, --gateway-id string The ID of the IPSec Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") -q, --quiet Quiet output diff --git a/docs/subcommands/VPN Gateway/ipsec/gateway/get.md b/docs/subcommands/VPN Gateway/ipsec/gateway/get.md index df84c65c3..b004d6a6e 100644 --- a/docs/subcommands/VPN Gateway/ipsec/gateway/get.md +++ b/docs/subcommands/VPN Gateway/ipsec/gateway/get.md @@ -31,14 +31,14 @@ Find a gateway by ID ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description GatewayIP DatacenterId LanId ConnectionIPv4 ConnectionIPv6 Version Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input -i, --gateway-id string The ID of the IPSec Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") -q, --quiet Quiet output diff --git a/docs/subcommands/VPN Gateway/ipsec/gateway/list.md b/docs/subcommands/VPN Gateway/ipsec/gateway/list.md index 13772796a..ed84262c0 100644 --- a/docs/subcommands/VPN Gateway/ipsec/gateway/list.md +++ b/docs/subcommands/VPN Gateway/ipsec/gateway/list.md @@ -31,13 +31,13 @@ List IPSec Gateways ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description GatewayIP DatacenterId LanId ConnectionIPv4 ConnectionIPv6 Version Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -M, --max-results int32 The maximum number of elements to return --no-headers Don't print table headers when table output is used --offset int32 Skip a certain number of results diff --git a/docs/subcommands/VPN Gateway/ipsec/gateway/update.md b/docs/subcommands/VPN Gateway/ipsec/gateway/update.md index 7ea2719dd..39b429137 100644 --- a/docs/subcommands/VPN Gateway/ipsec/gateway/update.md +++ b/docs/subcommands/VPN Gateway/ipsec/gateway/update.md @@ -31,7 +31,7 @@ Update a IPSec Gateway ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description GatewayIP DatacenterId LanId ConnectionIPv4 ConnectionIPv6 Version Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") @@ -43,7 +43,7 @@ Update a IPSec Gateway --gateway-ip string The IP of an IPBlock in the same location as the provided datacenter (required) -h, --help Print usage --lan-id string The numeric LAN ID to connect your VPN Gateway to (required) - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -n, --name string Name of the IPSec Gateway (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") diff --git a/docs/subcommands/VPN Gateway/ipsec/tunnel/create.md b/docs/subcommands/VPN Gateway/ipsec/tunnel/create.md index d7f3e2090..4e51c847d 100644 --- a/docs/subcommands/VPN Gateway/ipsec/tunnel/create.md +++ b/docs/subcommands/VPN Gateway/ipsec/tunnel/create.md @@ -31,7 +31,7 @@ Create IPSec tunnels ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --auth-method string The authentication method for the IPSec tunnel. Valid values are PSK or RSA (required) --cloud-network-cidrs strings The network CIDRs on the "Left" side that are allowed to connect to the IPSec tunnel, i.e the CIDRs within your IONOS Cloud LAN. Specify "0.0.0.0/0" or "::/0" for all addresses. --cols strings Set of columns to be printed on output @@ -52,7 +52,7 @@ Create IPSec tunnels --ike-lifetime int32 The phase lifetime in seconds --json-properties string Path to a JSON file containing the desired properties. Overrides any other properties set. --json-properties-example If set, prints a complete JSON which could be used for --json-properties and exits. Hint: Pipe me to a .json file - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --name string Name of the IPSec Tunnel (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") diff --git a/docs/subcommands/VPN Gateway/ipsec/tunnel/delete.md b/docs/subcommands/VPN Gateway/ipsec/tunnel/delete.md index bacd929b4..f16bd2913 100644 --- a/docs/subcommands/VPN Gateway/ipsec/tunnel/delete.md +++ b/docs/subcommands/VPN Gateway/ipsec/tunnel/delete.md @@ -32,14 +32,14 @@ Remove a IPSec Tunnel ```text -a, --all Delete all tunnels. Required or --tunnel-id - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description RemoteHost AuthMethod PSKKey IKEDiffieHellmanGroup IKEEncryptionAlgorithm IKEIntegrityAlgorithm IKELifetime ESPDiffieHellmanGroup ESPEncryptionAlgorithm ESPIntegrityAlgorithm ESPLifetime CloudNetworkCIDRs PeerNetworkCIDRs Status StatusMessage] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input --gateway-id string The ID of the IPSec Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") -q, --quiet Quiet output diff --git a/docs/subcommands/VPN Gateway/ipsec/tunnel/get.md b/docs/subcommands/VPN Gateway/ipsec/tunnel/get.md index 41e6bb819..5aeeb80b7 100644 --- a/docs/subcommands/VPN Gateway/ipsec/tunnel/get.md +++ b/docs/subcommands/VPN Gateway/ipsec/tunnel/get.md @@ -31,18 +31,18 @@ Find a tunnel by ID ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description RemoteHost AuthMethod PSKKey IKEDiffieHellmanGroup IKEEncryptionAlgorithm IKEIntegrityAlgorithm IKELifetime ESPDiffieHellmanGroup ESPEncryptionAlgorithm ESPIntegrityAlgorithm ESPLifetime CloudNetworkCIDRs PeerNetworkCIDRs Status StatusMessage] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input --gateway-id string The ID of the IPSec Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") -q, --quiet Quiet output - -i, --tunnel-id string The ID of the IPSec Tunnel you want to delete (required) + -i, --tunnel-id string The ID of the IPSec Tunnel (required) -v, --verbose Print step-by-step process when running command ``` diff --git a/docs/subcommands/VPN Gateway/ipsec/tunnel/list.md b/docs/subcommands/VPN Gateway/ipsec/tunnel/list.md index 1587002a0..7fb6b0c0c 100644 --- a/docs/subcommands/VPN Gateway/ipsec/tunnel/list.md +++ b/docs/subcommands/VPN Gateway/ipsec/tunnel/list.md @@ -31,14 +31,14 @@ List IPSec Tunnels ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description RemoteHost AuthMethod PSKKey IKEDiffieHellmanGroup IKEEncryptionAlgorithm IKEIntegrityAlgorithm IKELifetime ESPDiffieHellmanGroup ESPEncryptionAlgorithm ESPIntegrityAlgorithm ESPLifetime CloudNetworkCIDRs PeerNetworkCIDRs Status StatusMessage] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input -i, --gateway-id string The ID of the IPSec Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -M, --max-results int32 The maximum number of elements to return --no-headers Don't print table headers when table output is used --offset int32 Skip a certain number of results diff --git a/docs/subcommands/VPN Gateway/ipsec/tunnel/update.md b/docs/subcommands/VPN Gateway/ipsec/tunnel/update.md index 385bb5a4e..0119ee284 100644 --- a/docs/subcommands/VPN Gateway/ipsec/tunnel/update.md +++ b/docs/subcommands/VPN Gateway/ipsec/tunnel/update.md @@ -31,7 +31,7 @@ Update a IPSec Tunnel ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --auth-method string The authentication method for the IPSec tunnel. Valid values are PSK or RSA (required) --cloud-network-cidrs strings The network CIDRs on the "Left" side that are allowed to connect to the IPSec tunnel, i.e the CIDRs within your IONOS Cloud LAN. Specify "0.0.0.0/0" or "::/0" for all addresses. --cols strings Set of columns to be printed on output @@ -52,14 +52,14 @@ Update a IPSec Tunnel --ike-lifetime int32 The phase lifetime in seconds --json-properties string Path to a JSON file containing the desired properties. Overrides any other properties set. --json-properties-example If set, prints a complete JSON which could be used for --json-properties and exits. Hint: Pipe me to a .json file - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --name string Name of the IPSec Tunnel (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") --peer-network-cidrs strings The network CIDRs on the "Right" side that are allowed to connect to the IPSec tunnel. Specify "0.0.0.0/0" or "::/0" for all addresses. --psk-key string The pre-shared key for the IPSec tunnel (required) -q, --quiet Quiet output - -i, --tunnel-id string The ID of the IPSec Tunnel you want to delete (required) + -i, --tunnel-id string The ID of the IPSec Tunnel (required) -v, --verbose Print step-by-step process when running command ``` diff --git a/docs/subcommands/VPN Gateway/wireguard/gateway/create.md b/docs/subcommands/VPN Gateway/wireguard/gateway/create.md index 7f2b5b033..3e02d6ec8 100644 --- a/docs/subcommands/VPN Gateway/wireguard/gateway/create.md +++ b/docs/subcommands/VPN Gateway/wireguard/gateway/create.md @@ -37,7 +37,7 @@ Create a WireGuard Gateway ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name PublicKey Description GatewayIP InterfaceIPv4 InterfaceIPv6 DatacenterId LanId ConnectionIPv4 ConnectionIPv6 InterfaceIP ListenPort Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") @@ -49,7 +49,7 @@ Create a WireGuard Gateway -h, --help Print usage --interface-ip string The IPv4 or IPv6 address (with CIDR mask) to be assigned to the WireGuard interface (required) --lan-id string The numeric LAN ID to connect your VPN Gateway to (required) - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -n, --name string Name of the WireGuard Gateway (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") diff --git a/docs/subcommands/VPN Gateway/wireguard/gateway/delete.md b/docs/subcommands/VPN Gateway/wireguard/gateway/delete.md index 9351393a4..27ef8dbf0 100644 --- a/docs/subcommands/VPN Gateway/wireguard/gateway/delete.md +++ b/docs/subcommands/VPN Gateway/wireguard/gateway/delete.md @@ -38,14 +38,14 @@ Delete a gateway ```text -a, --all Delete all gateways. Required or --gateway-id - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name PublicKey Description GatewayIP InterfaceIPv4 InterfaceIPv6 DatacenterId LanId ConnectionIPv4 ConnectionIPv6 InterfaceIP ListenPort Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input -i, --gateway-id string The ID of the WireGuard Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") -q, --quiet Quiet output diff --git a/docs/subcommands/VPN Gateway/wireguard/gateway/get.md b/docs/subcommands/VPN Gateway/wireguard/gateway/get.md index c572b5c23..86f9c8576 100644 --- a/docs/subcommands/VPN Gateway/wireguard/gateway/get.md +++ b/docs/subcommands/VPN Gateway/wireguard/gateway/get.md @@ -37,14 +37,14 @@ Find a gateway by ID ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name PublicKey Description GatewayIP InterfaceIPv4 InterfaceIPv6 DatacenterId LanId ConnectionIPv4 ConnectionIPv6 InterfaceIP ListenPort Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input -i, --gateway-id string The ID of the WireGuard Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") -q, --quiet Quiet output diff --git a/docs/subcommands/VPN Gateway/wireguard/gateway/list.md b/docs/subcommands/VPN Gateway/wireguard/gateway/list.md index 433d52416..1faf83807 100644 --- a/docs/subcommands/VPN Gateway/wireguard/gateway/list.md +++ b/docs/subcommands/VPN Gateway/wireguard/gateway/list.md @@ -37,13 +37,13 @@ List WireGuard Gateways ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name PublicKey Description GatewayIP InterfaceIPv4 InterfaceIPv6 DatacenterId LanId ConnectionIPv4 ConnectionIPv6 InterfaceIP ListenPort Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -M, --max-results int32 The maximum number of elements to return --no-headers Don't print table headers when table output is used --offset int32 Skip a certain number of results diff --git a/docs/subcommands/VPN Gateway/wireguard/gateway/update.md b/docs/subcommands/VPN Gateway/wireguard/gateway/update.md index 720c39aee..a49ed62fc 100644 --- a/docs/subcommands/VPN Gateway/wireguard/gateway/update.md +++ b/docs/subcommands/VPN Gateway/wireguard/gateway/update.md @@ -37,7 +37,7 @@ Update a WireGuard Gateway. Note: The private key MUST be provided again (or cha ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name PublicKey Description GatewayIP InterfaceIPv4 InterfaceIPv6 DatacenterId LanId ConnectionIPv4 ConnectionIPv6 InterfaceIP ListenPort Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") @@ -50,7 +50,7 @@ Update a WireGuard Gateway. Note: The private key MUST be provided again (or cha -h, --help Print usage --interface-ip string The IPv4 or IPv6 address (with CIDR mask) to be assigned to the WireGuard interface (required) --lan-id string The numeric LAN ID to connect your VPN Gateway to (required) - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -n, --name string Name of the WireGuard Gateway (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") diff --git a/docs/subcommands/VPN Gateway/wireguard/peer/create.md b/docs/subcommands/VPN Gateway/wireguard/peer/create.md index 0834dff69..d1ca8d777 100644 --- a/docs/subcommands/VPN Gateway/wireguard/peer/create.md +++ b/docs/subcommands/VPN Gateway/wireguard/peer/create.md @@ -37,7 +37,7 @@ Create WireGuard Peers. There is a limit to the total number of peers. Please re ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description Host Port WhitelistIPs PublicKey Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") @@ -47,7 +47,7 @@ Create WireGuard Peers. There is a limit to the total number of peers. Please re -h, --help Print usage --host string Hostname or IPV4 address that the WireGuard Server will connect to (required) --ips strings Comma separated subnets of CIDRs that are allowed to connect to the WireGuard Gateway. Specify "a.b.c.d/32" for an individual IP address. Specify "0.0.0.0/0" or "::/0" for all addresses (required) - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --name string Name of the WireGuard Peer (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") diff --git a/docs/subcommands/VPN Gateway/wireguard/peer/delete.md b/docs/subcommands/VPN Gateway/wireguard/peer/delete.md index 03979fee9..8831afa7d 100644 --- a/docs/subcommands/VPN Gateway/wireguard/peer/delete.md +++ b/docs/subcommands/VPN Gateway/wireguard/peer/delete.md @@ -38,14 +38,14 @@ Remove a WireGuard Peer ```text -a, --all Delete all peers. Required or --peer-id - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description Host Port WhitelistIPs PublicKey Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input --gateway-id string The ID of the WireGuard Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") -i, --peer-id string The ID of the WireGuard Peer you want to delete (required) diff --git a/docs/subcommands/VPN Gateway/wireguard/peer/get.md b/docs/subcommands/VPN Gateway/wireguard/peer/get.md index 123552399..d085fcdac 100644 --- a/docs/subcommands/VPN Gateway/wireguard/peer/get.md +++ b/docs/subcommands/VPN Gateway/wireguard/peer/get.md @@ -37,17 +37,17 @@ Find a peer by ID ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description Host Port WhitelistIPs PublicKey Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input --gateway-id string The ID of the WireGuard Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") - -i, --peer-id string The ID of the WireGuard Peer you want to delete (required) + -i, --peer-id string The ID of the WireGuard Peer (required) -q, --quiet Quiet output -v, --verbose Print step-by-step process when running command ``` diff --git a/docs/subcommands/VPN Gateway/wireguard/peer/list.md b/docs/subcommands/VPN Gateway/wireguard/peer/list.md index 78891569e..b846bbed1 100644 --- a/docs/subcommands/VPN Gateway/wireguard/peer/list.md +++ b/docs/subcommands/VPN Gateway/wireguard/peer/list.md @@ -37,14 +37,14 @@ List WireGuard Peers ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description Host Port WhitelistIPs PublicKey Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") -f, --force Force command to execute without user input - -i, --gateway-id string The ID of the WireGuard Gateway (required) + -i, --gateway-id string The ID of the Wireguard Gateway (required) -h, --help Print usage - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci -M, --max-results int32 The maximum number of elements to return --no-headers Don't print table headers when table output is used --offset int32 Skip a certain number of results diff --git a/docs/subcommands/VPN Gateway/wireguard/peer/update.md b/docs/subcommands/VPN Gateway/wireguard/peer/update.md index fc308a188..7b796fec9 100644 --- a/docs/subcommands/VPN Gateway/wireguard/peer/update.md +++ b/docs/subcommands/VPN Gateway/wireguard/peer/update.md @@ -37,7 +37,7 @@ Update a WireGuard Peer ## Options ```text - -u, --api-url string Override default host url (default "vpn.de-txl.ionos.com") + -u, --api-url string Override default host URL (default "https://vpn.de-txl.ionos.com") --cols strings Set of columns to be printed on output Available columns: [ID Name Description Host Port WhitelistIPs PublicKey Status] -c, --config string Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.json") @@ -47,11 +47,11 @@ Update a WireGuard Peer -h, --help Print usage --host string Hostname or IPV4 address that the WireGuard Server will connect to (required) --ips strings Comma separated subnets of CIDRs that are allowed to connect to the WireGuard Gateway. Specify "a.b.c.d/32" for an individual IP address. Specify "0.0.0.0/0" or "::/0" for all addresses (required) - --location string The location your resources are hosted in. Possible values: [de/fra de/txl] (default "de/txl") + -l, --location string Location of the resource to operate on. Can be one of: de/txl, de/fra, es/vit, fr/par, gb/lhr, gb/bhx, us/ewr, us/las, us/mci --name string Name of the WireGuard Peer (required) --no-headers Don't print table headers when table output is used -o, --output string Desired output format [text|json|api-json] (default "text") - -i, --peer-id string The ID of the WireGuard Peer you want to delete (required) + -i, --peer-id string The ID of the WireGuard Peer (required) --port int Port that the WireGuard Server will connect to (default 51820) --public-key string Public key of the connecting peer (required) -q, --quiet Quiet output diff --git a/docs/summary.md b/docs/summary.md index 69cfb7f66..22d374b46 100644 --- a/docs/summary.md +++ b/docs/summary.md @@ -354,17 +354,6 @@ * [list](subcommands%2FDatabase-as-a-Service%2Fpostgres%2Fversion%2Flist.md) * Interactive Shell * [shell](subcommands%2FInteractive%20Shell%2Fshell.md) -* Kafka - * cluster - * [create](subcommands%2FKafka%2Fcluster%2Fcreate.md) - * [delete](subcommands%2FKafka%2Fcluster%2Fdelete.md) - * [get](subcommands%2FKafka%2Fcluster%2Fget.md) - * [list](subcommands%2FKafka%2Fcluster%2Flist.md) - * topic - * [create](subcommands%2FKafka%2Ftopic%2Fcreate.md) - * [delete](subcommands%2FKafka%2Ftopic%2Fdelete.md) - * [get](subcommands%2FKafka%2Ftopic%2Fget.md) - * [list](subcommands%2FKafka%2Ftopic%2Flist.md) * Logging Service * logs * [add](subcommands%2FLogging-Service%2Flogs%2Fadd.md) diff --git a/go.mod b/go.mod index 85b43aa48..a30d63365 100644 --- a/go.mod +++ b/go.mod @@ -42,6 +42,7 @@ require ( github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4 github.com/ionos-cloud/sdk-go-cdn v1.1.0 github.com/ionos-cloud/sdk-go-dbaas-mariadb v1.1.1 + github.com/ionos-cloud/sdk-go-kafka v1.1.0 github.com/ionos-cloud/sdk-go-vpn v1.0.1 ) diff --git a/internal/config/config.go b/internal/config/config.go index 9b0385809..7a25863ba 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -22,18 +22,25 @@ var FieldsWithSensitiveDataInConfigFile = []string{ // GetServerUrl returns the server URL the SDK should use, with support for layered fallbacks. func GetServerUrl() string { viper.AutomaticEnv() - if val := viper.GetString(constants.ArgServerUrl); viper.IsSet(constants.ArgServerUrl) { + if val := viper.GetString(constants.ArgServerUrl); viper.IsSet(constants.ArgServerUrl) && val != "" { // 1. Above all, use global flag val return val } - if val := viper.GetString(constants.EnvServerUrl); viper.IsSet(constants.EnvServerUrl) { + if val := viper.GetString(constants.EnvServerUrl); viper.IsSet(constants.EnvServerUrl) && val != "" { // 2. Fallback to non-empty env vars return val } - if val := viper.GetString(constants.CfgServerUrl); viper.IsSet(constants.CfgServerUrl) { - // 3. Fallback to non-empty cfg field + + cfgFields, err := Read() + if err != nil { + return "" + } + val := cfgFields[constants.CfgServerUrl] + + if val != "" { // 3. Fallback to non-empty cfg field return val } + // 4. Return empty string. SDKs should handle it, per docs return "" } diff --git a/internal/core/command.go b/internal/core/command.go index 224929c0e..7222a944d 100644 --- a/internal/core/command.go +++ b/internal/core/command.go @@ -95,7 +95,6 @@ func WithRegionalFlags(c *Command, baseURL string, allowedLocations []string) *C c.Command.PersistentFlags().StringP( constants.ArgServerUrl, constants.ArgServerUrlShort, defaultUrl, "Override default host URL", ) - viper.BindPFlag(constants.ArgServerUrl, c.Command.PersistentFlags().Lookup(constants.ArgServerUrl)) // Add the location flag c.Command.PersistentFlags().StringP( @@ -132,6 +131,17 @@ func WithRegionalFlags(c *Command, baseURL string, allowedLocations []string) *C } } + // Because Viper has issues with binding to the same flag multiple times, we need to manually set the value + if c.Command.PersistentFlags().Changed(constants.ArgServerUrl) { + customURL, _ := c.Command.PersistentFlags().GetString(constants.ArgServerUrl) + viper.Set(constants.ArgServerUrl, customURL) + } + + // Because Viper has issues with binding to the same env var multiple times, we need to manually set the value + if envURL := os.Getenv(constants.EnvServerUrl); envURL != "" { + viper.Set(constants.EnvServerUrl, envURL) + } + return nil } diff --git a/internal/core/flag-option.go b/internal/core/flag-option.go index 680a6b2cd..df5ff2c55 100644 --- a/internal/core/flag-option.go +++ b/internal/core/flag-option.go @@ -55,7 +55,9 @@ func WithCompletionComplex( func(passedCmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { viper.AutomaticEnv() - if viper.IsSet(constants.ArgServerUrl) || viper.IsSet(constants.EnvServerUrl) { + if viper.IsSet(constants.ArgServerUrl) || + viper.IsSet(constants.EnvServerUrl) || + viper.IsSet(constants.CfgServerUrl) { // If manually set, do nothing and directly call completionFunc return completionFunc(passedCmd, args, toComplete) }