InstanceSpec.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. // Copyright 2018 JDCLOUD.COM
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. //
  15. // NOTE: This class is auto generated by the jdcloud code generator program.
  16. package models
  17. import vpc "github.com/jdcloud-api/jdcloud-sdk-go/services/vpc/models"
  18. import charge "github.com/jdcloud-api/jdcloud-sdk-go/services/charge/models"
  19. import disk "github.com/jdcloud-api/jdcloud-sdk-go/services/disk/models"
  20. type InstanceSpec struct {
  21. /* 高可用组Id。指定了此参数后,只能通过高可用组关联的实例模板创建虚机,并且实例模板中的参数不可覆盖替换。实例模板以外的参数还可以指定。 (Optional) */
  22. AgId *string `json:"agId"`
  23. /* 实例模板id,如果没有使用高可用组,那么对于实例模板中没有的信息,需要使用创建虚机的参数进行补充,或者选择覆盖启动模板中的参数。 (Optional) */
  24. InstanceTemplateId *string `json:"instanceTemplateId"`
  25. /* 云主机所属的可用区。 (Optional) */
  26. Az *string `json:"az"`
  27. /* 实例规格。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeinstancetypes">DescribeInstanceTypes</a>接口获得指定地域或可用区的规格信息。 (Optional) */
  28. InstanceType *string `json:"instanceType"`
  29. /* 镜像ID。可查询<a href="http://docs.jdcloud.com/virtual-machines/api/describeimages">DescribeImages</a>接口获得指定地域的镜像信息。 (Optional) */
  30. ImageId *string `json:"imageId"`
  31. /* 云主机名称,不为空且只允许中文、数字、大小写字母、英文下划线(_)、连字符(-)及点(.),不能以(.)作为首尾,长度为2~128个字符。
  32. 批量创建多台云主机时,可在name中非首位位置以[start_number]格式来设置有序name。start_number为起始序号,取值范围[0,9999]。例如:name设置为“instance-[000]-ops”,则第一台主机name为“instance-000-ops”,第二台主机name为“instance-001-ops”。再如:name设置为“instance-[0]-ops”,则第一台主机name为“instance-0-ops”,第二台主机name为“instance-1-ops”。
  33. */
  34. Name string `json:"name"`
  35. /* 云主机hostname,若不指定hostname,则hostname默认使用云主机名称name,但是会以RFC 952和RFC 1123命名规范做一定转义。
  36. Windows Server系统:长度为2-15个字符,允许大小写字母、数字或连字符(-)。不能以连字符(-)开头或结尾,不能连续使用连字符(-),也不能全部使用数字。不支持点号(.)。
  37. Linux系统:长度为2-64个字符,允许支持多个点号,点之间为一段,每段允许使用大小写字母、数字或连字符(-),但不能连续使用点号(.)或连字符(-),不能以点号(.)或连字符(-)开头或结尾。
  38. 批量创建多台云主机时,可在hostname中非首位位置以[start_number]格式来设置有序hostname。start_number为起始序号,取值范围[0,9999]。例如:hostname设置为“instance-[000]-ops”,则第一台主机hostname为“instance-000-ops”,第二台主机hostname为“instance-001-ops”。再如:hostname设置为“instance-[0]-ops”,则第一台主机hostname为“instance-0-ops”,第二台主机hostname为“instance-1-ops”。批量创建时若不指定起始序号,则会默认追加从1开始的数字,例如批量创建两台虚拟机,且指定hostname是test,则hostname默认是test1,test2。
  39. (Optional) */
  40. Hostname *string `json:"hostname"`
  41. /* 密码,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */
  42. Password *string `json:"password"`
  43. /* 密钥对名称,当前只支持传入一个。 (Optional) */
  44. KeyNames []string `json:"keyNames"`
  45. /* 主网卡主IP关联的弹性IP规格 (Optional) */
  46. ElasticIp *vpc.ElasticIpSpec `json:"elasticIp"`
  47. /* 主网卡配置信息 (Optional) */
  48. PrimaryNetworkInterface *InstanceNetworkInterfaceAttachmentSpec `json:"primaryNetworkInterface"`
  49. /* 系统盘配置信息 (Optional) */
  50. SystemDisk *InstanceDiskAttachmentSpec `json:"systemDisk"`
  51. /* 数据盘配置信息,本地盘(local类型)做系统盘的云主机可挂载8块数据盘,云硬盘(cloud类型)做系统盘的云主机可挂载7块数据盘。 (Optional) */
  52. DataDisks []InstanceDiskAttachmentSpec `json:"dataDisks"`
  53. /* 计费配置
  54. 云主机不支持按用量方式计费,默认为按配置计费。
  55. 打包创建数据盘的情况下,数据盘的计费方式只能与云主机保持一致。
  56. 打包创建弹性公网IP的情况下,若公网IP的计费方式没有指定为按用量计费,那么公网IP计费方式只能与云主机保持一致。
  57. (Optional) */
  58. Charge *charge.ChargeSpec `json:"charge"`
  59. /* 用户自定义元数据信息,key-value键值对总数量不超过40对,其中有效键值对数量不超过20,无效键值对数量不超过20对。不区分大小写。
  60. 注意:key不要以连字符(-)结尾,否则此key不生效。
  61. (Optional) */
  62. Metadata []Metadata `json:"metadata"`
  63. /* 元数据信息,目前只支持传入一个key为"launch-script",表示首次启动脚本。value为base64格式,编码前数据不能大于16KB。
  64. launch-script:linux系统支持bash和python,编码前须分别以 #!/bin/bash 和 #!/usr/bin/env python 作为内容首行;
  65. launch-script:windows系统支持bat和powershell,编码前须分别以 <cmd></cmd> 和 <powershell></powershell> 作为内容首、尾行。
  66. (Optional) */
  67. Userdata []Userdata `json:"userdata"`
  68. /* 主机描述,<a href="http://docs.jdcloud.com/virtual-machines/api/general_parameters">参考公共参数规范</a>。 (Optional) */
  69. Description *string `json:"description"`
  70. /* 不使用模板中的密码。
  71. 仅当不使用Ag,并且使用了模板,并且password参数为空时,此参数(值为true)生效。
  72. 若使用模板创建虚机时,又指定了password参数时,此参数无效,以新指定的为准。
  73. (Optional) */
  74. NoPassword *bool `json:"noPassword"`
  75. /* 不使用模板中的密钥。
  76. 仅当不使用Ag,并且使用了模板,并且keynames参数为空时,此参数(值为true)生效。
  77. 若使用模板创建虚机时,又指定了keynames参数时,此参数无效,以新指定的为准。
  78. (Optional) */
  79. NoKeyNames *bool `json:"noKeyNames"`
  80. /* 不使用模板中的弹性公网IP。
  81. 仅当不使用Ag,并且使用了模板,并且elasticIp参数为空时,此参数(值为true)生效。
  82. 若使用模板创建虚机时,又指定了elasticIp参数时,此参数无效,以新指定的为准。
  83. (Optional) */
  84. NoElasticIp *bool `json:"noElasticIp"`
  85. /* 用户普通标签集合 (Optional) */
  86. UserTags []disk.Tag `json:"userTags"`
  87. /* 关机模式,只支持云盘做系统盘的按配置计费云主机。keepCharging:关机后继续计费;stopCharging:关机后停止计费。 (Optional) */
  88. ChargeOnStopped *string `json:"chargeOnStopped"`
  89. /* 自动镜像策略ID。 (Optional) */
  90. AutoImagePolicyId *string `json:"autoImagePolicyId"`
  91. /* 当存在密钥时,是否同时使用密码登录,"yes"为使用,"no"为不使用,""默认为"yes" (Optional) */
  92. PasswordAuth *string `json:"passwordAuth"`
  93. /* 继承镜像中的登录验证方式,"yes"为使用,"no"为不使用,""默认为"no" (Optional) */
  94. ImageInherit *string `json:"imageInherit"`
  95. }