export_container_group_template.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. //Licensed under the Apache License, Version 2.0 (the "License");
  2. //you may not use this file except in compliance with the License.
  3. //You may obtain a copy of the License at
  4. //
  5. //http://www.apache.org/licenses/LICENSE-2.0
  6. //
  7. //Unless required by applicable law or agreed to in writing, software
  8. //distributed under the License is distributed on an "AS IS" BASIS,
  9. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. //See the License for the specific language governing permissions and
  11. //limitations under the License.
  12. //
  13. // Code generated by Alibaba Cloud SDK Code Generator.
  14. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  15. package eci
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. // ExportContainerGroupTemplate invokes the eci.ExportContainerGroupTemplate API synchronously
  21. // api document: https://help.aliyun.com/api/eci/exportcontainergrouptemplate.html
  22. func (client *Client) ExportContainerGroupTemplate(request *ExportContainerGroupTemplateRequest) (response *ExportContainerGroupTemplateResponse, err error) {
  23. response = CreateExportContainerGroupTemplateResponse()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // ExportContainerGroupTemplateWithChan invokes the eci.ExportContainerGroupTemplate API asynchronously
  28. // api document: https://help.aliyun.com/api/eci/exportcontainergrouptemplate.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) ExportContainerGroupTemplateWithChan(request *ExportContainerGroupTemplateRequest) (<-chan *ExportContainerGroupTemplateResponse, <-chan error) {
  31. responseChan := make(chan *ExportContainerGroupTemplateResponse, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.ExportContainerGroupTemplate(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. // ExportContainerGroupTemplateWithCallback invokes the eci.ExportContainerGroupTemplate API asynchronously
  51. // api document: https://help.aliyun.com/api/eci/exportcontainergrouptemplate.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) ExportContainerGroupTemplateWithCallback(request *ExportContainerGroupTemplateRequest, callback func(response *ExportContainerGroupTemplateResponse, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *ExportContainerGroupTemplateResponse
  57. var err error
  58. defer close(result)
  59. response, err = client.ExportContainerGroupTemplate(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. // ExportContainerGroupTemplateRequest is the request struct for api ExportContainerGroupTemplate
  71. type ExportContainerGroupTemplateRequest struct {
  72. *requests.RpcRequest
  73. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  74. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  75. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  76. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  77. RegionId string `position:"Query" name:"RegionId"`
  78. ContainerGroupId string `position:"Query" name:"ContainerGroupId"`
  79. }
  80. // ExportContainerGroupTemplateResponse is the response struct for api ExportContainerGroupTemplate
  81. type ExportContainerGroupTemplateResponse struct {
  82. *responses.BaseResponse
  83. RequestId string `json:"RequestId" xml:"RequestId"`
  84. Template ExportContainerGroupTemplateTemplate0 `json:"Template" xml:"Template"`
  85. }
  86. type ExportContainerGroupTemplateTemplate0 struct {
  87. RegionId string `json:"RegionId" xml:"RegionId"`
  88. ZoneId string `json:"ZoneId" xml:"ZoneId"`
  89. SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"`
  90. VSwitchId string `json:"VSwitchId" xml:"VSwitchId"`
  91. ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"`
  92. EipInstanceId string `json:"EipInstanceId" xml:"EipInstanceId"`
  93. ContainerGroupName string `json:"ContainerGroupName" xml:"ContainerGroupName"`
  94. InstanceType string `json:"InstanceType" xml:"InstanceType"`
  95. Tags []ExportContainerGroupTemplateTags1 `json:"Tags" xml:"Tags"`
  96. Resources ExportContainerGroupTemplateResources1 `json:"Resources" xml:"Resources"`
  97. Spec ExportContainerGroupTemplateSpec1 `json:"Spec" xml:"Spec"`
  98. }
  99. type ExportContainerGroupTemplateTags1 struct {
  100. Tag []ExportContainerGroupTemplateTag2 `json:"Tag" xml:"Tag"`
  101. }
  102. type ExportContainerGroupTemplateTag2 struct {
  103. Key string `json:"Key" xml:"Key"`
  104. Value string `json:"Value" xml:"Value"`
  105. }
  106. type ExportContainerGroupTemplateResources1 struct {
  107. Cpu float32 `json:"Cpu" xml:"Cpu"`
  108. Memory float32 `json:"Memory" xml:"Memory"`
  109. }
  110. type ExportContainerGroupTemplateSpec1 struct {
  111. RestartPolicy string `json:"RestartPolicy" xml:"RestartPolicy"`
  112. DnsPolicy string `json:"DnsPolicy" xml:"DnsPolicy"`
  113. Volumes []ExportContainerGroupTemplateVolumes2 `json:"Volumes" xml:"Volumes"`
  114. InitContainers []ExportContainerGroupTemplateInitContainers2 `json:"InitContainers" xml:"InitContainers"`
  115. Containers []ExportContainerGroupTemplateContainers2 `json:"Containers" xml:"Containers"`
  116. DnsConfig ExportContainerGroupTemplateDnsConfig2 `json:"DnsConfig" xml:"DnsConfig"`
  117. SecurityContext ExportContainerGroupTemplateSecurityContext2 `json:"SecurityContext" xml:"SecurityContext"`
  118. }
  119. type ExportContainerGroupTemplateVolumes2 struct {
  120. Volume []ExportContainerGroupTemplateVolume3 `json:"Volume" xml:"Volume"`
  121. }
  122. type ExportContainerGroupTemplateVolume3 struct {
  123. Name string `json:"Name" xml:"Name"`
  124. ConfigFile ExportContainerGroupTemplateConfigFile3 `json:"ConfigFile" xml:"ConfigFile"`
  125. EmptyDir ExportContainerGroupTemplateEmptyDir3 `json:"EmptyDir" xml:"EmptyDir"`
  126. Nfs ExportContainerGroupTemplateNfs3 `json:"Nfs" xml:"Nfs"`
  127. }
  128. type ExportContainerGroupTemplateConfigFile3 struct {
  129. DefaultMode int `json:"DefaultMode" xml:"DefaultMode"`
  130. Items []ExportContainerGroupTemplateItems4 `json:"Items" xml:"Items"`
  131. }
  132. type ExportContainerGroupTemplateItems4 struct {
  133. Item []ExportContainerGroupTemplateItem5 `json:"Item" xml:"Item"`
  134. }
  135. type ExportContainerGroupTemplateItem5 struct {
  136. Mode int `json:"Mode" xml:"Mode"`
  137. Path string `json:"Path" xml:"Path"`
  138. Content string `json:"Content" xml:"Content"`
  139. }
  140. type ExportContainerGroupTemplateEmptyDir3 struct {
  141. SizeLimit string `json:"SizeLimit" xml:"SizeLimit"`
  142. }
  143. type ExportContainerGroupTemplateNfs3 struct {
  144. Server string `json:"Server" xml:"Server"`
  145. Path string `json:"Path" xml:"Path"`
  146. ReadOnly bool `json:"ReadOnly" xml:"ReadOnly"`
  147. }
  148. type ExportContainerGroupTemplateInitContainers2 struct {
  149. InitContainer []ExportContainerGroupTemplateInitContainer3 `json:"InitContainer" xml:"InitContainer"`
  150. }
  151. type ExportContainerGroupTemplateInitContainer3 struct {
  152. Name string `json:"Name" xml:"Name"`
  153. Image string `json:"Image" xml:"Image"`
  154. ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
  155. Stdin bool `json:"Stdin" xml:"Stdin"`
  156. StdinOnce bool `json:"StdinOnce" xml:"StdinOnce"`
  157. Tty bool `json:"Tty" xml:"Tty"`
  158. WorkingDir string `json:"WorkingDir" xml:"WorkingDir"`
  159. Env []ExportContainerGroupTemplateEnv3 `json:"Env" xml:"Env"`
  160. Ports []ExportContainerGroupTemplatePorts3 `json:"Ports" xml:"Ports"`
  161. VolumeMounts []ExportContainerGroupTemplateVolumeMounts3 `json:"VolumeMounts" xml:"VolumeMounts"`
  162. Command []string `json:"Command" xml:"Command"`
  163. Args []string `json:"Args" xml:"Args"`
  164. SecurityContext ExportContainerGroupTemplateSecurityContext3 `json:"SecurityContext" xml:"SecurityContext"`
  165. Resources ExportContainerGroupTemplateResources3 `json:"Resources" xml:"Resources"`
  166. }
  167. type ExportContainerGroupTemplateEnv3 struct {
  168. Env []ExportContainerGroupTemplateEnv4 `json:"Env" xml:"Env"`
  169. }
  170. type ExportContainerGroupTemplateEnv4 struct {
  171. Name string `json:"Name" xml:"Name"`
  172. Value string `json:"Value" xml:"Value"`
  173. ValueFrom ExportContainerGroupTemplateValueFrom4 `json:"ValueFrom" xml:"ValueFrom"`
  174. }
  175. type ExportContainerGroupTemplateValueFrom4 struct {
  176. FieldRef ExportContainerGroupTemplateFieldRef5 `json:"FieldRef" xml:"FieldRef"`
  177. }
  178. type ExportContainerGroupTemplateFieldRef5 struct {
  179. FieldPath string `json:"FieldPath" xml:"FieldPath"`
  180. }
  181. type ExportContainerGroupTemplatePorts3 struct {
  182. Port []ExportContainerGroupTemplatePort4 `json:"Port" xml:"Port"`
  183. }
  184. type ExportContainerGroupTemplatePort4 struct {
  185. Name string `json:"Name" xml:"Name"`
  186. Protocol string `json:"Protocol" xml:"Protocol"`
  187. ContainerPort int `json:"ContainerPort" xml:"ContainerPort"`
  188. }
  189. type ExportContainerGroupTemplateVolumeMounts3 struct {
  190. VolumeMount []ExportContainerGroupTemplateVolumeMount4 `json:"VolumeMount" xml:"VolumeMount"`
  191. }
  192. type ExportContainerGroupTemplateVolumeMount4 struct {
  193. Name string `json:"Name" xml:"Name"`
  194. SubPath string `json:"SubPath" xml:"SubPath"`
  195. MountPath string `json:"MountPath" xml:"MountPath"`
  196. ReadOnly bool `json:"ReadOnly" xml:"ReadOnly"`
  197. }
  198. type ExportContainerGroupTemplateSecurityContext3 struct {
  199. Sysctls []ExportContainerGroupTemplateSysctls4 `json:"Sysctls" xml:"Sysctls"`
  200. }
  201. type ExportContainerGroupTemplateSysctls4 struct {
  202. Sysctl []ExportContainerGroupTemplateSysctl5 `json:"Sysctl" xml:"Sysctl"`
  203. }
  204. type ExportContainerGroupTemplateSysctl5 struct {
  205. Name string `json:"Name" xml:"Name"`
  206. Value string `json:"Value" xml:"Value"`
  207. }
  208. type ExportContainerGroupTemplateResources3 struct {
  209. Cpu float32 `json:"Cpu" xml:"Cpu"`
  210. Memory float32 `json:"Memory" xml:"Memory"`
  211. }
  212. type ExportContainerGroupTemplateContainers2 struct {
  213. Containers []ExportContainerGroupTemplateContainers3 `json:"Containers" xml:"Containers"`
  214. }
  215. type ExportContainerGroupTemplateContainers3 struct {
  216. Name string `json:"Name" xml:"Name"`
  217. Image string `json:"Image" xml:"Image"`
  218. ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
  219. Stdin bool `json:"Stdin" xml:"Stdin"`
  220. StdinOnce bool `json:"StdinOnce" xml:"StdinOnce"`
  221. Tty bool `json:"Tty" xml:"Tty"`
  222. WorkingDir string `json:"WorkingDir" xml:"WorkingDir"`
  223. Env []ExportContainerGroupTemplateEnv3 `json:"Env" xml:"Env"`
  224. Ports []ExportContainerGroupTemplatePorts3 `json:"Ports" xml:"Ports"`
  225. VolumeMounts []ExportContainerGroupTemplateVolumeMounts3 `json:"VolumeMounts" xml:"VolumeMounts"`
  226. Command []string `json:"Command" xml:"Command"`
  227. Args []string `json:"Args" xml:"Args"`
  228. SecurityContext ExportContainerGroupTemplateSecurityContext3 `json:"SecurityContext" xml:"SecurityContext"`
  229. Resources ExportContainerGroupTemplateResources3 `json:"Resources" xml:"Resources"`
  230. ReadinessProbe ExportContainerGroupTemplateReadinessProbe3 `json:"ReadinessProbe" xml:"ReadinessProbe"`
  231. LivenessProbe ExportContainerGroupTemplateLivenessProbe3 `json:"LivenessProbe" xml:"LivenessProbe"`
  232. }
  233. type ExportContainerGroupTemplateReadinessProbe3 struct {
  234. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  235. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  236. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  237. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  238. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  239. Exec ExportContainerGroupTemplateExec4 `json:"Exec" xml:"Exec"`
  240. TcpSocket ExportContainerGroupTemplateTcpSocket4 `json:"TcpSocket" xml:"TcpSocket"`
  241. HttpGet ExportContainerGroupTemplateHttpGet4 `json:"HttpGet" xml:"HttpGet"`
  242. }
  243. type ExportContainerGroupTemplateExec4 struct {
  244. Command []string `json:"Command" xml:"Command"`
  245. }
  246. type ExportContainerGroupTemplateTcpSocket4 struct {
  247. Port int `json:"Port" xml:"Port"`
  248. }
  249. type ExportContainerGroupTemplateHttpGet4 struct {
  250. Scheme string `json:"Scheme" xml:"Scheme"`
  251. Path string `json:"Path" xml:"Path"`
  252. Port int `json:"Port" xml:"Port"`
  253. }
  254. type ExportContainerGroupTemplateLivenessProbe3 struct {
  255. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  256. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  257. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  258. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  259. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  260. Exec ExportContainerGroupTemplateExec4 `json:"Exec" xml:"Exec"`
  261. TcpSocket ExportContainerGroupTemplateTcpSocket4 `json:"TcpSocket" xml:"TcpSocket"`
  262. HttpGet ExportContainerGroupTemplateHttpGet4 `json:"HttpGet" xml:"HttpGet"`
  263. }
  264. type ExportContainerGroupTemplateDnsConfig2 struct {
  265. Options []ExportContainerGroupTemplateOptions3 `json:"Options" xml:"Options"`
  266. NameServers []string `json:"NameServers" xml:"NameServers"`
  267. Searches []string `json:"Searches" xml:"Searches"`
  268. }
  269. type ExportContainerGroupTemplateOptions3 struct {
  270. Option []ExportContainerGroupTemplateOption4 `json:"Option" xml:"Option"`
  271. }
  272. type ExportContainerGroupTemplateOption4 struct {
  273. Name string `json:"Name" xml:"Name"`
  274. Value string `json:"Value" xml:"Value"`
  275. }
  276. type ExportContainerGroupTemplateSecurityContext2 struct {
  277. Sysctls []ExportContainerGroupTemplateSysctls3 `json:"Sysctls" xml:"Sysctls"`
  278. }
  279. type ExportContainerGroupTemplateSysctls3 struct {
  280. Sysctl []ExportContainerGroupTemplateSysctl4 `json:"Sysctl" xml:"Sysctl"`
  281. }
  282. type ExportContainerGroupTemplateSysctl4 struct {
  283. Name string `json:"Name" xml:"Name"`
  284. Value string `json:"Value" xml:"Value"`
  285. }
  286. // CreateExportContainerGroupTemplateRequest creates a request to invoke ExportContainerGroupTemplate API
  287. func CreateExportContainerGroupTemplateRequest() (request *ExportContainerGroupTemplateRequest) {
  288. request = &ExportContainerGroupTemplateRequest{
  289. RpcRequest: &requests.RpcRequest{},
  290. }
  291. request.InitWithApiInfo("Eci", "2018-08-08", "ExportContainerGroupTemplate", "eci", "openAPI")
  292. return
  293. }
  294. // CreateExportContainerGroupTemplateResponse creates a response to parse from ExportContainerGroupTemplate response
  295. func CreateExportContainerGroupTemplateResponse() (response *ExportContainerGroupTemplateResponse) {
  296. response = &ExportContainerGroupTemplateResponse{
  297. BaseResponse: &responses.BaseResponse{},
  298. }
  299. return
  300. }