Skip to content

Commit 0859838

Browse files
authored
feat(applesilicon): add support for vpc (#4462)
1 parent 9850cc4 commit 0859838

10 files changed

+442
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Add an Apple silicon server to a Private Network.
4+
5+
USAGE:
6+
scw apple-silicon private-network add [arg=value ...]
7+
8+
ARGS:
9+
server-id ID of the server
10+
private-network-id ID of the Private Network
11+
[ipam-ip-ids.{index}] IPAM IDs of IPs to attach to the server
12+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-3)
13+
14+
FLAGS:
15+
-h, --help help for add
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete a Private Network.
4+
5+
USAGE:
6+
scw apple-silicon private-network delete [arg=value ...]
7+
8+
ARGS:
9+
server-id ID of the server
10+
private-network-id ID of the Private Network
11+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-3)
12+
13+
FLAGS:
14+
-h, --help help for delete
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List the Private Networks of an Apple silicon server.
4+
5+
USAGE:
6+
scw apple-silicon private-network list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] Sort order for the returned Private Networks (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
10+
[server-id] Filter Private Networks by server ID
11+
[private-network-id] Filter Private Networks by Private Network ID
12+
[project-id] Filter Private Networks by Project ID
13+
[ipam-ip-ids.{index}] Filter Private Networks by IPAM IP IDs
14+
[organization-id] Filter Private Networks by Organization ID
15+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-3 | all)
16+
17+
FLAGS:
18+
-h, --help help for list
19+
20+
GLOBAL FLAGS:
21+
-c, --config string The path to the config file
22+
-D, --debug Enable debug mode
23+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
24+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Configure multiple Private Networks on an Apple silicon server.
4+
5+
USAGE:
6+
scw apple-silicon private-network set [arg=value ...]
7+
8+
ARGS:
9+
server-id ID of the server
10+
per-private-network-ipam-ip-ids.{key} Object where the keys are the IDs of Private Networks and the values are arrays of IPAM IDs representing the IPs to assign to this Apple silicon server on the Private Network. If the array supplied for a Private Network is empty, the next available IP from the Private Network's CIDR block will automatically be used for attachment.
11+
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-3)
12+
13+
FLAGS:
14+
-h, --help help for set
15+
16+
GLOBAL FLAGS:
17+
-c, --config string The path to the config file
18+
-D, --debug Enable debug mode
19+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
20+
-p, --profile string The config profile to use
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
A Private Network allows you to interconnect your resources
4+
in an isolated and private
5+
network. Network reachability is limited to the
6+
resources that are in the same VPC.
7+
8+
Note that a resource can be a part of multiple Private Networks.
9+
10+
USAGE:
11+
scw apple-silicon private-network <command>
12+
13+
AVAILABLE COMMANDS:
14+
add Add a server to a Private Network
15+
delete Delete a Private Network
16+
list List the Private Networks of a server
17+
set Set multiple Private Networks on a server
18+
19+
FLAGS:
20+
-h, --help help for private-network
21+
22+
GLOBAL FLAGS:
23+
-c, --config string The path to the config file
24+
-D, --debug Enable debug mode
25+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
26+
-p, --profile string The config profile to use
27+
28+
Use "scw apple-silicon private-network [command] --help" for more information about a command.

cmd/scw/testdata/test-all-usage-apple-silicon-usage.golden

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ USAGE:
66
scw apple-silicon <command>
77

88
AVAILABLE COMMANDS:
9-
os OS management commands
10-
server Apple silicon management commands
11-
server-type Server-Types management commands
9+
os OS management commands
10+
private-network Private network management command
11+
server Apple silicon management commands
12+
server-type Server-Types management commands
1213

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

docs/commands/apple-silicon.md

