| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- //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.
- package eci
- import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- )
- // DescribeContainerGroups invokes the eci.DescribeContainerGroups API synchronously
- // api document: https://help.aliyun.com/api/eci/describecontainergroups.html
- func (client *Client) DescribeContainerGroups(request *DescribeContainerGroupsRequest) (response *DescribeContainerGroupsResponse, err error) {
- response = CreateDescribeContainerGroupsResponse()
- err = client.DoAction(request, response)
- return
- }
- // DescribeContainerGroupsWithChan invokes the eci.DescribeContainerGroups API asynchronously
- // api document: https://help.aliyun.com/api/eci/describecontainergroups.html
- // asynchronous document: https://help.aliyun.com/document_detail/66220.html
- func (client *Client) DescribeContainerGroupsWithChan(request *DescribeContainerGroupsRequest) (<-chan *DescribeContainerGroupsResponse, <-chan error) {
- responseChan := make(chan *DescribeContainerGroupsResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.DescribeContainerGroups(request)
- if err != nil {
- errChan <- err
- } else {
- responseChan <- response
- }
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
- }
- // DescribeContainerGroupsWithCallback invokes the eci.DescribeContainerGroups API asynchronously
- // api document: https://help.aliyun.com/api/eci/describecontainergroups.html
- // asynchronous document: https://help.aliyun.com/document_detail/66220.html
- func (client *Client) DescribeContainerGroupsWithCallback(request *DescribeContainerGroupsRequest, callback func(response *DescribeContainerGroupsResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *DescribeContainerGroupsResponse
- var err error
- defer close(result)
- response, err = client.DescribeContainerGroups(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
- }
- // DescribeContainerGroupsRequest is the request struct for api DescribeContainerGroups
- type DescribeContainerGroupsRequest struct {
- *requests.RpcRequest
- OwnerId requests.Integer `position:"Query" name:"OwnerId"`
- ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
- ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
- OwnerAccount string `position:"Query" name:"OwnerAccount"`
- RegionId string `position:"Query" name:"RegionId"`
- ZoneId string `position:"Query" name:"ZoneId"`
- VSwitchId string `position:"Query" name:"VSwitchId"`
- NextToken string `position:"Query" name:"NextToken"`
- Limit requests.Integer `position:"Query" name:"Limit"`
- Tag *[]DescribeContainerGroupsTag `position:"Query" name:"Tag" type:"Repeated"`
- ContainerGroupIds string `position:"Query" name:"ContainerGroupIds"`
- ContainerGroupName string `position:"Query" name:"ContainerGroupName"`
- Status string `position:"Query" name:"Status"`
- }
- type DescribeContainerGroupsTag struct {
- Key string `name:"Key"`
- Value string `name:"Value"`
- }
- // DescribeContainerGroupsResponse is the response struct for api DescribeContainerGroups
- type DescribeContainerGroupsResponse struct {
- *responses.BaseResponse
- RequestId string `json:"RequestId" xml:"RequestId"`
- NextToken string `json:"NextToken" xml:"NextToken"`
- TotalCount int `json:"TotalCount" xml:"TotalCount"`
- ContainerGroups DescribeContainerGroupsContainerGroups `json:"ContainerGroups" xml:"ContainerGroups"`
- }
- type DescribeContainerGroupsContainerGroups struct {
- ContainerGroup []DescribeContainerGroupsContainerGroup `json:"ContainerGroup" xml:"ContainerGroup"`
- }
- type DescribeContainerGroupsContainerGroup struct {
- ContainerGroupId string `json:"ContainerGroupId" xml:"ContainerGroupId"`
- ContainerGroupName string `json:"ContainerGroupName" xml:"ContainerGroupName"`
- RegionId string `json:"RegionId" xml:"RegionId"`
- ZoneId string `json:"ZoneId" xml:"ZoneId"`
- Memory float32 `json:"Memory" xml:"Memory"`
- Cpu float32 `json:"Cpu" xml:"Cpu"`
- VSwitchId string `json:"VSwitchId" xml:"VSwitchId"`
- SecurityGroupId string `json:"SecurityGroupId" xml:"SecurityGroupId"`
- RestartPolicy string `json:"RestartPolicy" xml:"RestartPolicy"`
- IntranetIp string `json:"IntranetIp" xml:"IntranetIp"`
- Status string `json:"Status" xml:"Status"`
- InternetIp string `json:"InternetIp" xml:"InternetIp"`
- CreationTime string `json:"CreationTime" xml:"CreationTime"`
- SucceededTime string `json:"SucceededTime" xml:"SucceededTime"`
- EniInstanceId string `json:"EniInstanceId" xml:"EniInstanceId"`
- Tags []DescribeContainerGroupsTags `json:"Tags" xml:"Tags"`
- Events []DescribeContainerGroupsEvents `json:"Events" xml:"Events"`
- Containers []DescribeContainerGroupsContainers `json:"Containers" xml:"Containers"`
- Volumes []DescribeContainerGroupsVolumes `json:"Volumes" xml:"Volumes"`
- InitContainers []DescribeContainerGroupsInitContainers `json:"InitContainers" xml:"InitContainers"`
- }
- type DescribeContainerGroupsTags struct {
- Label []DescribeContainerGroupsLabel `json:"Label" xml:"Label"`
- }
- type DescribeContainerGroupsLabel struct {
- Key string `json:"Key" xml:"Key"`
- Value string `json:"Value" xml:"Value"`
- }
- type DescribeContainerGroupsEvents struct {
- Event []DescribeContainerGroupsEvent `json:"Event" xml:"Event"`
- }
- type DescribeContainerGroupsEvent struct {
- Count int `json:"Count" xml:"Count"`
- Type string `json:"Type" xml:"Type"`
- Name string `json:"Name" xml:"Name"`
- Message string `json:"Message" xml:"Message"`
- FirstTimestamp string `json:"FirstTimestamp" xml:"FirstTimestamp"`
- LastTimestamp string `json:"LastTimestamp" xml:"LastTimestamp"`
- Reason string `json:"Reason" xml:"Reason"`
- }
- type DescribeContainerGroupsContainers struct {
- Container []DescribeContainerGroupsContainer `json:"Container" xml:"Container"`
- }
- type DescribeContainerGroupsContainer struct {
- Name string `json:"Name" xml:"Name"`
- Image string `json:"Image" xml:"Image"`
- Memory float32 `json:"Memory" xml:"Memory"`
- Cpu float32 `json:"Cpu" xml:"Cpu"`
- RestartCount int `json:"RestartCount" xml:"RestartCount"`
- WorkingDir string `json:"WorkingDir" xml:"WorkingDir"`
- ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
- VolumeMounts []DescribeContainerGroupsVolumeMounts `json:"VolumeMounts" xml:"VolumeMounts"`
- Ports []DescribeContainerGroupsPorts `json:"Ports" xml:"Ports"`
- EnvironmentVars []DescribeContainerGroupsEnvironmentVars `json:"EnvironmentVars" xml:"EnvironmentVars"`
- }
- type DescribeContainerGroupsVolumeMounts struct {
- VolumeMount []DescribeContainerGroupsVolumeMount `json:"VolumeMount" xml:"VolumeMount"`
- }
- type DescribeContainerGroupsVolumeMount struct {
- Name string `json:"Name" xml:"Name"`
- MountPath string `json:"MountPath" xml:"MountPath"`
- ReadOnly bool `json:"ReadOnly" xml:"ReadOnly"`
- }
- type DescribeContainerGroupsPorts struct {
- Port []DescribeContainerGroupsPort `json:"Port" xml:"Port"`
- }
- type DescribeContainerGroupsPort struct {
- Port int `json:"Port" xml:"Port"`
- Protocol string `json:"Protocol" xml:"Protocol"`
- }
- type DescribeContainerGroupsEnvironmentVars struct {
- EnvironmentVar []DescribeContainerGroupsEnvironmentVar `json:"EnvironmentVar" xml:"EnvironmentVar"`
- }
- type DescribeContainerGroupsEnvironmentVar struct {
- Key string `json:"Key" xml:"Key"`
- Value string `json:"Value" xml:"Value"`
- }
- type DescribeContainerGroupsVolumes struct {
- Volume []DescribeContainerGroupsVolume `json:"Volume" xml:"Volume"`
- }
- type DescribeContainerGroupsVolume struct {
- Type string `json:"Type" xml:"Type"`
- Name string `json:"Name" xml:"Name"`
- NFSVolumePath string `json:"NFSVolumePath" xml:"NFSVolumePath"`
- NFSVolumeServer string `json:"NFSVolumeServer" xml:"NFSVolumeServer"`
- NFSVolumeReadOnly bool `json:"NFSVolumeReadOnly" xml:"NFSVolumeReadOnly"`
- ConfigFileVolumeConfigFileToPaths []DescribeContainerGroupsConfigFileVolumeConfigFileToPaths `json:"ConfigFileVolumeConfigFileToPaths" xml:"ConfigFileVolumeConfigFileToPaths"`
- }
- type DescribeContainerGroupsConfigFileVolumeConfigFileToPaths struct {
- ConfigFileVolumeConfigFileToPath []DescribeContainerGroupsConfigFileVolumeConfigFileToPath `json:"ConfigFileVolumeConfigFileToPath" xml:"ConfigFileVolumeConfigFileToPath"`
- }
- type DescribeContainerGroupsConfigFileVolumeConfigFileToPath struct {
- Content string `json:"Content" xml:"Content"`
- Path string `json:"Path" xml:"Path"`
- }
- type DescribeContainerGroupsInitContainers struct {
- Container []DescribeContainerGroupsContainer `json:"Container" xml:"Container"`
- }
- // CreateDescribeContainerGroupsRequest creates a request to invoke DescribeContainerGroups API
- func CreateDescribeContainerGroupsRequest() (request *DescribeContainerGroupsRequest) {
- request = &DescribeContainerGroupsRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Eci", "2018-08-08", "DescribeContainerGroups", "eci", "openAPI")
- return
- }
- // CreateDescribeContainerGroupsResponse creates a response to parse from DescribeContainerGroups response
- func CreateDescribeContainerGroupsResponse() (response *DescribeContainerGroupsResponse) {
- response = &DescribeContainerGroupsResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
- }
|