describe_container_groups.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  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. VkClientVersion string `position:"Query" name:"VkClientVersion"`
  87. ResourceGroupId string `position:"Query" name:"ResourceGroupId"`
  88. WithEvent requests.Boolean `position:"Query" name:"WithEvent"`
  89. }
  90. type DescribeContainerGroupsTag struct {
  91. Key string `name:"Key"`
  92. Value string `name:"Value"`
  93. }
  94. // DescribeContainerGroupsResponse is the response struct for api DescribeContainerGroups
  95. type DescribeContainerGroupsResponse struct {
  96. *responses.BaseResponse
  97. RequestId string `json:"RequestId" xml:"RequestId"`
  98. NextToken string `json:"NextToken" xml:"NextToken"`
  99. TotalCount int `json:"TotalCount" xml:"TotalCount"`
  100. ContainerGroups []DescribeContainerGroupsContainerGroup0 `json:"ContainerGroups" xml:"ContainerGroups"`
  101. }
  102. type DescribeContainerGroupsContainerGroup0 struct {
  103. ContainerGroupId string `json:"ContainerGroupId" xml:"ContainerGroupId"`
  104. ContainerGroupName string `json:"ContainerGroupName" xml:"ContainerGroupName"`
  105. RegionId string `json:"RegionId" xml:"RegionId"`
  106. ZoneId string `json:"ZoneId" xml:"ZoneId"`
  107. Memory float32 `json:"Memory" xml:"Memory"`
  108. Cpu float32 `json:"Cpu" xml:"Cpu"`
  109. VSwitchId string `json:"VSwitchId" xml:"VSwitchId"`
  110. SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"`
  111. RestartPolicy string `json:"RestartPolicy" xml:"RestartPolicy"`
  112. IntranetIp string `json:"IntranetIp" xml:"IntranetIp"`
  113. Status string `json:"Status" xml:"Status"`
  114. InternetIp string `json:"InternetIp" xml:"InternetIp"`
  115. CreationTime string `json:"CreationTime" xml:"CreationTime"`
  116. SucceededTime string `json:"SucceededTime" xml:"SucceededTime"`
  117. EniInstanceId string `json:"EniInstanceId" xml:"EniInstanceId"`
  118. InstanceType string `json:"InstanceType" xml:"InstanceType"`
  119. ExpiredTime string `json:"ExpiredTime" xml:"ExpiredTime"`
  120. FailedTime string `json:"FailedTime" xml:"FailedTime"`
  121. RamRoleName string `json:"RamRoleName" xml:"RamRoleName"`
  122. Ipv6Address string `json:"Ipv6Address" xml:"Ipv6Address"`
  123. VpcId string `json:"VpcId" xml:"VpcId"`
  124. Discount int `json:"Discount" xml:"Discount"`
  125. ResourceGroupId string `json:"ResourceGroupId" xml:"ResourceGroupId"`
  126. Tags []DescribeContainerGroupsLabel1 `json:"Tags" xml:"Tags"`
  127. Events []DescribeContainerGroupsEvent1 `json:"Events" xml:"Events"`
  128. Containers []DescribeContainerGroupsContainer1 `json:"Containers" xml:"Containers"`
  129. Volumes []DescribeContainerGroupsVolume1 `json:"Volumes" xml:"Volumes"`
  130. InitContainers []DescribeContainerGroupsContainer1 `json:"InitContainers" xml:"InitContainers"`
  131. HostAliases []DescribeContainerGroupsHostAliase1 `json:"HostAliases" xml:"HostAliases"`
  132. DnsConfig DescribeContainerGroupsDnsConfig1 `json:"DnsConfig" xml:"DnsConfig"`
  133. EciSecurityContext DescribeContainerGroupsEciSecurityContext1 `json:"EciSecurityContext" xml:"EciSecurityContext"`
  134. }
  135. type DescribeContainerGroupsLabel1 struct {
  136. Key string `json:"Key" xml:"Key"`
  137. Value string `json:"Value" xml:"Value"`
  138. }
  139. type DescribeContainerGroupsEvent1 struct {
  140. Count int `json:"Count" xml:"Count"`
  141. Type string `json:"Type" xml:"Type"`
  142. Name string `json:"Name" xml:"Name"`
  143. Message string `json:"Message" xml:"Message"`
  144. FirstTimestamp string `json:"FirstTimestamp" xml:"FirstTimestamp"`
  145. LastTimestamp string `json:"LastTimestamp" xml:"LastTimestamp"`
  146. Reason string `json:"Reason" xml:"Reason"`
  147. }
  148. type DescribeContainerGroupsContainer1 struct {
  149. Name string `json:"Name" xml:"Name"`
  150. Image string `json:"Image" xml:"Image"`
  151. Memory float32 `json:"Memory" xml:"Memory"`
  152. Cpu float32 `json:"Cpu" xml:"Cpu"`
  153. RestartCount int `json:"RestartCount" xml:"RestartCount"`
  154. WorkingDir string `json:"WorkingDir" xml:"WorkingDir"`
  155. ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
  156. Ready bool `json:"Ready" xml:"Ready"`
  157. Gpu int `json:"Gpu" xml:"Gpu"`
  158. Stdin bool `json:"Stdin" xml:"Stdin"`
  159. StdinOnce bool `json:"StdinOnce" xml:"StdinOnce"`
  160. Tty bool `json:"Tty" xml:"Tty"`
  161. VolumeMounts []DescribeContainerGroupsVolumeMount2 `json:"VolumeMounts" xml:"VolumeMounts"`
  162. Ports []DescribeContainerGroupsPort2 `json:"Ports" xml:"Ports"`
  163. EnvironmentVars []DescribeContainerGroupsEnvironmentVar2 `json:"EnvironmentVars" xml:"EnvironmentVars"`
  164. Commands []string `json:"Commands" xml:"Commands"`
  165. Args []string `json:"Args" xml:"Args"`
  166. PreviousState DescribeContainerGroupsPreviousState2 `json:"PreviousState" xml:"PreviousState"`
  167. CurrentState DescribeContainerGroupsCurrentState2 `json:"CurrentState" xml:"CurrentState"`
  168. ReadinessProbe DescribeContainerGroupsReadinessProbe2 `json:"ReadinessProbe" xml:"ReadinessProbe"`
  169. LivenessProbe DescribeContainerGroupsLivenessProbe2 `json:"LivenessProbe" xml:"LivenessProbe"`
  170. SecurityContext DescribeContainerGroupsSecurityContext2 `json:"SecurityContext" xml:"SecurityContext"`
  171. }
  172. type DescribeContainerGroupsVolumeMount2 struct {
  173. Name string `json:"Name" xml:"Name"`
  174. MountPath string `json:"MountPath" xml:"MountPath"`
  175. ReadOnly bool `json:"ReadOnly" xml:"ReadOnly"`
  176. }
  177. type DescribeContainerGroupsPort2 struct {
  178. Port int `json:"Port" xml:"Port"`
  179. Protocol string `json:"Protocol" xml:"Protocol"`
  180. }
  181. type DescribeContainerGroupsEnvironmentVar2 struct {
  182. Key string `json:"Key" xml:"Key"`
  183. Value string `json:"Value" xml:"Value"`
  184. ValueFrom DescribeContainerGroupsValueFrom3 `json:"ValueFrom" xml:"ValueFrom"`
  185. }
  186. type DescribeContainerGroupsValueFrom3 struct {
  187. FieldRef DescribeContainerGroupsFieldRef4 `json:"FieldRef" xml:"FieldRef"`
  188. }
  189. type DescribeContainerGroupsFieldRef4 struct {
  190. FieldPath string `json:"FieldPath" xml:"FieldPath"`
  191. }
  192. type DescribeContainerGroupsPreviousState2 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 DescribeContainerGroupsCurrentState2 struct {
  203. State string `json:"State" xml:"State"`
  204. DetailStatus string `json:"DetailStatus" xml:"DetailStatus"`
  205. ExitCode int `json:"ExitCode" xml:"ExitCode"`
  206. StartTime string `json:"StartTime" xml:"StartTime"`
  207. FinishTime string `json:"FinishTime" xml:"FinishTime"`
  208. Reason string `json:"Reason" xml:"Reason"`
  209. Message string `json:"Message" xml:"Message"`
  210. Signal int `json:"Signal" xml:"Signal"`
  211. }
  212. type DescribeContainerGroupsReadinessProbe2 struct {
  213. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  214. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  215. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  216. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  217. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  218. Execs []string `json:"Execs" xml:"Execs"`
  219. HttpGet DescribeContainerGroupsHttpGet3 `json:"HttpGet" xml:"HttpGet"`
  220. TcpSocket DescribeContainerGroupsTcpSocket3 `json:"TcpSocket" xml:"TcpSocket"`
  221. }
  222. type DescribeContainerGroupsHttpGet3 struct {
  223. Path string `json:"Path" xml:"Path"`
  224. Port int `json:"Port" xml:"Port"`
  225. Scheme string `json:"Scheme" xml:"Scheme"`
  226. }
  227. type DescribeContainerGroupsTcpSocket3 struct {
  228. Host string `json:"Host" xml:"Host"`
  229. Port int `json:"Port" xml:"Port"`
  230. }
  231. type DescribeContainerGroupsLivenessProbe2 struct {
  232. InitialDelaySeconds int `json:"InitialDelaySeconds" xml:"InitialDelaySeconds"`
  233. PeriodSeconds int `json:"PeriodSeconds" xml:"PeriodSeconds"`
  234. TimeoutSeconds int `json:"TimeoutSeconds" xml:"TimeoutSeconds"`
  235. SuccessThreshold int `json:"SuccessThreshold" xml:"SuccessThreshold"`
  236. FailureThreshold int `json:"FailureThreshold" xml:"FailureThreshold"`
  237. Execs []string `json:"Execs" xml:"Execs"`
  238. HttpGet DescribeContainerGroupsHttpGet3 `json:"HttpGet" xml:"HttpGet"`
  239. TcpSocket DescribeContainerGroupsTcpSocket3 `json:"TcpSocket" xml:"TcpSocket"`
  240. }
  241. type DescribeContainerGroupsSecurityContext2 struct {
  242. ReadOnlyRootFilesystem bool `json:"ReadOnlyRootFilesystem" xml:"ReadOnlyRootFilesystem"`
  243. RunAsUser int64 `json:"RunAsUser" xml:"RunAsUser"`
  244. Capability DescribeContainerGroupsCapability3 `json:"Capability" xml:"Capability"`
  245. }
  246. type DescribeContainerGroupsCapability3 struct {
  247. Adds []string `json:"Adds" xml:"Adds"`
  248. }
  249. type DescribeContainerGroupsVolume1 struct {
  250. Type string `json:"Type" xml:"Type"`
  251. Name string `json:"Name" xml:"Name"`
  252. NFSVolumePath string `json:"NFSVolumePath" xml:"NFSVolumePath"`
  253. NFSVolumeServer string `json:"NFSVolumeServer" xml:"NFSVolumeServer"`
  254. NFSVolumeReadOnly bool `json:"NFSVolumeReadOnly" xml:"NFSVolumeReadOnly"`
  255. DiskVolumeDiskId string `json:"DiskVolumeDiskId" xml:"DiskVolumeDiskId"`
  256. DiskVolumeFsType string `json:"DiskVolumeFsType" xml:"DiskVolumeFsType"`
  257. FlexVolumeDriver string `json:"FlexVolumeDriver" xml:"FlexVolumeDriver"`
  258. FlexVolumeFsType string `json:"FlexVolumeFsType" xml:"FlexVolumeFsType"`
  259. FlexVolumeOptions string `json:"FlexVolumeOptions" xml:"FlexVolumeOptions"`
  260. ConfigFileVolumeConfigFileToPaths []DescribeContainerGroupsConfigFileVolumeConfigFileToPath2 `json:"ConfigFileVolumeConfigFileToPaths" xml:"ConfigFileVolumeConfigFileToPaths"`
  261. }
  262. type DescribeContainerGroupsConfigFileVolumeConfigFileToPath2 struct {
  263. Content string `json:"Content" xml:"Content"`
  264. Path string `json:"Path" xml:"Path"`
  265. }
  266. type DescribeContainerGroupsHostAliase1 struct {
  267. Ip string `json:"Ip" xml:"Ip"`
  268. Hostnames []string `json:"Hostnames" xml:"Hostnames"`
  269. }
  270. type DescribeContainerGroupsDnsConfig1 struct {
  271. Options []DescribeContainerGroupsOption2 `json:"Options" xml:"Options"`
  272. NameServers []string `json:"NameServers" xml:"NameServers"`
  273. Searches []string `json:"Searches" xml:"Searches"`
  274. }
  275. type DescribeContainerGroupsOption2 struct {
  276. Name string `json:"Name" xml:"Name"`
  277. Value string `json:"Value" xml:"Value"`
  278. }
  279. type DescribeContainerGroupsEciSecurityContext1 struct {
  280. Sysctls []DescribeContainerGroupsSysctl2 `json:"Sysctls" xml:"Sysctls"`
  281. }
  282. type DescribeContainerGroupsSysctl2 struct {
  283. Name string `json:"Name" xml:"Name"`
  284. Value string `json:"Value" xml:"Value"`
  285. }
  286. // CreateDescribeContainerGroupsRequest creates a request to invoke DescribeContainerGroups API
  287. func CreateDescribeContainerGroupsRequest() (request *DescribeContainerGroupsRequest) {
  288. request = &DescribeContainerGroupsRequest{
  289. RpcRequest: &requests.RpcRequest{},
  290. }
  291. request.InitWithApiInfo("Eci", "2018-08-08", "DescribeContainerGroups", "eci", "openAPI")
  292. return
  293. }
  294. // CreateDescribeContainerGroupsResponse creates a response to parse from DescribeContainerGroups response
  295. func CreateDescribeContainerGroupsResponse() (response *DescribeContainerGroupsResponse) {
  296. response = &DescribeContainerGroupsResponse{
  297. BaseResponse: &responses.BaseResponse{},
  298. }
  299. return
  300. }