github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/sms/v3/templates/results.go (about) 1 package templates 2 3 // CreateTemplateResp is the response from a Create operation. 4 type CreateTemplateResp struct { 5 // 服务端返回的新添加的模板的id 6 ID string `json:"id"` 7 } 8 9 // TemplateResponse is the response from a Get operation. 10 type TemplateResponse struct { 11 // 模板ID 12 Id string `json:"id"` 13 // 模板名称 14 Name string `json:"name"` 15 // 是否是通用模板,只有为true才能在console中显示 16 IsTemplate string `json:"is_template"` 17 // Region信息 18 Region string `json:"region"` 19 // 项目ID 20 Projectid string `json:"projectid"` 21 // 目标端服务器名称 22 TargetServerName string `json:"target_server_name"` 23 // 可用区 24 AvailabilityZone string `json:"availability_zone"` 25 // 虚拟机规格 26 Flavor string `json:"flavor"` 27 // VPC信息 28 Vpc VpcObject `json:"vpc"` 29 // 网卡信息,支持多个网卡,如果是自动创建,只填一个,id使用“autoCreate” 30 Nics []NicObject `json:"nics"` 31 // 安全组,支持多个安全组,如果是自动创建,只填一个,id使用“autoCreate” 32 SecurityGroups []SgObject `json:"security_groups"` 33 // 公网IP信息 34 PublicIP EipObject `json:"publicip"` 35 // 磁盘信息 36 Disks []DiskObject `json:"disk"` 37 // 磁盘类型: "SAS", "SSD", "GPSSD", "ESSD" 38 Volumetype string `json:"volumetype"` 39 // 数据盘磁盘类型: "SAS", "SSD", "GPSSD", "ESSD" 40 DataVolumeType string `json:"data_volume_type"` 41 // 目的端服务器密码 42 ServerPassword string `json:"target_password"` 43 } 44 45 // VpcObject vpc对象 46 type VpcObject struct { 47 // 虚拟私有云ID,如果是自动创建,填“autoCreate” 48 Id string `json:"id"` 49 // 虚拟私有云名称 50 Name string `json:"name"` 51 // VPC的网段,默认192.168.0.0/16 52 Cidr string `json:"cidr"` 53 } 54 55 // NicObject 网卡资源 56 type NicObject struct { 57 // 子网ID,如果是自动创建,使用"autoCreate" 58 Id string `json:"id"` 59 // 子网名称 60 Name string `json:"name"` 61 // 子网网关/掩码 62 Cidr string `json:"cidr"` 63 // 虚拟机IP地址,如果没有这个字段,自动分配IP 64 Ip string `json:"ip"` 65 } 66 67 // SgObject 安全组object 68 type SgObject struct { 69 // 安全组ID 70 Id string `json:"id"` 71 // 安全组名称 72 Name string `json:"name"` 73 } 74 75 // EipObject 公网ip 76 type EipObject struct { 77 // 弹性公网IP类型,默认为5_bgp 78 Type string `json:"type"` 79 // 带宽大小,单位:Mbit/s 80 BandwidthSize int `json:"bandwidth_size"` 81 } 82 83 // DiskObject 磁盘模板 84 type DiskObject struct { 85 // 磁盘序号,从0开始 86 Index int `json:"index"` 87 // 磁盘名称 88 Name string `json:"name"` 89 // 磁盘类型,同volumetype字段 90 Disktype string `json:"disktype"` 91 // 磁盘大小,单位:GB 92 Size int `json:"size"` 93 }