-
Notifications
You must be signed in to change notification settings - Fork 273
/
start_k8s_app_precheck.go
124 lines (115 loc) · 5.3 KB
/
start_k8s_app_precheck.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
package edas
//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"
)
// StartK8sAppPrecheck invokes the edas.StartK8sAppPrecheck API synchronously
func (client *Client) StartK8sAppPrecheck(request *StartK8sAppPrecheckRequest) (response *StartK8sAppPrecheckResponse, err error) {
response = CreateStartK8sAppPrecheckResponse()
err = client.DoAction(request, response)
return
}
// StartK8sAppPrecheckWithChan invokes the edas.StartK8sAppPrecheck API asynchronously
func (client *Client) StartK8sAppPrecheckWithChan(request *StartK8sAppPrecheckRequest) (<-chan *StartK8sAppPrecheckResponse, <-chan error) {
responseChan := make(chan *StartK8sAppPrecheckResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.StartK8sAppPrecheck(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// StartK8sAppPrecheckWithCallback invokes the edas.StartK8sAppPrecheck API asynchronously
func (client *Client) StartK8sAppPrecheckWithCallback(request *StartK8sAppPrecheckRequest, callback func(response *StartK8sAppPrecheckResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *StartK8sAppPrecheckResponse
var err error
defer close(result)
response, err = client.StartK8sAppPrecheck(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// StartK8sAppPrecheckRequest is the request struct for api StartK8sAppPrecheck
type StartK8sAppPrecheckRequest struct {
*requests.RoaRequest
ComponentIds string `position:"Query" name:"ComponentIds"`
Replicas requests.Integer `position:"Query" name:"Replicas"`
RequestsEphemeralStorage requests.Integer `position:"Query" name:"RequestsEphemeralStorage"`
Envs string `position:"Query" name:"Envs"`
Annotations string `position:"Query" name:"Annotations"`
ClusterId string `position:"Query" name:"ClusterId"`
RequestsMem requests.Integer `position:"Query" name:"RequestsMem"`
LocalVolume string `position:"Query" name:"LocalVolume"`
EnvFroms string `position:"Query" name:"EnvFroms"`
Labels string `position:"Query" name:"Labels"`
LimitMem requests.Integer `position:"Query" name:"LimitMem"`
LimitEphemeralStorage requests.Integer `position:"Query" name:"LimitEphemeralStorage"`
LimitmCpu requests.Integer `position:"Query" name:"LimitmCpu"`
ConfigMountDescs string `position:"Query" name:"ConfigMountDescs"`
AppName string `position:"Query" name:"AppName"`
PackageUrl string `position:"Query" name:"PackageUrl"`
AppId string `position:"Query" name:"AppId"`
EmptyDirs string `position:"Query" name:"EmptyDirs"`
PvcMountDescs string `position:"Query" name:"PvcMountDescs"`
ImageUrl string `position:"Query" name:"ImageUrl"`
Namespace string `position:"Query" name:"Namespace"`
RequestsmCpu requests.Integer `position:"Query" name:"RequestsmCpu"`
JavaStartUpConfig string `position:"Query" name:"JavaStartUpConfig"`
}
// StartK8sAppPrecheckResponse is the response struct for api StartK8sAppPrecheck
type StartK8sAppPrecheckResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
Code int `json:"Code" xml:"Code"`
Message string `json:"Message" xml:"Message"`
Data Data `json:"Data" xml:"Data"`
}
// CreateStartK8sAppPrecheckRequest creates a request to invoke StartK8sAppPrecheck API
func CreateStartK8sAppPrecheckRequest() (request *StartK8sAppPrecheckRequest) {
request = &StartK8sAppPrecheckRequest{
RoaRequest: &requests.RoaRequest{},
}
request.InitWithApiInfo("Edas", "2017-08-01", "StartK8sAppPrecheck", "/pop/v5/k8s/app_precheck", "Edas", "openAPI")
request.Method = requests.POST
return
}
// CreateStartK8sAppPrecheckResponse creates a response to parse from StartK8sAppPrecheck response
func CreateStartK8sAppPrecheckResponse() (response *StartK8sAppPrecheckResponse) {
response = &StartK8sAppPrecheckResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}