Skip to content

Commit b1a2323

Browse files
authored
feat(baremetal): expose BatchCreateServers into cli (#5488)
1 parent 01c789f commit b1a2323

4 files changed

Lines changed: 412 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create multiple new Elastic Metal servers. Once the servers are created, proceed with the [installation of an OS](#post-3e949e).
4+
5+
USAGE:
6+
scw baremetal server batch-create [arg=value ...]
7+
8+
ARGS:
9+
[common-configuration.offer-id] Offer ID of the new server
10+
[common-configuration.project-id] Project ID with which the server will be created
11+
[common-configuration.name] Name of the server (≠hostname)
12+
[common-configuration.description] Description associated with the server, max 255 characters
13+
[common-configuration.tags.{index}] Tags to associate to the server
14+
[common-configuration.install.os-id] ID of the OS to installation on the server
15+
[common-configuration.install.hostname] Hostname of the server
16+
[common-configuration.install.ssh-key-ids.{index}] SSH key IDs authorized on the server
17+
[common-configuration.install.user] User for the installation
18+
[common-configuration.install.password] Password for the installation
19+
[common-configuration.install.service-user] Regular user that runs the service to be installed on the server
20+
[common-configuration.install.service-password] Password used for the service to install
21+
[common-configuration.install.partitioning-schema.disks.{index}.device]
22+
[common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
23+
[common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.number]
24+
[common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.size]
25+
[common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space]
26+
[common-configuration.install.partitioning-schema.raids.{index}.name]
27+
[common-configuration.install.partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
28+
[common-configuration.install.partitioning-schema.raids.{index}.devices.{index}]
29+
[common-configuration.install.partitioning-schema.filesystems.{index}.device]
30+
[common-configuration.install.partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
31+
[common-configuration.install.partitioning-schema.filesystems.{index}.mountpoint]
32+
[common-configuration.install.partitioning-schema.zfs.pools.{index}.name]
33+
[common-configuration.install.partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
34+
[common-configuration.install.partitioning-schema.zfs.pools.{index}.devices.{index}]
35+
[common-configuration.install.partitioning-schema.zfs.pools.{index}.options.{index}]
36+
[common-configuration.install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
37+
[common-configuration.option-ids.{index}] IDs of options to enable on server
38+
[common-configuration.protected] If enabled, the server can not be deleted
39+
[common-configuration.user-data] Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script
40+
[common-configuration.zone]
41+
[servers.{index}.hostname]
42+
[servers.{index}.description]
43+
[servers.{index}.tags.{index}]
44+
[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 | nl-ams-2 | pl-waw-2 | pl-waw-3)
45+
46+
DEPRECATED ARGS:
47+
[common-configuration.organization-id] Organization ID with which the server will be created
48+
49+
FLAGS:
50+
-h, --help help for batch-create
51+
--list-sub-commands List all subcommands
52+
53+
GLOBAL FLAGS:
54+
-c, --config string The path to the config file
55+
-D, --debug Enable debug mode
56+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
57+
-p, --profile string The config profile to use

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ USAGE:
66
scw baremetal server <command>
77

88
AVAILABLE COMMANDS:
9+
batch-create Create multiple Elastic Metal servers
910
create Create an Elastic Metal server
1011
delete Delete an Elastic Metal server
1112
get Get a specific Elastic Metal server

docs/commands/baremetal.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Elastic Metal - Private Networks API.
2525
- [Set multiple Private Networks on a server](#set-multiple-private-networks-on-a-server)
2626
- [Server management commands](#server-management-commands)
2727
- [Attach a new flexible IP to a server](#attach-a-new-flexible-ip-to-a-server)
28+
- [Create multiple Elastic Metal servers](#create-multiple-elastic-metal-servers)
2829
- [Create an Elastic Metal server](#create-an-elastic-metal-server)
2930
- [Delete an Elastic Metal server](#delete-an-elastic-metal-server)
3031
- [Get a specific Elastic Metal server](#get-a-specific-elastic-metal-server)
@@ -520,6 +521,61 @@ scw baremetal server add-flexible-ip <server-id ...> [arg=value ...]
520521

521522

522523

524+
### Create multiple Elastic Metal servers
525+
526+
Create multiple new Elastic Metal servers. Once the servers are created, proceed with the [installation of an OS](#post-3e949e).
527+
528+
**Usage:**
529+
530+
```
531+
scw baremetal server batch-create [arg=value ...]
532+
```
533+
534+
535+
**Args:**
536+
537+
| Name | | Description |
538+
|------|---|-------------|
539+
| common-configuration.offer-id | | Offer ID of the new server |
540+
| common-configuration.project-id | | Project ID with which the server will be created |
541+
| common-configuration.name | | Name of the server (≠hostname) |
542+
| common-configuration.description | | Description associated with the server, max 255 characters |
543+
| common-configuration.tags.{index} | | Tags to associate to the server |
544+
| common-configuration.install.os-id | | ID of the OS to installation on the server |
545+
| common-configuration.install.hostname | | Hostname of the server |
546+
| common-configuration.install.ssh-key-ids.{index} | | SSH key IDs authorized on the server |
547+
| common-configuration.install.user | | User for the installation |
548+
| common-configuration.install.password | | Password for the installation |
549+
| common-configuration.install.service-user | | Regular user that runs the service to be installed on the server |
550+
| common-configuration.install.service-password | | Password used for the service to install |
551+
| common-configuration.install.partitioning-schema.disks.{index}.device | | |
552+
| common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.label | One of: `unknown_partition_label`, `uefi`, `legacy`, `root`, `boot`, `swap`, `data`, `home`, `raid`, `zfs` | |
553+
| common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.number | | |
554+
| common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.size | | |
555+
| common-configuration.install.partitioning-schema.disks.{index}.partitions.{index}.use-all-available-space | | |
556+
| common-configuration.install.partitioning-schema.raids.{index}.name | | |
557+
| common-configuration.install.partitioning-schema.raids.{index}.level | One of: `unknown_raid_level`, `raid_level_0`, `raid_level_1`, `raid_level_5`, `raid_level_6`, `raid_level_10` | |
558+
| common-configuration.install.partitioning-schema.raids.{index}.devices.{index} | | |
559+
| common-configuration.install.partitioning-schema.filesystems.{index}.device | | |
560+
| common-configuration.install.partitioning-schema.filesystems.{index}.format | One of: `unknown_format`, `fat32`, `ext4`, `swap`, `zfs`, `xfs` | |
561+
| common-configuration.install.partitioning-schema.filesystems.{index}.mountpoint | | |
562+
| common-configuration.install.partitioning-schema.zfs.pools.{index}.name | | |
563+
| common-configuration.install.partitioning-schema.zfs.pools.{index}.type | One of: `unknown_type`, `no_raid`, `mirror`, `raidz1`, `raidz2` | |
564+
| common-configuration.install.partitioning-schema.zfs.pools.{index}.devices.{index} | | |
565+
| common-configuration.install.partitioning-schema.zfs.pools.{index}.options.{index} | | |
566+
| common-configuration.install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index} | | |
567+
| common-configuration.option-ids.{index} | | IDs of options to enable on server |
568+
| common-configuration.protected | | If enabled, the server can not be deleted |
569+
| common-configuration.user-data | | Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script |
570+
| ~~common-configuration.organization-id~~ | Deprecated | Organization ID with which the server will be created |
571+
| common-configuration.zone | | |
572+
| servers.{index}.hostname | | |
573+
| servers.{index}.description | | |
574+
| servers.{index}.tags.{index} | | |
575+
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-2`, `pl-waw-3` | Zone to target. If none is passed will use default zone from the config |
576+
577+
578+
523579
### Create an Elastic Metal server
524580

525581
Create a new Elastic Metal server. Once the server is created, proceed with the [installation of an OS](#post-3e949e).

0 commit comments

Comments
 (0)