forked from aliyun/alibaba-cloud-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_hybrid_cluster.go
175 lines (161 loc) · 8.96 KB
/
create_hybrid_cluster.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
package ehpc
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)
// CreateHybridCluster invokes the ehpc.CreateHybridCluster API synchronously
func (client *Client) CreateHybridCluster(request *CreateHybridClusterRequest) (response *CreateHybridClusterResponse, err error) {
response = CreateCreateHybridClusterResponse()
err = client.DoAction(request, response)
return
}
// CreateHybridClusterWithChan invokes the ehpc.CreateHybridCluster API asynchronously
func (client *Client) CreateHybridClusterWithChan(request *CreateHybridClusterRequest) (<-chan *CreateHybridClusterResponse, <-chan error) {
responseChan := make(chan *CreateHybridClusterResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.CreateHybridCluster(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// CreateHybridClusterWithCallback invokes the ehpc.CreateHybridCluster API asynchronously
func (client *Client) CreateHybridClusterWithCallback(request *CreateHybridClusterRequest, callback func(response *CreateHybridClusterResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *CreateHybridClusterResponse
var err error
defer close(result)
response, err = client.CreateHybridCluster(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// CreateHybridClusterRequest is the request struct for api CreateHybridCluster
type CreateHybridClusterRequest struct {
*requests.RpcRequest
EcsOrderManagerInstanceType string `position:"Query" name:"EcsOrder.Manager.InstanceType"`
KeyPairName string `position:"Query" name:"KeyPairName"`
MultiOs requests.Boolean `position:"Query" name:"MultiOs"`
SecurityGroupName string `position:"Query" name:"SecurityGroupName"`
OnPremiseVolumeRemotePath string `position:"Query" name:"OnPremiseVolumeRemotePath"`
ImageOwnerAlias string `position:"Query" name:"ImageOwnerAlias"`
ResourceGroupId string `position:"Query" name:"ResourceGroupId"`
Password string `position:"Query" name:"Password"`
WinAdPar CreateHybridClusterWinAdPar `position:"Query" name:"WinAdPar" type:"Struct"`
ComputeSpotPriceLimit requests.Float `position:"Query" name:"ComputeSpotPriceLimit"`
OnPremiseVolumeLocalPath string `position:"Query" name:"OnPremiseVolumeLocalPath"`
RemoteDirectory string `position:"Query" name:"RemoteDirectory"`
ComputeSpotStrategy string `position:"Query" name:"ComputeSpotStrategy"`
PostInstallScript *[]CreateHybridClusterPostInstallScript `position:"Query" name:"PostInstallScript" type:"Repeated"`
VSwitchId string `position:"Query" name:"VSwitchId"`
Domain string `position:"Query" name:"Domain"`
Name string `position:"Query" name:"Name"`
VolumeId string `position:"Query" name:"VolumeId"`
ZoneId string `position:"Query" name:"ZoneId"`
ImageId string `position:"Query" name:"ImageId"`
ClientToken string `position:"Query" name:"ClientToken"`
EhpcVersion string `position:"Query" name:"EhpcVersion"`
SecurityGroupId string `position:"Query" name:"SecurityGroupId"`
Description string `position:"Query" name:"Description"`
EcsOrderComputeInstanceType string `position:"Query" name:"EcsOrder.Compute.InstanceType"`
OpenldapPar CreateHybridClusterOpenldapPar `position:"Query" name:"OpenldapPar" type:"Struct"`
JobQueue string `position:"Query" name:"JobQueue"`
VolumeType string `position:"Query" name:"VolumeType"`
OnPremiseVolumeMountPoint string `position:"Query" name:"OnPremiseVolumeMountPoint"`
OnPremiseVolumeProtocol string `position:"Query" name:"OnPremiseVolumeProtocol"`
VolumeProtocol string `position:"Query" name:"VolumeProtocol"`
ClientVersion string `position:"Query" name:"ClientVersion"`
OsTag string `position:"Query" name:"OsTag"`
Nodes *[]CreateHybridClusterNodes `position:"Query" name:"Nodes" type:"Repeated"`
Plugin string `position:"Query" name:"Plugin"`
Application *[]CreateHybridClusterApplication `position:"Query" name:"Application" type:"Repeated"`
VpcId string `position:"Query" name:"VpcId"`
VolumeMountpoint string `position:"Query" name:"VolumeMountpoint"`
SchedulerPreInstall requests.Boolean `position:"Query" name:"SchedulerPreInstall"`
Location string `position:"Query" name:"Location"`
}
// CreateHybridClusterWinAdPar is a repeated param struct in CreateHybridClusterRequest
type CreateHybridClusterWinAdPar struct {
AdUser string `name:"AdUser"`
AdUserPasswd string `name:"AdUserPasswd"`
AdIp string `name:"AdIp"`
AdDc string `name:"AdDc"`
}
// CreateHybridClusterPostInstallScript is a repeated param struct in CreateHybridClusterRequest
type CreateHybridClusterPostInstallScript struct {
Args string `name:"Args"`
Url string `name:"Url"`
}
// CreateHybridClusterOpenldapPar is a repeated param struct in CreateHybridClusterRequest
type CreateHybridClusterOpenldapPar struct {
BaseDn string `name:"BaseDn"`
LdapServerIp string `name:"LdapServerIp"`
}
// CreateHybridClusterNodes is a repeated param struct in CreateHybridClusterRequest
type CreateHybridClusterNodes struct {
IpAddress string `name:"IpAddress"`
HostName string `name:"HostName"`
Role string `name:"Role"`
SchedulerType string `name:"SchedulerType"`
AccountType string `name:"AccountType"`
Dir string `name:"Dir"`
}
// CreateHybridClusterApplication is a repeated param struct in CreateHybridClusterRequest
type CreateHybridClusterApplication struct {
Tag string `name:"Tag"`
}
// CreateHybridClusterResponse is the response struct for api CreateHybridCluster
type CreateHybridClusterResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
TaskId string `json:"TaskId" xml:"TaskId"`
ClusterId string `json:"ClusterId" xml:"ClusterId"`
}
// CreateCreateHybridClusterRequest creates a request to invoke CreateHybridCluster API
func CreateCreateHybridClusterRequest() (request *CreateHybridClusterRequest) {
request = &CreateHybridClusterRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("EHPC", "2018-04-12", "CreateHybridCluster", "", "")
request.Method = requests.GET
return
}
// CreateCreateHybridClusterResponse creates a response to parse from CreateHybridCluster response
func CreateCreateHybridClusterResponse() (response *CreateHybridClusterResponse) {
response = &CreateHybridClusterResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}