+104
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Apple silicon API.
55
- [OS management commands](#os-management-commands)
66
- [Get an Operating System (OS)](#get-an-operating-system-(os))
77
- [List all Operating Systems (OS)](#list-all-operating-systems-(os))
8+
- [Private network management command](#private-network-management-command)
9+
- [Add a server to a Private Network](#add-a-server-to-a-private-network)
10+
- [Delete a Private Network](#delete-a-private-network)
11+
- [List the Private Networks of a server](#list-the-private-networks-of-a-server)
12+
- [Set multiple Private Networks on a server](#set-multiple-private-networks-on-a-server)
813
- [Apple silicon management commands](#apple-silicon-management-commands)
914
- [Create a server](#create-a-server)
1015
- [Delete a server](#delete-a-server)
@@ -66,6 +71,105 @@ scw apple-silicon os list [arg=value ...]
6671

6772

6873

74+
## Private network management command
75+
76+
A Private Network allows you to interconnect your resources
77+
in an isolated and private
78+
network. Network reachability is limited to the
79+
resources that are in the same VPC.
80+
81+
Note that a resource can be a part of multiple Private Networks.
82+
83+
84+
### Add a server to a Private Network
85+
86+
Add an Apple silicon server to a Private Network.
87+
88+
**Usage:**
89+
90+
```
91+
scw apple-silicon private-network add [arg=value ...]
92+
```
93+
94+
95+
**Args:**
96+
97+
| Name | | Description |
98+
|------|---|-------------|
99+
| server-id | Required | ID of the server |
100+
| private-network-id | Required | ID of the Private Network |
101+
| ipam-ip-ids.{index} | | IPAM IDs of IPs to attach to the server |
102+
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-3` | Zone to target. If none is passed will use default zone from the config |
103+
104+
105+
106+
### Delete a Private Network
107+
108+
Delete a Private Network.
109+
110+
**Usage:**
111+
112+
```
113+
scw apple-silicon private-network delete [arg=value ...]
114+
```
115+
116+
117+
**Args:**
118+
119+
| Name | | Description |
120+
|------|---|-------------|
121+
| server-id | Required | ID of the server |
122+
| private-network-id | Required | ID of the Private Network |
123+
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-3` | Zone to target. If none is passed will use default zone from the config |
124+
125+
126+
127+
### List the Private Networks of a server
128+
129+
List the Private Networks of an Apple silicon server.
130+
131+
**Usage:**
132+
133+
```
134+
scw apple-silicon private-network list [arg=value ...]
135+
```
136+
137+
138+
**Args:**
139+
140+
| Name | | Description |
141+
|------|---|-------------|
142+
| order-by | One of: `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc` | Sort order for the returned Private Networks |
143+
| server-id | | Filter Private Networks by server ID |
144+
| private-network-id | | Filter Private Networks by Private Network ID |
145+
| project-id | | Filter Private Networks by Project ID |
146+
| ipam-ip-ids.{index} | | Filter Private Networks by IPAM IP IDs |
147+
| organization-id | | Filter Private Networks by Organization ID |
148+
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-3`, `all` | Zone to target. If none is passed will use default zone from the config |
149+
150+
151+
152+
### Set multiple Private Networks on a server
153+
154+
Configure multiple Private Networks on an Apple silicon server.
155+
156+
**Usage:**
157+
158+
```
159+
scw apple-silicon private-network set [arg=value ...]
160+
```
161+
162+
163+
**Args:**
164+
165+
| Name | | Description |
166+
|------|---|-------------|
167+
| server-id | Required | ID of the server |
168+
| per-private-network-ipam-ip-ids.{key} | Required | Object where the keys are the IDs of Private Networks and the values are arrays of IPAM IDs representing the IPs to assign to this Apple silicon server on the Private Network. If the array supplied for a Private Network is empty, the next available IP from the Private Network's CIDR block will automatically be used for attachment. |
169+
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-3` | Zone to target. If none is passed will use default zone from the config |
170+
171+
172+
69173
## Apple silicon management commands
70174

71175
Apple silicon management commands.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ require (
2626
github.com/mattn/go-isatty v0.0.20
2727
github.com/moby/buildkit v0.13.2
2828
github.com/opencontainers/go-digest v1.0.0
29-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250115142435-07825390847c
29+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d
3030
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3131
github.com/spf13/cobra v1.8.1
3232
github.com/spf13/pflag v1.0.5

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
463463
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
464464
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
465465
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
466-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250115142435-07825390847c h1:zn2PUSZUy/YS1oVV03pAGH6IB+gjxHxCyc/+KoRehUI=
467-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250115142435-07825390847c/go.mod h1:kzh+BSAvpoyHHdHBCDhmSWtBc1NbLMZ2lWHqnBoxFks=
466+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d h1:npDtKGreHq1EA6DoHo18YG25bsvZVlo4XlNm822GZ7A=
467+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d/go.mod h1:kzh+BSAvpoyHHdHBCDhmSWtBc1NbLMZ2lWHqnBoxFks=
468468
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
469469
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
470470
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

0 commit comments

Comments
 (0)