@@ -78,8 +78,8 @@ func imagesMarshalerFunc(i interface{}, _ *human.MarshalOpt) (string, error) {
78
78
ServerName : image .ServerName ,
79
79
ServerID : image .ServerID ,
80
80
Arch : image .Arch ,
81
- OrganizationID : image .OrganizationID ,
82
- ProjectID : image .ProjectID ,
81
+ OrganizationID : image .Organization ,
82
+ ProjectID : image .Project ,
83
83
CreationDate : image .CreationDate ,
84
84
ModificationDate : image .ModificationDate ,
85
85
})
@@ -153,23 +153,11 @@ func imageCreateBuilder(c *core.Command) *core.Command {
153
153
154
154
// customImage is based on instance.Image, with additional information about the server
155
155
type imageListItem struct {
156
- ID string `json:"id"`
157
- Name string `json:"name"`
158
- Arch instance.Arch `json:"arch"`
159
- CreationDate * time.Time `json:"creation_date"`
160
- ModificationDate * time.Time `json:"modification_date"`
161
- DefaultBootscript * instance.Bootscript `json:"default_bootscript"`
162
- ExtraVolumes map [string ]* instance.Volume `json:"extra_volumes"`
163
- OrganizationID string `json:"organization"`
164
- ProjectID string `json:"project"`
165
- Public bool `json:"public"`
166
- RootVolume * instance.VolumeSummary `json:"root_volume"`
167
- State instance.ImageState `json:"state"`
156
+ * instance.Image
168
157
169
158
// Replace Image.FromServer
170
- ServerID string `json:"server_id"`
171
- ServerName string `json:"server_name"`
172
- Zone scw.Zone `json:"zone"`
159
+ ServerID string `json:"server_id"`
160
+ ServerName string `json:"server_name"`
173
161
}
174
162
175
163
// imageListBuilder list the images for a given organization/project.
@@ -210,19 +198,7 @@ func imageListBuilder(c *core.Command) *core.Command {
210
198
customImages := []* imageListItem (nil )
211
199
for _ , image := range images {
212
200
newCustomImage := & imageListItem {
213
- ID : image .ID ,
214
- Name : image .Name ,
215
- Arch : image .Arch ,
216
- CreationDate : image .CreationDate ,
217
- ModificationDate : image .ModificationDate ,
218
- DefaultBootscript : image .DefaultBootscript ,
219
- ExtraVolumes : image .ExtraVolumes ,
220
- OrganizationID : image .Organization ,
221
- ProjectID : image .Project ,
222
- Public : image .Public ,
223
- RootVolume : image .RootVolume ,
224
- State : image .State ,
225
- Zone : image .Zone ,
201
+ Image : image ,
226
202
}
227
203
customImages = append (customImages , newCustomImage )
228
204
0 commit comments