Skip to content

Commit f0afbce

Browse files
authored
auto codegen for UHost
1 parent a02ec2d commit f0afbce

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

ucloud/services/uhost/client.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ def create_uhost_instance(
196196
**CreateUHostInstanceParamVirtualGpuGPUVirtualGpu**
197197
198198
199-
**CreateUHostInstanceParamVirtualGpu**
199+
**CreateUHostInstanceParamVolumes**
200200
201201
202-
**CreateUHostInstanceParamVolumes**
202+
**CreateUHostInstanceParamVirtualGpu**
203203
204204
205205
"""
@@ -386,10 +386,12 @@ def describe_uhost_instance(
386386
- **GPU** (int) - GPU个数
387387
- **HostType** (str) - 【建议不再使用】主机系列:N2,表示系列2;N1,表示系列1
388388
- **HotplugFeature** (bool) - true: 开启热升级; false,未开启热升级
389+
- **HpcFeature** (bool) - true: 开启 hpc 系列功能;false: 未开启
389390
- **IPSet** (list) - 见 **UHostIPSet** 模型定义
390391
- **IPv6Feature** (bool) - true:有ipv6特性;false,没有ipv6特性
391392
- **ImageId** (str) - 【建议不再使用】主机的系统盘ID。
392393
- **IsolationGroup** (str) - 隔离组id,不在隔离组则返回""
394+
- **KeyPair** (dict) - 见 **UHostKeyPair** 模型定义
393395
- **LifeCycle** (str) - 主机的生命周期类型。目前仅支持Normal:普通;
394396
- **MachineType** (str) - 云主机机型(新)。参考 `云主机机型说明 <https://docs.ucloud.cn/api/uhost-api/uhost_type#主机概念20版本>`_ 。
395397
- **Memory** (int) - 内存大小,单位: MB
@@ -401,7 +403,7 @@ def describe_uhost_instance(
401403
- **RdmaClusterId** (str) - RDMA集群id,仅快杰云主机返回该值;其他类型云主机返回""。当云主机的此值与RSSD云盘的RdmaClusterId相同时,RSSD可以挂载到这台云主机。
402404
- **Remark** (str) - 备注
403405
- **RestrictMode** (str) - 仅抢占式实例返回,LowSpeed为低速模式,PowerOff为关机模式
404-
- **State** (str) - 实例状态,枚举值:\\ >初始化: Initializing; \\ >启动中: Starting; \\> 运行中: Running; \\> 关机中: Stopping; \\ >关机: Stopped \\ >安装失败: Install Fail; \\ >重启中: Rebooting
406+
- **State** (str) - 实例状态,枚举值:\\ >初始化: Initializing; \\ >启动中: Starting; \\> 运行中: Running; \\> 关机中: Stopping; \\ >关机: Stopped \\ >安装失败: Install Fail; \\ >重启中: Rebooting; \\ > 未知(空字符串,获取状态超时或出错):""
405407
- **StorageType** (str) - 【建议不再使用】主机磁盘类型。 枚举值为:\\ > LocalDisk,本地磁盘; \\ > UDisk 云盘。\\只要有一块磁盘为本地盘,即返回LocalDisk。
406408
- **SubnetType** (str) - 【建议不再使用】仅北京A的云主机会返回此字段。基础网络模式:Default;子网模式:Private
407409
- **Tag** (str) - 业务组名称
@@ -438,6 +440,11 @@ def describe_uhost_instance(
438440
- **Weight** (int) - 当前EIP的权重。权重最大的为当前的出口IP。
439441
440442
443+
**UHostKeyPair**
444+
- **KeyPairId** (str) - 密钥对ID
445+
- **KeyPairState** (str) - 主机密钥对状态,Normal 正常,Deleted 删除
446+
447+
441448
"""
442449
# build request
443450
d = {

ucloud/services/uhost/schemas/apis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,14 @@ class CreateUHostInstanceParamVirtualGpuGPUVirtualGpuSchema(
183183
fields = {}
184184

185185

186-
class CreateUHostInstanceParamVirtualGpuSchema(schema.RequestSchema):
187-
"""CreateUHostInstanceParamVirtualGpu -"""
186+
class CreateUHostInstanceParamVolumesSchema(schema.RequestSchema):
187+
"""CreateUHostInstanceParamVolumes -"""
188188

189189
fields = {}
190190

191191

192-
class CreateUHostInstanceParamVolumesSchema(schema.RequestSchema):
193-
"""CreateUHostInstanceParamVolumes -"""
192+
class CreateUHostInstanceParamVirtualGpuSchema(schema.RequestSchema):
193+
"""CreateUHostInstanceParamVirtualGpu -"""
194194

195195
fields = {}
196196

ucloud/services/uhost/schemas/models.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ class UHostIPSetSchema(schema.ResponseSchema):
7070
}
7171

7272

73+
class UHostKeyPairSchema(schema.ResponseSchema):
74+
"""UHostKeyPair - 主机密钥信息"""
75+
76+
fields = {
77+
"KeyPairId": fields.Str(required=False, load_from="KeyPairId"),
78+
"KeyPairState": fields.Str(required=False, load_from="KeyPairState"),
79+
}
80+
81+
7382
class UHostDiskSetSchema(schema.ResponseSchema):
7483
"""UHostDiskSet - DescribeUHostInstance"""
7584

@@ -110,12 +119,14 @@ class UHostInstanceSetSchema(schema.ResponseSchema):
110119
"HotplugFeature": fields.Bool(
111120
required=False, load_from="HotplugFeature"
112121
),
122+
"HpcFeature": fields.Bool(required=False, load_from="HpcFeature"),
113123
"IPSet": fields.List(UHostIPSetSchema()),
114124
"IPv6Feature": fields.Bool(required=False, load_from="IPv6Feature"),
115125
"ImageId": fields.Str(required=False, load_from="ImageId"),
116126
"IsolationGroup": fields.Str(
117127
required=False, load_from="IsolationGroup"
118128
),
129+
"KeyPair": UHostKeyPairSchema(),
119130
"LifeCycle": fields.Str(required=False, load_from="LifeCycle"),
120131
"MachineType": fields.Str(required=False, load_from="MachineType"),
121132
"Memory": fields.Int(required=False, load_from="Memory"),

0 commit comments

Comments
 (0)