diff --git a/docs/services.rst b/docs/services.rst index ca5f81a..c9cfa92 100644 --- a/docs/services.rst +++ b/docs/services.rst @@ -87,206 +87,10 @@ VPC -Cube ----- - -.. autoclass:: ucloud.services.cube.client.CubeClient - :members: - - -IAM ---- - -.. autoclass:: ucloud.services.iam.client.IAMClient - :members: - - -IPSecVPN --------- - -.. autoclass:: ucloud.services.ipsecvpn.client.IPSecVPNClient - :members: - - -ISMS ----- - -.. autoclass:: ucloud.services.isms.client.ISMSClient - :members: - - -STS ---- - -.. autoclass:: ucloud.services.sts.client.STSClient - :members: - - -TiDB ----- - -.. autoclass:: ucloud.services.tidb.client.TiDBClient - :members: - - -UAAA ----- - -.. autoclass:: ucloud.services.uaaa.client.UAAAClient - :members: - - -UADS ----- - -.. autoclass:: ucloud.services.uads.client.UADSClient - :members: - - -UBill ------ - -.. autoclass:: ucloud.services.ubill.client.UBillClient - :members: - - -UCompShare +ULightHost ---------- -.. autoclass:: ucloud.services.ucompshare.client.UCompShareClient - :members: - - -UDBProxy --------- - -.. autoclass:: ucloud.services.udbproxy.client.UDBProxyClient - :members: - - -UDDB ----- - -.. autoclass:: ucloud.services.uddb.client.UDDBClient - :members: - - -UDI ---- - -.. autoclass:: ucloud.services.udi.client.UDIClient - :members: - - -UDNS ----- - -.. autoclass:: ucloud.services.udns.client.UDNSClient - :members: - - -UDTS ----- - -.. autoclass:: ucloud.services.udts.client.UDTSClient - :members: - - -UEC ---- - -.. autoclass:: ucloud.services.uec.client.UECClient - :members: - - -UFS ---- - -.. autoclass:: ucloud.services.ufs.client.UFSClient - :members: - - -UFile ------ - -.. autoclass:: ucloud.services.ufile.client.UFileClient - :members: - - -UGN ---- - -.. autoclass:: ucloud.services.ugn.client.UGNClient - :members: - - -UHub ----- - -.. autoclass:: ucloud.services.uhub.client.UHubClient - :members: - - -UK8S ----- - -.. autoclass:: ucloud.services.uk8s.client.UK8SClient - :members: - - -UMongoDB --------- - -.. autoclass:: ucloud.services.umongodb.client.UMongoDBClient - :members: - - -UNVS ----- - -.. autoclass:: ucloud.services.unvs.client.UNVSClient - :members: - - -UPFS ----- - -.. autoclass:: ucloud.services.upfs.client.UPFSClient - :members: - - -UPgSQL ------- - -.. autoclass:: ucloud.services.upgsql.client.UPgSQLClient - :members: - - -UPhone ------- - -.. autoclass:: ucloud.services.uphone.client.UPhoneClient - :members: - - -USLK ----- - -.. autoclass:: ucloud.services.uslk.client.USLKClient - :members: - - -UTSDB ------ - -.. autoclass:: ucloud.services.utsdb.client.UTSDBClient - :members: - - -UVMS ----- - -.. autoclass:: ucloud.services.uvms.client.UVMSClient +.. autoclass:: ucloud.services.ulighthost.client.ULightHostClient :members: @@ -296,10 +100,3 @@ VPC .. autoclass:: ucloud.services.vpc.client.VPCClient :members: - -ipv6gw ------- - -.. autoclass:: ucloud.services.ipv6gw.client.ipv6gwClient - :members: - diff --git a/ucloud/client.py b/ucloud/client.py index dff6291..558c284 100644 --- a/ucloud/client.py +++ b/ucloud/client.py @@ -22,421 +22,11 @@ def pathx(self): self.logger, ) - def cube(self): - from ucloud.services.cube.client import CubeClient + def ulighthost(self): + from ucloud.services.ulighthost.client import ULightHostClient - return CubeClient( - self._auto_config("cube"), - self.transport, - self.middleware, - self.logger, - ) - - def iam(self): - from ucloud.services.iam.client import IAMClient - - return IAMClient( - self._auto_config("iam"), - self.transport, - self.middleware, - self.logger, - ) - - def ipsecvpn(self): - from ucloud.services.ipsecvpn.client import IPSecVPNClient - - return IPSecVPNClient( - self._auto_config("ipsecvpn"), - self.transport, - self.middleware, - self.logger, - ) - - def isms(self): - from ucloud.services.isms.client import ISMSClient - - return ISMSClient( - self._auto_config("isms"), - self.transport, - self.middleware, - self.logger, - ) - - def sts(self): - from ucloud.services.sts.client import STSClient - - return STSClient( - self._auto_config("sts"), - self.transport, - self.middleware, - self.logger, - ) - - def stepflow(self): - from ucloud.services.stepflow.client import StepFlowClient - - return StepFlowClient( - self._auto_config("stepflow"), - self.transport, - self.middleware, - self.logger, - ) - - def tidb(self): - from ucloud.services.tidb.client import TiDBClient - - return TiDBClient( - self._auto_config("tidb"), - self.transport, - self.middleware, - self.logger, - ) - - def uaaa(self): - from ucloud.services.uaaa.client import UAAAClient - - return UAAAClient( - self._auto_config("uaaa"), - self.transport, - self.middleware, - self.logger, - ) - - def uads(self): - from ucloud.services.uads.client import UADSClient - - return UADSClient( - self._auto_config("uads"), - self.transport, - self.middleware, - self.logger, - ) - - def uaccount(self): - from ucloud.services.uaccount.client import UAccountClient - - return UAccountClient( - self._auto_config("uaccount"), - self.transport, - self.middleware, - self.logger, - ) - - def ubill(self): - from ucloud.services.ubill.client import UBillClient - - return UBillClient( - self._auto_config("ubill"), - self.transport, - self.middleware, - self.logger, - ) - - def ucdn(self): - from ucloud.services.ucdn.client import UCDNClient - - return UCDNClient( - self._auto_config("ucdn"), - self.transport, - self.middleware, - self.logger, - ) - - def ucompshare(self): - from ucloud.services.ucompshare.client import UCompShareClient - - return UCompShareClient( - self._auto_config("ucompshare"), - self.transport, - self.middleware, - self.logger, - ) - - def udb(self): - from ucloud.services.udb.client import UDBClient - - return UDBClient( - self._auto_config("udb"), - self.transport, - self.middleware, - self.logger, - ) - - def udbproxy(self): - from ucloud.services.udbproxy.client import UDBProxyClient - - return UDBProxyClient( - self._auto_config("udbproxy"), - self.transport, - self.middleware, - self.logger, - ) - - def uddb(self): - from ucloud.services.uddb.client import UDDBClient - - return UDDBClient( - self._auto_config("uddb"), - self.transport, - self.middleware, - self.logger, - ) - - def udi(self): - from ucloud.services.udi.client import UDIClient - - return UDIClient( - self._auto_config("udi"), - self.transport, - self.middleware, - self.logger, - ) - - def udns(self): - from ucloud.services.udns.client import UDNSClient - - return UDNSClient( - self._auto_config("udns"), - self.transport, - self.middleware, - self.logger, - ) - - def udpn(self): - from ucloud.services.udpn.client import UDPNClient - - return UDPNClient( - self._auto_config("udpn"), - self.transport, - self.middleware, - self.logger, - ) - - def udts(self): - from ucloud.services.udts.client import UDTSClient - - return UDTSClient( - self._auto_config("udts"), - self.transport, - self.middleware, - self.logger, - ) - - def udisk(self): - from ucloud.services.udisk.client import UDiskClient - - return UDiskClient( - self._auto_config("udisk"), - self.transport, - self.middleware, - self.logger, - ) - - def uec(self): - from ucloud.services.uec.client import UECClient - - return UECClient( - self._auto_config("uec"), - self.transport, - self.middleware, - self.logger, - ) - - def ufs(self): - from ucloud.services.ufs.client import UFSClient - - return UFSClient( - self._auto_config("ufs"), - self.transport, - self.middleware, - self.logger, - ) - - def ufile(self): - from ucloud.services.ufile.client import UFileClient - - return UFileClient( - self._auto_config("ufile"), - self.transport, - self.middleware, - self.logger, - ) - - def ugn(self): - from ucloud.services.ugn.client import UGNClient - - return UGNClient( - self._auto_config("ugn"), - self.transport, - self.middleware, - self.logger, - ) - - def uhost(self): - from ucloud.services.uhost.client import UHostClient - - return UHostClient( - self._auto_config("uhost"), - self.transport, - self.middleware, - self.logger, - ) - - def uhub(self): - from ucloud.services.uhub.client import UHubClient - - return UHubClient( - self._auto_config("uhub"), - self.transport, - self.middleware, - self.logger, - ) - - def uk8s(self): - from ucloud.services.uk8s.client import UK8SClient - - return UK8SClient( - self._auto_config("uk8s"), - self.transport, - self.middleware, - self.logger, - ) - - def ulb(self): - from ucloud.services.ulb.client import ULBClient - - return ULBClient( - self._auto_config("ulb"), - self.transport, - self.middleware, - self.logger, - ) - - def umem(self): - from ucloud.services.umem.client import UMemClient - - return UMemClient( - self._auto_config("umem"), - self.transport, - self.middleware, - self.logger, - ) - - def umongodb(self): - from ucloud.services.umongodb.client import UMongoDBClient - - return UMongoDBClient( - self._auto_config("umongodb"), - self.transport, - self.middleware, - self.logger, - ) - - def unvs(self): - from ucloud.services.unvs.client import UNVSClient - - return UNVSClient( - self._auto_config("unvs"), - self.transport, - self.middleware, - self.logger, - ) - - def unet(self): - from ucloud.services.unet.client import UNetClient - - return UNetClient( - self._auto_config("unet"), - self.transport, - self.middleware, - self.logger, - ) - - def upfs(self): - from ucloud.services.upfs.client import UPFSClient - - return UPFSClient( - self._auto_config("upfs"), - self.transport, - self.middleware, - self.logger, - ) - - def uphost(self): - from ucloud.services.uphost.client import UPHostClient - - return UPHostClient( - self._auto_config("uphost"), - self.transport, - self.middleware, - self.logger, - ) - - def upgsql(self): - from ucloud.services.upgsql.client import UPgSQLClient - - return UPgSQLClient( - self._auto_config("upgsql"), - self.transport, - self.middleware, - self.logger, - ) - - def uphone(self): - from ucloud.services.uphone.client import UPhoneClient - - return UPhoneClient( - self._auto_config("uphone"), - self.transport, - self.middleware, - self.logger, - ) - - def uslk(self): - from ucloud.services.uslk.client import USLKClient - - return USLKClient( - self._auto_config("uslk"), - self.transport, - self.middleware, - self.logger, - ) - - def usms(self): - from ucloud.services.usms.client import USMSClient - - return USMSClient( - self._auto_config("usms"), - self.transport, - self.middleware, - self.logger, - ) - - def utsdb(self): - from ucloud.services.utsdb.client import UTSDBClient - - return UTSDBClient( - self._auto_config("utsdb"), - self.transport, - self.middleware, - self.logger, - ) - - def uvms(self): - from ucloud.services.uvms.client import UVMSClient - - return UVMSClient( - self._auto_config("uvms"), - self.transport, - self.middleware, - self.logger, - ) - - def ipv6gw(self): - from ucloud.services.ipv6gw.client import ipv6gwClient - - return ipv6gwClient( - self._auto_config("ipv6gw"), + return ULightHostClient( + self._auto_config("ulighthost"), self.transport, self.middleware, self.logger, diff --git a/ucloud/services/ulighthost/__init__.py b/ucloud/services/ulighthost/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ucloud/services/ulighthost/client.py b/ucloud/services/ulighthost/client.py new file mode 100644 index 0000000..6a3d8ba --- /dev/null +++ b/ucloud/services/ulighthost/client.py @@ -0,0 +1,576 @@ +""" Code is generated by ucloud-model, DO NOT EDIT IT. """ + +import typing + + +from ucloud.core.client import Client +from ucloud.services.ulighthost.schemas import apis + + +class ULightHostClient(Client): + def __init__( + self, config: dict, transport=None, middleware=None, logger=None + ): + super(ULightHostClient, self).__init__( + config, transport, middleware, logger + ) + + def check_ul_host_resource_capacity( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """CheckULHostResourceCapacity - 检查轻量应用云主机资源余量 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **BundleId** (str) - (Required) 套餐ID。如:"ulh.c1m1s40b30t800" + - **ImageId** (str) - (Required) 镜像ID。 请通过 `DescribeImage `_ 获取 + - **ChargeType** (str) - 计费模式。枚举值: \\ > Year,按年付费; \\ > Month,按月付费;\\ > ThirtyDay,30天期付费,跨境电商相关套餐使用此计费方式;默认:Month + - **CouponId** (str) - 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看 + - **Name** (str) - 轻量应用主机名称。默认:套餐ID。请遵照 `字段规范 `_ 设定实例名称。 + - **Quantity** (int) - 购买时长。默认:1。不支持购买到月末 + - **SecurityGroupId** (str) - 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 `DescribeFirewall `_ 。 + - **SubnetId** (str) - 子网 ID。默认为当前地域的默认子网。 + - **VPCId** (str) - VPC ID。默认为当前地域的默认VPC。 + + **Response** + + - **Message** (str) - 错误信息 + - **ResourceEnough** (bool) - 资源是否充足 + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.CheckULHostResourceCapacityRequestSchema().dumps(d) + + resp = self.invoke("CheckULHostResourceCapacity", d, **kwargs) + return apis.CheckULHostResourceCapacityResponseSchema().loads(resp) + + def create_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """CreateULHostInstance - 创建轻量应用云主机 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **BundleId** (str) - (Required) 套餐ID。如:"ulh.c1m1s40b30t800" + - **ImageId** (str) - (Required) 镜像ID。 请通过 `DescribeImage `_ 获取 + - **Password** (str) - (Required) ULHost密码。请遵照 `字段规范 `_ 设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64 + - **ChargeType** (str) - 计费模式。枚举值: \\ > Year,按年付费; \\ > Month,按月付费;\\ > ThirtyDay,30天期付费,跨境电商相关套餐使用此计费方式;默认:Month + - **CouponId** (str) - 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看 + - **Name** (str) - 轻量应用主机名称。默认:套餐ID。请遵照 `字段规范 `_ 设定实例名称。 + - **Quantity** (int) - 购买时长。默认:1。不支持购买到月末 + - **SecurityGroupId** (str) - 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 `DescribeFirewall `_ 。 + - **SubnetId** (str) - 子网 ID。默认为当前地域的默认子网。 + - **VPCId** (str) - VPC ID。默认为当前地域的默认VPC。 + + **Response** + + - **Message** (str) - 错误信息 + - **ULHostId** (str) - 实例ID + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.CreateULHostInstanceRequestSchema().dumps(d) + + # build options + kwargs["max_retries"] = 0 # ignore retry when api is not idempotent + + resp = self.invoke("CreateULHostInstance", d, **kwargs) + return apis.CreateULHostInstanceResponseSchema().loads(resp) + + def describe_ul_host_bundles( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """DescribeULHostBundles - 获取轻量应用云主机套餐列表 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + + **Response** + + - **Bundles** (list) - 见 **Bundle** 模型定义 + - **Message** (str) - 错误信息 + + **Response Model** + + **Bundle** + - **Bandwidth** (int) - 外网带宽。单位:Mbps。 + - **BundleId** (str) - 套餐ID。 + - **CPU** (int) - CPU核数。 + - **Memory** (int) - 内存大小。单位:MB。 + - **SysDiskSpace** (int) - 系统盘大小。单位:GB。 + - **TrafficPacket** (int) - 流量包大小。单位:GB。 + + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.DescribeULHostBundlesRequestSchema().dumps(d) + + resp = self.invoke("DescribeULHostBundles", d, **kwargs) + return apis.DescribeULHostBundlesResponseSchema().loads(resp) + + def describe_ul_host_image( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """DescribeULHostImage - 获取指定数据中心镜像列表 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ImageId** (str) - 镜像Id + - **ImageIds** (list) - 镜像Id列表 + - **ImageType** (str) - 镜像类型。标准镜像:Base,应用镜像:App, 自定义镜像:Custom,默认返回所有类型 + - **Limit** (int) - 返回数据长度,默认为20 + - **Offset** (int) - 列表起始位置偏移量,默认为0 + - **OsType** (str) - 操作系统类型:Linux, Windows 默认返回所有类型 + - **Scene** (str) - 使用场景,当ImageType为"App"时生效。- Normal 常规专区- CrossBorder 跨境专区默认返回所有 + - **Tag** (str) - 业务组Id。默认:Default + - **Zone** (str) - 可用区。参见 `可用区列表 `_ + + **Response** + + - **ImageSet** (list) - 见 **ULHostImageSet** 模型定义 + - **TotalCount** (int) - 满足条件的镜像总数 + + **Response Model** + + **ULHostImageSet** + - **CreateTime** (int) - 创建时间,格式为Unix时间戳 + - **DisplayName** (str) - 用于控制台显示的名称 + - **Features** (list) - 特殊状态标识,目前包含NetEnhnced(网络增强1.0), NetEnhanced_Ultra(网络增强2.0), NetEnhanced_Extreme(网络增强3.0), HotPlug(热升级), GPU(GPU镜像),CloudInit, IPv6(支持IPv6网络),RssdAttachable(支持RSSD云盘),Vgpu_AMD(支持AMD的vgpu),Vgpu_NVIDIA(支持NVIDIA的vgpu),Aarch64_Type(支持arm64架构) + - **ImageDescription** (str) - 镜像描述 + - **ImageId** (str) - 镜像ID + - **ImageLogoLink** (str) - 应用镜像图标url + - **ImageName** (str) - 镜像名称 + - **ImageSize** (int) - 镜像大小 + - **ImageType** (str) - 镜像类型 标准镜像:Base, 行业镜像:Business,自定义镜像:Custom + - **IntegratedSoftware** (str) - 集成软件名称(仅行业镜像将返回这个值) + - **MaintainEol** (str) - 系统EOL的时间,格式:YYYY/MM/DD + - **MinimalCPU** (str) - 默认值为空'''。当CentOS 7.3/7.4/7.5等镜像会标记为“Broadwell” + - **OsName** (str) - 操作系统名称 + - **OsType** (str) - 操作系统类型:Linux,Windows + - **SceneCategories** (list) - 场景分类,目前包含Featured(精选),PreInstalledDrivers(预装驱动),AIPainting(AI绘画),AIModels(AI模型),HPC(高性能计算) + - **State** (str) - 镜像状态, 可用:Available,制作中:Making, 不可用:Unavailable,复制中:Copying + - **Tag** (str) - 业务组 + - **Zone** (str) - 可用区,参见 `可用区列表 `_ + + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.DescribeULHostImageRequestSchema().dumps(d) + + resp = self.invoke("DescribeULHostImage", d, **kwargs) + return apis.DescribeULHostImageResponseSchema().loads(resp) + + def describe_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """DescribeULHostInstance - 获取轻量应用云主机列表 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **Limit** (int) - 返回数据长度,默认为20,最大100 + - **Offset** (int) - 列表起始位置偏移量,默认为0 + - **ULHostIds** (list) - 【数组】轻量应用云主机ID。 + + **Response** + + - **Message** (str) - 错误信息 + - **ULHostInstanceSets** (list) - 见 **ULHostInstanceSet** 模型定义 + + **Response Model** + + **ExclusiveUTPInfo** + - **AvailableSize** (int) - 当前周期剩余流量 + - **CreateTime** (int) - 创建时间 + - **ExcessSize** (int) - 当前周期超出限额的流量 + - **LastResetTime** (int) - 上次重置时间 + - **NextResetTime** (int) - 下次重置时间 + - **TotalSize** (int) - 当前周期总流量 + - **UsedSize** (int) - 当前周期已使用流量 + + + **ULHostDiskSet** + - **DiskId** (str) - 磁盘Id + - **DiskType** (str) - 磁盘类型。如:"CLOUD_RSSD"、"CLOUD_SSD" + - **Drive** (str) - 磁盘盘符。系统盘:"vda" + - **IsBoot** (str) - 是否为系统盘。是:"True";否:"False" + - **Size** (int) - 磁盘大小。单位:GB + - **Type** (str) - 磁盘类型。系统盘:"Boot";数据盘:"Data" + + + **UHostIPSet** + - **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息) + - **Default** (str) - 内网 Private 类型下,表示是否为默认网卡。true: 是默认网卡;其他值:不是。 + - **IP** (str) - IP地址 + - **IPId** (str) - 外网IP资源ID 。(内网IP无对应的资源ID) + - **IPMode** (str) - IPv4/IPv6; + - **Mac** (str) - 内网 Private 类型下,当前网卡的Mac。 + - **NetworkInterfaceId** (str) - 弹性网卡为默认网卡时,返回对应的 ID 值 + - **SubnetId** (str) - IP地址对应的子网 ID。(北京一不支持,字段返回为空) + - **Type** (str) - 国际: Internation,BGP: Bgp,内网: Private + - **VPCId** (str) - IP地址对应的VPC ID。(北京一不支持,字段返回为空) + - **Weight** (int) - 当前EIP的权重。权重最大的为当前的出口IP。 + + + **ULHostInstanceSet** + - **Apps** (list) - 【数组】镜像包含的应用列表。 + - **AutoRenew** (str) - 是否自动续费。枚举值:Yes/No + - **CPU** (int) - CPU核数。 + - **ChargeType** (str) - 计费模式。枚举值:Month/Year + - **CreateTime** (int) - 创建时间。Unix时间戳 + - **DiskSet** (list) - 见 **ULHostDiskSet** 模型定义 + - **EIPExclusiveUTPInfo** (dict) - 见 **ExclusiveUTPInfo** 模型定义 + - **ExpireTime** (int) - 过期时间。Unix时间戳 + - **IPSet** (list) - 见 **UHostIPSet** 模型定义 + - **ImageId** (str) - 镜像Id。 + - **ImageName** (str) - 镜像名称。 + - **IsExpire** (str) - 是否过期。枚举值:Yes/No + - **Memory** (int) - 内存。单位:MB + - **Name** (str) - 实例名称。默认套餐Id + - **Remark** (str) - 备注。 + - **State** (str) - 实例状态。枚举值:\\ >初始化: Initializing; \\ >启动中: Starting; \\> 运行中: Running; \\> 关机中: Stopping; \\ >关机: Stopped \\ >安装失败: Install Fail; \\ >重启中: Rebooting; \\ > 未知(空字符串,获取状态超时或出错):"" + - **Tag** (str) - 业务组。 + - **ULHostId** (str) - 实例Id。 + - **Zone** (str) - 可用区。 + + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.DescribeULHostInstanceRequestSchema().dumps(d) + + resp = self.invoke("DescribeULHostInstance", d, **kwargs) + return apis.DescribeULHostInstanceResponseSchema().loads(resp) + + def get_ul_host_instance_price( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """GetULHostInstancePrice - 获取轻量应用云主机套餐价格 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **BundleId** (str) - (Required) 套餐ID + - **ChargeType** (str) - 获取指定计费模式的价格。枚举值:\\ > Year,按年付费; \\ > Month。未指定时,返回所有计费模式价格 + - **Count** (int) - 购买台数,范围[1,5]。默认:1 + - **Quantity** (int) - 购买时长。默认: 1。不支持购买到月末 + + **Response** + + - **Message** (str) - 错误信息 + - **PriceSet** (list) - 见 **ULHostPriceSet** 模型定义 + + **Response Model** + + **ULHostPriceSet** + - **ChargeType** (str) - 计费模式 + - **OriginalPrice** (float) - 原价 + - **Price** (float) - 价格 + + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.GetULHostInstancePriceRequestSchema().dumps(d) + + resp = self.invoke("GetULHostInstancePrice", d, **kwargs) + return apis.GetULHostInstancePriceResponseSchema().loads(resp) + + def get_ul_host_renew_price( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """GetULHostRenewPrice - 获取主机续费价格 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ULHostId** (str) - (Required) ULHost实例ID + - **ChargeType** (str) - 计费类型。支持:Year/Month;默认:Month + + **Response** + + - **PriceSet** (list) - 见 **ULHostPriceSet** 模型定义 + + **Response Model** + + **ULHostPriceSet** + - **ChargeType** (str) - 计费模式 + - **OriginalPrice** (float) - 原价 + - **Price** (float) - 价格 + + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.GetULHostRenewPriceRequestSchema().dumps(d) + + resp = self.invoke("GetULHostRenewPrice", d, **kwargs) + return apis.GetULHostRenewPriceResponseSchema().loads(resp) + + def modify_ul_host_attribute( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """ModifyULHostAttribute - 修改指定ULHost实例属性信息,包含名称和备注 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ULHostId** (str) - (Required) ULHost实例Id + - **Name** (str) - 名称。和Remark至少选择一个进行修改 + - **Remark** (str) - 备注。和Name至少选择一个进行修改 + + **Response** + + - **Message** (str) - 错误信息 + - **ULHostId** (str) - ULHost实例Id + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.ModifyULHostAttributeRequestSchema().dumps(d) + + resp = self.invoke("ModifyULHostAttribute", d, **kwargs) + return apis.ModifyULHostAttributeResponseSchema().loads(resp) + + def poweroff_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """PoweroffULHostInstance - 直接关闭UHost实例电源,无需等待实例正常关闭。 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ULHostId** (str) - (Required) ULHost实例ID + + **Response** + + - **ULHostId** (str) - ULHost实例ID + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.PoweroffULHostInstanceRequestSchema().dumps(d) + + resp = self.invoke("PoweroffULHostInstance", d, **kwargs) + return apis.PoweroffULHostInstanceResponseSchema().loads(resp) + + def reboot_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """RebootULHostInstance - 重新启动UHost实例。 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ULHostId** (str) - (Required) ULHost实例ID + + **Response** + + - **ULHostId** (str) - ULHost实例ID + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.RebootULHostInstanceRequestSchema().dumps(d) + + resp = self.invoke("RebootULHostInstance", d, **kwargs) + return apis.RebootULHostInstanceResponseSchema().loads(resp) + + def reinstall_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """ReinstallULHostInstance - 重装轻量应用云主机 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ImageId** (str) - (Required) 镜像Id。暂不支持使用自定义镜像重装 + - **Password** (str) - (Required) 登陆密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64 UGFzc3dvcmQx + - **ULHostId** (str) - (Required) 实例Id + + **Response** + + - **Message** (str) - 错误信息 + - **ULHostId** (str) - 实例Id + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.ReinstallULHostInstanceRequestSchema().dumps(d) + + resp = self.invoke("ReinstallULHostInstance", d, **kwargs) + return apis.ReinstallULHostInstanceResponseSchema().loads(resp) + + def reset_ul_host_instance_password( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """ResetULHostInstancePassword - 重置轻量应用云主机管理员密码。 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **Password** (str) - (Required) ULHost新密码(密码格式使用BASE64编码) + - **ULHostId** (str) - (Required) ULHost实例ID + + **Response** + + - **ULHostId** (str) - ULHost实例ID + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.ResetULHostInstancePasswordRequestSchema().dumps(d) + + resp = self.invoke("ResetULHostInstancePassword", d, **kwargs) + return apis.ResetULHostInstancePasswordResponseSchema().loads(resp) + + def start_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """StartULHostInstance - 启动处于关闭状态的UHost实例。 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ULHostId** (str) - (Required) ULHost实例ID + + **Response** + + - **ULHostId** (str) - ULHost实例ID + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.StartULHostInstanceRequestSchema().dumps(d) + + resp = self.invoke("StartULHostInstance", d, **kwargs) + return apis.StartULHostInstanceResponseSchema().loads(resp) + + def stop_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """StopULHostInstance - 指停止处于运行状态的ULHost实例 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ULHostId** (str) - (Required) ULHost实例ID。 + + **Response** + + - **ULHostId** (str) - ULHost实例ID + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.StopULHostInstanceRequestSchema().dumps(d) + + resp = self.invoke("StopULHostInstance", d, **kwargs) + return apis.StopULHostInstanceResponseSchema().loads(resp) + + def terminate_ul_host_instance( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """TerminateULHostInstance - 删除指定数据中心的ULHost实例。 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **ULHostId** (str) - (Required) ULHost资源Id + - **ReleaseUDisk** (bool) - 删除主机时是否同时删除挂载的数据盘。默认为false。 + + **Response** + + - **InRecycle** (str) - 用于判断主机删除时是否进入回收站。放入回收站:"Yes", 彻底删除:“No”。 + - **ULHostId** (str) - ULHost 实例 Id + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.TerminateULHostInstanceRequestSchema().dumps(d) + + resp = self.invoke("TerminateULHostInstance", d, **kwargs) + return apis.TerminateULHostInstanceResponseSchema().loads(resp) diff --git a/ucloud/services/ulighthost/schemas/__init__.py b/ucloud/services/ulighthost/schemas/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ucloud/services/ulighthost/schemas/apis.py b/ucloud/services/ulighthost/schemas/apis.py new file mode 100644 index 0000000..93bcc59 --- /dev/null +++ b/ucloud/services/ulighthost/schemas/apis.py @@ -0,0 +1,445 @@ +""" Code is generated by ucloud-model, DO NOT EDIT IT. """ + +from ucloud.core.typesystem import schema, fields +from ucloud.services.ulighthost.schemas import models + +""" ULightHost API Schema +""" + + +""" +API: CheckULHostResourceCapacity + +检查轻量应用云主机资源余量 +""" + + +class CheckULHostResourceCapacityRequestSchema(schema.RequestSchema): + """CheckULHostResourceCapacity - 检查轻量应用云主机资源余量""" + + fields = { + "BundleId": fields.Str(required=True, dump_to="BundleId"), + "ChargeType": fields.Str(required=False, dump_to="ChargeType"), + "CouponId": fields.Str(required=False, dump_to="CouponId"), + "ImageId": fields.Str(required=True, dump_to="ImageId"), + "Name": fields.Str(required=False, dump_to="Name"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Quantity": fields.Int(required=False, dump_to="Quantity"), + "Region": fields.Str(required=True, dump_to="Region"), + "SecurityGroupId": fields.Str( + required=False, dump_to="SecurityGroupId" + ), + "SubnetId": fields.Str(required=False, dump_to="SubnetId"), + "VPCId": fields.Str(required=False, dump_to="VPCId"), + } + + +class CheckULHostResourceCapacityResponseSchema(schema.ResponseSchema): + """CheckULHostResourceCapacity - 检查轻量应用云主机资源余量""" + + fields = { + "Message": fields.Str(required=True, load_from="Message"), + "ResourceEnough": fields.Bool( + required=True, load_from="ResourceEnough" + ), + } + + +""" +API: CreateULHostInstance + +创建轻量应用云主机 +""" + + +class CreateULHostInstanceRequestSchema(schema.RequestSchema): + """CreateULHostInstance - 创建轻量应用云主机""" + + fields = { + "BundleId": fields.Str(required=True, dump_to="BundleId"), + "ChargeType": fields.Str(required=False, dump_to="ChargeType"), + "CouponId": fields.Str(required=False, dump_to="CouponId"), + "ImageId": fields.Str(required=True, dump_to="ImageId"), + "Name": fields.Str(required=False, dump_to="Name"), + "Password": fields.Str(required=True, dump_to="Password"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Quantity": fields.Int(required=False, dump_to="Quantity"), + "Region": fields.Str(required=True, dump_to="Region"), + "SecurityGroupId": fields.Str( + required=False, dump_to="SecurityGroupId" + ), + "SubnetId": fields.Str(required=False, dump_to="SubnetId"), + "VPCId": fields.Str(required=False, dump_to="VPCId"), + } + + +class CreateULHostInstanceResponseSchema(schema.ResponseSchema): + """CreateULHostInstance - 创建轻量应用云主机""" + + fields = { + "Message": fields.Str(required=True, load_from="Message"), + "ULHostId": fields.Str(required=True, load_from="ULHostId"), + } + + +""" +API: DescribeULHostBundles + +获取轻量应用云主机套餐列表 +""" + + +class DescribeULHostBundlesRequestSchema(schema.RequestSchema): + """DescribeULHostBundles - 获取轻量应用云主机套餐列表""" + + fields = { + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + } + + +class DescribeULHostBundlesResponseSchema(schema.ResponseSchema): + """DescribeULHostBundles - 获取轻量应用云主机套餐列表""" + + fields = { + "Bundles": fields.List( + models.BundleSchema(), required=True, load_from="Bundles" + ), + "Message": fields.Str(required=False, load_from="Message"), + } + + +""" +API: DescribeULHostImage + +获取指定数据中心镜像列表 +""" + + +class DescribeULHostImageRequestSchema(schema.RequestSchema): + """DescribeULHostImage - 获取指定数据中心镜像列表""" + + fields = { + "ImageId": fields.Str(required=False, dump_to="ImageId"), + "ImageIds": fields.List(fields.Str()), + "ImageType": fields.Str(required=False, dump_to="ImageType"), + "Limit": fields.Int(required=False, dump_to="Limit"), + "Offset": fields.Int(required=False, dump_to="Offset"), + "OsType": fields.Str(required=False, dump_to="OsType"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "Scene": fields.Str(required=False, dump_to="Scene"), + "Tag": fields.Str(required=False, dump_to="Tag"), + "Zone": fields.Str(required=False, dump_to="Zone"), + } + + +class DescribeULHostImageResponseSchema(schema.ResponseSchema): + """DescribeULHostImage - 获取指定数据中心镜像列表""" + + fields = { + "ImageSet": fields.List( + models.ULHostImageSetSchema(), required=False, load_from="ImageSet" + ), + "TotalCount": fields.Int(required=False, load_from="TotalCount"), + } + + +""" +API: DescribeULHostInstance + +获取轻量应用云主机列表 +""" + + +class DescribeULHostInstanceRequestSchema(schema.RequestSchema): + """DescribeULHostInstance - 获取轻量应用云主机列表""" + + fields = { + "Limit": fields.Int(required=False, dump_to="Limit"), + "Offset": fields.Int(required=False, dump_to="Offset"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostIds": fields.List(fields.Str()), + } + + +class DescribeULHostInstanceResponseSchema(schema.ResponseSchema): + """DescribeULHostInstance - 获取轻量应用云主机列表""" + + fields = { + "Message": fields.Str(required=True, load_from="Message"), + "ULHostInstanceSets": fields.List( + models.ULHostInstanceSetSchema(), + required=True, + load_from="ULHostInstanceSets", + ), + } + + +""" +API: GetULHostInstancePrice + +获取轻量应用云主机套餐价格 +""" + + +class GetULHostInstancePriceRequestSchema(schema.RequestSchema): + """GetULHostInstancePrice - 获取轻量应用云主机套餐价格""" + + fields = { + "BundleId": fields.Str(required=True, dump_to="BundleId"), + "ChargeType": fields.Str(required=False, dump_to="ChargeType"), + "Count": fields.Int(required=False, dump_to="Count"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Quantity": fields.Int(required=False, dump_to="Quantity"), + "Region": fields.Str(required=True, dump_to="Region"), + } + + +class GetULHostInstancePriceResponseSchema(schema.ResponseSchema): + """GetULHostInstancePrice - 获取轻量应用云主机套餐价格""" + + fields = { + "Message": fields.Str(required=True, load_from="Message"), + "PriceSet": fields.List( + models.ULHostPriceSetSchema(), required=True, load_from="PriceSet" + ), + } + + +""" +API: GetULHostRenewPrice + +获取主机续费价格 +""" + + +class GetULHostRenewPriceRequestSchema(schema.RequestSchema): + """GetULHostRenewPrice - 获取主机续费价格""" + + fields = { + "ChargeType": fields.Str(required=False, dump_to="ChargeType"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class GetULHostRenewPriceResponseSchema(schema.ResponseSchema): + """GetULHostRenewPrice - 获取主机续费价格""" + + fields = { + "PriceSet": fields.List( + models.ULHostPriceSetSchema(), required=True, load_from="PriceSet" + ), + } + + +""" +API: ModifyULHostAttribute + +修改指定ULHost实例属性信息,包含名称和备注 +""" + + +class ModifyULHostAttributeRequestSchema(schema.RequestSchema): + """ModifyULHostAttribute - 修改指定ULHost实例属性信息,包含名称和备注""" + + fields = { + "Name": fields.Str(required=False, dump_to="Name"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "Remark": fields.Str(required=False, dump_to="Remark"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class ModifyULHostAttributeResponseSchema(schema.ResponseSchema): + """ModifyULHostAttribute - 修改指定ULHost实例属性信息,包含名称和备注""" + + fields = { + "Message": fields.Str(required=True, load_from="Message"), + "ULHostId": fields.Str(required=True, load_from="ULHostId"), + } + + +""" +API: PoweroffULHostInstance + +直接关闭UHost实例电源,无需等待实例正常关闭。 +""" + + +class PoweroffULHostInstanceRequestSchema(schema.RequestSchema): + """PoweroffULHostInstance - 直接关闭UHost实例电源,无需等待实例正常关闭。""" + + fields = { + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class PoweroffULHostInstanceResponseSchema(schema.ResponseSchema): + """PoweroffULHostInstance - 直接关闭UHost实例电源,无需等待实例正常关闭。""" + + fields = { + "ULHostId": fields.Str(required=True, load_from="ULHostId"), + } + + +""" +API: RebootULHostInstance + +重新启动UHost实例。 +""" + + +class RebootULHostInstanceRequestSchema(schema.RequestSchema): + """RebootULHostInstance - 重新启动UHost实例。""" + + fields = { + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class RebootULHostInstanceResponseSchema(schema.ResponseSchema): + """RebootULHostInstance - 重新启动UHost实例。""" + + fields = { + "ULHostId": fields.Str(required=False, load_from="ULHostId"), + } + + +""" +API: ReinstallULHostInstance + +重装轻量应用云主机 +""" + + +class ReinstallULHostInstanceRequestSchema(schema.RequestSchema): + """ReinstallULHostInstance - 重装轻量应用云主机""" + + fields = { + "ImageId": fields.Str(required=True, dump_to="ImageId"), + "Password": fields.Str(required=True, dump_to="Password"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class ReinstallULHostInstanceResponseSchema(schema.ResponseSchema): + """ReinstallULHostInstance - 重装轻量应用云主机""" + + fields = { + "Message": fields.Str(required=True, load_from="Message"), + "ULHostId": fields.Str(required=True, load_from="ULHostId"), + } + + +""" +API: ResetULHostInstancePassword + +重置轻量应用云主机管理员密码。 +""" + + +class ResetULHostInstancePasswordRequestSchema(schema.RequestSchema): + """ResetULHostInstancePassword - 重置轻量应用云主机管理员密码。""" + + fields = { + "Password": fields.Str(required=True, dump_to="Password"), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class ResetULHostInstancePasswordResponseSchema(schema.ResponseSchema): + """ResetULHostInstancePassword - 重置轻量应用云主机管理员密码。""" + + fields = { + "ULHostId": fields.Str(required=True, load_from="ULHostId"), + } + + +""" +API: StartULHostInstance + +启动处于关闭状态的UHost实例。 +""" + + +class StartULHostInstanceRequestSchema(schema.RequestSchema): + """StartULHostInstance - 启动处于关闭状态的UHost实例。""" + + fields = { + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class StartULHostInstanceResponseSchema(schema.ResponseSchema): + """StartULHostInstance - 启动处于关闭状态的UHost实例。""" + + fields = { + "ULHostId": fields.Str(required=False, load_from="ULHostId"), + } + + +""" +API: StopULHostInstance + +指停止处于运行状态的ULHost实例 +""" + + +class StopULHostInstanceRequestSchema(schema.RequestSchema): + """StopULHostInstance - 指停止处于运行状态的ULHost实例""" + + fields = { + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class StopULHostInstanceResponseSchema(schema.ResponseSchema): + """StopULHostInstance - 指停止处于运行状态的ULHost实例""" + + fields = { + "ULHostId": fields.Str(required=False, load_from="ULHostId"), + } + + +""" +API: TerminateULHostInstance + +删除指定数据中心的ULHost实例。 +""" + + +class TerminateULHostInstanceRequestSchema(schema.RequestSchema): + """TerminateULHostInstance - 删除指定数据中心的ULHost实例。""" + + fields = { + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "ReleaseUDisk": fields.Bool(required=False, dump_to="ReleaseUDisk"), + "ULHostId": fields.Str(required=True, dump_to="ULHostId"), + } + + +class TerminateULHostInstanceResponseSchema(schema.ResponseSchema): + """TerminateULHostInstance - 删除指定数据中心的ULHost实例。""" + + fields = { + "InRecycle": fields.Str(required=True, load_from="InRecycle"), + "ULHostId": fields.Str(required=False, load_from="ULHostId"), + } diff --git a/ucloud/services/ulighthost/schemas/models.py b/ucloud/services/ulighthost/schemas/models.py new file mode 100644 index 0000000..a1affa7 --- /dev/null +++ b/ucloud/services/ulighthost/schemas/models.py @@ -0,0 +1,130 @@ +""" Code is generated by ucloud-model, DO NOT EDIT IT. """ + +from ucloud.core.typesystem import schema, fields + + +class BundleSchema(schema.ResponseSchema): + """Bundle - 轻量应用云主机套餐""" + + fields = { + "Bandwidth": fields.Int(required=False, load_from="Bandwidth"), + "BundleId": fields.Str(required=False, load_from="BundleId"), + "CPU": fields.Int(required=False, load_from="CPU"), + "Memory": fields.Int(required=False, load_from="Memory"), + "SysDiskSpace": fields.Int(required=False, load_from="SysDiskSpace"), + "TrafficPacket": fields.Int(required=False, load_from="TrafficPacket"), + } + + +class ULHostImageSetSchema(schema.ResponseSchema): + """ULHostImageSet - DescribeULHostImage""" + + fields = { + "CreateTime": fields.Int(required=False, load_from="CreateTime"), + "DisplayName": fields.Str(required=False, load_from="DisplayName"), + "Features": fields.List(fields.Str()), + "ImageDescription": fields.Str( + required=False, load_from="ImageDescription" + ), + "ImageId": fields.Str(required=False, load_from="ImageId"), + "ImageLogoLink": fields.Str(required=False, load_from="ImageLogoLink"), + "ImageName": fields.Str(required=False, load_from="ImageName"), + "ImageSize": fields.Int(required=False, load_from="ImageSize"), + "ImageType": fields.Str(required=False, load_from="ImageType"), + "IntegratedSoftware": fields.Str( + required=False, load_from="IntegratedSoftware" + ), + "MaintainEol": fields.Str(required=False, load_from="MaintainEol"), + "MinimalCPU": fields.Str(required=False, load_from="MinimalCPU"), + "OsName": fields.Str(required=False, load_from="OsName"), + "OsType": fields.Str(required=False, load_from="OsType"), + "SceneCategories": fields.List(fields.Str()), + "State": fields.Str(required=False, load_from="State"), + "Tag": fields.Str(required=False, load_from="Tag"), + "Zone": fields.Str(required=False, load_from="Zone"), + } + + +class UHostIPSetSchema(schema.ResponseSchema): + """UHostIPSet -""" + + fields = { + "Bandwidth": fields.Int(required=False, load_from="Bandwidth"), + "Default": fields.Str(required=False, load_from="Default"), + "IP": fields.Str(required=False, load_from="IP"), + "IPId": fields.Str(required=False, load_from="IPId"), + "IPMode": fields.Str(required=True, load_from="IPMode"), + "Mac": fields.Str(required=False, load_from="Mac"), + "NetworkInterfaceId": fields.Str( + required=False, load_from="NetworkInterfaceId" + ), + "SubnetId": fields.Str(required=False, load_from="SubnetId"), + "Type": fields.Str(required=False, load_from="Type"), + "VPCId": fields.Str(required=False, load_from="VPCId"), + "Weight": fields.Int(required=False, load_from="Weight"), + } + + +class ExclusiveUTPInfoSchema(schema.ResponseSchema): + """ExclusiveUTPInfo - 流量包详情""" + + fields = { + "AvailableSize": fields.Int(required=False, load_from="AvailableSize"), + "CreateTime": fields.Int(required=False, load_from="CreateTime"), + "ExcessSize": fields.Int(required=False, load_from="ExcessSize"), + "LastResetTime": fields.Int(required=False, load_from="LastResetTime"), + "NextResetTime": fields.Int(required=False, load_from="NextResetTime"), + "TotalSize": fields.Int(required=False, load_from="TotalSize"), + "UsedSize": fields.Int(required=False, load_from="UsedSize"), + } + + +class ULHostDiskSetSchema(schema.ResponseSchema): + """ULHostDiskSet - 轻量应用主机的磁盘信息""" + + fields = { + "DiskId": fields.Str(required=False, load_from="DiskId"), + "DiskType": fields.Str(required=False, load_from="DiskType"), + "Drive": fields.Str(required=False, load_from="Drive"), + "IsBoot": fields.Str(required=False, load_from="IsBoot"), + "Size": fields.Int(required=False, load_from="Size"), + "Type": fields.Str(required=False, load_from="Type"), + } + + +class ULHostInstanceSetSchema(schema.ResponseSchema): + """ULHostInstanceSet - 轻量应用云主机详情""" + + fields = { + "Apps": fields.List(fields.Str()), + "AutoRenew": fields.Str(required=False, load_from="AutoRenew"), + "CPU": fields.Int(required=False, load_from="CPU"), + "ChargeType": fields.Str(required=False, load_from="ChargeType"), + "CreateTime": fields.Int(required=False, load_from="CreateTime"), + "DiskSet": fields.List(ULHostDiskSetSchema()), + "EIPExclusiveUTPInfo": ExclusiveUTPInfoSchema(), + "ExpireTime": fields.Int(required=False, load_from="ExpireTime"), + "IPSet": fields.List(UHostIPSetSchema()), + "ImageId": fields.Str(required=False, load_from="ImageId"), + "ImageName": fields.Str(required=False, load_from="ImageName"), + "IsExpire": fields.Str(required=False, load_from="IsExpire"), + "Memory": fields.Int(required=False, load_from="Memory"), + "Name": fields.Str(required=False, load_from="Name"), + "Remark": fields.Str(required=False, load_from="Remark"), + "State": fields.Str(required=False, load_from="State"), + "Tag": fields.Str(required=False, load_from="Tag"), + "ULHostId": fields.Str(required=False, load_from="ULHostId"), + "Zone": fields.Str(required=False, load_from="Zone"), + } + + +class ULHostPriceSetSchema(schema.ResponseSchema): + """ULHostPriceSet - 轻量应用主机价格详情""" + + fields = { + "ChargeType": fields.Str(required=False, load_from="ChargeType"), + "OriginalPrice": fields.Float( + required=False, load_from="OriginalPrice" + ), + "Price": fields.Float(required=False, load_from="Price"), + } diff --git a/ucloud/version.py b/ucloud/version.py index 171498d..3fd615e 100644 --- a/ucloud/version.py +++ b/ucloud/version.py @@ -1 +1 @@ -version = "0.11.80" +version = "0.11.81"