Skip to content

Commit 16d8e0b

Browse files
authored
Merge branch 'master' into v1.6368.0
2 parents 29dd669 + c27dbbc commit 16d8e0b

19 files changed

+1459
-1232
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ 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.20250407124844-38ab1ca8e81d
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

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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.20250407124844-38ab1ca8e81d h1:EjD1RHPgsTomVw0lKgZu6YHK4ZMSBkSjeFrirnvWBcw=
466-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.33.0.20250407124844-38ab1ca8e81d/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=

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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ func GetGeneratedCommands() *core.Commands {
9696
}
9797
func instanceRoot() *core.Command {
9898
return &core.Command{
99-
Short: `This API allows you to manage your Instances`,
100-
Long: `This API allows you to manage your Instances.`,
99+
Short: `This API allows you to manage your CPU and GPU Instances`,
100+
Long: `This API allows you to manage your CPU and GPU Instances.`,
101101
Namespace: "instance",
102102
}
103103
}
@@ -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,

internal/namespaces/instance/v1/testdata/test-create-server-scratch-storage-default-scratch-storage.golden

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ SecurityGroup.Name Default security group
7070
StateDetail -
7171
Arch x86_64
7272
Zone fr-par-2
73+
EndOfService false
7374
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
7475
{
7576
"id": "9851b09c-1c2b-4fef-bc06-7ce31ff3188a",
@@ -189,5 +190,6 @@ Zone fr-par-2
189190
"private_nics": [],
190191
"zone": "fr-par-2",
191192
"admin_password_encryption_ssh_key_id": null,
192-
"admin_password_encrypted_value": null
193+
"admin_password_encrypted_value": null,
194+
"end_of_service": false
193195
}

internal/namespaces/instance/v1/testdata/test-create-server-simple-default.golden

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ SecurityGroup.Name Default security group
3939
StateDetail -
4040
Arch x86_64
4141
Zone fr-par-1
42+
EndOfService false
4243
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
4344
{
4445
"id": "cf1cfe02-38f9-4fce-bc1c-ab61925cff05",
@@ -116,5 +117,6 @@ Zone fr-par-1
116117
"private_nics": [],
117118
"zone": "fr-par-1",
118119
"admin_password_encryption_ssh_key_id": null,
119-
"admin_password_encrypted_value": null
120+
"admin_password_encrypted_value": null,
121+
"end_of_service": false
120122
}

0 commit comments

Comments
 (0)