mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-04-25 21:01:12 -04:00
Update go-cloudstack dependency
This commit is contained in:
24
vendor/github.com/xanzy/go-cloudstack/cloudstack/PoolService.go
generated
vendored
24
vendor/github.com/xanzy/go-cloudstack/cloudstack/PoolService.go
generated
vendored
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright 2014, Sander van Harmelen
|
||||
// Copyright 2016, Sander van Harmelen
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -168,12 +168,18 @@ func (s *PoolService) NewListStoragePoolsParams() *ListStoragePoolsParams {
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *PoolService) GetStoragePoolID(name string) (string, error) {
|
||||
func (s *PoolService) GetStoragePoolID(name string, opts ...OptionFunc) (string, error) {
|
||||
p := &ListStoragePoolsParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["name"] = name
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListStoragePools(p)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -198,13 +204,13 @@ func (s *PoolService) GetStoragePoolID(name string) (string, error) {
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *PoolService) GetStoragePoolByName(name string) (*StoragePool, int, error) {
|
||||
id, err := s.GetStoragePoolID(name)
|
||||
func (s *PoolService) GetStoragePoolByName(name string, opts ...OptionFunc) (*StoragePool, int, error) {
|
||||
id, err := s.GetStoragePoolID(name, opts...)
|
||||
if err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
|
||||
r, count, err := s.GetStoragePoolByID(id)
|
||||
r, count, err := s.GetStoragePoolByID(id, opts...)
|
||||
if err != nil {
|
||||
return nil, count, err
|
||||
}
|
||||
@@ -212,12 +218,18 @@ func (s *PoolService) GetStoragePoolByName(name string) (*StoragePool, int, erro
|
||||
}
|
||||
|
||||
// This is a courtesy helper function, which in some cases may not work as expected!
|
||||
func (s *PoolService) GetStoragePoolByID(id string) (*StoragePool, int, error) {
|
||||
func (s *PoolService) GetStoragePoolByID(id string, opts ...OptionFunc) (*StoragePool, int, error) {
|
||||
p := &ListStoragePoolsParams{}
|
||||
p.p = make(map[string]interface{})
|
||||
|
||||
p.p["id"] = id
|
||||
|
||||
for _, fn := range opts {
|
||||
if err := fn(s.cs, p); err != nil {
|
||||
return nil, -1, err
|
||||
}
|
||||
}
|
||||
|
||||
l, err := s.ListStoragePools(p)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), fmt.Sprintf(
|
||||
|
||||
Reference in New Issue
Block a user