Skip to content

Commit

Permalink
feat(baremetal): add support for private network in v1 (#2573)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Nov 15, 2022
1 parent 8561404 commit d3bf03d
Show file tree
Hide file tree
Showing 8 changed files with 425 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Add a server to a private network.

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

ARGS:
server-id The ID of the server
private-network-id The 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-2 | nl-ams-1)

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 baremetal private-network delete [arg=value ...]

ARGS:
server-id The ID of the server
private-network-id The 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-2 | nl-ams-1)

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,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List the private networks of a server.

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

ARGS:
[order-by] The 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
[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-2 | nl-ams-1)

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️️ 🟥🟥🟥️
Set multiple private networks on a server.

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

ARGS:
server-id The ID of the server
private-network-ids.{index} The IDs of the private networks
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1)

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,30 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
A private network allows interconnecting your resources
(servers, instances, ...) in an isolated and private
network. The network reachability is limited to the
resources that are on the same private network. A VLAN
interface is available on the server and can be freely
managed (adding IP addresses, shutdown interface...).

Note that a resource can be a part of multiple private networks.

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

AVAILABLE COMMANDS:
bmc Baseboard Management Controller (BMC) management commands
offer Server offer management commands
os Operating System (OS) management commands
server Server management commands
bmc Baseboard Management Controller (BMC) management commands
offer Server offer management commands
os Operating System (OS) management commands
private-network Private network management command
server Server management commands

FLAGS:
-h, --help help for baremetal
Expand Down
105 changes: 105 additions & 0 deletions docs/commands/baremetal.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Elastic metal API
- [Operating System (OS) management commands](#operating-system-(os)-management-commands)
- [Get an OS with a given ID](#get-an-os-with-a-given-id)
- [List all available OS that can be install on an elastic metal server](#list-all-available-os-that-can-be-install-on-an-elastic-metal-server)
- [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)
- [Server management commands](#server-management-commands)
- [Create an elastic metal server](#create-an-elastic-metal-server)
- [Delete an elastic metal server](#delete-an-elastic-metal-server)
Expand Down Expand Up @@ -227,6 +232,106 @@ scw baremetal os list [arg=value ...]



## Private network management command

A private network allows interconnecting your resources
(servers, instances, ...) in an isolated and private
network. The network reachability is limited to the
resources that are on the same private network. A VLAN
interface is available on the server and can be freely
managed (adding IP addresses, shutdown interface...).

Note that a resource can be a part of multiple private networks.



### Add a server to a private network

Add a server to a private network.

**Usage:**

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


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | The ID of the server |
| private-network-id | Required | The ID of the private network |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |



### Delete a private network

Delete a private network.

**Usage:**

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


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | The ID of the server |
| private-network-id | Required | The ID of the private network |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1` | 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 a server.

**Usage:**

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


**Args:**

| Name | | Description |
|------|---|-------------|
| order-by | One of: `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc` | The 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 |
| organization-id | | Filter private networks by organization ID |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |



### Set multiple private networks on a server

Set multiple private networks on a server.

**Usage:**

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


**Args:**

| Name | | Description |
|------|---|-------------|
| server-id | Required | The ID of the server |
| private-network-ids.{index} | Required | The IDs of the private networks |
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1` | Zone to target. If none is passed will use default zone from the config |



## Server management commands

A server is a denomination of a type of instances provided by Scaleway
Expand Down
Loading

0 comments on commit d3bf03d

Please sign in to comment.