-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
579 additions
and
19 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
1 change: 1 addition & 0 deletions
1
cmd/scw/testdata/test-all-usage-baremetal-bmc-usage.stderr.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 @@ | ||
Baseboard Management Controller (BMC) offers a low-level access to your baremetal instance. |
3 changes: 3 additions & 0 deletions
3
cmd/scw/testdata/test-all-usage-baremetal-ip-usage.stderr.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,3 @@ | ||
The IPs failovers could be attach to any server in the same zone. | ||
A server could be linked with multiple failovers. | ||
. |
1 change: 1 addition & 0 deletions
1
cmd/scw/testdata/test-all-usage-baremetal-offer-usage.stderr.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 @@ | ||
Commercial offers. |
1 change: 1 addition & 0 deletions
1
cmd/scw/testdata/test-all-usage-baremetal-os-usage.stderr.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 @@ | ||
An Operating System (OS) is the underlying software installed on your server. |
24 changes: 24 additions & 0 deletions
24
cmd/scw/testdata/test-all-usage-baremetal-server-list-usage.stderr.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,24 @@ | ||
List all created servers. | ||
|
||
USAGE: | ||
scw [global-flags] baremetal server list [flags] [arg=value ...] | ||
|
||
EXAMPLES: | ||
List all servers on your default zone | ||
scw baremetal server list | ||
|
||
ARGS: | ||
[order-by] Order of the servers (created_at_asc | created_at_desc) | ||
[tags.{index}] Filter servers by tags | ||
[status.{index}] Filter servers by status | ||
[name] Filter servers by name | ||
[organization-id] Filter servers by organization ID | ||
[zone] Zone to target. If none is passed will use default zone from the config (fr-par-2) | ||
|
||
FLAGS: | ||
-h, --help help for list | ||
|
||
GLOBAL FLAGS: | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human | ||
-p, --profile string The config profile to use |
17 changes: 17 additions & 0 deletions
17
cmd/scw/testdata/test-all-usage-baremetal-server-usage.stderr.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,17 @@ | ||
A server is a denomination of a type of instances provided by Scaleway. | ||
|
||
USAGE: | ||
scw [global-flags] baremetal server <command> [flags] | ||
|
||
AVAILABLE COMMANDS: | ||
list List servers | ||
|
||
FLAGS: | ||
-h, --help help for server | ||
|
||
GLOBAL FLAGS: | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human | ||
-p, --profile string The config profile to use | ||
|
||
Use "scw baremetal server [command] --help" for more information about a command. |
25 changes: 25 additions & 0 deletions
25
cmd/scw/testdata/test-all-usage-baremetal-usage.stderr.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,25 @@ | ||
Baremetal API | ||
|
||
USAGE: | ||
scw [global-flags] baremetal <command> [flags] | ||
|
||
AVAILABLE COMMANDS: | ||
server A server is a denomination of a type of instances provided by Scaleway | ||
|
||
FLAGS: | ||
-h, --help help for baremetal | ||
|
||
GLOBAL FLAGS: | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human | ||
-p, --profile string The config profile to use | ||
|
||
Additional help topics: | ||
scw baremetal os An Operating System (OS) is the underlying software installed on your server | ||
scw baremetal ip The IPs failovers could be attach to any server in the same zone. | ||
A server could be linked with multiple failovers. | ||
|
||
scw baremetal bmc Baseboard Management Controller (BMC) offers a low-level access to your baremetal instance | ||
scw baremetal offer Commercial offers | ||
|
||
Use "scw baremetal [command] --help" for more information about a command. |
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
30 changes: 30 additions & 0 deletions
30
internal/namespaces/baremetal/v1alpha1/baremetal_cli_test.go
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 baremetal | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/scaleway/scaleway-cli/internal/core" | ||
"github.com/scaleway/scaleway-sdk-go/api/instance/v1" | ||
"github.com/scaleway/scaleway-sdk-go/scw" | ||
) | ||
|
||
func init() { | ||
if !core.UpdateCassettes { | ||
instance.RetryInterval = 0 | ||
} | ||
} | ||
|
||
// | ||
// Server | ||
// | ||
func Test_ListServer(t *testing.T) { | ||
t.Run("Simple", core.Test(&core.TestConfig{ | ||
Commands: GetCommands(), | ||
Cmd: "scw baremetal server list", | ||
Check: core.TestCheckCombine( | ||
core.TestCheckGolden(), | ||
core.TestCheckExitCode(0), | ||
), | ||
DefaultZone: scw.ZoneFrPar2, | ||
})) | ||
} |
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,8 @@ | ||
package baremetal | ||
|
||
import "github.com/scaleway/scaleway-cli/internal/core" | ||
|
||
func GetCommands() *core.Commands { | ||
cmds := GetGeneratedCommands() | ||
return cmds | ||
} |
35 changes: 35 additions & 0 deletions
35
internal/namespaces/baremetal/v1alpha1/testdata/test-list-server-simple.cassette.yaml
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,35 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
User-Agent: | ||
- scaleway-sdk-go/v1.0.0-beta.5+dev (go1.14; darwin; amd64) cli-e2e-test | ||
url: https://api.scaleway.com/baremetal/v1alpha1/zones/fr-par-2/servers?order_by=created_at_asc&page=1 | ||
method: GET | ||
response: | ||
body: '{"total_count":1,"servers":[{"id":"188b71df-4193-4f33-9151-df07234f3ef4","organization_id":"951df375-e094-4d26-97c1-ba548eeb9c42","name":"bm-determined-ellis","description":"","updated_at":"2020-02-24T09:55:20.021923Z","created_at":"2020-02-24T09:54:57.367412Z","status":"ready","offer_id":"737f18c8-febc-4408-b69e-776bca0a3f48","install":{"os_id":"f2aeab5d-6015-4b7c-b4ed-d76e89093621","hostname":"bm-determined-ellis","ssh_key_ids":["77021435-ad22-4748-8861-0a1c512154d0","90bf1977-43ab-4eb7-b178-3dd96963ce99"],"status":"completed"},"tags":[],"ips":[{"id":"80e3d13b-b5df-4c00-b38c-afc4e96f8ea5","address":"51.159.0.4","reverse":"188b71df-4193-4f33-9151-df07234f3ef4.fr-par-2.baremetal.scw.cloud","version":"Ipv4","reverse_status":"active","reverse_status_message":null},{"id":"b7abae59-34a3-49fc-87b4-93e95da83207","address":"2001:0bc8:6005:0000:529a:4cff:fe84:ea3d","reverse":"188b71df-4193-4f33-9151-df07234f3ef4.fr-par-2.baremetal.scw.cloud","version":"Ipv6","reverse_status":"active","reverse_status_message":null}],"domain":"188b71df-4193-4f33-9151-df07234f3ef4.fr-par-2.baremetal.scw.cloud","boot_type":"normal","zone":"fr-par-2"}]}' | ||
headers: | ||
Content-Length: | ||
- "1141" | ||
Content-Security-Policy: | ||
- default-src 'none'; frame-ancestors 'none' | ||
Content-Type: | ||
- application/json | ||
Date: | ||
- Mon, 09 Mar 2020 13:22:06 GMT | ||
Server: | ||
- scaleway_api | ||
Strict-Transport-Security: | ||
- max-age=63072000 | ||
X-Content-Type-Options: | ||
- nosniff | ||
X-Frame-Options: | ||
- DENY | ||
X-Request-Id: | ||
- 5afb66a6-c9ff-4fe7-8c2a-61e2d83fc937 | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
2 changes: 2 additions & 0 deletions
2
internal/namespaces/baremetal/v1alpha1/testdata/test-list-server-simple.stdout.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,2 @@ | ||
ID ORGANIZATION ID NAME DESCRIPTION UPDATED AT CREATED AT STATUS OFFER ID TAGS IPS DOMAIN BOOT TYPE ZONE | ||
188b71df-4193-4f33-9151-df07234f3ef4 951df375-e094-4d26-97c1-ba548eeb9c42 bm-determined-ellis - few seconds ago few seconds ago ready 737f18c8-febc-4408-b69e-776bca0a3f48 [] 2 188b71df-4193-4f33-9151-df07234f3ef4.fr-par-2.baremetal.scw.cloud normal fr-par-2 |
Oops, something went wrong.