Skip to content

Commit 0bc11ec

Browse files
Merge pull request #107 from kevin-lii/modify_post_request
Modify State Changing Requests to Utilize POST Request Co-authored-by: Suresh Kumar Anaparti <[email protected]>
2 parents 2298ed5 + 5ba605d commit 0bc11ec

File tree

88 files changed

+547
-535
lines changed

Some content is hidden

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

88 files changed

+547
-535
lines changed

cloudstack/ASNumberRangeService.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ func (s *ASNumberRangeService) NewCreateASNRangeParams(endasn int64, startasn in
133133

134134
// Creates a range of Autonomous Systems for BGP Dynamic Routing
135135
func (s *ASNumberRangeService) CreateASNRange(p *CreateASNRangeParams) (*CreateASNRangeResponse, error) {
136-
resp, err := s.cs.newRequest("createASNRange", p.toURLValues())
136+
resp, err := s.cs.newPostRequest("createASNRange", p.toURLValues())
137137
if err != nil {
138138
return nil, err
139139
}
@@ -203,7 +203,7 @@ func (s *ASNumberRangeService) NewDeleteASNRangeParams(id string) *DeleteASNRang
203203

204204
// deletes a range of Autonomous Systems for BGP Dynamic Routing
205205
func (s *ASNumberRangeService) DeleteASNRange(p *DeleteASNRangeParams) (*DeleteASNRangeResponse, error) {
206-
resp, err := s.cs.newRequest("deleteASNRange", p.toURLValues())
206+
resp, err := s.cs.newPostRequest("deleteASNRange", p.toURLValues())
207207
if err != nil {
208208
return nil, err
209209
}

cloudstack/ASNumberService.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ func (s *ASNumberService) NewReleaseASNumberParams(asnumber int64, zoneid string
435435

436436
// Releases an AS Number back to the pool
437437
func (s *ASNumberService) ReleaseASNumber(p *ReleaseASNumberParams) (*ReleaseASNumberResponse, error) {
438-
resp, err := s.cs.newRequest("releaseASNumber", p.toURLValues())
438+
resp, err := s.cs.newPostRequest("releaseASNumber", p.toURLValues())
439439
if err != nil {
440440
return nil, err
441441
}

cloudstack/AccountService.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func (s *AccountService) NewCreateAccountParams(email string, firstname string,
423423

424424
// Creates an account
425425
func (s *AccountService) CreateAccount(p *CreateAccountParams) (*CreateAccountResponse, error) {
426-
resp, err := s.cs.newRequest("createAccount", p.toURLValues())
426+
resp, err := s.cs.newPostRequest("createAccount", p.toURLValues())
427427
if err != nil {
428428
return nil, err
429429
}
@@ -579,7 +579,7 @@ func (s *AccountService) NewDeleteAccountParams(id string) *DeleteAccountParams
579579

580580
// Deletes a account, and all users associated with this account
581581
func (s *AccountService) DeleteAccount(p *DeleteAccountParams) (*DeleteAccountResponse, error) {
582-
resp, err := s.cs.newRequest("deleteAccount", p.toURLValues())
582+
resp, err := s.cs.newPostRequest("deleteAccount", p.toURLValues())
583583
if err != nil {
584584
return nil, err
585585
}
@@ -734,7 +734,7 @@ func (s *AccountService) NewDisableAccountParams(lock bool) *DisableAccountParam
734734

735735
// Disables an account
736736
func (s *AccountService) DisableAccount(p *DisableAccountParams) (*DisableAccountResponse, error) {
737-
resp, err := s.cs.newRequest("disableAccount", p.toURLValues())
737+
resp, err := s.cs.newPostRequest("disableAccount", p.toURLValues())
738738
if err != nil {
739739
return nil, err
740740
}
@@ -953,7 +953,7 @@ func (s *AccountService) NewEnableAccountParams() *EnableAccountParams {
953953

954954
// Enables an account
955955
func (s *AccountService) EnableAccount(p *EnableAccountParams) (*EnableAccountResponse, error) {
956-
resp, err := s.cs.newRequest("enableAccount", p.toURLValues())
956+
resp, err := s.cs.newPostRequest("enableAccount", p.toURLValues())
957957
if err != nil {
958958
return nil, err
959959
}
@@ -1317,7 +1317,7 @@ func (s *AccountService) NewLinkAccountToLdapParams(account string, domainid str
13171317

13181318
// link a cloudstack account to a group or OU in ldap
13191319
func (s *AccountService) LinkAccountToLdap(p *LinkAccountToLdapParams) (*LinkAccountToLdapResponse, error) {
1320-
resp, err := s.cs.newRequest("linkAccountToLdap", p.toURLValues())
1320+
resp, err := s.cs.newPostRequest("linkAccountToLdap", p.toURLValues())
13211321
if err != nil {
13221322
return nil, err
13231323
}
@@ -2310,7 +2310,7 @@ func (s *AccountService) NewLockAccountParams(account string, domainid string) *
23102310

23112311
// This deprecated function used to locks an account. Look for the API DisableAccount instead
23122312
func (s *AccountService) LockAccount(p *LockAccountParams) (*LockAccountResponse, error) {
2313-
resp, err := s.cs.newRequest("lockAccount", p.toURLValues())
2313+
resp, err := s.cs.newPostRequest("lockAccount", p.toURLValues())
23142314
if err != nil {
23152315
return nil, err
23162316
}
@@ -2512,7 +2512,7 @@ func (s *AccountService) NewMarkDefaultZoneForAccountParams(account string, doma
25122512

25132513
// Marks a default zone for this account
25142514
func (s *AccountService) MarkDefaultZoneForAccount(p *MarkDefaultZoneForAccountParams) (*MarkDefaultZoneForAccountResponse, error) {
2515-
resp, err := s.cs.newRequest("markDefaultZoneForAccount", p.toURLValues())
2515+
resp, err := s.cs.newPostRequest("markDefaultZoneForAccount", p.toURLValues())
25162516
if err != nil {
25172517
return nil, err
25182518
}
@@ -2830,7 +2830,7 @@ func (s *AccountService) NewUpdateAccountParams() *UpdateAccountParams {
28302830

28312831
// Updates account information for the authenticated user
28322832
func (s *AccountService) UpdateAccount(p *UpdateAccountParams) (*UpdateAccountResponse, error) {
2833-
resp, err := s.cs.newRequest("updateAccount", p.toURLValues())
2833+
resp, err := s.cs.newPostRequest("updateAccount", p.toURLValues())
28342834
if err != nil {
28352835
return nil, err
28362836
}

cloudstack/AddressService.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (s *AddressService) NewAcquirePodIpAddressParams(zoneid string) *AcquirePod
118118

119119
// Allocates IP addresses in respective Pod of a Zone
120120
func (s *AddressService) AcquirePodIpAddress(p *AcquirePodIpAddressParams) (*AcquirePodIpAddressResponse, error) {
121-
resp, err := s.cs.newRequest("acquirePodIpAddress", p.toURLValues())
121+
resp, err := s.cs.newPostRequest("acquirePodIpAddress", p.toURLValues())
122122
if err != nil {
123123
return nil, err
124124
}
@@ -408,7 +408,7 @@ func (s *AddressService) NewAssociateIpAddressParams() *AssociateIpAddressParams
408408

409409
// Acquires and associates a public IP to an account.
410410
func (s *AddressService) AssociateIpAddress(p *AssociateIpAddressParams) (*AssociateIpAddressResponse, error) {
411-
resp, err := s.cs.newRequest("associateIpAddress", p.toURLValues())
411+
resp, err := s.cs.newPostRequest("associateIpAddress", p.toURLValues())
412412
if err != nil {
413413
return nil, err
414414
}
@@ -554,7 +554,7 @@ func (s *AddressService) NewDisassociateIpAddressParams(id string) *Disassociate
554554

555555
// Disassociates an IP address from the account.
556556
func (s *AddressService) DisassociateIpAddress(p *DisassociateIpAddressParams) (*DisassociateIpAddressResponse, error) {
557-
resp, err := s.cs.newRequest("disassociateIpAddress", p.toURLValues())
557+
resp, err := s.cs.newPostRequest("disassociateIpAddress", p.toURLValues())
558558
if err != nil {
559559
return nil, err
560560
}
@@ -1440,7 +1440,7 @@ func (s *AddressService) NewUpdateIpAddressParams(id string) *UpdateIpAddressPar
14401440

14411441
// Updates an IP address
14421442
func (s *AddressService) UpdateIpAddress(p *UpdateIpAddressParams) (*UpdateIpAddressResponse, error) {
1443-
resp, err := s.cs.newRequest("updateIpAddress", p.toURLValues())
1443+
resp, err := s.cs.newPostRequest("updateIpAddress", p.toURLValues())
14441444
if err != nil {
14451445
return nil, err
14461446
}
@@ -1562,7 +1562,7 @@ func (s *AddressService) NewReleaseIpAddressParams(id string) *ReleaseIpAddressP
15621562

15631563
// Releases an IP address from the account.
15641564
func (s *AddressService) ReleaseIpAddress(p *ReleaseIpAddressParams) (*ReleaseIpAddressResponse, error) {
1565-
resp, err := s.cs.newRequest("releaseIpAddress", p.toURLValues())
1565+
resp, err := s.cs.newPostRequest("releaseIpAddress", p.toURLValues())
15661566
if err != nil {
15671567
return nil, err
15681568
}
@@ -1657,7 +1657,7 @@ func (s *AddressService) NewReleasePodIpAddressParams(id int64) *ReleasePodIpAdd
16571657

16581658
// Releases a Pod IP back to the Pod
16591659
func (s *AddressService) ReleasePodIpAddress(p *ReleasePodIpAddressParams) (*ReleasePodIpAddressResponse, error) {
1660-
resp, err := s.cs.newRequest("releasePodIpAddress", p.toURLValues())
1660+
resp, err := s.cs.newPostRequest("releasePodIpAddress", p.toURLValues())
16611661
if err != nil {
16621662
return nil, err
16631663
}
@@ -1848,7 +1848,7 @@ func (s *AddressService) NewReserveIpAddressParams(id string) *ReserveIpAddressP
18481848

18491849
// Reserve a public IP to an account.
18501850
func (s *AddressService) ReserveIpAddress(p *ReserveIpAddressParams) (*ReserveIpAddressResponse, error) {
1851-
resp, err := s.cs.newRequest("reserveIpAddress", p.toURLValues())
1851+
resp, err := s.cs.newPostRequest("reserveIpAddress", p.toURLValues())
18521852
if err != nil {
18531853
return nil, err
18541854
}

cloudstack/AffinityGroupService.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (s *AffinityGroupService) NewCreateAffinityGroupParams(name string, affinit
211211

212212
// Creates an affinity/anti-affinity group
213213
func (s *AffinityGroupService) CreateAffinityGroup(p *CreateAffinityGroupParams) (*CreateAffinityGroupResponse, error) {
214-
resp, err := s.cs.newRequest("createAffinityGroup", p.toURLValues())
214+
resp, err := s.cs.newPostRequest("createAffinityGroup", p.toURLValues())
215215
if err != nil {
216216
return nil, err
217217
}
@@ -403,7 +403,7 @@ func (s *AffinityGroupService) NewDeleteAffinityGroupParams() *DeleteAffinityGro
403403

404404
// Deletes affinity group
405405
func (s *AffinityGroupService) DeleteAffinityGroup(p *DeleteAffinityGroupParams) (*DeleteAffinityGroupResponse, error) {
406-
resp, err := s.cs.newRequest("deleteAffinityGroup", p.toURLValues())
406+
resp, err := s.cs.newPostRequest("deleteAffinityGroup", p.toURLValues())
407407
if err != nil {
408408
return nil, err
409409
}
@@ -1095,7 +1095,7 @@ func (s *AffinityGroupService) NewUpdateVMAffinityGroupParams(id string) *Update
10951095

10961096
// Updates the affinity/anti-affinity group associations of a virtual machine. The VM has to be stopped and restarted for the new properties to take effect.
10971097
func (s *AffinityGroupService) UpdateVMAffinityGroup(p *UpdateVMAffinityGroupParams) (*UpdateVMAffinityGroupResponse, error) {
1098-
resp, err := s.cs.newRequest("updateVMAffinityGroup", p.toURLValues())
1098+
resp, err := s.cs.newPostRequest("updateVMAffinityGroup", p.toURLValues())
10991099
if err != nil {
11001100
return nil, err
11011101
}

cloudstack/AlertService.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (s *AlertService) NewArchiveAlertsParams() *ArchiveAlertsParams {
162162

163163
// Archive one or more alerts.
164164
func (s *AlertService) ArchiveAlerts(p *ArchiveAlertsParams) (*ArchiveAlertsResponse, error) {
165-
resp, err := s.cs.newRequest("archiveAlerts", p.toURLValues())
165+
resp, err := s.cs.newPostRequest("archiveAlerts", p.toURLValues())
166166
if err != nil {
167167
return nil, err
168168
}
@@ -328,7 +328,7 @@ func (s *AlertService) NewDeleteAlertsParams() *DeleteAlertsParams {
328328

329329
// Delete one or more alerts.
330330
func (s *AlertService) DeleteAlerts(p *DeleteAlertsParams) (*DeleteAlertsResponse, error) {
331-
resp, err := s.cs.newRequest("deleteAlerts", p.toURLValues())
331+
resp, err := s.cs.newPostRequest("deleteAlerts", p.toURLValues())
332332
if err != nil {
333333
return nil, err
334334
}
@@ -521,7 +521,7 @@ func (s *AlertService) NewGenerateAlertParams(description string, name string, a
521521

522522
// Generates an alert
523523
func (s *AlertService) GenerateAlert(p *GenerateAlertParams) (*GenerateAlertResponse, error) {
524-
resp, err := s.cs.newRequest("generateAlert", p.toURLValues())
524+
resp, err := s.cs.newPostRequest("generateAlert", p.toURLValues())
525525
if err != nil {
526526
return nil, err
527527
}

cloudstack/AnnotationService.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (s *AnnotationService) NewAddAnnotationParams() *AddAnnotationParams {
158158

159159
// add an annotation.
160160
func (s *AnnotationService) AddAnnotation(p *AddAnnotationParams) (*AddAnnotationResponse, error) {
161-
resp, err := s.cs.newRequest("addAnnotation", p.toURLValues())
161+
resp, err := s.cs.newPostRequest("addAnnotation", p.toURLValues())
162162
if err != nil {
163163
return nil, err
164164
}
@@ -519,7 +519,7 @@ func (s *AnnotationService) NewRemoveAnnotationParams(id string) *RemoveAnnotati
519519

520520
// remove an annotation.
521521
func (s *AnnotationService) RemoveAnnotation(p *RemoveAnnotationParams) (*RemoveAnnotationResponse, error) {
522-
resp, err := s.cs.newRequest("removeAnnotation", p.toURLValues())
522+
resp, err := s.cs.newPostRequest("removeAnnotation", p.toURLValues())
523523
if err != nil {
524524
return nil, err
525525
}
@@ -624,7 +624,7 @@ func (s *AnnotationService) NewUpdateAnnotationVisibilityParams(adminsonly bool,
624624

625625
// update an annotation visibility.
626626
func (s *AnnotationService) UpdateAnnotationVisibility(p *UpdateAnnotationVisibilityParams) (*UpdateAnnotationVisibilityResponse, error) {
627-
resp, err := s.cs.newRequest("updateAnnotationVisibility", p.toURLValues())
627+
resp, err := s.cs.newPostRequest("updateAnnotationVisibility", p.toURLValues())
628628
if err != nil {
629629
return nil, err
630630
}

cloudstack/AuthenticationService.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (s *AuthenticationService) NewLogoutParams() *LogoutParams {
211211

212212
// Logs out the user
213213
func (s *AuthenticationService) Logout(p *LogoutParams) (*LogoutResponse, error) {
214-
resp, err := s.cs.newRequest("logout", p.toURLValues())
214+
resp, err := s.cs.newPostRequest("logout", p.toURLValues())
215215
if err != nil {
216216
return nil, err
217217
}
@@ -375,7 +375,7 @@ func (s *AuthenticationService) NewOauthloginParams(email string, provider strin
375375

376376
// Logs a user into the CloudStack after successful verification of OAuth secret code from the particular provider.A successful login attempt will generate a JSESSIONID cookie value that can be passed in subsequent Query command calls until the "logout" command has been issued or the session has expired.
377377
func (s *AuthenticationService) Oauthlogin(p *OauthloginParams) (*OauthloginResponse, error) {
378-
resp, err := s.cs.newRequest("oauthlogin", p.toURLValues())
378+
resp, err := s.cs.newPostRequest("oauthlogin", p.toURLValues())
379379
if err != nil {
380380
return nil, err
381381
}

0 commit comments

Comments
 (0)