describe_container_groups.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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. // DescribeContainerGroups invokes the eci.DescribeContainerGroups API synchronously
  21. // api document: https://help.aliyun.com/api/eci/describecontainergroups.html
  22. func (client *Client) DescribeContainerGroups(request *DescribeContainerGroupsRequest) (response *DescribeContainerGroupsResponse, err error) {
  23. response = CreateDescribeContainerGroupsResponse()
  24. err = client.DoAction(request, response)
  25. return
  26. }
  27. // DescribeContainerGroupsWithChan invokes the eci.DescribeContainerGroups API asynchronously
  28. // api document: https://help.aliyun.com/api/eci/describecontainergroups.html
  29. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  30. func (client *Client) DescribeContainerGroupsWithChan(request *DescribeContainerGroupsRequest) (<-chan *DescribeContainerGroupsResponse, <-chan error) {
  31. responseChan := make(chan *DescribeContainerGroupsResponse, 1)
  32. errChan := make(chan error, 1)
  33. err := client.AddAsyncTask(func() {
  34. defer close(responseChan)
  35. defer close(errChan)
  36. response, err := client.DescribeContainerGroups(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. // DescribeContainerGroupsWithCallback invokes the eci.DescribeContainerGroups API asynchronously
  51. // api document: https://help.aliyun.com/api/eci/describecontainergroups.html
  52. // asynchronous document: https://help.aliyun.com/document_detail/66220.html
  53. func (client *Client) DescribeContainerGroupsWithCallback(request *DescribeContainerGroupsRequest, callback func(response *DescribeContainerGroupsResponse, err error)) <-chan int {
  54. result := make(chan int, 1)
  55. err := client.AddAsyncTask(func() {
  56. var response *DescribeContainerGroupsResponse
  57. var err error
  58. defer close(result)
  59. response, err = client.DescribeContainerGroups(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. // DescribeContainerGroupsRequest is the request struct for api DescribeContainerGroups
  71. type DescribeContainerGroupsRequest 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. ZoneId string `position:"Query" name:"ZoneId"`
  79. VSwitchId string `position:"Query" name:"VSwitchId"`
  80. NextToken string `position:"Query" name:"NextToken"`
  81. Limit requests.Integer `position:"Query" name:"Limit"`
  82. Tag *[]DescribeContainerGroupsTag `position:"Query" name:"Tag" type:"Repeated"`
  83. ContainerGroupIds string `position:"Query" name:"ContainerGroupIds"`
  84. ContainerGroupName string `position:"Query" name:"ContainerGroupName"`
  85. Status string `position:"Query" name:"Status"`
  86. }
  87. type DescribeContainerGroupsTag struct {
  88. Key string `name:"Key"`
  89. Value string `name:"Value"`
  90. }
  91. // DescribeContainerGroupsResponse is the response struct for api DescribeContainerGroups
  92. type DescribeContainerGroupsResponse struct {
  93. *responses.BaseResponse
  94. RequestId string `json:"RequestId" xml:"RequestId"`
  95. NextToken string `json:"NextToken" xml:"NextToken"`
  96. TotalCount int `json:"TotalCount" xml:"TotalCount"`
  97. ContainerGroups []DescribeContainerGroupsContainerGroup0 `json:"ContainerGroups" xml:"ContainerGroups"`
  98. }
  99. type DescribeContainerGroupsContainerGroup0 struct {
  100. ContainerGroupId string `json:"ContainerGroupId" xml:"ContainerGroupId"`
  101. ContainerGroupName string `json:"ContainerGroupName" xml:"ContainerGroupName"`
  102. RegionId string `json:"RegionId" xml:"RegionId"`
  103. ZoneId string `json:"ZoneId" xml:"ZoneId"`
  104. Memory float32 `json:"Memory" xml:"Memory"`
  105. Cpu float32 `json:"Cpu" xml:"Cpu"`
  106. VSwitchId string `json:"VSwitchId" xml:"VSwitchId"`
  107. SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"`
  108. RestartPolicy string `json:"RestartPolicy" xml:"RestartPolicy"`
  109. IntranetIp string `json:"IntranetIp" xml:"IntranetIp"`
  110. Status string `json:"Status" xml:"Status"`
  111. InternetIp string `json:"InternetIp" xml:"InternetIp"`
  112. CreationTime string `json:"CreationTime" xml:"CreationTime"`
  113. SucceededTime string `json:"SucceededTime" xml:"SucceededTime"`
  114. EniInstanceId string `json:"EniInstanceId" xml:"EniInstanceId"`
  115. InstanceType string `json:"InstanceType" xml:"InstanceType"`
  116. ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"`
  117. FailedTime string `json:"FailedTime" xml:"FailedTime"`
  118. Tags []DescribeContainerGroupsLabel1 `json:"Tags" xml:"Tags"`
  119. Events []DescribeContainerGroupsEvent1 `json:"Events" xml:"Events"`
  120. Containers []DescribeContainerGroupsContainer1 `json:"Containers" xml:"Containers"`
  121. Volumes []DescribeContainerGroupsVolume1 `json:"Volumes" xml:"Volumes"`
  122. InitContainers []DescribeContainerGroupsContainer1 `json:"InitContainers" xml:"InitContainers"`
  123. HostAliases []DescribeContainerGroupsHostAliase1 `json:"HostAliases" xml:"HostAliases"`
  124. DnsConfig DescribeContainerGroupsDnsConfig1 `json:"DnsConfig" xml:"DnsConfig"`
  125. EciSecurityContext DescribeContainerGroupsEciSecurityContext1 `json:"EciSecurityContext" xml:"EciSecurityContext"`
  126. }
  127. type DescribeContainerGroupsLabel1 struct {
  128. Key string `json:"Key" xml:"Key"`
  129. Value string `json:"Value" xml:"Value"`
  130. }
  131. type DescribeContainerGroupsEvent1 struct {
  132. Count int `json:"Count" xml:"Count"`
  133. Type string `json:"Type" xml:"Type"`
  134. Name string `json:"Name" xml:"Name"`
  135. Message string `json:"Message" xml:"Message"`
  136. FirstTimestamp string `json:"FirstTimestamp" xml:"FirstTimestamp"`
  137. LastTimestamp string `json:"LastTimestamp" xml:"LastTimestamp"`
  138. Reason string `json:"Reason" xml:"Reason"`
  139. }
  140. type DescribeContainerGroupsContainer1 struct {
  141. Name string `json:"Name" xml:"Name"`
  142. Image string `json:"Image" xml:"Image"`
  143. Memory float32 `json:"Memory" xml:"Memory"`
  144. Cpu float32 `json:"Cpu" xml:"Cpu"`
  145. RestartCount int `json:"RestartCount" xml:"RestartCount"`
  146. WorkingDir string `json:"WorkingDir" xml:"WorkingDir"`
  147. ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
  148. Ready bool `json:"Ready" xml:"Ready"`
  149. Gpu int `json:"Gpu" xml:"Gpu"`
  150. VolumeMounts []DescribeContainerGroupsVolumeMount2 `json:"VolumeMounts" xml:"VolumeMounts"`
  151. Ports []DescribeContainerGroupsPort2 `json:"Ports" xml:"Ports"`
  152. EnvironmentVars []DescribeContainerGroupsEnvironmentVar2 `json:"EnvironmentVars" xml:"EnvironmentVars"`
  153. Commands []string `json:"Commands" xml:"Commands"`
  154. Args []string `json:"Args" xml:"Args"`
  155. PreviousState DescribeContainerGroupsPreviousState2 `json:"PreviousState" xml:"PreviousState"`
  156. CurrentState DescribeContainerGroupsCurrentState2 `json:"CurrentState" xml:"CurrentState"`
  157. ReadinessProbe DescribeContainerGroupsReadinessProbe2 `json:"ReadinessProbe" xml:"ReadinessProbe"`
  158. LivenessProbe DescribeContainerGroupsLivenessProbe2 `json:"LivenessProbe" xml:"LivenessProbe"`
  159. SecurityContext DescribeContainerGroupsSecurityContext2 `json:"SecurityContext" xml:"SecurityContext"`
  160. }
  161. type DescribeContainerGroupsVolumeMount2 struct {
  162. Name string `json:"Name" xml:"Name"`
  163. MountPath string `json:"MountPath" xml:"MountPath"`
  164. ReadOnly bool `json:"ReadOnly" xml:"ReadOnly"`
  165. }
  166. type DescribeContainerGroupsPort2 struct {
  167. Port int `json:"Port" xml:"Port"`
  168. Protocol string `json:"Protocol" xml:"Protocol"`
  169. }
  170. type DescribeContainerGroupsEnvironmentVar2 struct {
  171. Key string `json:"Key" xml:"Key"`
  172. Value string `json:"Value" xml:"Value"`
  173. ValueFrom DescribeContainerGroupsValueFrom3 `json:"ValueFrom" xml:"ValueFrom"`
  174. }
  175. type DescribeContainerGroupsValueFrom3 struct {
  176. FieldRef DescribeContainerGroupsFieldRef4 `json:"FieldRef" xml:"FieldRef"`
  177. }
  178. type DescribeContainerGroupsFieldRef4 struct {
  179. FieldPath string `json:"FieldPath" xml:"FieldPath"`
  180. }
  181. type DescribeContainerGroupsPreviousState2 struct {
  182. State string `json:"State" xml:"State"`
  183. DetailStatus string `json:"DetailStatus" xml:"DetailStatus"`
  184. ExitCode int `json:"ExitCode" xml:"ExitCode"`
  185. StartTime string `json:"StartTime" xml:"StartTime"`
  186. FinishTime string `json:"FinishTime" xml:"FinishTime"`
  187. Reason string `json:"Reason" xml:"Reason"`
  188. Message string `json:"Message" xml:"Message"`
  189. Signal int `json:"Signal" xml:"Signal"`
  190. }
  191. type DescribeContainerGroupsCurrentState2 struct {
  192. State string `json:"State" xml:"State"`
  193. DetailStatus string `json:"DetailStatus" xml:"DetailStatus"`
  194. ExitCode int `json:"ExitCode" xml:"ExitCode"`
  195. StartTime string `json:"StartTime" xml:"StartTime"`
  196. FinishTime string `json:"FinishTime" xml:"FinishTime"`
  197. Reason string `json:"Reason" xml:"Reason"`
  198. Message string `json:"Message" xml:"Message"`
  199. Signal int `json:"Signal" xml:"Signal"`
  200. }
  201. type DescribeContainerGroupsReadinessProbe2 struct {
  202. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  203. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  204. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  205. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  206. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  207. Execs []string `json:"Execs" xml:"Execs"`
  208. HttpGet DescribeContainerGroupsHttpGet3 `json:"HttpGet" xml:"HttpGet"`
  209. TcpSocket DescribeContainerGroupsTcpSocket3 `json:"TcpSocket" xml:"TcpSocket"`
  210. }
  211. type DescribeContainerGroupsHttpGet3 struct {
  212. Path string `json:"Path" xml:"Path"`
  213. Port int `json:"Port" xml:"Port"`
  214. Scheme string `json:"Scheme" xml:"Scheme"`
  215. }
  216. type DescribeContainerGroupsTcpSocket3 struct {
  217. Host string `json:"Host" xml:"Host"`
  218. Port int `json:"Port" xml:"Port"`
  219. }
  220. type DescribeContainerGroupsLivenessProbe2 struct {
  221. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  222. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  223. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  224. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  225. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  226. Execs []string `json:"Execs" xml:"Execs"`
  227. HttpGet DescribeContainerGroupsHttpGet3 `json:"HttpGet" xml:"HttpGet"`
  228. TcpSocket DescribeContainerGroupsTcpSocket3 `json:"TcpSocket" xml:"TcpSocket"`
  229. }
  230. type DescribeContainerGroupsSecurityContext2 struct {
  231. ReadOnlyRootFilesystem bool `json:"ReadOnlyRootFilesystem" xml:"ReadOnlyRootFilesystem"`
  232. RunAsUser int64 `json:"RunAsUser" xml:"RunAsUser"`
  233. Capability DescribeContainerGroupsCapability3 `json:"Capability" xml:"Capability"`
  234. }
  235. type DescribeContainerGroupsCapability3 struct {
  236. Adds []string `json:"Adds" xml:"Adds"`
  237. }
  238. type DescribeContainerGroupsVolume1 struct {
  239. Type string `json:"Type" xml:"Type"`
  240. Name string `json:"Name" xml:"Name"`
  241. NFSVolumePath string `json:"NFSVolumePath" xml:"NFSVolumePath"`
  242. NFSVolumeServer string `json:"NFSVolumeServer" xml:"NFSVolumeServer"`
  243. NFSVolumeReadOnly bool `json:"NFSVolumeReadOnly" xml:"NFSVolumeReadOnly"`
  244. ConfigFileVolumeConfigFileToPaths []DescribeContainerGroupsConfigFileVolumeConfigFileToPath2 `json:"ConfigFileVolumeConfigFileToPaths" xml:"ConfigFileVolumeConfigFileToPaths"`
  245. }
  246. type DescribeContainerGroupsConfigFileVolumeConfigFileToPath2 struct {
  247. Content string `json:"Content" xml:"Content"`
  248. Path string `json:"Path" xml:"Path"`
  249. }
  250. type DescribeContainerGroupsHostAliase1 struct {
  251. Ip string `json:"Ip" xml:"Ip"`
  252. Hostnames []string `json:"Hostnames" xml:"Hostnames"`
  253. }
  254. type DescribeContainerGroupsDnsConfig1 struct {
  255. Options []DescribeContainerGroupsOption2 `json:"Options" xml:"Options"`
  256. NameServers []string `json:"NameServers" xml:"NameServers"`
  257. Searches []string `json:"Searches" xml:"Searches"`
  258. }
  259. type DescribeContainerGroupsOption2 struct {
  260. Name string `json:"Name" xml:"Name"`
  261. Value string `json:"Value" xml:"Value"`
  262. }
  263. type DescribeContainerGroupsEciSecurityContext1 struct {
  264. Sysctls []DescribeContainerGroupsSysctl2 `json:"Sysctls" xml:"Sysctls"`
  265. }
  266. type DescribeContainerGroupsSysctl2 struct {
  267. Name string `json:"Name" xml:"Name"`
  268. Value string `json:"Value" xml:"Value"`
  269. }
  270. // CreateDescribeContainerGroupsRequest creates a request to invoke DescribeContainerGroups API
  271. func CreateDescribeContainerGroupsRequest() (request *DescribeContainerGroupsRequest) {
  272. request = &DescribeContainerGroupsRequest{
  273. RpcRequest: &requests.RpcRequest{},
  274. }
  275. request.InitWithApiInfo("Eci", "2018-08-08", "DescribeContainerGroups", "eci", "openAPI")
  276. return
  277. }
  278. // CreateDescribeContainerGroupsResponse creates a response to parse from DescribeContainerGroups response
  279. func CreateDescribeContainerGroupsResponse() (response *DescribeContainerGroupsResponse) {
  280. response = &DescribeContainerGroupsResponse{
  281. BaseResponse: &responses.BaseResponse{},
  282. }
  283. return
  284. }