-
Notifications
You must be signed in to change notification settings - Fork 21
/
storagedomain_list.go
43 lines (40 loc) · 1.13 KB
/
storagedomain_list.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Code generated automatically using go:generate. DO NOT EDIT.
package ovirtclient
func (o *oVirtClient) ListStorageDomains(retries ...RetryStrategy) (result StorageDomainList, err error) {
retries = defaultRetries(retries, defaultReadTimeouts(o))
result = []StorageDomain{}
err = retry(
"listing storage domains",
o.logger,
retries,
func() error {
response, e := o.conn.SystemService().StorageDomainsService().List().Send()
if e != nil {
return e
}
sdkObjects, ok := response.StorageDomains()
if !ok {
return nil
}
result = make([]StorageDomain, len(sdkObjects.Slice()))
for i, sdkObject := range sdkObjects.Slice() {
result[i], e = convertSDKStorageDomain(sdkObject, o)
if e != nil {
return wrap(e, EBug, "failed to convert storage domain during listing item #%d", i)
}
}
return nil
})
return
}
func (m *mockClient) ListStorageDomains(_ ...RetryStrategy) (StorageDomainList, error) {
m.lock.Lock()
defer m.lock.Unlock()
result := make([]StorageDomain, len(m.storageDomains))
i := 0
for _, item := range m.storageDomains {
result[i] = item
i++
}
return result, nil
}