describe_scaling_groups.go 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. package ess
  2. //Licensed under the Apache License, Version 2.0 (the "License");
  3. //you may not use this file except in compliance with the License.
  4. //You may obtain a copy of the License at
  5. //
  6. //http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. //Unless required by applicable law or agreed to in writing, software
  9. //distributed under the License is distributed on an "AS IS" BASIS,
  10. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. //See the License for the specific language governing permissions and
  12. //limitations under the License.
  13. //
  14. // Code generated by Alibaba Cloud SDK Code Generator.
  15. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. // DescribeScalingGroups invokes the ess.DescribeScalingGroups API synchronously
  21. // api document: https://help.aliyun.com/api/ess/describescalinggroups.html
  22. func (client *Client) DescribeScalingGroups(request *DescribeScalingGroupsRequest) (response *DescribeScalingGroupsResponse, err error) {
  23. response = CreateDescribeScalingGroupsResponse()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // DescribeScalingGroupsWithChan invokes the ess.DescribeScalingGroups API asynchronously
  28. // api document: https://help.aliyun.com/api/ess/describescalinggroups.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) DescribeScalingGroupsWithChan(request *DescribeScalingGroupsRequest) (<-chan *DescribeScalingGroupsResponse, <-chan error) {
  31. responseChan := make(chan *DescribeScalingGroupsResponse, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.DescribeScalingGroups(request)
  37. if err != nil {
  38. errChan <- err
  39. } else {
  40. responseChan <- response
  41. }
  42. })
  43. if err != nil {
  44. errChan <- err
  45. close(responseChan)
  46. close(errChan)
  47. }
  48. return responseChan, errChan
  49. }
  50. // DescribeScalingGroupsWithCallback invokes the ess.DescribeScalingGroups API asynchronously
  51. // api document: https://help.aliyun.com/api/ess/describescalinggroups.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) DescribeScalingGroupsWithCallback(request *DescribeScalingGroupsRequest, callback func(response *DescribeScalingGroupsResponse, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *DescribeScalingGroupsResponse
  57. var err error
  58. defer close(result)
  59. response, err = client.DescribeScalingGroups(request)
  60. callback(response, err)
  61. result <- 1
  62. })
  63. if err != nil {
  64. defer close(result)
  65. callback(nil, err)
  66. result <- 0
  67. }
  68. return result
  69. }
  70. // DescribeScalingGroupsRequest is the request struct for api DescribeScalingGroups
  71. type DescribeScalingGroupsRequest struct {
  72. *requests.RpcRequest
  73. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  74. ScalingGroupId10 string `position:"Query" name:"ScalingGroupId.10"`
  75. ScalingGroupId12 string `position:"Query" name:"ScalingGroupId.12"`
  76. ScalingGroupId13 string `position:"Query" name:"ScalingGroupId.13"`
  77. ScalingGroupId14 string `position:"Query" name:"ScalingGroupId.14"`
  78. ScalingGroupId15 string `position:"Query" name:"ScalingGroupId.15"`
  79. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  80. PageNumber requests.Integer `position:"Query" name:"PageNumber"`
  81. PageSize requests.Integer `position:"Query" name:"PageSize"`
  82. ScalingGroupName20 string `position:"Query" name:"ScalingGroupName.20"`
  83. ScalingGroupName19 string `position:"Query" name:"ScalingGroupName.19"`
  84. ScalingGroupId20 string `position:"Query" name:"ScalingGroupId.20"`
  85. ScalingGroupName18 string `position:"Query" name:"ScalingGroupName.18"`
  86. ScalingGroupName17 string `position:"Query" name:"ScalingGroupName.17"`
  87. ScalingGroupName16 string `position:"Query" name:"ScalingGroupName.16"`
  88. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  89. ScalingGroupName string `position:"Query" name:"ScalingGroupName"`
  90. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  91. ScalingGroupName1 string `position:"Query" name:"ScalingGroupName.1"`
  92. ScalingGroupName2 string `position:"Query" name:"ScalingGroupName.2"`
  93. ScalingGroupId2 string `position:"Query" name:"ScalingGroupId.2"`
  94. ScalingGroupId1 string `position:"Query" name:"ScalingGroupId.1"`
  95. ScalingGroupId6 string `position:"Query" name:"ScalingGroupId.6"`
  96. ScalingGroupId16 string `position:"Query" name:"ScalingGroupId.16"`
  97. ScalingGroupName7 string `position:"Query" name:"ScalingGroupName.7"`
  98. ScalingGroupName11 string `position:"Query" name:"ScalingGroupName.11"`
  99. ScalingGroupId5 string `position:"Query" name:"ScalingGroupId.5"`
  100. ScalingGroupId17 string `position:"Query" name:"ScalingGroupId.17"`
  101. ScalingGroupName8 string `position:"Query" name:"ScalingGroupName.8"`
  102. ScalingGroupName10 string `position:"Query" name:"ScalingGroupName.10"`
  103. ScalingGroupId4 string `position:"Query" name:"ScalingGroupId.4"`
  104. ScalingGroupId18 string `position:"Query" name:"ScalingGroupId.18"`
  105. ScalingGroupName9 string `position:"Query" name:"ScalingGroupName.9"`
  106. ScalingGroupId3 string `position:"Query" name:"ScalingGroupId.3"`
  107. ScalingGroupId19 string `position:"Query" name:"ScalingGroupId.19"`
  108. ScalingGroupName3 string `position:"Query" name:"ScalingGroupName.3"`
  109. ScalingGroupName15 string `position:"Query" name:"ScalingGroupName.15"`
  110. ScalingGroupId9 string `position:"Query" name:"ScalingGroupId.9"`
  111. ScalingGroupName4 string `position:"Query" name:"ScalingGroupName.4"`
  112. ScalingGroupName14 string `position:"Query" name:"ScalingGroupName.14"`
  113. ScalingGroupId8 string `position:"Query" name:"ScalingGroupId.8"`
  114. ScalingGroupName5 string `position:"Query" name:"ScalingGroupName.5"`
  115. ScalingGroupName13 string `position:"Query" name:"ScalingGroupName.13"`
  116. ScalingGroupId7 string `position:"Query" name:"ScalingGroupId.7"`
  117. ScalingGroupName6 string `position:"Query" name:"ScalingGroupName.6"`
  118. ScalingGroupName12 string `position:"Query" name:"ScalingGroupName.12"`
  119. }
  120. // DescribeScalingGroupsResponse is the response struct for api DescribeScalingGroups
  121. type DescribeScalingGroupsResponse struct {
  122. *responses.BaseResponse
  123. TotalCount int `json:"TotalCount" xml:"TotalCount"`
  124. PageNumber int `json:"PageNumber" xml:"PageNumber"`
  125. PageSize int `json:"PageSize" xml:"PageSize"`
  126. RequestId string `json:"RequestId" xml:"RequestId"`
  127. ScalingGroups ScalingGroups `json:"ScalingGroups" xml:"ScalingGroups"`
  128. }
  129. // CreateDescribeScalingGroupsRequest creates a request to invoke DescribeScalingGroups API
  130. func CreateDescribeScalingGroupsRequest() (request *DescribeScalingGroupsRequest) {
  131. request = &DescribeScalingGroupsRequest{
  132. RpcRequest: &requests.RpcRequest{},
  133. }
  134. request.InitWithApiInfo("Ess", "2014-08-28", "DescribeScalingGroups", "", "")
  135. return
  136. }
  137. // CreateDescribeScalingGroupsResponse creates a response to parse from DescribeScalingGroups response
  138. func CreateDescribeScalingGroupsResponse() (response *DescribeScalingGroupsResponse) {
  139. response = &DescribeScalingGroupsResponse{
  140. BaseResponse: &responses.BaseResponse{},
  141. }
  142. return
  143. }