describe_execution_plan.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. package emr
  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. func (client *Client) DescribeExecutionPlan(request *DescribeExecutionPlanRequest) (response *DescribeExecutionPlanResponse, err error) {
  21. response = CreateDescribeExecutionPlanResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) DescribeExecutionPlanWithChan(request *DescribeExecutionPlanRequest) (<-chan *DescribeExecutionPlanResponse, <-chan error) {
  26. responseChan := make(chan *DescribeExecutionPlanResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.DescribeExecutionPlan(request)
  32. responseChan <- response
  33. errChan <- err
  34. })
  35. if err != nil {
  36. errChan <- err
  37. close(responseChan)
  38. close(errChan)
  39. }
  40. return responseChan, errChan
  41. }
  42. func (client *Client) DescribeExecutionPlanWithCallback(request *DescribeExecutionPlanRequest, callback func(response *DescribeExecutionPlanResponse, err error)) <-chan int {
  43. result := make(chan int, 1)
  44. err := client.AddAsyncTask(func() {
  45. var response *DescribeExecutionPlanResponse
  46. var err error
  47. defer close(result)
  48. response, err = client.DescribeExecutionPlan(request)
  49. callback(response, err)
  50. result <- 1
  51. })
  52. if err != nil {
  53. defer close(result)
  54. callback(nil, err)
  55. result <- 0
  56. }
  57. return result
  58. }
  59. type DescribeExecutionPlanRequest struct {
  60. *requests.RpcRequest
  61. Id string `position:"Query" name:"Id"`
  62. ResourceOwnerId string `position:"Query" name:"ResourceOwnerId"`
  63. }
  64. type DescribeExecutionPlanResponse struct {
  65. *responses.BaseResponse
  66. RequestId string `json:"RequestId" xml:"RequestId"`
  67. Id string `json:"Id" xml:"Id"`
  68. Name string `json:"Name" xml:"Name"`
  69. Status string `json:"Status" xml:"Status"`
  70. Strategy string `json:"Strategy" xml:"Strategy"`
  71. TimeInterval int `json:"TimeInterval" xml:"TimeInterval"`
  72. StartTime int64 `json:"StartTime" xml:"StartTime"`
  73. TimeUnit string `json:"TimeUnit" xml:"TimeUnit"`
  74. DayOfWeek string `json:"DayOfWeek" xml:"DayOfWeek"`
  75. DayOfMonth string `json:"DayOfMonth" xml:"DayOfMonth"`
  76. CreateClusterOnDemand bool `json:"CreateClusterOnDemand" xml:"CreateClusterOnDemand"`
  77. ClusterId string `json:"ClusterId" xml:"ClusterId"`
  78. ClusterName string `json:"ClusterName" xml:"ClusterName"`
  79. ExecutionPlanVersion int64 `json:"ExecutionPlanVersion" xml:"ExecutionPlanVersion"`
  80. ClusterInfo struct {
  81. Name string `json:"Name" xml:"Name"`
  82. ZoneId string `json:"ZoneId" xml:"ZoneId"`
  83. LogEnable bool `json:"LogEnable" xml:"LogEnable"`
  84. LogPath string `json:"LogPath" xml:"LogPath"`
  85. SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"`
  86. EmrVer string `json:"EmrVer" xml:"EmrVer"`
  87. ClusterType string `json:"ClusterType" xml:"ClusterType"`
  88. HighAvailabilityEnable bool `json:"HighAvailabilityEnable" xml:"HighAvailabilityEnable"`
  89. VpcId string `json:"VpcId" xml:"VpcId"`
  90. VSwitchId string `json:"VSwitchId" xml:"VSwitchId"`
  91. NetType string `json:"NetType" xml:"NetType"`
  92. IoOptimized bool `json:"IoOptimized" xml:"IoOptimized"`
  93. InstanceGeneration string `json:"InstanceGeneration" xml:"InstanceGeneration"`
  94. Configurations string `json:"Configurations" xml:"Configurations"`
  95. EasEnable bool `json:"EasEnable" xml:"EasEnable"`
  96. UserDefinedEmrEcsRole string `json:"UserDefinedEmrEcsRole" xml:"UserDefinedEmrEcsRole"`
  97. SoftwareInfo struct {
  98. EmrVer string `json:"EmrVer" xml:"EmrVer"`
  99. ClusterType string `json:"ClusterType" xml:"ClusterType"`
  100. Softwares []struct {
  101. DisplayName string `json:"DisplayName" xml:"DisplayName"`
  102. Name string `json:"Name" xml:"Name"`
  103. OnlyDisplay bool `json:"OnlyDisplay" xml:"OnlyDisplay"`
  104. StartTpe int `json:"StartTpe" xml:"StartTpe"`
  105. Version string `json:"Version" xml:"Version"`
  106. Optional bool `json:"Optional" xml:"Optional"`
  107. } `json:"Softwares" xml:"Softwares"`
  108. } `json:"SoftwareInfo" xml:"SoftwareInfo"`
  109. EcsOrders []struct {
  110. Index int `json:"Index" xml:"Index"`
  111. NodeCount int `json:"NodeCount" xml:"NodeCount"`
  112. InstanceType string `json:"InstanceType" xml:"InstanceType"`
  113. DiskType string `json:"DiskType" xml:"DiskType"`
  114. DiskCapacity int `json:"DiskCapacity" xml:"DiskCapacity"`
  115. NodeType string `json:"NodeType" xml:"NodeType"`
  116. DiskCount int `json:"DiskCount" xml:"DiskCount"`
  117. } `json:"EcsOrders" xml:"EcsOrders"`
  118. BootstrapActionList []struct {
  119. Name string `json:"Name" xml:"Name"`
  120. Path string `json:"Path" xml:"Path"`
  121. Arg string `json:"Arg" xml:"Arg"`
  122. } `json:"BootstrapActionList" xml:"BootstrapActionList"`
  123. } `json:"ClusterInfo" xml:"ClusterInfo"`
  124. JobInfoList []struct {
  125. Id string `json:"Id" xml:"Id"`
  126. Name string `json:"Name" xml:"Name"`
  127. Type string `json:"Type" xml:"Type"`
  128. RunParameter string `json:"RunParameter" xml:"RunParameter"`
  129. FailAct string `json:"FailAct" xml:"FailAct"`
  130. } `json:"JobInfoList" xml:"JobInfoList"`
  131. }
  132. func CreateDescribeExecutionPlanRequest() (request *DescribeExecutionPlanRequest) {
  133. request = &DescribeExecutionPlanRequest{
  134. RpcRequest: &requests.RpcRequest{},
  135. }
  136. request.InitWithApiInfo("Emr", "2016-04-08", "DescribeExecutionPlan", "", "")
  137. return
  138. }
  139. func CreateDescribeExecutionPlanResponse() (response *DescribeExecutionPlanResponse) {
  140. response = &DescribeExecutionPlanResponse{
  141. BaseResponse: &responses.BaseResponse{},
  142. }
  143. return
  144. }