Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(instance): use snake case in json output format for image list #1750

Merged
merged 2 commits into from
Feb 8, 2021
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
30 changes: 15 additions & 15 deletions internal/namespaces/instance/v1/custom_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]