Skip to content

Commit 0051876

Browse files
authored
Implement resourceiconresponse as interface{} (#45)
All "icon" fields are set to be of resourceiconresponse type, however that type is not defined anywhere, making the icon field resolving to a string. This isn't correct as ACS returns the Icon as an object, which in term causes these types of error: "json: cannot unmarshal object into Go struct field VirtualMachinesMetric.virtualmachine.icon of type string" This change sets the type of resourceiconresponse type to be an empty interface{}, to guarantee some backward compatibility and ensure that the unmarshalling works as intended. Tested againt ACS 4.17.1
1 parent 5b49469 commit 0051876

17 files changed

+412
-410
lines changed

cloudstack/AccountService.go

Lines changed: 162 additions & 162 deletions
Large diffs are not rendered by default.

cloudstack/AffinityGroupService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ type UpdateVMAffinityGroupResponse struct {
981981
Hostid string `json:"hostid"`
982982
Hostname string `json:"hostname"`
983983
Hypervisor string `json:"hypervisor"`
984-
Icon string `json:"icon"`
984+
Icon interface{} `json:"icon"`
985985
Id string `json:"id"`
986986
Instancename string `json:"instancename"`
987987
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`

cloudstack/BrocadeVCSService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ type BrocadeVcsDeviceNetwork struct {
427427
Externalid string `json:"externalid"`
428428
Gateway string `json:"gateway"`
429429
Hasannotations bool `json:"hasannotations"`
430-
Icon string `json:"icon"`
430+
Icon interface{} `json:"icon"`
431431
Id string `json:"id"`
432432
Ip6cidr string `json:"ip6cidr"`
433433
Ip6gateway string `json:"ip6gateway"`

cloudstack/DomainService.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ type CreateDomainResponse struct {
166166
Domaindetails map[string]string `json:"domaindetails"`
167167
Hasannotations bool `json:"hasannotations"`
168168
Haschild bool `json:"haschild"`
169-
Icon string `json:"icon"`
169+
Icon interface{} `json:"icon"`
170170
Id string `json:"id"`
171171
Ipavailable string `json:"ipavailable"`
172172
Iplimit string `json:"iplimit"`
@@ -587,7 +587,7 @@ type DomainChildren struct {
587587
Domaindetails map[string]string `json:"domaindetails"`
588588
Hasannotations bool `json:"hasannotations"`
589589
Haschild bool `json:"haschild"`
590-
Icon string `json:"icon"`
590+
Icon interface{} `json:"icon"`
591591
Id string `json:"id"`
592592
Ipavailable string `json:"ipavailable"`
593593
Iplimit string `json:"iplimit"`
@@ -932,7 +932,7 @@ type Domain struct {
932932
Domaindetails map[string]string `json:"domaindetails"`
933933
Hasannotations bool `json:"hasannotations"`
934934
Haschild bool `json:"haschild"`
935-
Icon string `json:"icon"`
935+
Icon interface{} `json:"icon"`
936936
Id string `json:"id"`
937937
Ipavailable string `json:"ipavailable"`
938938
Iplimit string `json:"iplimit"`
@@ -1080,7 +1080,7 @@ type UpdateDomainResponse struct {
10801080
Domaindetails map[string]string `json:"domaindetails"`
10811081
Hasannotations bool `json:"hasannotations"`
10821082
Haschild bool `json:"haschild"`
1083-
Icon string `json:"icon"`
1083+
Icon interface{} `json:"icon"`
10841084
Id string `json:"id"`
10851085
Ipavailable string `json:"ipavailable"`
10861086
Iplimit string `json:"iplimit"`

cloudstack/ISOService.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ type AttachIsoResponse struct {
197197
Hostid string `json:"hostid"`
198198
Hostname string `json:"hostname"`
199199
Hypervisor string `json:"hypervisor"`
200-
Icon string `json:"icon"`
200+
Icon interface{} `json:"icon"`
201201
Id string `json:"id"`
202202
Instancename string `json:"instancename"`
203203
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`
@@ -466,7 +466,7 @@ type CopyIsoResponse struct {
466466
Hostid string `json:"hostid"`
467467
Hostname string `json:"hostname"`
468468
Hypervisor string `json:"hypervisor"`
469-
Icon string `json:"icon"`
469+
Icon interface{} `json:"icon"`
470470
Id string `json:"id"`
471471
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`
472472
Isextractable bool `json:"isextractable"`
@@ -742,7 +742,7 @@ type DetachIsoResponse struct {
742742
Hostid string `json:"hostid"`
743743
Hostname string `json:"hostname"`
744744
Hypervisor string `json:"hypervisor"`
745-
Icon string `json:"icon"`
745+
Icon interface{} `json:"icon"`
746746
Id string `json:"id"`
747747
Instancename string `json:"instancename"`
748748
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`
@@ -1631,7 +1631,7 @@ type Iso struct {
16311631
Hostid string `json:"hostid"`
16321632
Hostname string `json:"hostname"`
16331633
Hypervisor string `json:"hypervisor"`
1634-
Icon string `json:"icon"`
1634+
Icon interface{} `json:"icon"`
16351635
Id string `json:"id"`
16361636
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`
16371637
Isextractable bool `json:"isextractable"`
@@ -2067,7 +2067,7 @@ type RegisterIsoResponse struct {
20672067
Hostid string `json:"hostid"`
20682068
Hostname string `json:"hostname"`
20692069
Hypervisor string `json:"hypervisor"`
2070-
Icon string `json:"icon"`
2070+
Icon interface{} `json:"icon"`
20712071
Id string `json:"id"`
20722072
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`
20732073
Isextractable bool `json:"isextractable"`
@@ -2446,7 +2446,7 @@ type UpdateIsoResponse struct {
24462446
Hostid string `json:"hostid"`
24472447
Hostname string `json:"hostname"`
24482448
Hypervisor string `json:"hypervisor"`
2449-
Icon string `json:"icon"`
2449+
Icon interface{} `json:"icon"`
24502450
Id string `json:"id"`
24512451
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`
24522452
Isextractable bool `json:"isextractable"`

cloudstack/LDAPService.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ type LdapCreateAccountResponse struct {
945945
Domainid string `json:"domainid"`
946946
Domainpath string `json:"domainpath"`
947947
Groups []string `json:"groups"`
948-
Icon string `json:"icon"`
948+
Icon interface{} `json:"icon"`
949949
Id string `json:"id"`
950950
Ipavailable string `json:"ipavailable"`
951951
Iplimit string `json:"iplimit"`
@@ -998,28 +998,28 @@ type LdapCreateAccountResponse struct {
998998
}
999999

10001000
type LdapCreateAccountResponseUser struct {
1001-
Account string `json:"account"`
1002-
Accountid string `json:"accountid"`
1003-
Accounttype int `json:"accounttype"`
1004-
Apikey string `json:"apikey"`
1005-
Created string `json:"created"`
1006-
Domain string `json:"domain"`
1007-
Domainid string `json:"domainid"`
1008-
Email string `json:"email"`
1009-
Firstname string `json:"firstname"`
1010-
Icon string `json:"icon"`
1011-
Id string `json:"id"`
1012-
Iscallerchilddomain bool `json:"iscallerchilddomain"`
1013-
Isdefault bool `json:"isdefault"`
1014-
Lastname string `json:"lastname"`
1015-
Roleid string `json:"roleid"`
1016-
Rolename string `json:"rolename"`
1017-
Roletype string `json:"roletype"`
1018-
Secretkey string `json:"secretkey"`
1019-
State string `json:"state"`
1020-
Timezone string `json:"timezone"`
1021-
Username string `json:"username"`
1022-
Usersource string `json:"usersource"`
1001+
Account string `json:"account"`
1002+
Accountid string `json:"accountid"`
1003+
Accounttype int `json:"accounttype"`
1004+
Apikey string `json:"apikey"`
1005+
Created string `json:"created"`
1006+
Domain string `json:"domain"`
1007+
Domainid string `json:"domainid"`
1008+
Email string `json:"email"`
1009+
Firstname string `json:"firstname"`
1010+
Icon interface{} `json:"icon"`
1011+
Id string `json:"id"`
1012+
Iscallerchilddomain bool `json:"iscallerchilddomain"`
1013+
Isdefault bool `json:"isdefault"`
1014+
Lastname string `json:"lastname"`
1015+
Roleid string `json:"roleid"`
1016+
Rolename string `json:"rolename"`
1017+
Roletype string `json:"roletype"`
1018+
Secretkey string `json:"secretkey"`
1019+
State string `json:"state"`
1020+
Timezone string `json:"timezone"`
1021+
Username string `json:"username"`
1022+
Usersource string `json:"usersource"`
10231023
}
10241024

10251025
type LdapRemoveParams struct {

cloudstack/NetworkService.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ type CreateNetworkResponse struct {
988988
Externalid string `json:"externalid"`
989989
Gateway string `json:"gateway"`
990990
Hasannotations bool `json:"hasannotations"`
991-
Icon string `json:"icon"`
991+
Icon interface{} `json:"icon"`
992992
Id string `json:"id"`
993993
Ip6cidr string `json:"ip6cidr"`
994994
Ip6gateway string `json:"ip6gateway"`
@@ -2406,7 +2406,7 @@ type NetscalerLoadBalancerNetwork struct {
24062406
Externalid string `json:"externalid"`
24072407
Gateway string `json:"gateway"`
24082408
Hasannotations bool `json:"hasannotations"`
2409-
Icon string `json:"icon"`
2409+
Icon interface{} `json:"icon"`
24102410
Id string `json:"id"`
24112411
Ip6cidr string `json:"ip6cidr"`
24122412
Ip6gateway string `json:"ip6gateway"`
@@ -3380,7 +3380,7 @@ type Network struct {
33803380
Externalid string `json:"externalid"`
33813381
Gateway string `json:"gateway"`
33823382
Hasannotations bool `json:"hasannotations"`
3383-
Icon string `json:"icon"`
3383+
Icon interface{} `json:"icon"`
33843384
Id string `json:"id"`
33853385
Ip6cidr string `json:"ip6cidr"`
33863386
Ip6gateway string `json:"ip6gateway"`
@@ -3617,7 +3617,7 @@ type NiciraNvpDeviceNetwork struct {
36173617
Externalid string `json:"externalid"`
36183618
Gateway string `json:"gateway"`
36193619
Hasannotations bool `json:"hasannotations"`
3620-
Icon string `json:"icon"`
3620+
Icon interface{} `json:"icon"`
36213621
Id string `json:"id"`
36223622
Ip6cidr string `json:"ip6cidr"`
36233623
Ip6gateway string `json:"ip6gateway"`
@@ -3973,7 +3973,7 @@ type PaloAltoFirewallNetwork struct {
39733973
Externalid string `json:"externalid"`
39743974
Gateway string `json:"gateway"`
39753975
Hasannotations bool `json:"hasannotations"`
3976-
Icon string `json:"icon"`
3976+
Icon interface{} `json:"icon"`
39773977
Id string `json:"id"`
39783978
Ip6cidr string `json:"ip6cidr"`
39793979
Ip6gateway string `json:"ip6gateway"`
@@ -5139,7 +5139,7 @@ type UpdateNetworkResponse struct {
51395139
Externalid string `json:"externalid"`
51405140
Gateway string `json:"gateway"`
51415141
Hasannotations bool `json:"hasannotations"`
5142-
Icon string `json:"icon"`
5142+
Icon interface{} `json:"icon"`
51435143
Id string `json:"id"`
51445144
Ip6cidr string `json:"ip6cidr"`
51455145
Ip6gateway string `json:"ip6gateway"`

cloudstack/NicService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ type UpdateVmNicIpResponse struct {
545545
Hostid string `json:"hostid"`
546546
Hostname string `json:"hostname"`
547547
Hypervisor string `json:"hypervisor"`
548-
Icon string `json:"icon"`
548+
Icon interface{} `json:"icon"`
549549
Id string `json:"id"`
550550
Instancename string `json:"instancename"`
551551
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`

cloudstack/ProjectService.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ type ActivateProjectResponse struct {
150150
Displaytext string `json:"displaytext"`
151151
Domain string `json:"domain"`
152152
Domainid string `json:"domainid"`
153-
Icon string `json:"icon"`
153+
Icon interface{} `json:"icon"`
154154
Id string `json:"id"`
155155
Ipavailable string `json:"ipavailable"`
156156
Iplimit string `json:"iplimit"`
@@ -663,7 +663,7 @@ type CreateProjectResponse struct {
663663
Displaytext string `json:"displaytext"`
664664
Domain string `json:"domain"`
665665
Domainid string `json:"domainid"`
666-
Icon string `json:"icon"`
666+
Icon interface{} `json:"icon"`
667667
Id string `json:"id"`
668668
Ipavailable string `json:"ipavailable"`
669669
Iplimit string `json:"iplimit"`
@@ -1786,7 +1786,7 @@ type Project struct {
17861786
Displaytext string `json:"displaytext"`
17871787
Domain string `json:"domain"`
17881788
Domainid string `json:"domainid"`
1789-
Icon string `json:"icon"`
1789+
Icon interface{} `json:"icon"`
17901790
Id string `json:"id"`
17911791
Ipavailable string `json:"ipavailable"`
17921792
Iplimit string `json:"iplimit"`
@@ -1911,7 +1911,7 @@ type SuspendProjectResponse struct {
19111911
Displaytext string `json:"displaytext"`
19121912
Domain string `json:"domain"`
19131913
Domainid string `json:"domainid"`
1914-
Icon string `json:"icon"`
1914+
Icon interface{} `json:"icon"`
19151915
Id string `json:"id"`
19161916
Ipavailable string `json:"ipavailable"`
19171917
Iplimit string `json:"iplimit"`
@@ -2127,7 +2127,7 @@ type UpdateProjectResponse struct {
21272127
Displaytext string `json:"displaytext"`
21282128
Domain string `json:"domain"`
21292129
Domainid string `json:"domainid"`
2130-
Icon string `json:"icon"`
2130+
Icon interface{} `json:"icon"`
21312131
Id string `json:"id"`
21322132
Ipavailable string `json:"ipavailable"`
21332133
Iplimit string `json:"iplimit"`

cloudstack/SSHService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ type ResetSSHKeyForVirtualMachineResponse struct {
968968
Hostid string `json:"hostid"`
969969
Hostname string `json:"hostname"`
970970
Hypervisor string `json:"hypervisor"`
971-
Icon string `json:"icon"`
971+
Icon interface{} `json:"icon"`
972972
Id string `json:"id"`
973973
Instancename string `json:"instancename"`
974974
Isdynamicallyscalable bool `json:"isdynamicallyscalable"`

0 commit comments

Comments
 (0)