diff --git a/internal/namespaces/instance/v1/custom_image.go b/internal/namespaces/instance/v1/custom_image.go index 0164ce19af..6e9326be8b 100644 --- a/internal/namespaces/instance/v1/custom_image.go +++ b/internal/namespaces/instance/v1/custom_image.go @@ -152,23 +152,23 @@ func imageCreateBuilder(c *core.Command) *core.Command { // customImage is based on instance.Image, with additional information about the server type imageListItem struct { - ID string - Name string - Arch instance.Arch - CreationDate *time.Time - ModificationDate *time.Time - DefaultBootscript *instance.Bootscript - ExtraVolumes map[string]*instance.Volume - OrganizationID string - ProjectID string - Public bool - RootVolume *instance.VolumeSummary - State instance.ImageState + ID string `json:"id"` + Name string `json:"name"` + Arch instance.Arch `json:"arch"` + CreationDate *time.Time `json:"creation_date"` + ModificationDate *time.Time `json:"modification_date"` + DefaultBootscript *instance.Bootscript `json:"default_bootscript"` + ExtraVolumes map[string]*instance.Volume `json:"extra_volumes"` + OrganizationID string `json:"organization"` + ProjectID string `json:"project"` + Public bool `json:"public"` + RootVolume *instance.VolumeSummary `json:"root_volume"` + State instance.ImageState `json:"state"` // Replace Image.FromServer - ServerID string - ServerName string - Zone scw.Zone + ServerID string `json:"server_id"` + ServerName string `json:"server_name"` + Zone scw.Zone `json:"zone"` } // imageListBuilder list the images for a given organization/project. diff --git a/internal/namespaces/instance/v1/testdata/test-image-list-simple.golden b/internal/namespaces/instance/v1/testdata/test-image-list-simple.golden index b4d6a45c46..823cb55b91 100644 --- a/internal/namespaces/instance/v1/testdata/test-image-list-simple.golden +++ b/internal/namespaces/instance/v1/testdata/test-image-list-simple.golden @@ -5,25 +5,25 @@ ID NAME STATE PUBLI 🟩🟩🟩 JSON STDOUT 🟩🟩🟩 [ { - "ID": "1a5178fe-f813-404a-a31c-df3822256c43", - "Name": "cli-img-practical-banzai", - "Arch": "x86_64", - "CreationDate": "1970-01-01T00:00:00.0Z", - "ModificationDate": "1970-01-01T00:00:00.0Z", - "DefaultBootscript": null, - "ExtraVolumes": {}, - "OrganizationID": "b8fdefc6-c926-4a47-af24-24f14f724d6a", - "ProjectID": "b8fdefc6-c926-4a47-af24-24f14f724d6a", - "Public": false, - "RootVolume": { + "id": "1a5178fe-f813-404a-a31c-df3822256c43", + "name": "cli-img-practical-banzai", + "arch": "x86_64", + "creation_date": "1970-01-01T00:00:00.0Z", + "modification_date": "1970-01-01T00:00:00.0Z", + "default_bootscript": null, + "extra_volumes": {}, + "organization": "b8fdefc6-c926-4a47-af24-24f14f724d6a", + "project": "b8fdefc6-c926-4a47-af24-24f14f724d6a", + "public": false, + "root_volume": { "id": "032d525e-d014-4b48-aaed-ea7d2c611a94", "name": "cli-snp-gifted-solomon", "size": 20000000000, "volume_type": "l_ssd" }, - "State": "available", - "ServerID": "", - "ServerName": "", - "Zone": "fr-par-1" + "state": "available", + "server_id": "", + "server_name": "", + "zone": "fr-par-1" } ]