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 GetStorageProfileByHref method #435

Merged
merged 27 commits into from
Feb 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d05517b
add main implementation
vbauzys Aug 25, 2020
3faee0a
git push origin master
vbauzys Aug 25, 2020
a497ca1
git push origin master
vbauzys Sep 3, 2020
71d524d
git push origin master
vbauzys Sep 22, 2020
879296d
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Oct 21, 2020
02a4d81
git push origin masterMerge branch 'master' of github.com:vmware/go-v…
vbauzys Oct 21, 2020
b365d6c
git push origin masterMerge branch 'master' of github.com:vmware/go-v…
vbauzys Oct 27, 2020
808752b
removed not needed after merge
vbauzys Oct 29, 2020
29c17ae
git push origin masterMerge branch 'master' of github.com:vmware/go-v…
vbauzys Nov 5, 2020
9073403
git push origin masterMerge branch 'master' of github.com:vmware/go-v…
vbauzys Nov 12, 2020
9efad14
Merge branch 'vmware:master' into master
vbauzys Oct 11, 2021
dabfd82
git push origin masterMerge branch 'master' of github.com:vmware/go-v…
vbauzys Nov 8, 2021
be532a2
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Nov 10, 2021
6cf856a
git push origin masterMerge branch 'master' of github.com:vmware/go-v…
vbauzys Nov 23, 2021
144ef18
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Nov 25, 2021
8c0217f
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Dec 8, 2021
05ac73e
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Dec 17, 2021
9056c05
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Dec 20, 2021
cb919b2
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Jan 5, 2022
253df2d
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Jan 13, 2022
a1bccce
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Jan 17, 2022
2fa708c
Merge branch 'master' of github.com:vmware/go-vcloud-director
vbauzys Jan 17, 2022
5161390
Merge branch 'main' of github.com:vmware/go-vcloud-director into main
vbauzys Jan 19, 2022
7c0cf81
Merge branch 'main' of github.com:vmware/go-vcloud-director into main
vbauzys Jan 19, 2022
63c5cdd
add fix for IopsSettings in method GetStorageProfileByHref
vbauzys Feb 8, 2022
9921312
add fix to type
vbauzys Feb 8, 2022
20b5107
fix typo
vbauzys Feb 18, 2022
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
1 change: 1 addition & 0 deletions .changes/v2.15.0/435-bug-fixes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Fix method `client.GetStorageProfileByHref` to return IOPS `IopsSettings` [GH-435]
5 changes: 3 additions & 2 deletions govcd/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,9 @@ func (client *Client) GetStorageProfileByHref(url string) (*types.VdcStorageProf

vdcStorageProfile := &types.VdcStorageProfile{}

_, err := client.ExecuteRequest(url, http.MethodGet,
"", "error retrieving storage profile: %s", nil, vdcStorageProfile)
// only from 35.0 API version IOPS settings are added to response
_, err := client.ExecuteRequestWithApiVersion(url, http.MethodGet,
"", "error retrieving storage profile: %s", nil, vdcStorageProfile, client.GetSpecificApiVersionOnCondition(">= 35.0", "35.0"))
if err != nil {
return nil, err
}
Expand Down
4 changes: 3 additions & 1 deletion govcd/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,10 @@ func (vcd *TestVCD) Test_GetStorageProfileByHref(check *C) {
// Get storage profile by href
foundStorageProfile, err := vcd.client.Client.GetStorageProfileByHref(adminVdc.AdminVdc.VdcStorageProfiles.VdcStorageProfile[0].HREF)
check.Assert(err, IsNil)
check.Assert(foundStorageProfile, Not(Equals), types.VdcStorageProfile{})
check.Assert(foundStorageProfile, NotNil)
check.Assert(foundStorageProfile.IopsSettings, NotNil)
check.Assert(foundStorageProfile, Not(Equals), types.VdcStorageProfile{})
check.Assert(foundStorageProfile.IopsSettings, Not(Equals), types.VdcStorageProfileIopsSettings{})
}

func (vcd *TestVCD) Test_GetOrgList(check *C) {
Expand Down
14 changes: 7 additions & 7 deletions types/v56/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ type VdcStorageProfile struct {
Units string `xml:"Units"`
Limit int64 `xml:"Limit"`
Default bool `xml:"Default"`
IopsSettings *VdcStorageProfileIopsSettings `xml:"IopsSettingsint64"`
IopsSettings *VdcStorageProfileIopsSettings `xml:"IopsSettings"`
StorageUsedMB int64 `xml:"StorageUsedMB"`
IopsAllocated int64 `xml:"IopsAllocated"`
ProviderVdcStorageProfile *Reference `xml:"ProviderVdcStorageProfile"`
Expand All @@ -506,7 +506,7 @@ type AdminVdcStorageProfile struct {
Units string `xml:"Units"`
Limit int64 `xml:"Limit"`
Default bool `xml:"Default"`
IopsSettings *VdcStorageProfileIopsSettings `xml:"IopsSettingsint64"`
IopsSettings *VdcStorageProfileIopsSettings `xml:"IopsSettings"`
StorageUsedMB int64 `xml:"StorageUsedMB"`
IopsAllocated int64 `xml:"IopsAllocated"`
ProviderVdcStorageProfile *Reference `xml:"ProviderVdcStorageProfile"`
Expand All @@ -517,11 +517,11 @@ type AdminVdcStorageProfile struct {
// https://vdc-repo.vmware.com/vmwb-repository/dcr-public/71e12563-bc11-4d64-821d-92d30f8fcfa1/7424bf8e-aec2-44ad-be7d-b98feda7bae0/doc/doc/types/VdcStorageProfileIopsSettingsType.html
type VdcStorageProfileIopsSettings struct {
Xmlns string `xml:"xmlns,attr"`
Enabled bool `xml:"enabled"`
DiskIopsMax int64 `xml:"diskIopsMax,"`
DiskIopsDefault int64 `xml:"diskIopsDefault"`
StorageProfileIopsLimit int64 `xml:"storageProfileIopsLimit,omitempty"`
DiskIopsPerGbMax int64 `xml:"diskIopsPerGbMax"`
Enabled bool `xml:"Enabled"`
DiskIopsMax int64 `xml:"DiskIopsMax"`
DiskIopsDefault int64 `xml:"DiskIopsDefault"`
StorageProfileIopsLimit int64 `xml:"StorageProfileIopsLimit,omitempty"`
DiskIopsPerGbMax int64 `xml:"DiskIopsPerGbMax"`
}

// VdcConfiguration models the payload for creating a VDC.
Expand Down