Skip to content

Commit 2489ebe

Browse files
authored
Merge branch 'master' into v1.6359.0
2 parents f757418 + c27dbbc commit 2489ebe

22 files changed

+1515
-1288
lines changed

cmd/scw/testdata/test-all-usage-instance-server-update-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ARGS:
3434
[volumes.{key}.organization] Organization ID of the volume
3535
[dynamic-ip-required]
3636
[public-ips.{index}] A list of reserved IP IDs to attach to the Instance
37-
[protected]
37+
[protected] True to activate server protection option
3838
[security-group-id]
3939
[volume-ids.{index}] Will update ALL volume IDs at once, including the root volume of the server (use volume-ids=none to detach all volumes)
4040
[placement-group-id] Placement group ID if Instance must be part of a placement group

docs/commands/instance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,7 @@ scw instance server update <server-id ...> [arg=value ...]
23012301
| ~~routed-ip-enabled~~ | Deprecated | True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False) |
23022302
| public-ips.{index} | | A list of reserved IP IDs to attach to the Instance |
23032303
| ~~enable-ipv6~~ | Deprecated | |
2304-
| protected | | |
2304+
| protected | | True to activate server protection option |
23052305
| security-group-id | | |
23062306
| volume-ids.{index} | | Will update ALL volume IDs at once, including the root volume of the server (use volume-ids=none to detach all volumes) |
23072307
| placement-group-id | | Placement group ID if Instance must be part of a placement group |

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.0
44

