Skip to content

Commit f4cfaae

Browse files
Pearl1594DaanHooglandshwstppr
authored
Add ACS 4.17 support (#38)
* Add ACS 4.17 support * update 4.17 apis Signed-off-by: Abhishek Kumar <[email protected]> * add 4.17 new apis Signed-off-by: Abhishek Kumar <[email protected]> --------- Signed-off-by: Abhishek Kumar <[email protected]> Co-authored-by: dahn <[email protected]> Co-authored-by: Abhishek Kumar <[email protected]>
1 parent 0051876 commit f4cfaae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+64861
-57822
lines changed

cloudstack/AccountService.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ func (p *ListAccountsParams) toURLValues() url.Values {
10041004
return u
10051005
}
10061006
if v, found := p.p["accounttype"]; found {
1007-
vv := strconv.FormatInt(v.(int64), 10)
1007+
vv := strconv.Itoa(v.(int))
10081008
u.Set("accounttype", vv)
10091009
}
10101010
if v, found := p.p["details"]; found {
@@ -1053,18 +1053,18 @@ func (p *ListAccountsParams) toURLValues() url.Values {
10531053
return u
10541054
}
10551055

1056-
func (p *ListAccountsParams) SetAccounttype(v int64) {
1056+
func (p *ListAccountsParams) SetAccounttype(v int) {
10571057
if p.p == nil {
10581058
p.p = make(map[string]interface{})
10591059
}
10601060
p.p["accounttype"] = v
10611061
}
10621062

1063-
func (p *ListAccountsParams) GetAccounttype() (int64, bool) {
1063+
func (p *ListAccountsParams) GetAccounttype() (int, bool) {
10641064
if p.p == nil {
10651065
p.p = make(map[string]interface{})
10661066
}
1067-
value, ok := p.p["accounttype"].(int64)
1067+
value, ok := p.p["accounttype"].(int)
10681068
return value, ok
10691069
}
10701070

cloudstack/AddressService.go

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ type AddressServiceIface interface {
3737
GetPublicIpAddressByID(id string, opts ...OptionFunc) (*PublicIpAddress, int, error)
3838
UpdateIpAddress(p *UpdateIpAddressParams) (*UpdateIpAddressResponse, error)
3939
NewUpdateIpAddressParams(id string) *UpdateIpAddressParams
40+
ReleaseIpAddress(p *ReleaseIpAddressParams) (*ReleaseIpAddressResponse, error)
41+
NewReleaseIpAddressParams(id string) *ReleaseIpAddressParams
4042
}
4143

4244
type AssociateIpAddressParams struct {
@@ -1096,3 +1098,91 @@ type UpdateIpAddressResponse struct {
10961098
Zoneid string `json:"zoneid"`
10971099
Zonename string `json:"zonename"`
10981100
}
1101+
1102+
type ReleaseIpAddressParams struct {
1103+
p map[string]interface{}
1104+
}
1105+
1106+
func (p *ReleaseIpAddressParams) toURLValues() url.Values {
1107+
u := url.Values{}
1108+
if p.p == nil {
1109+
return u
1110+
}
1111+
if v, found := p.p["id"]; found {
1112+
u.Set("id", v.(string))
1113+
}
1114+
return u
1115+
}
1116+
1117+
func (p *ReleaseIpAddressParams) SetId(v string) {
1118+
if p.p == nil {
1119+
p.p = make(map[string]interface{})
1120+
}
1121+
p.p["id"] = v
1122+
}
1123+
1124+
func (p *ReleaseIpAddressParams) GetId() (string, bool) {
1125+
if p.p == nil {
1126+
p.p = make(map[string]interface{})
1127+
}
1128+
value, ok := p.p["id"].(string)
1129+
return value, ok
1130+
}
1131+
1132+
// You should always use this function to get a new ReleaseIpAddressParams instance,
1133+
// as then you are sure you have configured all required params
1134+
func (s *AddressService) NewReleaseIpAddressParams(id string) *ReleaseIpAddressParams {
1135+
p := &ReleaseIpAddressParams{}
1136+
p.p = make(map[string]interface{})
1137+
p.p["id"] = id
1138+
return p
1139+
}
1140+
1141+
// Releases an IP address from the account.
1142+
func (s *AddressService) ReleaseIpAddress(p *ReleaseIpAddressParams) (*ReleaseIpAddressResponse, error) {
1143+
resp, err := s.cs.newRequest("releaseIpAddress", p.toURLValues())
1144+
if err != nil {
1145+
return nil, err
1146+
}
1147+
1148+
var r ReleaseIpAddressResponse
1149+
if err := json.Unmarshal(resp, &r); err != nil {
1150+
return nil, err
1151+
}
1152+
1153+
return &r, nil
1154+
}
1155+
1156+
type ReleaseIpAddressResponse struct {
1157+
Displaytext string `json:"displaytext"`
1158+
JobID string `json:"jobid"`
1159+
Jobstatus int `json:"jobstatus"`
1160+
Success bool `json:"success"`
1161+
}
1162+
1163+
func (r *ReleaseIpAddressResponse) UnmarshalJSON(b []byte) error {
1164+
var m map[string]interface{}
1165+
err := json.Unmarshal(b, &m)
1166+
if err != nil {
1167+
return err
1168+
}
1169+
1170+
if success, ok := m["success"].(string); ok {
1171+
m["success"] = success == "true"
1172+
b, err = json.Marshal(m)
1173+
if err != nil {
1174+
return err
1175+
}
1176+
}
1177+
1178+
if ostypeid, ok := m["ostypeid"].(float64); ok {
1179+
m["ostypeid"] = strconv.Itoa(int(ostypeid))
1180+
b, err = json.Marshal(m)
1181+
if err != nil {
1182+
return err
1183+
}
1184+
}
1185+
1186+
type alias ReleaseIpAddressResponse
1187+
return json.Unmarshal(b, (*alias)(r))
1188+
}

cloudstack/AddressService_mock.go

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloudstack/AffinityGroupService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ type UpdateVMAffinityGroupResponse struct {
990990
Isoname string `json:"isoname"`
991991
JobID string `json:"jobid"`
992992
Jobstatus int `json:"jobstatus"`
993-
Keypair string `json:"keypair"`
993+
Keypairs string `json:"keypairs"`
994994
Lastupdated string `json:"lastupdated"`
995995
Memory int `json:"memory"`
996996
Memoryintfreekbs int64 `json:"memoryintfreekbs"`

cloudstack/BrocadeVCSService.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ type BrocadeVcsDeviceNetwork struct {
412412
Aclid string `json:"aclid"`
413413
Aclname string `json:"aclname"`
414414
Acltype string `json:"acltype"`
415+
Associatednetwork string `json:"associatednetwork"`
416+
Associatednetworkid string `json:"associatednetworkid"`
415417
Broadcastdomaintype string `json:"broadcastdomaintype"`
416418
Broadcasturi string `json:"broadcasturi"`
417419
Canusefordeploy bool `json:"canusefordeploy"`
@@ -424,13 +426,17 @@ type BrocadeVcsDeviceNetwork struct {
424426
Dns2 string `json:"dns2"`
425427
Domain string `json:"domain"`
426428
Domainid string `json:"domainid"`
429+
Egressdefaultpolicy bool `json:"egressdefaultpolicy"`
427430
Externalid string `json:"externalid"`
428431
Gateway string `json:"gateway"`
429432
Hasannotations bool `json:"hasannotations"`
430433
Icon interface{} `json:"icon"`
431434
Id string `json:"id"`
435+
Internetprotocol string `json:"internetprotocol"`
432436
Ip6cidr string `json:"ip6cidr"`
433437
Ip6gateway string `json:"ip6gateway"`
438+
Ip6routes []interface{} `json:"ip6routes"`
439+
Ip6routing string `json:"ip6routing"`
434440
Isdefault bool `json:"isdefault"`
435441
Ispersistent bool `json:"ispersistent"`
436442
Issystem bool `json:"issystem"`

cloudstack/DiskOfferingService.go

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ func (p *CreateDiskOfferingParams) toURLValues() url.Values {
9595
vv := strconv.FormatInt(v.(int64), 10)
9696
u.Set("disksize", vv)
9797
}
98+
if v, found := p.p["disksizestrictness"]; found {
99+
vv := strconv.FormatBool(v.(bool))
100+
u.Set("disksizestrictness", vv)
101+
}
98102
if v, found := p.p["displayoffering"]; found {
99103
vv := strconv.FormatBool(v.(bool))
100104
u.Set("displayoffering", vv)
@@ -329,6 +333,21 @@ func (p *CreateDiskOfferingParams) GetDisksize() (int64, bool) {
329333
return value, ok
330334
}
331335

336+
func (p *CreateDiskOfferingParams) SetDisksizestrictness(v bool) {
337+
if p.p == nil {
338+
p.p = make(map[string]interface{})
339+
}
340+
p.p["disksizestrictness"] = v
341+
}
342+
343+
func (p *CreateDiskOfferingParams) GetDisksizestrictness() (bool, bool) {
344+
if p.p == nil {
345+
p.p = make(map[string]interface{})
346+
}
347+
value, ok := p.p["disksizestrictness"].(bool)
348+
return value, ok
349+
}
350+
332351
func (p *CreateDiskOfferingParams) SetDisplayoffering(v bool) {
333352
if p.p == nil {
334353
p.p = make(map[string]interface{})
@@ -644,6 +663,7 @@ type CreateDiskOfferingResponse struct {
644663
DiskIopsWriteRateMax int64 `json:"diskIopsWriteRateMax"`
645664
DiskIopsWriteRateMaxLength int64 `json:"diskIopsWriteRateMaxLength"`
646665
Disksize int64 `json:"disksize"`
666+
Disksizestrictness bool `json:"disksizestrictness"`
647667
Displayoffering bool `json:"displayoffering"`
648668
Displaytext string `json:"displaytext"`
649669
Domain string `json:"domain"`
@@ -791,6 +811,12 @@ func (p *ListDiskOfferingsParams) toURLValues() url.Values {
791811
vv := strconv.Itoa(v.(int))
792812
u.Set("pagesize", vv)
793813
}
814+
if v, found := p.p["storageid"]; found {
815+
u.Set("storageid", v.(string))
816+
}
817+
if v, found := p.p["volumeid"]; found {
818+
u.Set("volumeid", v.(string))
819+
}
794820
if v, found := p.p["zoneid"]; found {
795821
u.Set("zoneid", v.(string))
796822
}
@@ -917,6 +943,36 @@ func (p *ListDiskOfferingsParams) GetPagesize() (int, bool) {
917943
return value, ok
918944
}
919945

946+
func (p *ListDiskOfferingsParams) SetStorageid(v string) {
947+
if p.p == nil {
948+
p.p = make(map[string]interface{})
949+
}
950+
p.p["storageid"] = v
951+
}
952+
953+
func (p *ListDiskOfferingsParams) GetStorageid() (string, bool) {
954+
if p.p == nil {
955+
p.p = make(map[string]interface{})
956+
}
957+
value, ok := p.p["storageid"].(string)
958+
return value, ok
959+
}
960+
961+
func (p *ListDiskOfferingsParams) SetVolumeid(v string) {
962+
if p.p == nil {
963+
p.p = make(map[string]interface{})
964+
}
965+
p.p["volumeid"] = v
966+
}
967+
968+
func (p *ListDiskOfferingsParams) GetVolumeid() (string, bool) {
969+
if p.p == nil {
970+
p.p = make(map[string]interface{})
971+
}
972+
value, ok := p.p["volumeid"].(string)
973+
return value, ok
974+
}
975+
920976
func (p *ListDiskOfferingsParams) SetZoneid(v string) {
921977
if p.p == nil {
922978
p.p = make(map[string]interface{})
@@ -1059,6 +1115,7 @@ type DiskOffering struct {
10591115
DiskIopsWriteRateMax int64 `json:"diskIopsWriteRateMax"`
10601116
DiskIopsWriteRateMaxLength int64 `json:"diskIopsWriteRateMaxLength"`
10611117
Disksize int64 `json:"disksize"`
1118+
Disksizestrictness bool `json:"disksizestrictness"`
10621119
Displayoffering bool `json:"displayoffering"`
10631120
Displaytext string `json:"displaytext"`
10641121
Domain string `json:"domain"`
@@ -1525,6 +1582,7 @@ type UpdateDiskOfferingResponse struct {
15251582
DiskIopsWriteRateMax int64 `json:"diskIopsWriteRateMax"`
15261583
DiskIopsWriteRateMaxLength int64 `json:"diskIopsWriteRateMaxLength"`
15271584
Disksize int64 `json:"disksize"`
1585+
Disksizestrictness bool `json:"disksizestrictness"`
15281586
Displayoffering bool `json:"displayoffering"`
15291587
Displaytext string `json:"displaytext"`
15301588
Domain string `json:"domain"`

0 commit comments

Comments
 (0)