describe_cluster_basic_info.go 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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) DescribeClusterBasicInfo(request *DescribeClusterBasicInfoRequest) (response *DescribeClusterBasicInfoResponse, err error) {
  21. response = CreateDescribeClusterBasicInfoResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) DescribeClusterBasicInfoWithChan(request *DescribeClusterBasicInfoRequest) (<-chan *DescribeClusterBasicInfoResponse, <-chan error) {
  26. responseChan := make(chan *DescribeClusterBasicInfoResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.DescribeClusterBasicInfo(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) DescribeClusterBasicInfoWithCallback(request *DescribeClusterBasicInfoRequest, callback func(response *DescribeClusterBasicInfoResponse, err error)) <-chan int {
  43. result := make(chan int, 1)
  44. err := client.AddAsyncTask(func() {
  45. var response *DescribeClusterBasicInfoResponse
  46. var err error
  47. defer close(result)
  48. response, err = client.DescribeClusterBasicInfo(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 DescribeClusterBasicInfoRequest struct {
  60. *requests.RpcRequest
  61. ClusterId string `position:"Query" name:"ClusterId"`
  62. ResourceOwnerId string `position:"Query" name:"ResourceOwnerId"`
  63. }
  64. type DescribeClusterBasicInfoResponse struct {
  65. *responses.BaseResponse
  66. RequestId string `json:"RequestId" xml:"RequestId"`
  67. ClusterInfo struct {
  68. Id string `json:"Id" xml:"Id"`
  69. BizId string `json:"BizId" xml:"BizId"`
  70. RegionId string `json:"RegionId" xml:"RegionId"`
  71. ZoneId string `json:"ZoneId" xml:"ZoneId"`
  72. Name string `json:"Name" xml:"Name"`
  73. CreateType string `json:"CreateType" xml:"CreateType"`
  74. StartTime int64 `json:"StartTime" xml:"StartTime"`
  75. StopTime int64 `json:"StopTime" xml:"StopTime"`
  76. LogEnable bool `json:"LogEnable" xml:"LogEnable"`
  77. LogPath string `json:"LogPath" xml:"LogPath"`
  78. Status string `json:"Status" xml:"Status"`
  79. HighAvailabilityEnable bool `json:"HighAvailabilityEnable" xml:"HighAvailabilityEnable"`
  80. ChargeType string `json:"ChargeType" xml:"ChargeType"`
  81. ExpiredTime int64 `json:"ExpiredTime" xml:"ExpiredTime"`
  82. Period int `json:"Period" xml:"Period"`
  83. RunningTime int `json:"RunningTime" xml:"RunningTime"`
  84. MasterNodeTotal int `json:"MasterNodeTotal" xml:"MasterNodeTotal"`
  85. MasterNodeInService int `json:"MasterNodeInService" xml:"MasterNodeInService"`
  86. CoreNodeTotal int `json:"CoreNodeTotal" xml:"CoreNodeTotal"`
  87. CoreNodeInService int `json:"CoreNodeInService" xml:"CoreNodeInService"`
  88. TaskNodeTotal int `json:"TaskNodeTotal" xml:"TaskNodeTotal"`
  89. TaskNodeInService int `json:"TaskNodeInService" xml:"TaskNodeInService"`
  90. ShowSoftwareInterface bool `json:"ShowSoftwareInterface" xml:"ShowSoftwareInterface"`
  91. VpcId string `json:"VpcId" xml:"VpcId"`
  92. VSwitchId string `json:"VSwitchId" xml:"VSwitchId"`
  93. NetType string `json:"NetType" xml:"NetType"`
  94. UserDefinedEmrEcsRole string `json:"UserDefinedEmrEcsRole" xml:"UserDefinedEmrEcsRole"`
  95. IoOptimized bool `json:"IoOptimized" xml:"IoOptimized"`
  96. InstanceGeneration string `json:"InstanceGeneration" xml:"InstanceGeneration"`
  97. BootstrapFailed bool `json:"BootstrapFailed" xml:"BootstrapFailed"`
  98. Configurations string `json:"Configurations" xml:"Configurations"`
  99. ImageId string `json:"ImageId" xml:"ImageId"`
  100. SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"`
  101. SecurityGroupName string `json:"SecurityGroupName" xml:"SecurityGroupName"`
  102. EasEnable bool `json:"EasEnable" xml:"EasEnable"`
  103. SoftwareInfo struct {
  104. EmrVer string `json:"EmrVer" xml:"EmrVer"`
  105. ClusterType string `json:"ClusterType" xml:"ClusterType"`
  106. Softwares []struct {
  107. DisplayName string `json:"DisplayName" xml:"DisplayName"`
  108. Name string `json:"Name" xml:"Name"`
  109. OnlyDisplay bool `json:"OnlyDisplay" xml:"OnlyDisplay"`
  110. StartTpe int `json:"StartTpe" xml:"StartTpe"`
  111. Version string `json:"Version" xml:"Version"`
  112. } `json:"Softwares" xml:"Softwares"`
  113. } `json:"SoftwareInfo" xml:"SoftwareInfo"`
  114. FailReason struct {
  115. ErrorCode string `json:"ErrorCode" xml:"ErrorCode"`
  116. ErrorMsg string `json:"ErrorMsg" xml:"ErrorMsg"`
  117. RequestId string `json:"RequestId" xml:"RequestId"`
  118. } `json:"FailReason" xml:"FailReason"`
  119. BootstrapActionList []struct {
  120. Name string `json:"Name" xml:"Name"`
  121. Path string `json:"Path" xml:"Path"`
  122. Arg string `json:"Arg" xml:"Arg"`
  123. } `json:"BootstrapActionList" xml:"BootstrapActionList"`
  124. } `json:"ClusterInfo" xml:"ClusterInfo"`
  125. }
  126. func CreateDescribeClusterBasicInfoRequest() (request *DescribeClusterBasicInfoRequest) {
  127. request = &DescribeClusterBasicInfoRequest{
  128. RpcRequest: &requests.RpcRequest{},
  129. }
  130. request.InitWithApiInfo("Emr", "2016-04-08", "DescribeClusterBasicInfo", "", "")
  131. return
  132. }
  133. func CreateDescribeClusterBasicInfoResponse() (response *DescribeClusterBasicInfoResponse) {
  134. response = &DescribeClusterBasicInfoResponse{
  135. BaseResponse: &responses.BaseResponse{},
  136. }
  137. return
  138. }