调用CreateGWSInstance创建一个可视化实例。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateGWSInstance

系统规定参数。取值:CreateGWSInstance

AllocatePublicAddress Boolean false

是否分配公网地址。取值范围:

  • true:分配
  • false:不分配

默认值:false

ClusterId String gws-rhzxpazwebua****

可视化服务集群ID。

ImageId String ehs-faeid-****

可视化服务镜像ID。

InstanceChargeType String Postpaid

可视化实例计费方式,不能为抢占式实例。

  • PostPaid:按量付费
  • PrePaid:包年包月

默认值:PostPaid

InstanceType String ecs.g6.large

可视化实例规格。

SystemDiskCategory String cloud

系统盘类型。取值范围:

  • cloud_efficiency:高效云盘
  • cloud_ssd:SSD云盘
  • cloud_essd:ESSD云盘
  • cloud:普通云盘
SystemDiskSize Integer 20

系统盘大小。单位:GiB

取值范围:20~500

WorkMode String Desktop

实例工作模式。取值范围:

  • Desktop:桌面模式
  • Application:应用模式
InternetChargeType String PayByTraffic

公网带宽计费方式。取值范围:

  • PayByBandwidth:按固定带宽计费。
  • PayByTraffic:按使用流量计费。

默认值:PayByTraffic

InternetMaxBandwidthIn Integer 122

公网入带宽最大值。单位为Mbit/s。取值范围:

  • 当所购出网带宽小于等于10 Mbit/s时:1~10。默认值:10
  • 当所购出网带宽大于10 Mbit/s时:1~InternetMaxBandwidthOut的取值,默认为InternetMaxBandwidthOut的取值。
InternetMaxBandwidthOut Integer 122

公网出带宽最大值。单位:Mbit/s

取值范围:0~100

默认值:0

Name String Test-ehpc

可视化实例名称。

Period String 1

购买资源的时长。单位由PeriodUnit指定。当参数ChargeType取值为PrePaid时才生效,且为必选值。

  • 如果PeriodUnit为Month,该参数的取值范围:{“1”, “2”, “3”, “6”}。
  • 如果PeriodUnit为Year,该参数的取值范围:{“1”, “2”, “3”, “4”, “5”}。
PeriodUnit String Month

购买资源的时长单位。取值范围:

  • Month:月
  • Year:年
AutoRenew Boolean false

是否自动续费。取值范围:

  • true:是
  • false:否

默认值:false

AppList String [{AppName: notepad},{AppArgs:c:/temp.txt}]

应用程序列表。WorkMode选择为Application时必选。包含如下信息:

  • AppName:应用名称。
  • AppPath:应用运行路径。
  • AppArgs:应用运行参数。
VSwitchId String vsw-bp1gb5gf5546rn****

交换机ID。

返回数据

名称 类型 示例值 描述
InstanceId String i-bp1bzqddeemudsdsdsdsdn****

可视化实例ID。

RequestId String 5198C3E8-85F5-4280-8547-687C1710FE08

请求ID。

示例

请求示例

https://ehpc.cn-hangzhou.aliyuncs.com/?Action=CreateGWSInstance
&AllocatePublicAddress=false
&ClusterId=gws-rhzxpazwebua****
&ImageId=ehs-faeid-gws
&InstanceChargeType=Postpaid
&InstanceType=ecs.g6.large
&SystemDiskCategory=cloud
&SystemDiskSize=20
&WorkMode=Desktop
&<公共请求参数>

正常返回示例

XML格式

<CreateGWSInstanceResponse>
      <InstanceId>i-bp1bzqq4rj1ddeemudsdsdsdsdn****</InstanceId>
      <requestId>5198C3E8-85F5-4280-8547-687C1710FE08</requestId>
</CreateGWSInstanceResponse>

JSON格式

{
    "InstanceId": "i-bp1bzqq1ddeemudsdsdsdsdn****",
    "requestId": "5198C3E8-85F5-4280-8547-687C1710FE08"
}

错误码

HttpCode 错误码 错误信息 描述
503 ServiceUnavailable The request has failed due to a temporary failure of the server 请求失败,服务暂时不可用

访问错误中心查看更多错误码。