create_cluster_v2.go 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. // CreateClusterV2 invokes the emr.CreateClusterV2 API synchronously
  21. // api document: https://help.aliyun.com/api/emr/createclusterv2.html
  22. func (client *Client) CreateClusterV2(request *CreateClusterV2Request) (response *CreateClusterV2Response, err error) {
  23. response = CreateCreateClusterV2Response()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // CreateClusterV2WithChan invokes the emr.CreateClusterV2 API asynchronously
  28. // api document: https://help.aliyun.com/api/emr/createclusterv2.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) CreateClusterV2WithChan(request *CreateClusterV2Request) (<-chan *CreateClusterV2Response, <-chan error) {
  31. responseChan := make(chan *CreateClusterV2Response, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.CreateClusterV2(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. // CreateClusterV2WithCallback invokes the emr.CreateClusterV2 API asynchronously
  51. // api document: https://help.aliyun.com/api/emr/createclusterv2.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) CreateClusterV2WithCallback(request *CreateClusterV2Request, callback func(response *CreateClusterV2Response, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *CreateClusterV2Response
  57. var err error
  58. defer close(result)
  59. response, err = client.CreateClusterV2(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. // CreateClusterV2Request is the request struct for api CreateClusterV2
  71. type CreateClusterV2Request struct {
  72. *requests.RpcRequest
  73. AutoPayOrder requests.Boolean `position:"Query" name:"AutoPayOrder"`
  74. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  75. LogPath string `position:"Query" name:"LogPath"`
  76. MasterPwd string `position:"Query" name:"MasterPwd"`
  77. Configurations string `position:"Query" name:"Configurations"`
  78. SshEnable requests.Boolean `position:"Query" name:"SshEnable"`
  79. KeyPairName string `position:"Query" name:"KeyPairName"`
  80. MetaStoreType string `position:"Query" name:"MetaStoreType"`
  81. SecurityGroupName string `position:"Query" name:"SecurityGroupName"`
  82. MachineType string `position:"Query" name:"MachineType"`
  83. HostComponentInfo *[]CreateClusterV2HostComponentInfo `position:"Query" name:"HostComponentInfo" type:"Repeated"`
  84. ClickHouseConf string `position:"Query" name:"ClickHouseConf"`
  85. BootstrapAction *[]CreateClusterV2BootstrapAction `position:"Query" name:"BootstrapAction" type:"Repeated"`
  86. MetaStoreConf string `position:"Query" name:"MetaStoreConf"`
  87. EmrVer string `position:"Query" name:"EmrVer"`
  88. Tag *[]CreateClusterV2Tag `position:"Query" name:"Tag" type:"Repeated"`
  89. AuthorizeContent string `position:"Query" name:"AuthorizeContent"`
  90. IsOpenPublicIp requests.Boolean `position:"Query" name:"IsOpenPublicIp"`
  91. Period requests.Integer `position:"Query" name:"Period"`
  92. InstanceGeneration string `position:"Query" name:"InstanceGeneration"`
  93. VSwitchId string `position:"Query" name:"VSwitchId"`
  94. ClusterType string `position:"Query" name:"ClusterType"`
  95. AutoRenew requests.Boolean `position:"Query" name:"AutoRenew"`
  96. OptionSoftWareList *[]string `position:"Query" name:"OptionSoftWareList" type:"Repeated"`
  97. NetType string `position:"Query" name:"NetType"`
  98. Name string `position:"Query" name:"Name"`
  99. ZoneId string `position:"Query" name:"ZoneId"`
  100. UseCustomHiveMetaDB requests.Boolean `position:"Query" name:"UseCustomHiveMetaDB"`
  101. InitCustomHiveMetaDB requests.Boolean `position:"Query" name:"InitCustomHiveMetaDB"`
  102. IoOptimized requests.Boolean `position:"Query" name:"IoOptimized"`
  103. SecurityGroupId string `position:"Query" name:"SecurityGroupId"`
  104. EasEnable requests.Boolean `position:"Query" name:"EasEnable"`
  105. DepositType string `position:"Query" name:"DepositType"`
  106. UseLocalMetaDb requests.Boolean `position:"Query" name:"UseLocalMetaDb"`
  107. UserInfo *[]CreateClusterV2UserInfo `position:"Query" name:"UserInfo" type:"Repeated"`
  108. UserDefinedEmrEcsRole string `position:"Query" name:"UserDefinedEmrEcsRole"`
  109. WhiteListType string `position:"Query" name:"WhiteListType"`
  110. RelatedClusterId string `position:"Query" name:"RelatedClusterId"`
  111. VpcId string `position:"Query" name:"VpcId"`
  112. HostGroup *[]CreateClusterV2HostGroup `position:"Query" name:"HostGroup" type:"Repeated"`
  113. ChargeType string `position:"Query" name:"ChargeType"`
  114. ServiceInfo *[]CreateClusterV2ServiceInfo `position:"Query" name:"ServiceInfo" type:"Repeated"`
  115. Config *[]CreateClusterV2Config `position:"Query" name:"Config" type:"Repeated"`
  116. HighAvailabilityEnable requests.Boolean `position:"Query" name:"HighAvailabilityEnable"`
  117. }
  118. // CreateClusterV2HostComponentInfo is a repeated param struct in CreateClusterV2Request
  119. type CreateClusterV2HostComponentInfo struct {
  120. HostName string `name:"HostName"`
  121. ComponentNameList *[]string `name:"ComponentNameList" type:"Repeated"`
  122. ServiceName string `name:"ServiceName"`
  123. }
  124. // CreateClusterV2BootstrapAction is a repeated param struct in CreateClusterV2Request
  125. type CreateClusterV2BootstrapAction struct {
  126. Path string `name:"Path"`
  127. Arg string `name:"Arg"`
  128. Name string `name:"Name"`
  129. }
  130. // CreateClusterV2Tag is a repeated param struct in CreateClusterV2Request
  131. type CreateClusterV2Tag struct {
  132. Value string `name:"Value"`
  133. Key string `name:"Key"`
  134. }
  135. // CreateClusterV2UserInfo is a repeated param struct in CreateClusterV2Request
  136. type CreateClusterV2UserInfo struct {
  137. Password string `name:"Password"`
  138. UserId string `name:"UserId"`
  139. UserName string `name:"UserName"`
  140. }
  141. // CreateClusterV2HostGroup is a repeated param struct in CreateClusterV2Request
  142. type CreateClusterV2HostGroup struct {
  143. Period string `name:"Period"`
  144. SysDiskCapacity string `name:"SysDiskCapacity"`
  145. DiskCapacity string `name:"DiskCapacity"`
  146. SysDiskType string `name:"SysDiskType"`
  147. ClusterId string `name:"ClusterId"`
  148. DiskType string `name:"DiskType"`
  149. HostGroupName string `name:"HostGroupName"`
  150. VSwitchId string `name:"VSwitchId"`
  151. DiskCount string `name:"DiskCount"`
  152. AutoRenew string `name:"AutoRenew"`
  153. GpuDriver string `name:"GpuDriver"`
  154. HostGroupId string `name:"HostGroupId"`
  155. NodeCount string `name:"NodeCount"`
  156. InstanceType string `name:"InstanceType"`
  157. Comment string `name:"Comment"`
  158. ChargeType string `name:"ChargeType"`
  159. CreateType string `name:"CreateType"`
  160. HostGroupType string `name:"HostGroupType"`
  161. }
  162. // CreateClusterV2ServiceInfo is a repeated param struct in CreateClusterV2Request
  163. type CreateClusterV2ServiceInfo struct {
  164. ServiceVersion string `name:"ServiceVersion"`
  165. ServiceName string `name:"ServiceName"`
  166. }
  167. // CreateClusterV2Config is a repeated param struct in CreateClusterV2Request
  168. type CreateClusterV2Config struct {
  169. ConfigKey string `name:"ConfigKey"`
  170. FileName string `name:"FileName"`
  171. Encrypt string `name:"Encrypt"`
  172. Replace string `name:"Replace"`
  173. ConfigValue string `name:"ConfigValue"`
  174. ServiceName string `name:"ServiceName"`
  175. }
  176. // CreateClusterV2Response is the response struct for api CreateClusterV2
  177. type CreateClusterV2Response struct {
  178. *responses.BaseResponse
  179. RequestId string `json:"RequestId" xml:"RequestId"`
  180. ClusterId string `json:"ClusterId" xml:"ClusterId"`
  181. EmrOrderId string `json:"EmrOrderId" xml:"EmrOrderId"`
  182. MasterOrderId string `json:"MasterOrderId" xml:"MasterOrderId"`
  183. CoreOrderId string `json:"CoreOrderId" xml:"CoreOrderId"`
  184. }
  185. // CreateCreateClusterV2Request creates a request to invoke CreateClusterV2 API
  186. func CreateCreateClusterV2Request() (request *CreateClusterV2Request) {
  187. request = &CreateClusterV2Request{
  188. RpcRequest: &requests.RpcRequest{},
  189. }
  190. request.InitWithApiInfo("Emr", "2016-04-08", "CreateClusterV2", "emr", "openAPI")
  191. return
  192. }
  193. // CreateCreateClusterV2Response creates a response to parse from CreateClusterV2 response
  194. func CreateCreateClusterV2Response() (response *CreateClusterV2Response) {
  195. response = &CreateClusterV2Response{
  196. BaseResponse: &responses.BaseResponse{},
  197. }
  198. return
  199. }