Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ EXAMPLES:

ARGS:
[name]
[public]
[arch]
[project-id]
[tags]
Expand Down
1 change: 0 additions & 1 deletion docs/commands/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ scw instance image list [arg=value ...]
| Name | | Description |
|------|---|-------------|
| name | | |
| public | | |
| arch | | |
| project-id | | |
| tags | | |
Expand Down
16 changes: 8 additions & 8 deletions internal/namespaces/instance/v1/custom_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ func imagesMarshalerFunc(i any, _ *human.MarshalOpt) (string, error) {
ID string
Name string
State instance.ImageState
Public bool
Zone scw.Zone
Volumes []scw.Size
ServerName string
Expand Down Expand Up @@ -72,7 +71,6 @@ func imagesMarshalerFunc(i any, _ *human.MarshalOpt) (string, error) {
ID: image.ID,
Name: image.Name,
State: image.State,
Public: image.Public,
Zone: image.Zone,
Volumes: volumes,
ServerName: image.ServerName,
Expand Down Expand Up @@ -167,25 +165,27 @@ type imageListItem struct {
// A call to GetServer(..) with the ID contained in Image.FromServer retrieves more information about the server.
func imageListBuilder(c *core.Command) *core.Command {
type customListImageRequest struct {
*instance.ListImagesRequest
Zone scw.Zone `json:"-"`
PerPage *uint32 `json:"-"`
Page *int32 `json:"-"`
Name *string `json:"-"`
Arch *string `json:"-"`
Tags *string `json:"-"`
OrganizationID *string
ProjectID *string
}

renameOrganizationIDArgSpec(c.ArgSpecs)
renameProjectIDArgSpec(c.ArgSpecs)
c.ArgSpecs.DeleteByName("public")

c.ArgsType = reflect.TypeOf(customListImageRequest{})

c.Run = func(ctx context.Context, argsI any) (i any, e error) {
// Get images
args := argsI.(*customListImageRequest)

if args.ListImagesRequest == nil {
args.ListImagesRequest = &instance.ListImagesRequest{}
}

req := args.ListImagesRequest
req := &instance.ListImagesRequest{}
req.Organization = args.OrganizationID
req.Project = args.ProjectID
req.Public = scw.BoolPtr(false)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟩🟩🟩 STDOUT️ 🟩🟩🟩️
ID NAME STATE PUBLIC ZONE VOLUMES SERVER NAME SERVER ID ARCH ORGANIZATION ID PROJECT ID CREATION DATE MODIFICATION DATE
d033d71f-79a4-4b58-96e2-dbddce4894b3 cli-img-jolly-thompson available false fr-par-1 20 GB - - x86_64 fa1e3217-dc80-42ac-85c3-3f034b78b552 fa1e3217-dc80-42ac-85c3-3f034b78b552 few seconds ago few seconds ago
958fd56a-19a3-426c-9c98-487618f44126 cli-img-zen-goldwasser available false fr-par-1 20 GB - - x86_64 fa1e3217-dc80-42ac-85c3-3f034b78b552 fa1e3217-dc80-42ac-85c3-3f034b78b552 few seconds ago few seconds ago
decb60c8-7673-4518-8ee3-ce0aa42522be cli-img-bold-ramanujan available false fr-par-1 20 GB - - x86_64 fa1e3217-dc80-42ac-85c3-3f034b78b552 fa1e3217-dc80-42ac-85c3-3f034b78b552 few seconds ago few seconds ago
6f50550d-39d6-4f72-8f66-9d87277c626b cli-img-angry-buck available false fr-par-1 20 GB - - x86_64 fa1e3217-dc80-42ac-85c3-3f034b78b552 fa1e3217-dc80-42ac-85c3-3f034b78b552 few seconds ago few seconds ago
942bb563-f079-4d9b-a881-3f060d559e3b img-mystifying-rosalind available false fr-par-1 20 GB - - x86_64 fa1e3217-dc80-42ac-85c3-3f034b78b552 19a4819b-24bf-4d44-969f-935ef0061b71 few seconds ago few seconds ago
🟩🟩🟩 JSON STDOUT 🟩🟩🟩
[
{
"id": "d033d71f-79a4-4b58-96e2-dbddce4894b3",
"name": "cli-img-jolly-thompson",
"arch": "x86_64",
"creation_date": "1970-01-01T00:00:00.0Z",
"modification_date": "1970-01-01T00:00:00.0Z",
"default_bootscript": null,
"extra_volumes": {},
"from_server": "",
"organization": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"public": false,
"root_volume": {
"id": "9a603922-b39b-4c45-abec-23da474fdda5",
"name": "cli-snp-dreamy-wilbur",
"size": 20000000000,
"volume_type": "l_ssd"
},
"state": "available",
"project": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"tags": [],
"zone": "fr-par-1",
"server_id": "",
"server_name": ""
},
{
"id": "958fd56a-19a3-426c-9c98-487618f44126",
"name": "cli-img-zen-goldwasser",
"arch": "x86_64",
"creation_date": "1970-01-01T00:00:00.0Z",
"modification_date": "1970-01-01T00:00:00.0Z",
"default_bootscript": null,
"extra_volumes": {},
"from_server": "",
"organization": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"public": false,
"root_volume": {
"id": "0cfc4d6c-e383-4646-b150-87054d5b4f22",
"name": "cli-snp-priceless-dirac",
"size": 20000000000,
"volume_type": "l_ssd"
},
"state": "available",
"project": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"tags": [],
"zone": "fr-par-1",
"server_id": "",
"server_name": ""
},
{
"id": "decb60c8-7673-4518-8ee3-ce0aa42522be",
"name": "cli-img-bold-ramanujan",
"arch": "x86_64",
"creation_date": "1970-01-01T00:00:00.0Z",
"modification_date": "1970-01-01T00:00:00.0Z",
"default_bootscript": null,
"extra_volumes": {},
"from_server": "",
"organization": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"public": false,
"root_volume": {
"id": "3596c079-ff05-40aa-bf0e-ed8b163b318a",
"name": "cli-snp-dreamy-lehmann",
"size": 20000000000,
"volume_type": "l_ssd"
},
"state": "available",
"project": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"tags": [],
"zone": "fr-par-1",
"server_id": "",
"server_name": ""
},
{
"id": "6f50550d-39d6-4f72-8f66-9d87277c626b",
"name": "cli-img-angry-buck",
"arch": "x86_64",
"creation_date": "1970-01-01T00:00:00.0Z",
"modification_date": "1970-01-01T00:00:00.0Z",
"default_bootscript": null,
"extra_volumes": {},
"from_server": "",
"organization": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"public": false,
"root_volume": {
"id": "439ab483-67b2-4ff3-83ca-aa47d59386f1",
"name": "tf-snap-sweet-cori",
"size": 20000000000,
"volume_type": "l_ssd"
},
"state": "available",
"project": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"tags": [],
"zone": "fr-par-1",
"server_id": "",
"server_name": ""
},
{
"id": "942bb563-f079-4d9b-a881-3f060d559e3b",
"name": "img-mystifying-rosalind",
"arch": "x86_64",
"creation_date": "1970-01-01T00:00:00.0Z",
"modification_date": "1970-01-01T00:00:00.0Z",
"default_bootscript": null,
"extra_volumes": {},
"from_server": "",
"organization": "fa1e3217-dc80-42ac-85c3-3f034b78b552",
"public": false,
"root_volume": {
"id": "e06bbd25-55da-4011-a26f-8e4f1d0b973a",
"name": "tf-snap-cranky-khorana",
"size": 20000000000,
"volume_type": "l_ssd"
},
"state": "available",
"project": "19a4819b-24bf-4d44-969f-935ef0061b71",
"tags": [],
"zone": "fr-par-1",
"server_id": "",
"server_name": ""
}
]
Loading
Loading