github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/clients/cvm/create_image.go (about) 1 package cvm 2 3 import ( 4 github_com_morlay_goqcloud "github.com/morlay/goqcloud" 5 ) 6 7 // 创建镜像 8 // https://cloud.tencent.com/document/api/213/16726 9 10 type CreateImageRequest struct { 11 // DryRun 12 DryRun *bool `name:"DryRun,omitempty"` 13 // 软关机失败时是否执行强制关机以制作镜像 14 ForcePoweroff *string `name:"ForcePoweroff,omitempty"` 15 // 镜像描述 16 ImageDescription *string `name:"ImageDescription,omitempty"` 17 // 镜像名称 18 ImageName string `name:"ImageName"` 19 // 需要制作镜像的实例ID 20 InstanceId string `name:"InstanceId"` 21 // 实例处于运行中时,是否允许关机执行制作镜像任务。 22 Reboot *string `name:"Reboot,omitempty"` 23 // 区域 24 Region string `name:"Region"` 25 // 创建Windows镜像时是否启用Sysprep 26 Sysprep *string `name:"Sysprep,omitempty"` 27 } 28 29 func (req *CreateImageRequest) Invoke(client github_com_morlay_goqcloud.Client) (*CreateImageResponse, error) { 30 resp := &CreateImageResponse{} 31 err := client.Request("cvm", "CreateImage", "2017-03-12").Do(req, resp) 32 return resp, err 33 } 34 35 type CreateImageResponse struct { 36 github_com_morlay_goqcloud.TencentCloudBaseResponse 37 }