Jackson Tian il y a 7 ans
Parent
commit
00070eb993

+ 81 - 0
services/eci/client.go

@@ -0,0 +1,81 @@
+//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"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth"
+)
+
+// Client is the sdk client struct, each func corresponds to an OpenAPI
+type Client struct {
+	sdk.Client
+}
+
+// NewClient creates a sdk client with environment variables
+func NewClient() (client *Client, err error) {
+	client = &Client{}
+	err = client.Init()
+	return
+}
+
+// NewClientWithOptions creates a sdk client with regionId/sdkConfig/credential
+// this is the common api to create a sdk client
+func NewClientWithOptions(regionId string, config *sdk.Config, credential auth.Credential) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithOptions(regionId, config, credential)
+	return
+}
+
+// NewClientWithAccessKey is a shortcut to create sdk client with accesskey
+// usage: https://help.aliyun.com/document_detail/66217.html
+func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithAccessKey(regionId, accessKeyId, accessKeySecret)
+	return
+}
+
+// NewClientWithStsToken is a shortcut to create sdk client with sts token
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithStsToken(regionId, stsAccessKeyId, stsAccessKeySecret, stsToken)
+	return
+}
+
+// NewClientWithRamRoleArn is a shortcut to create sdk client with ram roleArn
+// usage: https://help.aliyun.com/document_detail/66222.html
+func NewClientWithRamRoleArn(regionId string, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRamRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	return
+}
+
+// NewClientWithEcsRamRole is a shortcut to create sdk client with ecs ram role
+// usage: https://help.aliyun.com/document_detail/66223.html
+func NewClientWithEcsRamRole(regionId string, roleName string) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithEcsRamRole(regionId, roleName)
+	return
+}
+
+// NewClientWithRsaKeyPair is a shortcut to create sdk client with rsa key pair
+// attention: rsa key pair auth is only Japan regions available
+func NewClientWithRsaKeyPair(regionId string, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+	client = &Client{}
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	return
+}

+ 225 - 0
services/eci/create_container_group.go

