describe_scaling_instances.go 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. // DescribeScalingInstances invokes the ess.DescribeScalingInstances API synchronously
  21. // api document: https://help.aliyun.com/api/ess/describescalinginstances.html
  22. func (client *Client) DescribeScalingInstances(request *DescribeScalingInstancesRequest) (response *DescribeScalingInstancesResponse, err error) {
  23. response = CreateDescribeScalingInstancesResponse()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // DescribeScalingInstancesWithChan invokes the ess.DescribeScalingInstances API asynchronously
  28. // api document: https://help.aliyun.com/api/ess/describescalinginstances.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) DescribeScalingInstancesWithChan(request *DescribeScalingInstancesRequest) (<-chan *DescribeScalingInstancesResponse, <-chan error) {
  31. responseChan := make(chan *DescribeScalingInstancesResponse, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.DescribeScalingInstances(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. // DescribeScalingInstancesWithCallback invokes the ess.DescribeScalingInstances API asynchronously
  51. // api document: https://help.aliyun.com/api/ess/describescalinginstances.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) DescribeScalingInstancesWithCallback(request *DescribeScalingInstancesRequest, callback func(response *DescribeScalingInstancesResponse, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *DescribeScalingInstancesResponse
  57. var err error
  58. defer close(result)
  59. response, err = client.DescribeScalingInstances(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. // DescribeScalingInstancesRequest is the request struct for api DescribeScalingInstances
  71. type DescribeScalingInstancesRequest struct {
  72. *requests.RpcRequest
  73. InstanceId10 string `position:"Query" name:"InstanceId.10"`
  74. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  75. InstanceId12 string `position:"Query" name:"InstanceId.12"`
  76. InstanceId11 string `position:"Query" name:"InstanceId.11"`
  77. ScalingGroupId string `position:"Query" name:"ScalingGroupId"`
  78. LifecycleState string `position:"Query" name:"LifecycleState"`
  79. CreationType string `position:"Query" name:"CreationType"`
  80. PageNumber requests.Integer `position:"Query" name:"PageNumber"`
  81. PageSize requests.Integer `position:"Query" name:"PageSize"`
  82. InstanceId20 string `position:"Query" name:"InstanceId.20"`
  83. InstanceId1 string `position:"Query" name:"InstanceId.1"`
  84. InstanceId3 string `position:"Query" name:"InstanceId.3"`
  85. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  86. InstanceId2 string `position:"Query" name:"InstanceId.2"`
  87. InstanceId5 string `position:"Query" name:"InstanceId.5"`
  88. InstanceId4 string `position:"Query" name:"InstanceId.4"`
  89. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  90. InstanceId7 string `position:"Query" name:"InstanceId.7"`
  91. InstanceId6 string `position:"Query" name:"InstanceId.6"`
  92. InstanceId9 string `position:"Query" name:"InstanceId.9"`
  93. InstanceId8 string `position:"Query" name:"InstanceId.8"`
  94. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  95. ScalingConfigurationId string `position:"Query" name:"ScalingConfigurationId"`
  96. HealthStatus string `position:"Query" name:"HealthStatus"`
  97. InstanceId18 string `position:"Query" name:"InstanceId.18"`
  98. InstanceId17 string `position:"Query" name:"InstanceId.17"`
  99. InstanceId19 string `position:"Query" name:"InstanceId.19"`
  100. InstanceId14 string `position:"Query" name:"InstanceId.14"`
  101. InstanceId13 string `position:"Query" name:"InstanceId.13"`
  102. InstanceId16 string `position:"Query" name:"InstanceId.16"`
  103. InstanceId15 string `position:"Query" name:"InstanceId.15"`
  104. }
  105. // DescribeScalingInstancesResponse is the response struct for api DescribeScalingInstances
  106. type DescribeScalingInstancesResponse struct {
  107. *responses.BaseResponse
  108. TotalCount int `json:"TotalCount" xml:"TotalCount"`
  109. PageNumber int `json:"PageNumber" xml:"PageNumber"`
  110. PageSize int `json:"PageSize" xml:"PageSize"`
  111. RequestId string `json:"RequestId" xml:"RequestId"`
  112. ScalingInstances ScalingInstances `json:"ScalingInstances" xml:"ScalingInstances"`
  113. }
  114. // CreateDescribeScalingInstancesRequest creates a request to invoke DescribeScalingInstances API
  115. func CreateDescribeScalingInstancesRequest() (request *DescribeScalingInstancesRequest) {
  116. request = &DescribeScalingInstancesRequest{
  117. RpcRequest: &requests.RpcRequest{},
  118. }
  119. request.InitWithApiInfo("Ess", "2014-08-28", "DescribeScalingInstances", "ess", "openAPI")
  120. return
  121. }
  122. // CreateDescribeScalingInstancesResponse creates a response to parse from DescribeScalingInstances response
  123. func CreateDescribeScalingInstancesResponse() (response *DescribeScalingInstancesResponse) {
  124. response = &DescribeScalingInstancesResponse{
  125. BaseResponse: &responses.BaseResponse{},
  126. }
  127. return
  128. }