v1.6.8
This commit is contained in:
19
pkg/cloudapi/image/ids.go
Normal file
19
pkg/cloudapi/image/ids.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package image
|
||||
|
||||
// IDs gets array of ImageIDs from ListImages struct
|
||||
func (li ListImages) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(li.Data))
|
||||
for _, i := range li.Data {
|
||||
res = append(res, i.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// IDs gets array of HistoryIDs from ListHistories struct
|
||||
func (lh ListHistories) IDs() []uint64 {
|
||||
res := make([]uint64, 0, len(lh))
|
||||
for _, h := range lh {
|
||||
res = append(res, h.ID)
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -66,7 +66,10 @@ type ListImages struct {
|
||||
EntryCount uint64 `json:"entryCount"`
|
||||
}
|
||||
|
||||
// History
|
||||
// ListHistories of record image
|
||||
type ListHistories []History
|
||||
|
||||
// History of record image
|
||||
type History struct {
|
||||
// GUID
|
||||
GUID string `json:"guid"`
|
||||
@@ -123,7 +126,7 @@ type RecordImage struct {
|
||||
GUID uint64 `json:"guid"`
|
||||
|
||||
// History
|
||||
History []History `json:"history"`
|
||||
History ListHistories `json:"history"`
|
||||
|
||||
// HotResize
|
||||
HotResize bool `json:"hotResize"`
|
||||
|
||||
Reference in New Issue
Block a user