@@ -0,0 +1,225 @@
+//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"
+)
+
+// CreateContainerGroup invokes the eci.CreateContainerGroup API synchronously
+// api document: https://help.aliyun.com/api/eci/createcontainergroup.html
+func (client *Client) CreateContainerGroup(request *CreateContainerGroupRequest) (response *CreateContainerGroupResponse, err error) {
+	response = CreateCreateContainerGroupResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// CreateContainerGroupWithChan invokes the eci.CreateContainerGroup API asynchronously
+// api document: https://help.aliyun.com/api/eci/createcontainergroup.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateContainerGroupWithChan(request *CreateContainerGroupRequest) (<-chan *CreateContainerGroupResponse, <-chan error) {
+	responseChan := make(chan *CreateContainerGroupResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.CreateContainerGroup(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// CreateContainerGroupWithCallback invokes the eci.CreateContainerGroup API asynchronously
+// api document: https://help.aliyun.com/api/eci/createcontainergroup.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) CreateContainerGroupWithCallback(request *CreateContainerGroupRequest, callback func(response *CreateContainerGroupResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *CreateContainerGroupResponse
+		var err error
+		defer close(result)
+		response, err = client.CreateContainerGroup(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// CreateContainerGroupRequest is the request struct for api CreateContainerGroup
+type CreateContainerGroupRequest struct {
+	*requests.RpcRequest
+	Action                  string                                          `position:"Query" name:"Action"`
+	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"`
+	SecurityGroupId         string                                          `position:"Query" name:"SecurityGroupId"`
+	VSwitchId               string                                          `position:"Query" name:"VSwitchId"`
+	ContainerGroupName      string                                          `position:"Query" name:"ContainerGroupName"`
+	RestartPolicy           string                                          `position:"Query" name:"RestartPolicy"`
+	Tag                     *[]CreateContainerGroup_Tag                     `position:"Query" name:"Tag"`
+	ImageRegistryCredential *[]CreateContainerGroup_ImageRegistryCredential `position:"Query" name:"ImageRegistryCredential"`
+	Container               *[]CreateContainerGroup_Container               `position:"Query" name:"Container"`
+	Volume                  *[]CreateContainerGroup_Volume                  `position:"Query" name:"Volume"`
+	EipInstanceId           string                                          `position:"Query" name:"EipInstanceId"`
+	InitContainer           *[]CreateContainerGroup_InitContainer           `position:"Query" name:"InitContainer"`
+	DnsConfig_NameServer    []string                                        `position:"Query" name:"DnsConfig.NameServer"`
+	DnsConfig_Search        []string                                        `position:"Query" name:"DnsConfig.Search"`
+	DnsConfig_Option        *[]CreateContainerGroup_DnsConfig_Option        `position:"Query" name:"DnsConfig.Option"`
+	Cpu                     requests.Float                                  `position:"Query" name:"Cpu"`
+	Memory                  requests.Float                                  `position:"Query" name:"Memory"`
+}
+
+type CreateContainerGroup_Tag struct {
+	Key   string `json:"Key" xml:"Key"`
+	Value string `json:"Value" xml:"Value"`
+}
+
+type CreateContainerGroup_ImageRegistryCredential struct {
+	Server   string `json:"Server" xml:"Server"`
+	UserName string `json:"UserName" xml:"UserName"`
+	Password string `json:"Password" xml:"Password"`
+}
+
+type CreateContainerGroup_Container struct {
+	Image                                  string                                 `json:"Image" xml:"Image"`
+	Name                                   string                                 `json:"Name" xml:"Name"`
+	Cpu                                    requests.Float                         `json:"Cpu" xml:"Cpu"`
+	Memory                                 requests.Float                         `json:"Memory" xml:"Memory"`
+	WorkingDir                             string                                 `json:"WorkingDir" xml:"WorkingDir"`
+	ImagePullPolicy                        string                                 `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
+	Command                                []string                               `json:"Command" xml:"Command"`
+	Arg                                    []string                               `json:"Arg" xml:"Arg"`
+	VolumeMount                            *[]CreateContainerGroup_VolumeMount    `json:"VolumeMount" xml:"VolumeMount"`
+	Port                                   *[]CreateContainerGroup_Port           `json:"Port" xml:"Port"`
+	EnvironmentVar                         *[]CreateContainerGroup_EnvironmentVar `json:"EnvironmentVar" xml:"EnvironmentVar"`
+	ReadinessProbe_HttpGet_Path            string                                 `json:"ReadinessProbe.HttpGet.Path" xml:"ReadinessProbe.HttpGet.Path"`
+	ReadinessProbe_HttpGet_Port            requests.Integer                       `json:"ReadinessProbe.HttpGet.Port" xml:"ReadinessProbe.HttpGet.Port"`
+	ReadinessProbe_HttpGet_Scheme          string                                 `json:"ReadinessProbe.HttpGet.Scheme" xml:"ReadinessProbe.HttpGet.Scheme"`
+	ReadinessProbe_InitialDelaySeconds     requests.Integer                       `json:"ReadinessProbe.InitialDelaySeconds" xml:"ReadinessProbe.InitialDelaySeconds"`
+	ReadinessProbe_PeriodSeconds           requests.Integer                       `json:"ReadinessProbe.PeriodSeconds" xml:"ReadinessProbe.PeriodSeconds"`
+	ReadinessProbe_SuccessThreshold        requests.Integer                       `json:"ReadinessProbe.SuccessThreshold" xml:"ReadinessProbe.SuccessThreshold"`
+	ReadinessProbe_FailureThreshold        requests.Integer                       `json:"ReadinessProbe.FailureThreshold" xml:"ReadinessProbe.FailureThreshold"`
+	ReadinessProbe_TimeoutSeconds          requests.Integer                       `json:"ReadinessProbe.TimeoutSeconds" xml:"ReadinessProbe.TimeoutSeconds"`
+	ReadinessProbe_Exec_Command            []string                               `json:"ReadinessProbe.Exec.Command" xml:"ReadinessProbe.Exec.Command"`
+	LivenessProbe_HttpGet_Path             string                                 `json:"LivenessProbe.HttpGet.Path" xml:"LivenessProbe.HttpGet.Path"`
+	LivenessProbe_HttpGet_Port             requests.Integer                       `json:"LivenessProbe.HttpGet.Port" xml:"LivenessProbe.HttpGet.Port"`
+	LivenessProbe_HttpGet_Scheme           string                                 `json:"LivenessProbe.HttpGet.Scheme" xml:"LivenessProbe.HttpGet.Scheme"`
+	LivenessProbe_InitialDelaySeconds      requests.Integer                       `json:"LivenessProbe.InitialDelaySeconds" xml:"LivenessProbe.InitialDelaySeconds"`
+	LivenessProbe_PeriodSeconds            requests.Integer                       `json:"LivenessProbe.PeriodSeconds" xml:"LivenessProbe.PeriodSeconds"`
+	LivenessProbe_SuccessThreshold         requests.Integer                       `json:"LivenessProbe.SuccessThreshold" xml:"LivenessProbe.SuccessThreshold"`
+	LivenessProbe_FailureThreshold         requests.Integer                       `json:"LivenessProbe.FailureThreshold" xml:"LivenessProbe.FailureThreshold"`
+	LivenessProbe_TimeoutSeconds           requests.Integer                       `json:"LivenessProbe.TimeoutSeconds" xml:"LivenessProbe.TimeoutSeconds"`
+	LivenessProbe_Exec_Command             []string                               `json:"LivenessProbe.Exec.Command" xml:"LivenessProbe.Exec.Command"`
+	SecurityContext_Capability_Add         []string                               `json:"SecurityContext.Capability.Add" xml:"SecurityContext.Capability.Add"`
+	SecurityContext_ReadOnlyRootFilesystem requests.Boolean                       `json:"SecurityContext.ReadOnlyRootFilesystem" xml:"SecurityContext.ReadOnlyRootFilesystem"`
+	SecurityContext_RunAsUser              requests.Integer                       `json:"SecurityContext.RunAsUser" xml:"SecurityContext.RunAsUser"`
+	ReadinessProbe_TcpSocket_Port          requests.Integer                       `json:"ReadinessProbe.TcpSocket.Port" xml:"ReadinessProbe.TcpSocket.Port"`
+	LivenessProbe_TcpSocket_Port           requests.Integer                       `json:"LivenessProbe.TcpSocket.Port" xml:"LivenessProbe.TcpSocket.Port"`
+}
+
+type CreateContainerGroup_Volume struct {
+	Name                              string                                                    `json:"Name" xml:"Name"`
+	NFSVolume_Server                  string                                                    `json:"NFSVolume.Server" xml:"NFSVolume.Server"`
+	NFSVolume_Path                    string                                                    `json:"NFSVolume.Path" xml:"NFSVolume.Path"`
+	NFSVolume_ReadOnly                requests.Boolean                                          `json:"NFSVolume.ReadOnly" xml:"NFSVolume.ReadOnly"`
+	ConfigFileVolume_ConfigFileToPath *[]CreateContainerGroup_ConfigFileVolume_ConfigFileToPath `json:"ConfigFileVolume.ConfigFileToPath" xml:"ConfigFileVolume.ConfigFileToPath"`
+	Type                              string                                                    `json:"Type" xml:"Type"`
+}
+
+type CreateContainerGroup_InitContainer struct {
+	Name                                   string                                 `json:"Name" xml:"Name"`
+	Image                                  string                                 `json:"Image" xml:"Image"`
+	Cpu                                    requests.Float                         `json:"Cpu" xml:"Cpu"`
+	Memory                                 requests.Float                         `json:"Memory" xml:"Memory"`
+	WorkingDir                             string                                 `json:"WorkingDir" xml:"WorkingDir"`
+	ImagePullPolicy                        string                                 `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
+	Command                                []string                               `json:"Command" xml:"Command"`
+	Arg                                    []string                               `json:"Arg" xml:"Arg"`
+	VolumeMount                            *[]CreateContainerGroup_VolumeMount    `json:"VolumeMount" xml:"VolumeMount"`
+	Port                                   *[]CreateContainerGroup_Port           `json:"Port" xml:"Port"`
+	EnvironmentVar                         *[]CreateContainerGroup_EnvironmentVar `json:"EnvironmentVar" xml:"EnvironmentVar"`
+	SecurityContext_Capability_Add         []string                               `json:"SecurityContext.Capability.Add" xml:"SecurityContext.Capability.Add"`
+	SecurityContext_ReadOnlyRootFilesystem requests.Boolean                       `json:"SecurityContext.ReadOnlyRootFilesystem" xml:"SecurityContext.ReadOnlyRootFilesystem"`
+	SecurityContext_RunAsUser              requests.Integer                       `json:"SecurityContext.RunAsUser" xml:"SecurityContext.RunAsUser"`
+}
+
+type CreateContainerGroup_DnsConfig_Option struct {
+	Name  string `json:"Name" xml:"Name"`
+	Value string `json:"Value" xml:"Value"`
+}
+
+type CreateContainerGroup_VolumeMount struct {
+	MountPath string           `json:"MountPath" xml:"MountPath"`
+	ReadOnly  requests.Boolean `json:"ReadOnly" xml:"ReadOnly"`
+	Name      string           `json:"Name" xml:"Name"`
+}
+
+type CreateContainerGroup_Port struct {
+	Protocol string           `json:"Protocol" xml:"Protocol"`
+	Port     requests.Integer `json:"Port" xml:"Port"`
+}
+
+type CreateContainerGroup_EnvironmentVar struct {
+	Key   string `json:"Key" xml:"Key"`
+	Value string `json:"Value" xml:"Value"`
+}
+
+type CreateContainerGroup_ConfigFileVolume_ConfigFileToPath struct {
+	Content string `json:"Content" xml:"Content"`
+	Path    string `json:"Path" xml:"Path"`
+}
+
+// CreateContainerGroupResponse is the response struct for api CreateContainerGroup
+type CreateContainerGroupResponse struct {
+	*responses.BaseResponse
+	RequestId        string `json:"RequestId" xml:"RequestId"`
+	ContainerGroupId string `json:"ContainerGroupId" xml:"ContainerGroupId"`
+}
+
+// CreateCreateContainerGroupRequest creates a request to invoke CreateContainerGroup API
+func CreateCreateContainerGroupRequest() (request *CreateContainerGroupRequest) {
+	request = &CreateContainerGroupRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Eci", "2018-08-08", "CreateContainerGroup", "eci", "openAPI")
+	return
+}
+
+// CreateCreateContainerGroupResponse creates a response to parse from CreateContainerGroup response
+func CreateCreateContainerGroupResponse() (response *CreateContainerGroupResponse) {
+	response = &CreateContainerGroupResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 109 - 0
services/eci/delete_container_group.go

@@ -0,0 +1,109 @@
+//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"
+)
+
+// DeleteContainerGroup invokes the eci.DeleteContainerGroup API synchronously
+// api document: https://help.aliyun.com/api/eci/deletecontainergroup.html
+func (client *Client) DeleteContainerGroup(request *DeleteContainerGroupRequest) (response *DeleteContainerGroupResponse, err error) {
+	response = CreateDeleteContainerGroupResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DeleteContainerGroupWithChan invokes the eci.DeleteContainerGroup API asynchronously
+// api document: https://help.aliyun.com/api/eci/deletecontainergroup.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteContainerGroupWithChan(request *DeleteContainerGroupRequest) (<-chan *DeleteContainerGroupResponse, <-chan error) {
+	responseChan := make(chan *DeleteContainerGroupResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DeleteContainerGroup(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DeleteContainerGroupWithCallback invokes the eci.DeleteContainerGroup API asynchronously
+// api document: https://help.aliyun.com/api/eci/deletecontainergroup.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DeleteContainerGroupWithCallback(request *DeleteContainerGroupRequest, callback func(response *DeleteContainerGroupResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DeleteContainerGroupResponse
+		var err error
+		defer close(result)
+		response, err = client.DeleteContainerGroup(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DeleteContainerGroupRequest is the request struct for api DeleteContainerGroup
+type DeleteContainerGroupRequest struct {
+	*requests.RpcRequest
+	Action               string           `position:"Query" name:"Action"`
+	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"`
+	ContainerGroupId     string           `position:"Query" name:"ContainerGroupId"`
+}
+
+// DeleteContainerGroupResponse is the response struct for api DeleteContainerGroup
+type DeleteContainerGroupResponse struct {
+	*responses.BaseResponse
+	RequestId string `json:"RequestId" xml:"RequestId"`
+}
+
+// CreateDeleteContainerGroupRequest creates a request to invoke DeleteContainerGroup API
+func CreateDeleteContainerGroupRequest() (request *DeleteContainerGroupRequest) {
+	request = &DeleteContainerGroupRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Eci", "2018-08-08", "DeleteContainerGroup", "eci", "openAPI")
+	return
+}
+
+// CreateDeleteContainerGroupResponse creates a response to parse from DeleteContainerGroup response
+func CreateDeleteContainerGroupResponse() (response *DeleteContainerGroupResponse) {
+	response = &DeleteContainerGroupResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 245 - 0
services/eci/describe_container_groups.go

@@ -0,0 +1,245 @@
+//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
+	Action               string                         `position:"Query" name:"Action"`
+	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                  *[]DescribeContainerGroups_Tag `position:"Query" name:"Tag"`
+	ContainerGroupIds    string                         `position:"Query" name:"ContainerGroupIds"`
+	ContainerGroupName   string                         `position:"Query" name:"ContainerGroupName"`
+	Status               string                         `position:"Query" name:"Status"`
+}
+
+type DescribeContainerGroups_Tag struct {
+	Key   string `json:"Key" xml:"Key"`
+	Value string `json:"Value" xml:"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 DescribeContainerGroups_ContainerGroups `json:"ContainerGroups" xml:"ContainerGroups"`
+}
+
+type DescribeContainerGroups_ContainerGroups struct {
+	ContainerGroup []DescribeContainerGroups_ContainerGroup `json:"ContainerGroup" xml:"ContainerGroup"`
+}
+
+type DescribeContainerGroups_ContainerGroup 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               []DescribeContainerGroups_Tags           `json:"Tags" xml:"Tags"`
+	Events             []DescribeContainerGroups_Events         `json:"Events" xml:"Events"`
+	Containers         []DescribeContainerGroups_Containers     `json:"Containers" xml:"Containers"`
+	Volumes            []DescribeContainerGroups_Volumes        `json:"Volumes" xml:"Volumes"`
+	InitContainers     []DescribeContainerGroups_InitContainers `json:"InitContainers" xml:"InitContainers"`
+}
+
+type DescribeContainerGroups_Tags struct {
+	Label []DescribeContainerGroups_Label `json:"Label" xml:"Label"`
+}
+
+type DescribeContainerGroups_Label struct {
+	Key   string `json:"Key" xml:"Key"`
+	Value string `json:"Value" xml:"Value"`
+}
+
+type DescribeContainerGroups_Events struct {
+	Event []DescribeContainerGroups_Event `json:"Event" xml:"Event"`
+}
+
+type DescribeContainerGroups_Event 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 DescribeContainerGroups_Containers struct {
+	Container []DescribeContainerGroups_Container `json:"Container" xml:"Container"`
+}
+
+type DescribeContainerGroups_Container 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    []DescribeContainerGroups_VolumeMounts    `json:"VolumeMounts" xml:"VolumeMounts"`
+	Ports           []DescribeContainerGroups_Ports           `json:"Ports" xml:"Ports"`
+	EnvironmentVars []DescribeContainerGroups_EnvironmentVars `json:"EnvironmentVars" xml:"EnvironmentVars"`
+}
+
+type DescribeContainerGroups_VolumeMounts struct {
+	VolumeMount []DescribeContainerGroups_VolumeMount `json:"VolumeMount" xml:"VolumeMount"`
+}
+
+type DescribeContainerGroups_VolumeMount struct {
+	Name      string `json:"Name" xml:"Name"`
+	MountPath string `json:"MountPath" xml:"MountPath"`
+	ReadOnly  bool   `json:"ReadOnly" xml:"ReadOnly"`
+}
+
+type DescribeContainerGroups_Ports struct {
+	Port []DescribeContainerGroups_Port `json:"Port" xml:"Port"`
+}
+
+type DescribeContainerGroups_Port struct {
+	Port     int    `json:"Port" xml:"Port"`
+	Protocol string `json:"Protocol" xml:"Protocol"`
+}
+
+type DescribeContainerGroups_EnvironmentVars struct {
+	EnvironmentVar []DescribeContainerGroups_EnvironmentVar `json:"EnvironmentVar" xml:"EnvironmentVar"`
+}
+
+type DescribeContainerGroups_EnvironmentVar struct {
+	Key   string `json:"Key" xml:"Key"`
+	Value string `json:"Value" xml:"Value"`
+}
+
+type DescribeContainerGroups_Volumes struct {
+	Volume []DescribeContainerGroups_Volume `json:"Volume" xml:"Volume"`
+}
+
+type DescribeContainerGroups_Volume 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 []DescribeContainerGroups_ConfigFileVolumeConfigFileToPaths `json:"ConfigFileVolumeConfigFileToPaths" xml:"ConfigFileVolumeConfigFileToPaths"`
+}
+
+type DescribeContainerGroups_ConfigFileVolumeConfigFileToPaths struct {
+	ConfigFileVolumeConfigFileToPath []DescribeContainerGroups_ConfigFileVolumeConfigFileToPath `json:"ConfigFileVolumeConfigFileToPath" xml:"ConfigFileVolumeConfigFileToPath"`
+}
+
+type DescribeContainerGroups_ConfigFileVolumeConfigFileToPath struct {
+	Content string `json:"Content" xml:"Content"`
+	Path    string `json:"Path" xml:"Path"`
+}
+
+type DescribeContainerGroups_InitContainers struct {
+	Container []DescribeContainerGroups_Container `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
+}

+ 114 - 0
services/eci/describe_container_log.go

@@ -0,0 +1,114 @@
+//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"
+)
+
+// DescribeContainerLog invokes the eci.DescribeContainerLog API synchronously
+// api document: https://help.aliyun.com/api/eci/describecontainerlog.html
+func (client *Client) DescribeContainerLog(request *DescribeContainerLogRequest) (response *DescribeContainerLogResponse, err error) {
+	response = CreateDescribeContainerLogResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// DescribeContainerLogWithChan invokes the eci.DescribeContainerLog API asynchronously
+// api document: https://help.aliyun.com/api/eci/describecontainerlog.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeContainerLogWithChan(request *DescribeContainerLogRequest) (<-chan *DescribeContainerLogResponse, <-chan error) {
+	responseChan := make(chan *DescribeContainerLogResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.DescribeContainerLog(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// DescribeContainerLogWithCallback invokes the eci.DescribeContainerLog API asynchronously
+// api document: https://help.aliyun.com/api/eci/describecontainerlog.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) DescribeContainerLogWithCallback(request *DescribeContainerLogRequest, callback func(response *DescribeContainerLogResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *DescribeContainerLogResponse
+		var err error
+		defer close(result)
+		response, err = client.DescribeContainerLog(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// DescribeContainerLogRequest is the request struct for api DescribeContainerLog
+type DescribeContainerLogRequest struct {
+	*requests.RpcRequest
+	Action               string           `position:"Query" name:"Action"`
+	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"`
+	ContainerGroupId     string           `position:"Query" name:"ContainerGroupId"`
+	ContainerName        string           `position:"Query" name:"ContainerName"`
+	StartTime            string           `position:"Query" name:"StartTime"`
+	Tail                 requests.Integer `position:"Query" name:"Tail"`
+}
+
+// DescribeContainerLogResponse is the response struct for api DescribeContainerLog
+type DescribeContainerLogResponse struct {
+	*responses.BaseResponse
+	RequestId     string `json:"RequestId" xml:"RequestId"`
+	ContainerName string `json:"ContainerName" xml:"ContainerName"`
+	Content       string `json:"Content" xml:"Content"`
+}
+
+// CreateDescribeContainerLogRequest creates a request to invoke DescribeContainerLog API
+func CreateDescribeContainerLogRequest() (request *DescribeContainerLogRequest) {
+	request = &DescribeContainerLogRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Eci", "2018-08-08", "DescribeContainerLog", "eci", "openAPI")
+	return
+}
+
+// CreateDescribeContainerLogResponse creates a response to parse from DescribeContainerLog response
+func CreateDescribeContainerLogResponse() (response *DescribeContainerLogResponse) {
+	response = &DescribeContainerLogResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}

+ 112 - 0
services/eci/exec_container_command.go

@@ -0,0 +1,112 @@
+//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"
+)
+
+// ExecContainerCommand invokes the eci.ExecContainerCommand API synchronously
+// api document: https://help.aliyun.com/api/eci/execcontainercommand.html
+func (client *Client) ExecContainerCommand(request *ExecContainerCommandRequest) (response *ExecContainerCommandResponse, err error) {
+	response = CreateExecContainerCommandResponse()
+	err = client.DoAction(request, response)
+	return
+}
+
+// ExecContainerCommandWithChan invokes the eci.ExecContainerCommand API asynchronously
+// api document: https://help.aliyun.com/api/eci/execcontainercommand.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ExecContainerCommandWithChan(request *ExecContainerCommandRequest) (<-chan *ExecContainerCommandResponse, <-chan error) {
+	responseChan := make(chan *ExecContainerCommandResponse, 1)
+	errChan := make(chan error, 1)
+	err := client.AddAsyncTask(func() {
+		defer close(responseChan)
+		defer close(errChan)
+		response, err := client.ExecContainerCommand(request)
+		if err != nil {
+			errChan <- err
+		} else {
+			responseChan <- response
+		}
+	})
+	if err != nil {
+		errChan <- err
+		close(responseChan)
+		close(errChan)
+	}
+	return responseChan, errChan
+}
+
+// ExecContainerCommandWithCallback invokes the eci.ExecContainerCommand API asynchronously
+// api document: https://help.aliyun.com/api/eci/execcontainercommand.html
+// asynchronous document: https://help.aliyun.com/document_detail/66220.html
+func (client *Client) ExecContainerCommandWithCallback(request *ExecContainerCommandRequest, callback func(response *ExecContainerCommandResponse, err error)) <-chan int {
+	result := make(chan int, 1)
+	err := client.AddAsyncTask(func() {
+		var response *ExecContainerCommandResponse
+		var err error
+		defer close(result)
+		response, err = client.ExecContainerCommand(request)
+		callback(response, err)
+		result <- 1
+	})
+	if err != nil {
+		defer close(result)
+		callback(nil, err)
+		result <- 0
+	}
+	return result
+}
+
+// ExecContainerCommandRequest is the request struct for api ExecContainerCommand
+type ExecContainerCommandRequest struct {
+	*requests.RpcRequest
+	Action               string           `position:"Query" name:"Action"`
+	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"`
+	ContainerGroupId     string           `position:"Query" name:"ContainerGroupId"`
+	ContainerName        string           `position:"Query" name:"ContainerName"`
+	Command              string           `position:"Query" name:"Command"`
+}
+
+// ExecContainerCommandResponse is the response struct for api ExecContainerCommand
+type ExecContainerCommandResponse struct {
+	*responses.BaseResponse
+	RequestId    string `json:"RequestId" xml:"RequestId"`
+	WebSocketUri string `json:"WebSocketUri" xml:"WebSocketUri"`
+}
+
+// CreateExecContainerCommandRequest creates a request to invoke ExecContainerCommand API
+func CreateExecContainerCommandRequest() (request *ExecContainerCommandRequest) {
+	request = &ExecContainerCommandRequest{
+		RpcRequest: &requests.RpcRequest{},
+	}
+	request.InitWithApiInfo("Eci", "2018-08-08", "ExecContainerCommand", "eci", "openAPI")
+	return
+}
+
+// CreateExecContainerCommandResponse creates a response to parse from ExecContainerCommand response
+func CreateExecContainerCommandResponse() (response *ExecContainerCommandResponse) {
+	response = &ExecContainerCommandResponse{
+		BaseResponse: &responses.BaseResponse{},
+	}
+	return
+}