github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/clients/cis/create_container_instance.go (about)

     1  package cis
     2  
     3  import (
     4  	github_com_morlay_goqcloud "github.com/morlay/goqcloud"
     5  )
     6  
     7  // 创建容器实例
     8  // https://cloud.tencent.com/document/api/858/17775
     9  
    10  type CreateContainerInstanceRequest struct {
    11  	// 容器列表
    12  	Containers []*Container `name:"Containers"`
    13  	// 容器实例名称,由小写字母、数字和 - 组成,由小写字母开头,小写字母或数字结尾,且长度不超过 40个字符
    14  	InstanceName string `name:"InstanceName"`
    15  	// 区域
    16  	Region string `name:"Region"`
    17  	// 重启策略(Always,OnFailure,Never)
    18  	RestartPolicy string `name:"RestartPolicy"`
    19  	// subnetId
    20  	SubnetId string `name:"SubnetId"`
    21  	// vpcId
    22  	VpcId string `name:"VpcId"`
    23  	// 可用区
    24  	Zone string `name:"Zone"`
    25  }
    26  
    27  func (req *CreateContainerInstanceRequest) Invoke(client github_com_morlay_goqcloud.Client) (*CreateContainerInstanceResponse, error) {
    28  	resp := &CreateContainerInstanceResponse{}
    29  	err := client.Request("cis", "CreateContainerInstance", "2018-04-08").Do(req, resp)
    30  	return resp, err
    31  }
    32  
    33  type CreateContainerInstanceResponse struct {
    34  	github_com_morlay_goqcloud.TencentCloudBaseResponse
    35  	// 容器实例ID
    36  	InstanceId string `json:"InstanceId"`
    37  }