Skip to content

Commit d3bf03d

Browse files
authored
feat(baremetal): add support for private network in v1 (#2573)
1 parent 8561404 commit d3bf03d

8 files changed

+425
-4
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Add a server to a private network.
4+
5+
USAGE:
6+
scw baremetal private-network add [arg=value ...]
7+
8+
ARGS:
9+
server-id The ID of the server
10+
private-network-id The 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-2 | nl-ams-1)
12+
13+
FLAGS:
14+
-h, --help help for add
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
Lines changed: 20 additions & 0 deletions
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 baremetal private-network delete [arg=value ...]
7+
8+
ARGS:
9+
server-id The ID of the server
10+
private-network-id The 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-2 | nl-ams-1)
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
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List the private networks of a server.
4+
5+
USAGE:
6+
scw baremetal private-network list [arg=value ...]
7+
8+
ARGS:
9+
[order-by] The 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+
[organization-id] Filter private networks by organization ID
14+
[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)
15+
16+
FLAGS:
17+
-h, --help help for list
18+
19+
GLOBAL FLAGS:
20+
-c, --config string The path to the config file
21+
-D, --debug Enable debug mode
22+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
23+
-p, --profile string The config profile to use
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Set multiple private networks on a server.
4+
5+
USAGE:
6+
scw baremetal private-network set [arg=value ...]
7+
8+
ARGS:
9+
server-id The ID of the server
10+
private-network-ids.{index} The IDs of the private networks
11+
[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)
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
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
A private network allows interconnecting your resources
4+
(servers, instances, ...) in an isolated and private
5+
network. The network reachability is limited to the
6+
resources that are on the same private network. A VLAN
7+
interface is available on the server and can be freely
8+
managed (adding IP addresses, shutdown interface...).
9+
10+
Note that a resource can be a part of multiple private networks.
11+
12+
USAGE:
13+
scw baremetal private-network <command>
14+
15+
AVAILABLE COMMANDS:
16+
add Add a server to a private network
17+
delete Delete a private network
18+
list List the private networks of a server
19+
set Set multiple private networks on a server
20+
21+
FLAGS:
22+
-h, --help help for private-network
23+
24+
GLOBAL FLAGS:
25+
-c, --config string The path to the config file
26+
-D, --debug Enable debug mode
27+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
28+
-p, --profile string The config profile to use
29+
30+
Use "scw baremetal private-network [command] --help" for more information about a command.

cmd/scw/testdata/test-all-usage-baremetal-usage.golden

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ USAGE:
66
scw baremetal <command>
77

88
AVAILABLE COMMANDS:
9-
bmc Baseboard Management Controller (BMC) management commands
10-
offer Server offer management commands
11-
os Operating System (OS) management commands
12-
server Server management commands
9+
bmc Baseboard Management Controller (BMC) management commands
10+
offer Server offer management commands
11+
os Operating System (OS) management commands
12+
private-network Private network management command
13+
server Server management commands
1314

1415
FLAGS:
1516
-h, --help help for baremetal

docs/commands/baremetal.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Elastic metal API
1212
- [Operating System (OS) management commands](#operating-system-(os)-management-commands)
1313
- [Get an OS with a given ID](#get-an-os-with-a-given-id)
1414
- [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)
15+
- [Private network management command](#private-network-management-command)
16+
- [Add a server to a private network](#add-a-server-to-a-private-network)
17+
- [Delete a private network](#delete-a-private-network)
18+
- [List the private networks of a server](#list-the-private-networks-of-a-server)
19+
- [Set multiple private networks on a server](#set-multiple-private-networks-on-a-server)
1520
- [Server management commands](#server-management-commands)
1621
- [Create an elastic metal server](#create-an-elastic-metal-server)
1722
- [Delete an elastic metal server](#delete-an-elastic-metal-server)
@@ -227,6 +232,106 @@ scw baremetal os list [arg=value ...]
227232

228233

229234

235+
## Private network management command
236+
237+
A private network allows interconnecting your resources
238+
(servers, instances, ...) in an isolated and private
239+
network. The network reachability is limited to the
240+
resources that are on the same private network. A VLAN
241+
interface is available on the server and can be freely
242+
managed (adding IP addresses, shutdown interface...).
243+
244+
Note that a resource can be a part of multiple private networks.
245+
246+
247+
248+
### Add a server to a private network
249+
250+
Add a server to a private network.
251+
252+
**Usage:**
253+
254+
```
255+
scw baremetal private-network add [arg=value ...]
256+
```
257+
258+
259+
**Args:**
260+
261+
| Name | | Description |
262+
|------|---|-------------|
263+
| server-id | Required | The ID of the server |
264+
| private-network-id | Required | The ID of the private network |
265+
| 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 |
266+
267+
268+
269+
### Delete a private network
270+
271+
Delete a private network.
272+
273+
**Usage:**
274+
275+
```
276+
scw baremetal private-network delete [arg=value ...]
277+
```
278+
279+
280+
**Args:**
281+
282+
| Name | | Description |
283+
|------|---|-------------|
284+
| server-id | Required | The ID of the server |
285+
| private-network-id | Required | The ID of the private network |
286+
| 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 |
287+
288+
289+
290+
### List the private networks of a server
291+
292+
List the private networks of a server.
293+
294+
**Usage:**
295+
296+
```
297+
scw baremetal private-network list [arg=value ...]
298+
```
299+
300+
301+
**Args:**
302+
303+
| Name | | Description |
304+
|------|---|-------------|
305+
| order-by | One of: `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc` | The sort order for the returned private networks |
306+
| server-id | | Filter private networks by server ID |
307+
| private-network-id | | Filter private networks by private network ID |
308+
| project-id | | Filter private networks by project ID |
309+
| organization-id | | Filter private networks by organization ID |
310+
| 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 |
311+
312+
313+
314+
### Set multiple private networks on a server
315+
316+
Set multiple private networks on a server.
317+
318+
**Usage:**
319+
320+
```
321+
scw baremetal private-network set [arg=value ...]
322+
```
323+
324+
325+
**Args:**
326+
327+
| Name | | Description |
328+
|------|---|-------------|
329+
| server-id | Required | The ID of the server |
330+
| private-network-ids.{index} | Required | The IDs of the private networks |
331+
| 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 |
332+
333+
334+
230335
## Server management commands
231336

232337
A server is a denomination of a type of instances provided by Scaleway

0 commit comments

Comments
 (0)