55
require (
66
github.com/aws/aws-sdk-go-v2 v1.36.3
7-
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.0
7+
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.1
88
github.com/buildpacks/pack v0.34.2
99
github.com/c-bata/go-prompt v0.2.6
1010
github.com/charmbracelet/bubbletea v1.3.4
@@ -23,14 +23,14 @@ require (
2323
github.com/mattn/go-isatty v0.0.20
2424
github.com/moby/buildkit v0.13.2
2525
github.com/opencontainers/go-digest v1.0.0
26-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250403083316-214281155a8d
26+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250408082303-4ecf08b8a1ef
2727
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2828
github.com/spf13/cobra v1.9.1
2929
github.com/spf13/pflag v1.0.6
3030
github.com/stretchr/testify v1.10.0
31-
golang.org/x/crypto v0.36.0
32-
golang.org/x/term v0.30.0
33-
golang.org/x/text v0.23.0
31+
golang.org/x/crypto v0.37.0
32+
golang.org/x/term v0.31.0
33+
golang.org/x/text v0.24.0
3434
gopkg.in/yaml.v3 v3.0.1
3535
)
3636

@@ -187,8 +187,8 @@ require (
187187
go.opentelemetry.io/proto/otlp v1.2.0 // indirect
188188
golang.org/x/mod v0.17.0 // indirect
189189
golang.org/x/net v0.36.0 // indirect
190-
golang.org/x/sync v0.12.0 // indirect
191-
golang.org/x/sys v0.31.0 // indirect
190+
golang.org/x/sync v0.13.0 // indirect
191+
golang.org/x/sys v0.32.0 // indirect
192192
golang.org/x/time v0.5.0 // indirect
193193
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
194194
google.golang.org/genproto/googleapis/api v0.0.0-20240401170217-c3f982113cda // indirect

go.sum

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15 h1:dM9/92u2
9090
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.15/go.mod h1:SwFBy2vjtA0vZbjjaFtfN045boopadnoVPhu4Fv66vY=
9191
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.15 h1:moLQUoVq91LiqT1nbvzDukyqAlCv89ZmwaHw/ZFlFZg=
9292
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.15/go.mod h1:ZH34PJUc8ApjBIfgQCFvkWcUDBtl/WTD+uiYHjd8igA=
93-
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.0 h1:OIw2nryEApESTYI5deCZGcq4Gvz8DBAt4tJlNyg3v5o=
94-
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.0/go.mod h1:U5SNqwhXB3Xe6F47kXvWihPl/ilGaEDe8HD/50Z9wxc=
93+
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.1 h1:2Ku1xwAohSSXHR1tpAnyVDSQSxoDMA+/NZBytW+f4qg=
94+
github.com/aws/aws-sdk-go-v2/service/s3 v1.79.1/go.mod h1:U5SNqwhXB3Xe6F47kXvWihPl/ilGaEDe8HD/50Z9wxc=
9595
github.com/aws/aws-sdk-go-v2/service/sso v1.20.2 h1:XOPfar83RIRPEzfihnp+U6udOveKZJvPQ76SKWrLRHc=
9696
github.com/aws/aws-sdk-go-v2/service/sso v1.20.2/go.mod h1:Vv9Xyk1KMHXrR3vNQe8W5LMFdTjSeWk0gBZBzvf3Qa0=
9797
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.23.2 h1:pi0Skl6mNl2w8qWZXcdOyg197Zsf4G97U7Sso9JXGZE=
@@ -462,8 +462,8 @@ github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUz
462462
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
463463
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
464464
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
465-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250403083316-214281155a8d h1:qFZ2cWNezuUhi+0HT+FMe4M8NzAMppHCL1xX2AvwFec=
466-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250403083316-214281155a8d/go.mod h1:792k1RTU+5JeMXm35/e2Wgp71qPH/DmDoZrRc+EFZDk=
465+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250408082303-4ecf08b8a1ef h1:e0aETjcCykw59oyfal17KonPnJjnIsYKt4y9GHrwYjM=
466+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250408082303-4ecf08b8a1ef/go.mod h1:ILAZV9jmsf+YmJ8UGNpZ9rUnKtHs5EqnBFv47qqYcaU=
467467
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
468468
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
469469
github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbmfHkLguCE9laoZCUzEEpIZXA=
@@ -568,8 +568,8 @@ golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0
568568
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
569569
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
570570
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
571-
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
572-
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
571+
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
572+
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
573573
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
574574
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
575575
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
@@ -609,8 +609,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
609609
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
610610
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
611611
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
612-
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
613-
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
612+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
613+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
614614
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
615615
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
616616
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -643,23 +643,23 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
643643
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
644644
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
645645
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
646-
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
647-
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
646+
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
647+
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
648648
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
649649
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
650650
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
651651
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
652-
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
653-
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
652+
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
653+
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
654654
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
655655
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
656656
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
657657
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
658658
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
659659
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
660660
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
661-
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
662-
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
661+
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
662+
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
663663
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
664664
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
665665
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

internal/namespaces/documentdb/v1beta1/documentdb_cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ func documentDbSettingDelete() *core.Command {
13601360
func documentDbSettingSet() *core.Command {
13611361
return &core.Command{
13621362
Short: `Set Database Instance advanced settings`,
1363-
Long: `Update an advanced setting for a Database Instance. Settings added upon database engine initalization can only be defined once, and cannot, therefore, be updated.`,
1363+
Long: `Update an advanced setting for a Database Instance. Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated.`,
13641364
Namespace: "document-db",
13651365
Resource: "setting",
13661366
Verb: "set",

internal/namespaces/function/v1beta1/function_cli.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ func functionFunctionList() *core.Command {
451451
},
452452
{
453453
Name: "organization-id",
454-
Short: `UUID of the Organziation the function belongs to`,
454+
Short: `UUID of the Organization the function belongs to`,
455455
Required: false,
456456
Deprecated: false,
457457
Positional: false,
@@ -540,7 +540,7 @@ func functionFunctionCreate() *core.Command {
540540
},
541541
{
542542
Name: "min-scale",
543-
Short: `Minumum number of instances to scale the function to`,
543+
Short: `Minimum number of instances to scale the function to`,
544544
Required: false,
545545
Deprecated: false,
546546
Positional: false,
@@ -663,7 +663,7 @@ func functionFunctionUpdate() *core.Command {
663663
},
664664
{
665665
Name: "min-scale",
666-
Short: `Minumum number of instances to scale the function to`,
666+
Short: `Minimum number of instances to scale the function to`,
667667
Required: false,
668668
Deprecated: false,
669669
Positional: false,
@@ -894,7 +894,7 @@ func functionFunctionGetDownloadURL() *core.Command {
894894
ArgSpecs: core.ArgSpecs{
895895
{
896896
Name: "function-id",
897-
Short: `UUID of the function to get the the download URL for`,
897+
Short: `UUID of the function to get the download URL for`,
898898
Required: true,
899899
Deprecated: false,
900900
Positional: true,
@@ -1142,7 +1142,7 @@ func functionDomainList() *core.Command {
11421142
},
11431143
{
11441144
Name: "function-id",
1145-
Short: `UUID of the function the domain is assoicated with`,
1145+
Short: `UUID of the function the domain is associated with`,
11461146
Required: false,
11471147
Deprecated: false,
11481148
Positional: false,
@@ -1361,7 +1361,7 @@ func functionTokenList() *core.Command {
13611361
},
13621362
{
13631363
Name: "function-id",
1364-
Short: `UUID of the function the token is assoicated with`,
1364+
Short: `UUID of the function the token is associated with`,
13651365
Required: false,
13661366
Deprecated: false,
13671367
Positional: false,

internal/namespaces/iam/v1alpha1/iam_cli.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ func iamGroupCreate() *core.Command {
11751175
func iamGroupGet() *core.Command {
11761176
return &core.Command{
11771177
Short: `Get a group`,
1178-
Long: `Retrive information about a given group, specified by the ` + "`" + `group_id` + "`" + ` parameter. The group's full details, including ` + "`" + `user_ids` + "`" + ` and ` + "`" + `application_ids` + "`" + ` are returned in the response.`,
1178+
Long: `Retrieve information about a given group, specified by the ` + "`" + `group_id` + "`" + ` parameter. The group's full details, including ` + "`" + `user_ids` + "`" + ` and ` + "`" + `application_ids` + "`" + ` are returned in the response.`,
11791179
Namespace: "iam",
11801180
Resource: "group",
11811181
Verb: "get",
@@ -1301,7 +1301,7 @@ func iamGroupSetMembers() *core.Command {
13011301
func iamGroupAddMember() *core.Command {
13021302
return &core.Command{
13031303
Short: `Add a user or an application to a group`,
1304-
Long: `Add a user or an application to a group. You can specify a ` + "`" + `user_id` + "`" + ` and and ` + "`" + `application_id` + "`" + ` in the body of your request. Note that you can only add one of each per request.`,
1304+
Long: `Add a user or an application to a group. You can specify a ` + "`" + `user_id` + "`" + ` and ` + "`" + `application_id` + "`" + ` in the body of your request. Note that you can only add one of each per request.`,
13051305
Namespace: "iam",
13061306
Resource: "group",
13071307
Verb: "add-member",
@@ -1385,7 +1385,7 @@ func iamGroupAddMembers() *core.Command {
13851385
func iamGroupRemoveMember() *core.Command {
13861386
return &core.Command{
13871387
Short: `Remove a user or an application from a group`,
1388-
Long: `Remove a user or an application from a group. You can specify a ` + "`" + `user_id` + "`" + ` and and ` + "`" + `application_id` + "`" + ` in the body of your request. Note that you can only remove one of each per request. Removing a user from a group means that any permissions given to them via the group (i.e. from an attached policy) will no longer apply. Be sure you want to remove these permissions from the user before proceeding.`,
1388+
Long: `Remove a user or an application from a group. You can specify a ` + "`" + `user_id` + "`" + ` and ` + "`" + `application_id` + "`" + ` in the body of your request. Note that you can only remove one of each per request. Removing a user from a group means that any permissions given to them via the group (i.e. from an attached policy) will no longer apply. Be sure you want to remove these permissions from the user before proceeding.`,
13891389
Namespace: "iam",
13901390
Resource: "group",
13911391
Verb: "remove-member",
@@ -2170,7 +2170,7 @@ func iamAPIKeyCreate() *core.Command {
21702170
func iamAPIKeyGet() *core.Command {
21712171
return &core.Command{
21722172
Short: `Get an API key`,
2173-
Long: `Retrive information about an API key, specified by the ` + "`" + `access_key` + "`" + ` parameter. The API key's details, including either the ` + "`" + `user_id` + "`" + ` or ` + "`" + `application_id` + "`" + ` of its bearer are returned in the response. Note that the string value for the ` + "`" + `secret_key` + "`" + ` is nullable, and therefore is not displayed in the response. The ` + "`" + `secret_key` + "`" + ` value is only displayed upon API key creation.`,
2173+
Long: `Retrieve information about an API key, specified by the ` + "`" + `access_key` + "`" + ` parameter. The API key's details, including either the ` + "`" + `user_id` + "`" + ` or ` + "`" + `application_id` + "`" + ` of its bearer are returned in the response. Note that the string value for the ` + "`" + `secret_key` + "`" + ` is nullable, and therefore is not displayed in the response. The ` + "`" + `secret_key` + "`" + ` value is only displayed upon API key creation.`,
21742174
Namespace: "iam",
21752175
Resource: "api-key",
21762176
Verb: "get",

internal/namespaces/inference/v1beta1/inference_cli.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ func inferenceACLSet() *core.Command {
637637

638638
func inferenceACLDelete() *core.Command {
639639
return &core.Command{
640-
Short: `Delete an exising ACL`,
641-
Long: `Delete an exising ACL.`,
640+
Short: `Delete an existing ACL`,
641+
Long: `Delete an existing ACL.`,
642642
Namespace: "inference",
643643
Resource: "acl",
644644
Verb: "delete",

internal/namespaces/instance/v1/custom_server.go

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,28 @@ func serversMarshalerFunc(i interface{}, opt *human.MarshalOpt) (string, error)
120120
return human.Marshal(humanServers, opt)
121121
}
122122

123+
type customVolume struct {
124+
ID string `json:"id"`
125+
Name string `json:"name"`
126+
Size scw.Size `json:"size"`
127+
VolumeType string `json:"volume_type"`
128+
IOPS string `json:"iops"`
129+
State string `json:"state"`
130+
CreationDate *time.Time `json:"creation_date"`
131+
ModificationDate *time.Time `json:"modification_date"`
132+
Boot bool `json:"boot"`
133+
Zone string `json:"zone"`
134+
}
135+
123136
// orderVolumes return an ordered slice based on the volume map key "0", "1", "2",...
124-
func orderVolumes(v map[string]*instance.VolumeServer) []*instance.VolumeServer {
137+
func orderVolumes(v map[string]*customVolume) []*customVolume {
125138
indexes := []string(nil)
126139
for index := range v {
127140
indexes = append(indexes, index)
128141
}
129142
sort.Strings(indexes)
130143

131-
orderedVolumes := make([]*instance.VolumeServer, 0, len(indexes))
144+
orderedVolumes := make([]*customVolume, 0, len(indexes))
132145
for _, index := range indexes {
133146
orderedVolumes = append(orderedVolumes, v[index])
134147
}
@@ -407,13 +420,61 @@ func serverGetBuilder(c *core.Command) *core.Command {
407420
})
408421
}
409422

423+
volumes := map[string]*customVolume{}
424+
blockAPI := block.NewAPI(client)
425+
426+
for _, volume := range getServerResp.Server.Volumes {
427+
customVol := &customVolume{
428+
ID: volume.ID,
429+
Zone: volume.Zone.String(),
430+
Boot: volume.Boot,
431+
}
432+
433+
blockVol, _ := blockAPI.GetVolume(&block.GetVolumeRequest{
434+
VolumeID: volume.ID,
435+
Zone: volume.Zone,
436+
})
437+
if blockVol != nil {
438+
customVol.Name = blockVol.Name
439+
customVol.Size = blockVol.Size
440+
customVol.VolumeType = blockVol.Type
441+
customVol.State = blockVol.Status.String()
442+
customVol.CreationDate = blockVol.CreatedAt
443+
customVol.ModificationDate = blockVol.UpdatedAt
444+
if blockVol.Specs != nil && blockVol.Specs.PerfIops != nil {
445+
switch *blockVol.Specs.PerfIops {
446+
case 5000:
447+
customVol.IOPS = "5K"
448+
case 15000:
449+
customVol.IOPS = "15K"
450+
}
451+
}
452+
} else {
453+
instanceVol, err := instance.NewAPI(client).GetVolume(&instance.GetVolumeRequest{
454+
VolumeID: volume.ID,
455+
Zone: volume.Zone,
456+
})
457+
if err != nil {
458+
return nil, err
459+
}
460+
customVol.Name = instanceVol.Volume.Name
461+
customVol.Size = instanceVol.Volume.Size
462+
customVol.VolumeType = instanceVol.Volume.VolumeType.String()
463+
customVol.State = instanceVol.Volume.State.String()
464+
customVol.CreationDate = instanceVol.Volume.CreationDate
465+
customVol.ModificationDate = instanceVol.Volume.ModificationDate
466+
}
467+
468+
volumes[volume.ID] = customVol
469+
}
470+
410471
return &struct {
411472
*instance.Server
412-
Volumes []*instance.VolumeServer
473+
Volumes []*customVolume
413474
PrivateNics []customNICs `json:"private_nics"`
414475
}{
415476
getServerResp.Server,
416-
orderVolumes(getServerResp.Server.Volumes),
477+
orderVolumes(volumes),
417478
nics,
418479
}, nil
419480
}

internal/namespaces/instance/v1/instance_cli.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ func instanceServerUpdate() *core.Command {
675675
},
676676
{
677677
Name: "protected",
678+
Short: `True to activate server protection option`,
678679
Required: false,
679680
Deprecated: false,
680681
Positional: false,

0 commit comments

Comments
 (0)