Skip to content

Commit

Permalink
feat(apple-silicon): add support for zone (#2303)
Browse files Browse the repository at this point in the history
Co-authored-by: Rémy Léone <rleone@scaleway.com>
  • Loading branch information
scaleway-bot and remyleone committed May 3, 2022
1 parent a14c349 commit 1942024
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ USAGE:
scw apple-silicon os get <os-id ...> [arg=value ...]

ARGS:
os-id UUID of the OS you want to get
os-id UUID of the OS you want to get
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ 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")
[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")
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARGS:
[name=<generated>] Create a server with this given name
[project-id] Project ID to use. If none is passed the default project ID will be used
[type=M1-M] Create a server of the given type
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ USAGE:
scw apple-silicon server delete <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to delete
server-id UUID of the server you want to delete
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ USAGE:
scw apple-silicon server get <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to get
server-id UUID of the server you want to get
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ USAGE:
scw apple-silicon server reboot <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to reboot
server-id UUID of the server you want to reboot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for reboot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ USAGE:
scw apple-silicon server reinstall <server-id ...> [arg=value ...]

ARGS:
server-id UUID of the server you want to reinstall
server-id UUID of the server you want to reinstall
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for reinstall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ USAGE:
scw apple-silicon server-type get <server-type ...> [arg=value ...]

ARGS:
server-type Server type identifier
server-type Server type identifier
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
List all server types technical details.

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

ARGS:
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ 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
server-id UUID of the server you want to update
name Updated name for your server
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-3)

FLAGS:
-h, --help help for update
Expand Down
19 changes: 18 additions & 1 deletion docs/commands/apple-silicon.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ scw apple-silicon os get <os-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| os-id | Required | UUID of the OS you want to get |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -72,6 +73,7 @@ scw apple-silicon os list [arg=value ...]
|------|---|-------------|
| 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") |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -98,6 +100,7 @@ scw apple-silicon server create [arg=value ...]
| name | Default: `<generated>` | Create a server with this given name |
| project-id | | Project ID to use. If none is passed the default project ID will be used |
| type | Default: `M1-M` | Create a server of the given type |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -117,6 +120,7 @@ scw apple-silicon server delete <server-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| server-id | Required | UUID of the server you want to delete |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -136,6 +140,7 @@ scw apple-silicon server get <server-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| server-id | Required | UUID of the server you want to get |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -157,6 +162,7 @@ scw apple-silicon server list [arg=value ...]
| order-by | One of: `created_at_asc`, `created_at_desc` | The sort order of the returned servers |
| project-id | | List only servers of this project ID |
| organization-id | | List only servers of this organization ID |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -176,6 +182,7 @@ scw apple-silicon server reboot <server-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| server-id | Required | UUID of the server you want to reboot |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -195,6 +202,7 @@ scw apple-silicon server reinstall <server-id ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| server-id | Required | UUID of the server you want to reinstall |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand Down Expand Up @@ -238,6 +246,7 @@ scw apple-silicon server update <name ...> [arg=value ...]
|------|---|-------------|
| server-id | Required | UUID of the server you want to update |
| name | Required | Updated name for your server |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand Down Expand Up @@ -292,6 +301,7 @@ scw apple-silicon server-type get <server-type ...> [arg=value ...]
| Name | | Description |
|------|---|-------------|
| server-type | Required | Server type identifier |
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



Expand All @@ -302,8 +312,15 @@ List all server types technical details.
**Usage:**

```
scw apple-silicon server-type list
scw apple-silicon server-type list [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| zone | Default: `fr-par-1`<br />One of: `fr-par-3` | Zone to target. If none is passed will use default zone from the config |



14 changes: 13 additions & 1 deletion internal/namespaces/applesilicon/v1alpha1/applesilicon_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ func appleSiliconServerTypeList() *core.Command {
Verb: "list",
// Deprecated: false,
ArgsType: reflect.TypeOf(applesilicon.ListServerTypesRequest{}),
ArgSpecs: core.ArgSpecs{},
ArgSpecs: core.ArgSpecs{
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.ListServerTypesRequest)

Expand Down Expand Up @@ -120,6 +122,7 @@ func appleSiliconServerTypeGet() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.GetServerTypeRequest)
Expand Down Expand Up @@ -159,6 +162,7 @@ func appleSiliconServerCreate() *core.Command {
Positional: false,
Default: core.DefaultValueSetter("M1-M"),
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.CreateServerRequest)
Expand Down Expand Up @@ -203,6 +207,7 @@ func appleSiliconServerList() *core.Command {
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.ListServersRequest)
Expand Down Expand Up @@ -243,6 +248,7 @@ func appleSiliconOsList() *core.Command {
Deprecated: false,
Positional: false,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.ListOSRequest)
Expand Down Expand Up @@ -276,6 +282,7 @@ func appleSiliconOsGet() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.GetOSRequest)
Expand Down Expand Up @@ -305,6 +312,7 @@ func appleSiliconServerGet() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.GetServerRequest)
Expand Down Expand Up @@ -341,6 +349,7 @@ func appleSiliconServerUpdate() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.UpdateServerRequest)
Expand Down Expand Up @@ -370,6 +379,7 @@ func appleSiliconServerDelete() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.DeleteServerRequest)
Expand Down Expand Up @@ -405,6 +415,7 @@ func appleSiliconServerReboot() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.RebootServerRequest)
Expand Down Expand Up @@ -434,6 +445,7 @@ func appleSiliconServerReinstall() *core.Command {
Deprecated: false,
Positional: true,
},
core.ZoneArgSpec(scw.ZoneFrPar3),
},
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {
request := args.(*applesilicon.ReinstallServerRequest)
Expand Down

0 comments on commit 1942024

Please sign in to comment.