describe_container_groups.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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. RamRoleName string `json:"RamRoleName" xml:"RamRoleName"`
  119. Tags []DescribeContainerGroupsLabel1 `json:"Tags" xml:"Tags"`
  120. Events []DescribeContainerGroupsEvent1 `json:"Events" xml:"Events"`
  121. Containers []DescribeContainerGroupsContainer1 `json:"Containers" xml:"Containers"`
  122. Volumes []DescribeContainerGroupsVolume1 `json:"Volumes" xml:"Volumes"`
  123. InitContainers []DescribeContainerGroupsContainer1 `json:"InitContainers" xml:"InitContainers"`
  124. HostAliases []DescribeContainerGroupsHostAliase1 `json:"HostAliases" xml:"HostAliases"`
  125. DnsConfig DescribeContainerGroupsDnsConfig1 `json:"DnsConfig" xml:"DnsConfig"`
  126. EciSecurityContext DescribeContainerGroupsEciSecurityContext1 `json:"EciSecurityContext" xml:"EciSecurityContext"`
  127. }
  128. type DescribeContainerGroupsLabel1 struct {
  129. Key string `json:"Key" xml:"Key"`
  130. Value string `json:"Value" xml:"Value"`
  131. }
  132. type DescribeContainerGroupsEvent1 struct {
  133. Count int `json:"Count" xml:"Count"`
  134. Type string `json:"Type" xml:"Type"`
  135. Name string `json:"Name" xml:"Name"`
  136. Message string `json:"Message" xml:"Message"`
  137. FirstTimestamp string `json:"FirstTimestamp" xml:"FirstTimestamp"`
  138. LastTimestamp string `json:"LastTimestamp" xml:"LastTimestamp"`
  139. Reason string `json:"Reason" xml:"Reason"`
  140. }
  141. type DescribeContainerGroupsContainer1 struct {
  142. Name string `json:"Name" xml:"Name"`
  143. Image string `json:"Image" xml:"Image"`
  144. Memory float32 `json:"Memory" xml:"Memory"`
  145. Cpu float32 `json:"Cpu" xml:"Cpu"`
  146. RestartCount int `json:"RestartCount" xml:"RestartCount"`
  147. WorkingDir string `json:"WorkingDir" xml:"WorkingDir"`
  148. ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
  149. Ready bool `json:"Ready" xml:"Ready"`
  150. Gpu int `json:"Gpu" xml:"Gpu"`
  151. VolumeMounts []DescribeContainerGroupsVolumeMount2 `json:"VolumeMounts" xml:"VolumeMounts"`
  152. Ports []DescribeContainerGroupsPort2 `json:"Ports" xml:"Ports"`
  153. EnvironmentVars []DescribeContainerGroupsEnvironmentVar2 `json:"EnvironmentVars" xml:"EnvironmentVars"`
  154. Commands []string `json:"Commands" xml:"Commands"`
  155. Args []string `json:"Args" xml:"Args"`
  156. PreviousState DescribeContainerGroupsPreviousState2 `json:"PreviousState" xml:"PreviousState"`
  157. CurrentState DescribeContainerGroupsCurrentState2 `json:"CurrentState" xml:"CurrentState"`
  158. ReadinessProbe DescribeContainerGroupsReadinessProbe2 `json:"ReadinessProbe" xml:"ReadinessProbe"`
  159. LivenessProbe DescribeContainerGroupsLivenessProbe2 `json:"LivenessProbe" xml:"LivenessProbe"`
  160. SecurityContext DescribeContainerGroupsSecurityContext2 `json:"SecurityContext" xml:"SecurityContext"`
  161. }
  162. type DescribeContainerGroupsVolumeMount2 struct {
  163. Name string `json:"Name" xml:"Name"`
  164. MountPath string `json:"MountPath" xml:"MountPath"`
  165. ReadOnly bool `json:"ReadOnly" xml:"ReadOnly"`
  166. }
  167. type DescribeContainerGroupsPort2 struct {
  168. Port int `json:"Port" xml:"Port"`
  169. Protocol string `json:"Protocol" xml:"Protocol"`
  170. }
  171. type DescribeContainerGroupsEnvironmentVar2 struct {
  172. Key string `json:"Key" xml:"Key"`
  173. Value string `json:"Value" xml:"Value"`
  174. ValueFrom DescribeContainerGroupsValueFrom3 `json:"ValueFrom" xml:"ValueFrom"`
  175. }
  176. type DescribeContainerGroupsValueFrom3 struct {
  177. FieldRef DescribeContainerGroupsFieldRef4 `json:"FieldRef" xml:"FieldRef"`
  178. }
  179. type DescribeContainerGroupsFieldRef4 struct {
  180. FieldPath string `json:"FieldPath" xml:"FieldPath"`
  181. }
  182. type DescribeContainerGroupsPreviousState2 struct {
  183. State string `json:"State" xml:"State"`
  184. DetailStatus string `json:"DetailStatus" xml:"DetailStatus"`
  185. ExitCode int `json:"ExitCode" xml:"ExitCode"`
  186. StartTime string `json:"StartTime" xml:"StartTime"`
  187. FinishTime string `json:"FinishTime" xml:"FinishTime"`
  188. Reason string `json:"Reason" xml:"Reason"`
  189. Message string `json:"Message" xml:"Message"`
  190. Signal int `json:"Signal" xml:"Signal"`
  191. }
  192. type DescribeContainerGroupsCurrentState2 struct {
  193. State string `json:"State" xml:"State"`
  194. DetailStatus string `json:"DetailStatus" xml:"DetailStatus"`
  195. ExitCode int `json:"ExitCode" xml:"ExitCode"`
  196. StartTime string `json:"StartTime" xml:"StartTime"`
  197. FinishTime string `json:"FinishTime" xml:"FinishTime"`
  198. Reason string `json:"Reason" xml:"Reason"`
  199. Message string `json:"Message" xml:"Message"`
  200. Signal int `json:"Signal" xml:"Signal"`
  201. }
  202. type DescribeContainerGroupsReadinessProbe2 struct {
  203. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  204. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  205. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  206. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  207. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  208. Execs []string `json:"Execs" xml:"Execs"`
  209. HttpGet DescribeContainerGroupsHttpGet3 `json:"HttpGet" xml:"HttpGet"`
  210. TcpSocket DescribeContainerGroupsTcpSocket3 `json:"TcpSocket" xml:"TcpSocket"`
  211. }
  212. type DescribeContainerGroupsHttpGet3 struct {
  213. Path string `json:"Path" xml:"Path"`
  214. Port int `json:"Port" xml:"Port"`
  215. Scheme string `json:"Scheme" xml:"Scheme"`
  216. }
  217. type DescribeContainerGroupsTcpSocket3 struct {
  218. Host string `json:"Host" xml:"Host"`
  219. Port int `json:"Port" xml:"Port"`
  220. }
  221. type DescribeContainerGroupsLivenessProbe2 struct {
  222. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  223. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  224. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  225. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  226. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  227. Execs []string `json:"Execs" xml:"Execs"`
  228. HttpGet DescribeContainerGroupsHttpGet3 `json:"HttpGet" xml:"HttpGet"`
  229. TcpSocket DescribeContainerGroupsTcpSocket3 `json:"TcpSocket" xml:"TcpSocket"`
  230. }
  231. type DescribeContainerGroupsSecurityContext2 struct {
  232. ReadOnlyRootFilesystem bool `json:"ReadOnlyRootFilesystem" xml:"ReadOnlyRootFilesystem"`
  233. RunAsUser int64 `json:"RunAsUser" xml:"RunAsUser"`
  234. Capability DescribeContainerGroupsCapability3 `json:"Capability" xml:"Capability"`
  235. }
  236. type DescribeContainerGroupsCapability3 struct {
  237. Adds []string `json:"Adds" xml:"Adds"`
  238. }
  239. type DescribeContainerGroupsVolume1 struct {
  240. Type string `json:"Type" xml:"Type"`
  241. Name string `json:"Name" xml:"Name"`
  242. NFSVolumePath string `json:"NFSVolumePath" xml:"NFSVolumePath"`
  243. NFSVolumeServer string `json:"NFSVolumeServer" xml:"NFSVolumeServer"`
  244. NFSVolumeReadOnly bool `json:"NFSVolumeReadOnly" xml:"NFSVolumeReadOnly"`
  245. DiskVolumeDiskId string `json:"DiskVolumeDiskId" xml:"DiskVolumeDiskId"`
  246. DiskVolumeFsType string `json:"DiskVolumeFsType" xml:"DiskVolumeFsType"`
  247. ConfigFileVolumeConfigFileToPaths []DescribeContainerGroupsConfigFileVolumeConfigFileToPath2 `json:"ConfigFileVolumeConfigFileToPaths" xml:"ConfigFileVolumeConfigFileToPaths"`
  248. }
  249. type DescribeContainerGroupsConfigFileVolumeConfigFileToPath2 struct {
  250. Content string `json:"Content" xml:"Content"`
  251. Path string `json:"Path" xml:"Path"`
  252. }
  253. type DescribeContainerGroupsHostAliase1 struct {
  254. Ip string `json:"Ip" xml:"Ip"`
  255. Hostnames []string `json:"Hostnames" xml:"Hostnames"`
  256. }
  257. type DescribeContainerGroupsDnsConfig1 struct {
  258. Options []DescribeContainerGroupsOption2 `json:"Options" xml:"Options"`
  259. NameServers []string `json:"NameServers" xml:"NameServers"`
  260. Searches []string `json:"Searches" xml:"Searches"`
  261. }
  262. type DescribeContainerGroupsOption2 struct {
  263. Name string `json:"Name" xml:"Name"`
  264. Value string `json:"Value" xml:"Value"`
  265. }
  266. type DescribeContainerGroupsEciSecurityContext1 struct {
  267. Sysctls []DescribeContainerGroupsSysctl2 `json:"Sysctls" xml:"Sysctls"`
  268. }
  269. type DescribeContainerGroupsSysctl2 struct {
  270. Name string `json:"Name" xml:"Name"`
  271. Value string `json:"Value" xml:"Value"`
  272. }
  273. // CreateDescribeContainerGroupsRequest creates a request to invoke DescribeContainerGroups API
  274. func CreateDescribeContainerGroupsRequest() (request *DescribeContainerGroupsRequest) {
  275. request = &DescribeContainerGroupsRequest{
  276. RpcRequest: &requests.RpcRequest{},
  277. }
  278. request.InitWithApiInfo("Eci", "2018-08-08", "DescribeContainerGroups", "eci", "openAPI")
  279. return
  280. }
  281. // CreateDescribeContainerGroupsResponse creates a response to parse from DescribeContainerGroups response
  282. func CreateDescribeContainerGroupsResponse() (response *DescribeContainerGroupsResponse) {
  283. response = &DescribeContainerGroupsResponse{
  284. BaseResponse: &responses.BaseResponse{},
  285. }
  286. return
  287. }