Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apple-silicon): add support for M1 control #1739

Merged
merged 6 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get an Operating System (OS).

USAGE:
scw apple-silicon os get <os-id ...> [arg=value ...]

ARGS:
os-id UUID of the OS you want to get

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,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List all Operating System (OS).

USAGE:
scw apple-silicon os list [arg=value ...]

ARGS:
[server-type] List of compatible server type
[name] Filter os by name (for eg. "11.1" will return "11.1.2" and "11.1" but not "12")

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
21 changes: 21 additions & 0 deletions cmd/scw/testdata/test-all-usage-apple-silicon-os-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
OS management commands

USAGE:
scw apple-silicon os <command>

AVAILABLE COMMANDS:
get Get an Operating System (OS)
list List all Operating System (OS)

FLAGS:
-h, --help help for os

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 apple-silicon os [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create a server.

USAGE:
scw apple-silicon server create [arg=value ...]

ARGS:
[name] Create a server with this given name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should generate a default server name.

[project-id] Project ID to use. If none is passed the default project ID will be used
[type] Create a server of the given type

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,18 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a server.

USAGE:
scw apple-silicon server delete <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to delete

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,18 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a server.

USAGE:
scw apple-silicon server get <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to get

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,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List all servers.

USAGE:
scw apple-silicon server list [arg=value ...]

ARGS:
[order-by] The sort order of the returned servers (created_at_asc | created_at_desc)
[project-id] List only servers of this project ID
[organization-id] List only servers of this organization ID

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,18 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Reboot a server.

USAGE:
scw apple-silicon server reboot <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to reboot

FLAGS:
-h, --help help for reboot

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,18 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Reinstall a server.

USAGE:
scw apple-silicon server reinstall <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to reinstall

FLAGS:
-h, --help help for reinstall

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,18 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a server technical details.

USAGE:
scw apple-silicon server-type get <server-type ...> [arg=value ...]

ARGS:
server-type Server type identifier

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,15 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List all server types technical details.

USAGE:
scw apple-silicon server-type list

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️️ 🟥🟥🟥️
Server-Types management commands

USAGE:
scw apple-silicon server-type <command>

AVAILABLE COMMANDS:
get Get a server type
list List server types

FLAGS:
-h, --help help for server-type

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 apple-silicon server-type [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update a server.

USAGE:
scw apple-silicon server update <name ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to update
name Updated name for your server

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Apple silicon management commands

USAGE:
scw apple-silicon server <command>

AVAILABLE COMMANDS:
create Create a server
delete Delete a server
get Get a server
list List all servers
reboot Reboot a server
reinstall Reinstall a server
update Update a server

FLAGS:
-h, --help help for server

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 apple-silicon server [command] --help" for more information about a command.
32 changes: 32 additions & 0 deletions cmd/scw/testdata/test-all-usage-apple-silicon-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Scaleway Apple silicon M1 as-a-Service is built using the latest generation of Apple Mac mini hardware (fifth generation).

These dedicated Mac mini M1s are designed for developing, building, testing, and signing applications for Apple devices, including iPhones, iPads, Mac computers and much more.

Get set to explore, learn and build on a dedicated Mac mini M1 with more performance and speed than you ever thought possible.

**Apple silicon as a Service comes with a minimum allocation period of 24 hours**.

Mac mini and macOS are trademarks of Apple Inc., registered in the U.S. and other countries and regions.
IOS is a trademark or registered trademark of Cisco in the U.S. and other countries and is used by Apple under license.
Scaleway is not affiliated with Apple Inc.

USAGE:
scw apple-silicon <command>

AVAILABLE COMMANDS:
os OS management commands
server Apple silicon management commands
server-type Server-Types management commands

FLAGS:
-h, --help help for apple-silicon

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 apple-silicon [command] --help" for more information about a command.
39 changes: 20 additions & 19 deletions cmd/scw/testdata/test-main-usage-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@ USAGE:
scw <command>

AVAILABLE COMMANDS:
account Account API
autocomplete Autocomplete related commands
baremetal Baremetal API
config Config file management
feedback Send feedback to the Scaleway CLI Team!
help Get help about how the CLI works
info Get info about current settings
init Initialize the config
instance Instance API
iot This API allows you to manage IoT hubs and devices
k8s Kapsule API
lb This API allows you to manage your load balancer service
marketplace Marketplace API
object Object-storage utils
rdb Database RDB API
registry Container registry API
version Display cli version
vpc VPC API
help Help about any command
account Account API
apple-silicon Apple silicon API
autocomplete Autocomplete related commands
baremetal Baremetal API
config Config file management
feedback Send feedback to the Scaleway CLI Team!
help Get help about how the CLI works
info Get info about current settings
init Initialize the config
instance Instance API
iot This API allows you to manage IoT hubs and devices
k8s Kapsule API
lb This API allows you to manage your load balancer service
marketplace Marketplace API
object Object-storage utils
rdb Database RDB API
registry Container registry API
version Display cli version
vpc VPC API
help Help about any command

FLAGS:
-c, --config string The path to the config file
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.7
github.com/mattn/go-isatty v0.0.12
github.com/pkg/errors v0.9.1 // indirect
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210127161313-bd30bebeac4f
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210202173413-337fb17121a1
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210127161313-bd30bebeac4f h1:WSnaD0/cvbKJgSTYbjAPf4RJXVvNNDAwVm+W8wEmnGE=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210127161313-bd30bebeac4f/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210202173413-337fb17121a1 h1:vytHInJpH5I4FheLyFW2wu5LmtcQOJhetm3+jaVGp74=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.7.0.20210202173413-337fb17121a1/go.mod h1:CJJ5VAbozOl0yEw7nHB9+7BXTJbIn6h7W+f6Gau5IP8=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
Expand Down
Loading