Skip to content

Commit

Permalink
feate(applesilicon): enable vpc option
Browse files Browse the repository at this point in the history
  • Loading branch information
Laure-di committed Jan 27, 2025
1 parent 9850cc4 commit 9eb7f50
Show file tree
Hide file tree
Showing 10 changed files with 442 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Add an Apple silicon server to a Private Network.

USAGE:
scw apple-silicon private-network add [arg=value ...]

ARGS:
server-id ID of the server
private-network-id ID of the Private Network
[ipam-ip-ids.{index}] IPAM IDs of IPs to attach to the server
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-3)

FLAGS:
-h, --help help for add

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️️ 🟥🟥🟥️
Delete a Private Network.

USAGE:
scw apple-silicon private-network delete [arg=value ...]

ARGS:
server-id ID of the server
private-network-id ID of the Private Network
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-3)

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,24 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List the Private Networks of an Apple silicon server.

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

ARGS:
[order-by] Sort order for the returned Private Networks (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc)
[server-id] Filter Private Networks by server ID
[private-network-id] Filter Private Networks by Private Network ID
[project-id] Filter Private Networks by Project ID
[ipam-ip-ids.{index}] Filter Private Networks by IPAM IP IDs
[organization-id] Filter Private Networks by Organization ID
[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)

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,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Configure multiple Private Networks on an Apple silicon server.

USAGE:
scw apple-silicon private-network set [arg=value ...]

ARGS:
server-id ID of the server
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.
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-3)

FLAGS:
-h, --help help for set

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,28 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
A Private Network allows you to interconnect your resources
in an isolated and private
network. Network reachability is limited to the
resources that are in the same VPC.

Note that a resource can be a part of multiple Private Networks.

USAGE:
scw apple-silicon private-network <command>

AVAILABLE COMMANDS:
add Add a server to a Private Network
delete Delete a Private Network
list List the Private Networks of a server
set Set multiple Private Networks on a server

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 apple-silicon private-network [command] --help" for more information about a command.
7 changes: 4 additions & 3 deletions cmd/scw/testdata/test-all-usage-apple-silicon-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ USAGE:
scw apple-silicon <command>

AVAILABLE COMMANDS:
os OS management commands
server Apple silicon management commands
server-type Server-Types management commands
os OS management commands
private-network Private network management command
server Apple silicon management commands
server-type Server-Types management commands

FLAGS:
-h, --help help for apple-silicon
Expand Down
104 changes: 104 additions & 0 deletions docs/commands/apple-silicon.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ Apple silicon API.
- [OS management commands](#os-management-commands)
- [Get an Operating System (OS)](#get-an-operating-system-(os))
- [List all Operating Systems (OS)](#list-all-operating-systems-(os))
- [Private network management command](#private-network-management-command)
- [Add a server to a Private Network](#add-a-server-to-a-private-network)
- [Delete a Private Network](#delete-a-private-network)
- [List the Private Networks of a server](#list-the-private-networks-of-a-server)
- [Set multiple Private Networks on a server](#set-multiple-private-networks-on-a-server)
- [Apple silicon management commands](#apple-silicon-management-commands)
- [Create a server](#create-a-server)
- [Delete a server](#delete-a-server)
Expand Down Expand Up @@ -66,6 +71,105 @@ scw apple-silicon os list [arg=value ...]



## Private network management command

A Private Network allows you to interconnect your resources
in an isolated and private
network. Network reachability is limited to the
resources that are in the same VPC.

Note that a resource can be a part of multiple Private Networks.


### Add a server to a Private Network

Add an Apple silicon server to a Private Network.

**Usage:**

```
scw apple-silicon private-network add [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | ID of the server |
| private-network-id | Required | ID of the Private Network |
| ipam-ip-ids.{index} | | IPAM IDs of IPs to attach to the server |
| 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 |



### Delete a Private Network

Delete a Private Network.

**Usage:**

```
scw apple-silicon private-network delete [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | ID of the server |
| private-network-id | Required | ID of the Private Network |
| 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 |



### List the Private Networks of a server

List the Private Networks of an Apple silicon server.

**Usage:**

```
scw apple-silicon private-network list [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| order-by | One of: `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc` | Sort order for the returned Private Networks |
| server-id | | Filter Private Networks by server ID |
| private-network-id | | Filter Private Networks by Private Network ID |
| project-id | | Filter Private Networks by Project ID |
| ipam-ip-ids.{index} | | Filter Private Networks by IPAM IP IDs |
| organization-id | | Filter Private Networks by Organization ID |
| 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 |



### Set multiple Private Networks on a server

Configure multiple Private Networks on an Apple silicon server.

**Usage:**

```
scw apple-silicon private-network set [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | ID of the server |
| 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. |
| 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 |



## Apple silicon management commands

Apple silicon management commands.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/mattn/go-isatty v0.0.20
github.com/moby/buildkit v0.13.2
github.com/opencontainers/go-digest v1.0.0
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250115142435-07825390847c
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.8.1
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 @@ -463,8 +463,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250115142435-07825390847c h1:zn2PUSZUy/YS1oVV03pAGH6IB+gjxHxCyc/+KoRehUI=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250115142435-07825390847c/go.mod h1:kzh+BSAvpoyHHdHBCDhmSWtBc1NbLMZ2lWHqnBoxFks=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d h1:npDtKGreHq1EA6DoHo18YG25bsvZVlo4XlNm822GZ7A=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20250117133139-e360c98f921d/go.mod h1:kzh+BSAvpoyHHdHBCDhmSWtBc1NbLMZ2lWHqnBoxFks=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
Expand Down
Loading

0 comments on commit 9eb7f50

Please sign in to comment.