Skip to content

Commit 3e0ef52

Browse files
authored
chore(baremetal): add missing localities and generate SDK for BMaaS-PN v3 (#4157)
1 parent 99e4b05 commit 3e0ef52

File tree

8 files changed

+277
-27
lines changed

8 files changed

+277
-27
lines changed

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

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,36 @@ EXAMPLES:
1010
scw baremetal server create
1111

1212
ARGS:
13-
[project-id] Project ID to use. If none is passed the default project ID will be used
14-
name=<generated> Name of the server (≠hostname)
15-
[description] Description associated with the server, max 255 characters
16-
[type] Server commercial type
17-
[tags.{index}] Tags to associate to the server
18-
[install.os-id] ID of the OS to installation on the server
19-
[install.hostname] Hostname of the server
20-
[install.ssh-key-ids.{index}] SSH key IDs authorized on the server
21-
[install.user] User for the installation
22-
[install.password] Password for the installation
23-
[install.service-user] Regular user that runs the service to be installed on the server
24-
[install.service-password] Password used for the service to install
25-
[option-ids.{index}] IDs of options to enable on server
26-
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
27-
[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)
13+
[project-id] Project ID to use. If none is passed the default project ID will be used
14+
name=<generated> Name of the server (≠hostname)
15+
[description] Description associated with the server, max 255 characters
16+
[type] Server commercial type
17+
[tags.{index}] Tags to associate to the server
18+
[install.os-id] ID of the OS to installation on the server
19+
[install.hostname] Hostname of the server
20+
[install.ssh-key-ids.{index}] SSH key IDs authorized on the server
21+
[install.user] User for the installation
22+
[install.password] Password for the installation
23+
[install.service-user] Regular user that runs the service to be installed on the server
24+
[install.service-password] Password used for the service to install
25+
[install.partitioning-schema.disks.{index}.device]
26+
[install.partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
27+
[install.partitioning-schema.disks.{index}.partitions.{index}.number]
28+
[install.partitioning-schema.disks.{index}.partitions.{index}.size]
29+
[install.partitioning-schema.raids.{index}.name]
30+
[install.partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
31+
[install.partitioning-schema.raids.{index}.devices.{index}]
32+
[install.partitioning-schema.filesystems.{index}.device]
33+
[install.partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
34+
[install.partitioning-schema.filesystems.{index}.mountpoint]
35+
[install.partitioning-schema.zfs.pools.{index}.name]
36+
[install.partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
37+
[install.partitioning-schema.zfs.pools.{index}.devices.{index}]
38+
[install.partitioning-schema.zfs.pools.{index}.options.{index}]
39+
[install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
40+
[option-ids.{index}] IDs of options to enable on server
41+
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
42+
[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)
2843

2944
FLAGS:
3045
-h, --help help for create

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,28 @@ ARGS:
1414
os-id ID of the OS to installation on the server
1515
hostname Hostname of the server
1616
ssh (one of):
17-
[all-ssh-keys] Add all SSH keys on your baremetal instance (cannot be used with ssh-key-ids)
18-
ssh-key-ids.{index} SSH key IDs authorized on the server (cannot be used with all-ssh-keys)
19-
[user] User used for the installation
20-
[password] Password used for the installation
21-
[service-user] User used for the service to install
22-
[service-password] Password used for the service to install
23-
[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)
17+
[all-ssh-keys] Add all SSH keys on your baremetal instance (cannot be used with ssh-key-ids)
18+
ssh-key-ids.{index} SSH key IDs authorized on the server (cannot be used with all-ssh-keys)
19+
[user] User used for the installation
20+
[password] Password used for the installation
21+
[service-user] User used for the service to install
22+
[service-password] Password used for the service to install
23+
[partitioning-schema.disks.{index}.device]
24+
[partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
25+
[partitioning-schema.disks.{index}.partitions.{index}.number]
26+
[partitioning-schema.disks.{index}.partitions.{index}.size]
27+
[partitioning-schema.raids.{index}.name]
28+
[partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
29+
[partitioning-schema.raids.{index}.devices.{index}]
30+
[partitioning-schema.filesystems.{index}.device]
31+
[partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
32+
[partitioning-schema.filesystems.{index}.mountpoint]
33+
[partitioning-schema.zfs.pools.{index}.name]
34+
[partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
35+
[partitioning-schema.zfs.pools.{index}.devices.{index}]
36+
[partitioning-schema.zfs.pools.{index}.options.{index}]
37+
[partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
38+
[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)
2439

2540
FLAGS:
2641
-h, --help help for install

docs/commands/baremetal.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,21 @@ scw baremetal server create [arg=value ...]
545545
| install.password | | Password for the installation |
546546
| install.service-user | | Regular user that runs the service to be installed on the server |
547547
| install.service-password | | Password used for the service to install |
548+
| install.partitioning-schema.disks.{index}.device | | |
549+
| install.partitioning-schema.disks.{index}.partitions.{index}.label | One of: `unknown_partition_label`, `uefi`, `legacy`, `root`, `boot`, `swap`, `data`, `home`, `raid`, `zfs` | |
550+
| install.partitioning-schema.disks.{index}.partitions.{index}.number | | |
551+
| install.partitioning-schema.disks.{index}.partitions.{index}.size | | |
552+
| install.partitioning-schema.raids.{index}.name | | |
553+
| 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` | |
554+
| install.partitioning-schema.raids.{index}.devices.{index} | | |
555+
| install.partitioning-schema.filesystems.{index}.device | | |
556+
| install.partitioning-schema.filesystems.{index}.format | One of: `unknown_format`, `fat32`, `ext4`, `swap`, `zfs`, `xfs` | |
557+
| install.partitioning-schema.filesystems.{index}.mountpoint | | |
558+
| install.partitioning-schema.zfs.pools.{index}.name | | |
559+
| install.partitioning-schema.zfs.pools.{index}.type | One of: `unknown_type`, `no_raid`, `mirror`, `raidz1`, `raidz2` | |
560+
| install.partitioning-schema.zfs.pools.{index}.devices.{index} | | |
561+
| install.partitioning-schema.zfs.pools.{index}.options.{index} | | |
562+
| install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index} | | |
548563
| option-ids.{index} | | IDs of options to enable on server |
549564
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
550565
| 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 |
@@ -665,6 +680,21 @@ scw baremetal server install <server-id ...> [arg=value ...]
665680
| password | | Password used for the installation |
666681
| service-user | | User used for the service to install |
667682
| service-password | | Password used for the service to install |
683+
| partitioning-schema.disks.{index}.device | | |
684+
| partitioning-schema.disks.{index}.partitions.{index}.label | One of: `unknown_partition_label`, `uefi`, `legacy`, `root`, `boot`, `swap`, `data`, `home`, `raid`, `zfs` | |
685+
| partitioning-schema.disks.{index}.partitions.{index}.number | | |
686+
| partitioning-schema.disks.{index}.partitions.{index}.size | | |
687+
| partitioning-schema.raids.{index}.name | | |
688+
| 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` | |
689+
| partitioning-schema.raids.{index}.devices.{index} | | |
690+
| partitioning-schema.filesystems.{index}.device | | |
691+
| partitioning-schema.filesystems.{index}.format | One of: `unknown_format`, `fat32`, `ext4`, `swap`, `zfs`, `xfs` | |
692+
| partitioning-schema.filesystems.{index}.mountpoint | | |
693+
| partitioning-schema.zfs.pools.{index}.name | | |
694+
| partitioning-schema.zfs.pools.{index}.type | One of: `unknown_type`, `no_raid`, `mirror`, `raidz1`, `raidz2` | |
695+
| partitioning-schema.zfs.pools.{index}.devices.{index} | | |
696+
| partitioning-schema.zfs.pools.{index}.options.{index} | | |
697+
| partitioning-schema.zfs.pools.{index}.filesystem-options.{index} | | |
668698
| 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 |
669699

670700

go.mod

Lines changed: 1 addition & 1 deletion
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.20241001085744-c3abf300c911
29+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241003135237-a80efc7ba222
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
465465
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
466466
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
467467
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
468-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241001085744-c3abf300c911 h1:IwmIIQaLdCx38LeWFIJqNqF8qHTCEdSecY5k5D5LI0k=
469-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241001085744-c3abf300c911/go.mod h1:o/2twhmcz4HlhtuuubCuwQ/fe+zyzoJR85+02gy04yY=
468+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241003135237-a80efc7ba222 h1:lr/Ewp6Ph3cXaEAyaPJqT7ZvC/wBnm1VoRHVz1FqOkM=
469+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.30.0.20241003135237-a80efc7ba222/go.mod h1:o/2twhmcz4HlhtuuubCuwQ/fe+zyzoJR85+02gy04yY=
470470
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
471471
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
472472
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=

internal/namespaces/baremetal/v1/baremetal_cli.go

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,100 @@ func baremetalServerCreate() *core.Command {
363363
Deprecated: false,
364364
Positional: false,
365365
},
366+
{
367+
Name: "install.partitioning-schema.disks.{index}.device",
368+
Required: false,
369+
Deprecated: false,
370+
Positional: false,
371+
},
372+
{
373+
Name: "install.partitioning-schema.disks.{index}.partitions.{index}.label",
374+
Required: false,
375+
Deprecated: false,
376+
Positional: false,
377+
EnumValues: []string{"unknown_partition_label", "uefi", "legacy", "root", "boot", "swap", "data", "home", "raid", "zfs"},
378+
},
379+
{
380+
Name: "install.partitioning-schema.disks.{index}.partitions.{index}.number",
381+
Required: false,
382+
Deprecated: false,
383+
Positional: false,
384+
},
385+
{
386+
Name: "install.partitioning-schema.disks.{index}.partitions.{index}.size",
387+
Required: false,
388+
Deprecated: false,
389+
Positional: false,
390+
},
391+
{
392+
Name: "install.partitioning-schema.raids.{index}.name",
393+
Required: false,
394+
Deprecated: false,
395+
Positional: false,
396+
},
397+
{
398+
Name: "install.partitioning-schema.raids.{index}.level",
399+
Required: false,
400+
Deprecated: false,
401+
Positional: false,
402+
EnumValues: []string{"unknown_raid_level", "raid_level_0", "raid_level_1", "raid_level_5", "raid_level_6", "raid_level_10"},
403+
},
404+
{
405+
Name: "install.partitioning-schema.raids.{index}.devices.{index}",
406+
Required: false,
407+
Deprecated: false,
408+
Positional: false,
409+
},
410+
{
411+
Name: "install.partitioning-schema.filesystems.{index}.device",
412+
Required: false,
413+
Deprecated: false,
414+
Positional: false,
415+
},
416+
{
417+
Name: "install.partitioning-schema.filesystems.{index}.format",
418+
Required: false,
419+
Deprecated: false,
420+
Positional: false,
421+
EnumValues: []string{"unknown_format", "fat32", "ext4", "swap", "zfs", "xfs"},
422+
},
423+
{
424+
Name: "install.partitioning-schema.filesystems.{index}.mountpoint",
425+
Required: false,
426+
Deprecated: false,
427+
Positional: false,
428+
},
429+
{
430+
Name: "install.partitioning-schema.zfs.pools.{index}.name",
431+
Required: false,
432+
Deprecated: false,
433+
Positional: false,
434+
},
435+
{
436+
Name: "install.partitioning-schema.zfs.pools.{index}.type",
437+
Required: false,
438+
Deprecated: false,
439+
Positional: false,
440+
EnumValues: []string{"unknown_type", "no_raid", "mirror", "raidz1", "raidz2"},
441+
},
442+
{
443+
Name: "install.partitioning-schema.zfs.pools.{index}.devices.{index}",
444+
Required: false,
445+
Deprecated: false,
446+
Positional: false,
447+
},
448+
{
449+
Name: "install.partitioning-schema.zfs.pools.{index}.options.{index}",
450+
Required: false,
451+
Deprecated: false,
452+
Positional: false,
453+
},
454+
{
455+
Name: "install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index}",
456+
Required: false,
457+
Deprecated: false,
458+
Positional: false,
459+
},
366460
{
367461
Name: "option-ids.{index}",
368462
Short: `IDs of options to enable on server`,
@@ -507,6 +601,100 @@ func baremetalServerInstall() *core.Command {
507601
Deprecated: false,
508602
Positional: false,
509603
},
604+
{
605+
Name: "partitioning-schema.disks.{index}.device",
606+
Required: false,
607+
Deprecated: false,
608+
Positional: false,
609+
},
610+
{
611+
Name: "partitioning-schema.disks.{index}.partitions.{index}.label",
612+
Required: false,
613+
Deprecated: false,
614+
Positional: false,
615+
EnumValues: []string{"unknown_partition_label", "uefi", "legacy", "root", "boot", "swap", "data", "home", "raid", "zfs"},
616+
},
617+
{
618+
Name: "partitioning-schema.disks.{index}.partitions.{index}.number",
619+
Required: false,
620+
Deprecated: false,
621+
Positional: false,
622+
},
623+
{
624+
Name: "partitioning-schema.disks.{index}.partitions.{index}.size",
625+
Required: false,
626+
Deprecated: false,
627+
Positional: false,
628+
},
629+
{
630+
Name: "partitioning-schema.raids.{index}.name",
631+
Required: false,
632+
Deprecated: false,
633+
Positional: false,
634+
},
635+
{
636+
Name: "partitioning-schema.raids.{index}.level",
637+
Required: false,
638+
Deprecated: false,
639+
Positional: false,
640+
EnumValues: []string{"unknown_raid_level", "raid_level_0", "raid_level_1", "raid_level_5", "raid_level_6", "raid_level_10"},
641+
},
642+
{
643+
Name: "partitioning-schema.raids.{index}.devices.{index}",
644+
Required: false,
645+
Deprecated: false,
646+
Positional: false,
647+
},
648+
{
649+
Name: "partitioning-schema.filesystems.{index}.device",
650+
Required: false,
651+
Deprecated: false,
652+
Positional: false,
653+
},
654+
{
655+
Name: "partitioning-schema.filesystems.{index}.format",
656+
Required: false,
657+
Deprecated: false,
658+
Positional: false,
659+
EnumValues: []string{"unknown_format", "fat32", "ext4", "swap", "zfs", "xfs"},
660+
},
661+
{
662+
Name: "partitioning-schema.filesystems.{index}.mountpoint",
663+
Required: false,
664+
Deprecated: false,
665+
Positional: false,
666+
},
667+
{
668+
Name: "partitioning-schema.zfs.pools.{index}.name",
669+
Required: false,
670+
Deprecated: false,
671+
Positional: false,
672+
},
673+
{
674+
Name: "partitioning-schema.zfs.pools.{index}.type",
675+
Required: false,
676+
Deprecated: false,
677+
Positional: false,
678+
EnumValues: []string{"unknown_type", "no_raid", "mirror", "raidz1", "raidz2"},
679+
},
680+
{
681+
Name: "partitioning-schema.zfs.pools.{index}.devices.{index}",
682+
Required: false,
683+
Deprecated: false,
684+
Positional: false,
685+
},
686+
{
687+
Name: "partitioning-schema.zfs.pools.{index}.options.{index}",
688+
Required: false,
689+
Deprecated: false,
690+
Positional: false,
691+
},
692+
{
693+
Name: "partitioning-schema.zfs.pools.{index}.filesystem-options.{index}",
694+
Required: false,
695+
Deprecated: false,
696+
Positional: false,
697+
},
510698
core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1, scw.ZoneNlAms2, scw.ZonePlWaw2, scw.ZonePlWaw3),
511699
},
512700
Run: func(ctx context.Context, args interface{}) (i interface{}, e error) {

internal/namespaces/baremetal/v1/testdata/test-install-server-simple-all-ssh-keys.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ ServiceURL -
7171
"status": "completed",
7272
"user": "",
7373
"service_user": "",
74-
"service_url": ""
74+
"service_url": "",
75+
"partitioning_schema": null
7576
},
7677
"ping_status": "ping_status_down",
7778
"options": null,

internal/namespaces/baremetal/v1/testdata/test-install-server-simple-with-id.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ ServiceURL -
7171
"status": "completed",
7272
"user": "",
7373
"service_user": "",
74-
"service_url": ""
74+
"service_url": "",
75+
"partitioning_schema": null
7576
},
7677
"ping_status": "ping_status_down",
7778
"options": null,

0 commit comments

Comments
 (0)