Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
avirtopeanu-ionos committed Nov 21, 2024
1 parent 8754e30 commit dbd61d6
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion commands/vpn/ipsec/gateway/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Get() *core.Command {
Verb: "get",
Aliases: []string{"g"},
ShortDesc: "Find a gateway by ID",
Example: "ionosctl vpn wg g delete ...", // TODO: Probably best if I don't forget this
Example: "ionosctl vpn ipsec gateway get " + core.FlagsUsage(constants.FlagGatewayID),
PreCmdRun: func(c *core.PreCommandConfig) error {
return core.CheckRequiredFlags(c.Command, c.NS, constants.FlagGatewayID)
},
Expand Down
2 changes: 1 addition & 1 deletion commands/vpn/wireguard/peer/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func Create() *core.Command {
Aliases: []string{"c", "post"},
ShortDesc: "Create a WireGuard Peer",
LongDesc: "Create WireGuard Peers. There is a limit to the total number of peers. Please refer to product documentation",
Example: "", // TODO: Probably best if I don't forget this
Example: "ionosctl vpn wireguard peer create " + core.FlagsUsage(constants.FlagGatewayID, constants.FlagName, constants.FlagIps, constants.FlagPublicKey, constants.FlagHost),
PreCmdRun: func(c *core.PreCommandConfig) error {
return core.CheckRequiredFlags(c.Command, c.NS,
constants.FlagGatewayID, constants.FlagName, constants.FlagIps, constants.FlagPublicKey, constants.FlagHost,
Expand Down
2 changes: 1 addition & 1 deletion commands/vpn/wireguard/peer/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Delete() *core.Command {
Verb: "delete",
Aliases: []string{"d", "del", "rm"},
ShortDesc: "Remove a WireGuard Peer",
Example: "", // TODO: Probably best if I don't forget this
Example: "ionosctl vpn wireguard peer delete " + core.FlagsUsage(constants.FlagGatewayID, constants.FlagPeerID),
PreCmdRun: func(c *core.PreCommandConfig) error {
return core.CheckRequiredFlagsSets(c.Command, c.NS,
[]string{constants.FlagGatewayID, constants.FlagPeerID},
Expand Down
2 changes: 1 addition & 1 deletion docs/subcommands/VPN Gateway/ipsec/gateway/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ Find a gateway by ID
## Examples

```text
ionosctl vpn wg g delete ...
ionosctl vpn ipsec gateway get --gateway-id GATEWAY_ID
```

6 changes: 6 additions & 0 deletions docs/subcommands/VPN Gateway/wireguard/peer/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ Create WireGuard Peers. There is a limit to the total number of peers. Please re
-v, --verbose Print step-by-step process when running command
```

## Examples

```text
ionosctl vpn wireguard peer create --gateway-id GATEWAY_ID --name NAME --ips IPS --public-key PUBLIC_KEY --host HOST
```

6 changes: 6 additions & 0 deletions docs/subcommands/VPN Gateway/wireguard/peer/delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ Remove a WireGuard Peer
-v, --verbose Print step-by-step process when running command
```

## Examples

```text
ionosctl vpn wireguard peer delete --gateway-id GATEWAY_ID --peer-id PEER_ID
```

2 changes: 1 addition & 1 deletion test/bats/vpn/wireguard.bats
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ setup_file() {
assert_output "$(cat /tmp/bats_test/peer_id)"

run ionosctl vpn wireguard peer get --gateway-id "$(cat /tmp/bats_test/gateway_id)" --peer-id "$(cat /tmp/bats_test/peer_id)" --cols name --no-headers 2> /dev/null
asserWt_success
assert_success
assert_output "$new_name"

# Not using no-headers shows the header and the value
Expand Down

0 comments on commit dbd61d6

Please sign in to comment.