[AliCloud] Add init container (#382)
* clean up eci sdk code remove unnecessary code * add init containers support
This commit is contained in:
@@ -77,6 +77,7 @@ func (client *Client) CreateContainerGroupWithCallback(request *CreateContainerG
|
||||
type CreateContainerGroupRequest struct {
|
||||
*requests.RpcRequest
|
||||
Containers []CreateContainer `position:"Query" name:"Container" type:"Repeated"`
|
||||
InitContainers []CreateContainer `position:"Query" name:"InitContainer" type:"Repeated"`
|
||||
ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
|
||||
SecurityGroupId string `position:"Query" name:"SecurityGroupId"`
|
||||
ImageRegistryCredentials []ImageRegistryCredential `position:"Query" name:"ImageRegistryCredential" type:"Repeated"`
|
||||
@@ -92,17 +93,17 @@ type CreateContainerGroupRequest struct {
|
||||
}
|
||||
|
||||
type CreateContainer struct {
|
||||
Name string `position:"Query" name:"Name"`
|
||||
Image string `position:"Query" name:"Image"`
|
||||
Memory requests.Float `position:"Query" name:"Memory"`
|
||||
Cpu requests.Float `position:"Query" name:"Cpu"`
|
||||
WorkingDir string `position:"Query" name:"WorkingDir"`
|
||||
ImagePullPolicy string `position:"Query" name:"ImagePullPolicy"`
|
||||
Commands []string `position:"Query" name:"Command" type:"Repeated"`
|
||||
Args []string `position:"Query" name:"Arg" type:"Repeated"`
|
||||
VolumeMounts []VolumeMount `position:"Query" name:"VolumeMount" type:"Repeated"`
|
||||
Ports []ContainerPort `position:"Query" name:"Port" type:"Repeated"`
|
||||
EnvironmentVars []EnvironmentVar `position:"Query" name:"EnvironmentVar" type:"Repeated"`
|
||||
Name string `name:"Name"`
|
||||
Image string `name:"Image"`
|
||||
Memory requests.Float `name:"Memory"`
|
||||
Cpu requests.Float `name:"Cpu"`
|
||||
WorkingDir string `name:"WorkingDir"`
|
||||
ImagePullPolicy string `name:"ImagePullPolicy"`
|
||||
Commands []string `name:"Command" type:"Repeated"`
|
||||
Args []string `name:"Arg" type:"Repeated"`
|
||||
VolumeMounts []VolumeMount `name:"VolumeMount" type:"Repeated"`
|
||||
Ports []ContainerPort `name:"Port" type:"Repeated"`
|
||||
EnvironmentVars []EnvironmentVar `name:"EnvironmentVar" type:"Repeated"`
|
||||
}
|
||||
|
||||
// CreateContainerGroupImageRegistryCredential is a repeated param struct in CreateContainerGroupRequest
|
||||
@@ -115,8 +116,8 @@ type ImageRegistryCredential struct {
|
||||
// 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"`
|
||||
RequestId string
|
||||
ContainerGroupId string
|
||||
}
|
||||
|
||||
// CreateCreateContainerGroupRequest creates a request to invoke CreateContainerGroup API
|
||||
|
||||
@@ -17,6 +17,6 @@ package eci
|
||||
|
||||
// ConfigFileVolumeConfigFileToPath is a nested struct in eci response
|
||||
type ConfigFileToPath struct {
|
||||
Content string `json:"Content" xml:"Content" position:"Query" name:"Content"`
|
||||
Path string `json:"Path" xml:"Path" position:"Query" name:"Path"`
|
||||
Content string `name:"Content"`
|
||||
Path string `name:"Path"`
|
||||
}
|
||||
|
||||
@@ -17,18 +17,18 @@ package eci
|
||||
|
||||
// Container is a nested struct in eci response
|
||||
type Container struct {
|
||||
Name string `json:"Name" xml:"Name" position:"Query" name:"Name"`
|
||||
Image string `json:"Image" xml:"Image" position:"Query" name:"Image"`
|
||||
Memory float64 `json:"Memory" xml:"Memory" position:"Query" name:"Memory"`
|
||||
Cpu float64 `json:"Cpu" xml:"Cpu" position:"Query" name:"Cpu" `
|
||||
Name string `json:"Name" xml:"Name" `
|
||||
Image string `json:"Image" xml:"Image"`
|
||||
Memory float64 `json:"Memory" xml:"Memory"`
|
||||
Cpu float64 `json:"Cpu" xml:"Cpu"`
|
||||
RestartCount int `json:"RestartCount" xml:"RestartCount"`
|
||||
WorkingDir string `json:"WorkingDir" xml:"WorkingDir" position:"Query" name:"WorkingDir"`
|
||||
ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy" position:"Query" name:"ImagePullPolicy"`
|
||||
Commands []string `json:"Commands" xml:"Commands" position:"Query" name:"Command" type:"Repeated"`
|
||||
Args []string `json:"Args" xml:"Args" position:"Query" name:"Arg" type:"Repeated"`
|
||||
WorkingDir string `json:"WorkingDir" xml:"WorkingDir"`
|
||||
ImagePullPolicy string `json:"ImagePullPolicy" xml:"ImagePullPolicy"`
|
||||
Commands []string `json:"Commands" xml:"Commands"`
|
||||
Args []string `json:"Args" xml:"Args"`
|
||||
PreviousState ContainerState `json:"PreviousState" xml:"PreviousState"`
|
||||
CurrentState ContainerState `json:"CurrentState" xml:"CurrentState"`
|
||||
VolumeMounts []VolumeMount `json:"VolumeMounts" xml:"VolumeMounts" position:"Query" name:"VolumeMount" type:"Repeated"`
|
||||
Ports []ContainerPort `json:"Ports" xml:"Ports" position:"Query" name:"Port" type:"Repeated"`
|
||||
EnvironmentVars []EnvironmentVar `json:"EnvironmentVars" xml:"EnvironmentVars" position:"Query" name:"EnvironmentVar" type:"Repeated"`
|
||||
VolumeMounts []VolumeMount `json:"VolumeMounts" xml:"VolumeMounts"`
|
||||
Ports []ContainerPort `json:"Ports" xml:"Ports"`
|
||||
EnvironmentVars []EnvironmentVar `json:"EnvironmentVars" xml:"EnvironmentVars"`
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ import (
|
||||
|
||||
// ContainerPort is a nested struct in eci response
|
||||
type ContainerPort struct {
|
||||
Port requests.Integer `json:"Port" xml:"Port" position:"Query" name:"Port"`
|
||||
Protocol string `json:"Protocol" xml:"Protocol" position:"Query" name:"Protocol"`
|
||||
Port requests.Integer `name:"Port"`
|
||||
Protocol string `name:"Protocol"`
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ package eci
|
||||
|
||||
// EnvironmentVar is a nested struct in eci response
|
||||
type EnvironmentVar struct {
|
||||
Key string `json:"Key" xml:"Key" position:"Query" name:"Key"`
|
||||
Value string `json:"Value" xml:"Value" position:"Query" name:"Value"`
|
||||
Key string `name:"Key"`
|
||||
Value string `name:"Value"`
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ package eci
|
||||
|
||||
// Label is a nested struct in eci response
|
||||
type Tag struct {
|
||||
Key string `json:"Key" xml:"Key" position:"Query" name:"Key"`
|
||||
Value string `json:"Value" xml:"Value" position:"Query" name:"Value"`
|
||||
Key string `name:"Key"`
|
||||
Value string `name:"Value"`
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ const (
|
||||
)
|
||||
|
||||
type Volume struct {
|
||||
Type string `json:"Type" xml:"Type" position:"Query" name:"Type"`
|
||||
Name string `json:"Name" xml:"Name" position:"Query" name:"Name"`
|
||||
NfsVolumePath string `json:"NfsVolumePath" xml:"NfsVolumePath" position:"Query" name:"NFSVolume.Path"`
|
||||
NfsVolumeServer string `json:"NfsVolumeServer" xml:"NfsVolumeServer" position:"Query" name:"NFSVolume.Server"`
|
||||
NfsVolumeReadOnly requests.Boolean `json:"NfsVolumeReadOnly" xml:"NfsVolumeReadOnly" position:"Query" name:"NFSVolume.ReadOnly"`
|
||||
EmptyDirVolumeEnable requests.Boolean `json:"EmptyDirVolumeEnable" xml:"EmptyDirVolumeEnable" position:"Query" name:"EmptyDirVolume.Enable"`
|
||||
ConfigFileVolumeConfigFileToPaths []ConfigFileToPath `json:"ConfigFileVolumeConfigFileToPaths" xml:"ConfigFileVolume" position:"Query" name:"ConfigFileVolume.ConfigFileToPath" type:"Repeated"`
|
||||
Type string `name:"Type"`
|
||||
Name string `name:"Name"`
|
||||
NfsVolumePath string `name:"NFSVolume.Path"`
|
||||
NfsVolumeServer string `name:"NFSVolume.Server"`
|
||||
NfsVolumeReadOnly requests.Boolean `name:"NFSVolume.ReadOnly"`
|
||||
EmptyDirVolumeEnable requests.Boolean `name:"EmptyDirVolume.Enable"`
|
||||
ConfigFileToPaths []ConfigFileToPath `name:"ConfigFileVolume.ConfigFileToPath" type:"Repeated"`
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
|
||||
|
||||
// VolumeMount is a nested struct in eci response
|
||||
type VolumeMount struct {
|
||||
MountPath string `json:"MountPath" xml:"MountPath" position:"Query" name:"MountPath"`
|
||||
ReadOnly requests.Boolean `json:"ReadOnly" xml:"ReadOnly" position:"Query" name:"ReadOnly"`
|
||||
Name string `json:"Name" xml:"Name" position:"Query" name:"Name"`
|
||||
MountPath string `name:"MountPath"`
|
||||
ReadOnly requests.Boolean `name:"ReadOnly"`
|
||||
Name string `name:"Name"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user