Skip to content

Commit

Permalink
Merge branch 'master' into deprecate-argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Brosse authored Sep 14, 2020
2 parents 59dad1b + 1b72b7b commit effee73
Show file tree
Hide file tree
Showing 14 changed files with 420 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create a private network.

USAGE:
scw vpc private-network create [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed will use default project ID from the config
name=<generated> The name of the private network
[tags.{index}] The private networks tags
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

FLAGS:
-h, --help help for create

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a private network.

USAGE:
scw vpc private-network delete <private-network-id ...> [arg=value ...]

ARGS:
private-network-id The private network ID
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

FLAGS:
-h, --help help for delete

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a private network.

USAGE:
scw vpc private-network get <private-network-id ...> [arg=value ...]

ARGS:
private-network-id The private network id
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

FLAGS:
-h, --help help for get

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List private networks.

USAGE:
scw vpc private-network list [arg=value ...]

ARGS:
[order-by] The sort order of the returned private networks (created_at_asc | created_at_desc | name_asc | name_desc)
[name] Filter private networks with names containing this string
[tags.{index}] Filter private networks with one or more matching tags
[project-id] The project ID on which to filter the returned private networks
[organization-id] The organization ID on which to filter the returned private networks
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update private network.

USAGE:
scw vpc private-network update <private-network-id ...> [arg=value ...]

ARGS:
private-network-id The private network ID
[name] The name of the private network
[tags.{index}] The private networks tags
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | nl-ams-1)

FLAGS:
-h, --help help for update

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
30 changes: 30 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-private-network-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
A private network allows interconnecting your instances in an
isolated and private network. The network reachability is limited
to the instances that are on the same private network. Network
Interface Controllers (NICs) are available on the instance and can
be freely managed (adding IP addresses, shutdown interface...)

Note that an instance can be a part of multiple private networks.

USAGE:
scw vpc private-network <command>

AVAILABLE COMMANDS:
create Create a private network
delete Delete a private network
get Get a private network
list List private networks
update Update private network

FLAGS:
-h, --help help for private-network

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw vpc private-network [command] --help" for more information about a command.
20 changes: 20 additions & 0 deletions cmd/scw/testdata/test-all-usage-vpc-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
VPC API

USAGE:
scw vpc <command>

AVAILABLE COMMANDS:
private-network Private network management command

FLAGS:
-h, --help help for vpc

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw vpc [command] --help" for more information about a command.
1 change: 1 addition & 0 deletions cmd/scw/testdata/test-main-usage-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AVAILABLE COMMANDS:
rdb Database RDB API
registry Container registry API
version Display cli version
vpc VPC API
help Help about any command

FLAGS:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/mattn/go-colorable v0.1.4
github.com/mattn/go-isatty v0.0.11
github.com/pkg/errors v0.9.1 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200908180425-0a4ce2d8f2ad
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200911150340-00656aa3a030
github.com/sergi/go-diff v1.0.0 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200908180425-0a4ce2d8f2ad h1:s0ZGnCDNJAbkQqOKCjzoAKNBPQyvrZUaWLKUtDKPIcc=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200908180425-0a4ce2d8f2ad/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200911150340-00656aa3a030 h1:v4Ge/Hm1UnrDP83PG7Spt2dYJT/3+ppruwdYbJ658A4=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.6.0.20200911150340-00656aa3a030/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
Expand Down
2 changes: 2 additions & 0 deletions internal/namespaces/get_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/scaleway/scaleway-cli/internal/namespaces/rdb/v1"
"github.com/scaleway/scaleway-cli/internal/namespaces/registry/v1"
versionNamespace "github.com/scaleway/scaleway-cli/internal/namespaces/version"
"github.com/scaleway/scaleway-cli/internal/namespaces/vpc/v1"
)

// GetCommands returns a list of all commands in the CLI.
Expand All @@ -45,5 +46,6 @@ func GetCommands() *core.Commands {
commands.Merge(lb.GetCommands())
commands.Merge(iot.GetCommands())
commands.Merge(help.GetCommands())
commands.Merge(vpc.GetCommands())
return commands
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
ID 69edd934-c6a6-4eb4-8854-c4dd0de988eb
Name cli-snp-frosty-noether
Organization b8fdefc6-c926-4a47-af24-24f14f724d6a
Project b8fdefc6-c926-4a47-af24-24f14f724d6a
VolumeType l_ssd
Size 20 GB
State available
BaseVolume.ID f79252f4-89d3-485f-9d0a-9b85bdb273b6
BaseVolume.Name snapshot-de728daa-0bf6-4c64-abf5-a9477e791c83-2019-03-05_10:13
CreationDate few seconds ago
ModificationDate few seconds ago
Project b8fdefc6-c926-4a47-af24-24f14f724d6a
Zone fr-par-1
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
{
"snapshot": {
"id": "69edd934-c6a6-4eb4-8854-c4dd0de988eb",
"name": "cli-snp-frosty-noether",
"organization": "b8fdefc6-c926-4a47-af24-24f14f724d6a",
"project": "b8fdefc6-c926-4a47-af24-24f14f724d6a",
"volume_type": "l_ssd",
"size": 20000000000,
"state": "available",
Expand All @@ -27,7 +28,6 @@ Zone fr-par-1
},
"creation_date": "1970-01-01T00:00:00.0Z",
"modification_date": "1970-01-01T00:00:00.0Z",
"project": "b8fdefc6-c926-4a47-af24-24f14f724d6a",
"zone": "fr-par-1"
}
}
11 changes: 11 additions & 0 deletions internal/namespaces/vpc/v1/custom.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package vpc

import (
"github.com/scaleway/scaleway-cli/internal/core"
)

func GetCommands() *core.Commands {
cmds := GetGeneratedCommands()

return cmds
}
Loading

0 comments on commit effee73

Please sign in to comment.