From 29287bdda343921071302a8d310f77fab152cd95 Mon Sep 17 00:00:00 2001 From: ucloud-bot Date: Mon, 20 Jun 2022 02:53:52 +0000 Subject: [PATCH] auto code generation --- lib/services/uhost/index.d.ts | 2 +- lib/services/unet/index.d.ts | 8 +- lib/services/uphone/index.d.ts | 660 ++++++++++++++++++++++++++++- lib/services/uphone/index.js | 78 +++- lib/services/uvms/index.d.ts | 4 - lib/services/vpc/index.d.ts | 261 +++++++++++- lib/services/vpc/index.js | 18 + package-lock.json | 2 +- package.json | 2 +- src/services/uhost/index.ts | 2 +- src/services/unet/index.ts | 8 +- src/services/uphone/index.ts | 741 ++++++++++++++++++++++++++++++++- src/services/uvms/index.ts | 4 - src/services/vpc/index.ts | 281 ++++++++++++- 14 files changed, 1965 insertions(+), 106 deletions(-) diff --git a/lib/services/uhost/index.d.ts b/lib/services/uhost/index.d.ts index bc16751..fe4d16a 100644 --- a/lib/services/uhost/index.d.ts +++ b/lib/services/uhost/index.d.ts @@ -656,7 +656,7 @@ export interface DescribeAvailableInstanceTypesResponse { * 返回Arm的CPU平台信息,例如:Ampere: ['Ampere/Altra'] */ Ampere?: string[]; - }[]; + }; /** * 磁盘信息。磁盘主要分类如下:云盘|cloudDisk、普通本地盘|normalLocalDisk和SSD本地盘|ssdLocalDisk。其中云盘主要包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。MinimalSize为磁盘最小值,如果没有该字段,最小值取基础镜像Size值即可(linux为20G,windows为40G)。MaximalSize为磁盘最大值。InstantResize表示系统盘是否允许扩容,如果是本地盘,则不允许扩容,InstantResize为false。Features为磁盘可支持的服务:数据方舟|DATAARK,快照服务|SNAPSHOT,加密盘|Encrypted。 */ diff --git a/lib/services/unet/index.d.ts b/lib/services/unet/index.d.ts index 6d5c91a..f5fd434 100644 --- a/lib/services/unet/index.d.ts +++ b/lib/services/unet/index.d.ts @@ -274,7 +274,7 @@ export interface AllocateEIPResponse { */ EIPAddr?: { /** - * 运营商信息如: 国际: International, BGP: BGP + * 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp */ OperatorName?: string; /** @@ -356,6 +356,10 @@ export interface BindEIPRequest { * 弹性IP请求绑定的资源ID */ ResourceId: string; + /** + * EIP与内网IP进行绑定时需要传入UNI下未绑定过EIP的内网IP + */ + PrivateIP?: string; } /** * BindEIP - 将尚未使用的弹性IP绑定到指定的资源 @@ -668,7 +672,7 @@ export interface DescribeEIPResponse { */ EIPAddr?: { /** - * 运营商信息如: 国际: International, BGP: BGP + * 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp */ OperatorName?: string; /** diff --git a/lib/services/uphone/index.d.ts b/lib/services/uphone/index.d.ts index 41eb7e8..6a83313 100644 --- a/lib/services/uphone/index.d.ts +++ b/lib/services/uphone/index.d.ts @@ -9,6 +9,12 @@ export default class UPhoneClient extends Client { config: ConfigOptions; credential: CredentialOptions; }); + /** + * CreateUPhone - 创建云手机 + * + * See also: https://docs.ucloud.cn/api/uphone-api/create_u_phone + */ + createUPhone(request?: CreateUPhoneRequest): Promise; /** * CreateUPhoneApp - 一个 app 对应多个 app_version。 * @@ -34,6 +40,12 @@ export default class UPhoneClient extends Client { * See also: https://docs.ucloud.cn/api/uphone-api/create_u_phone_server */ createUPhoneServer(request?: CreateUPhoneServerRequest): Promise; + /** + * DeleteUPhone - 删除云手机 + * + * See also: https://docs.ucloud.cn/api/uphone-api/delete_u_phone + */ + deleteUPhone(request?: DeleteUPhoneRequest): Promise; /** * DeleteUPhoneImage - 删除自制云手机镜像。 * @@ -41,7 +53,7 @@ export default class UPhoneClient extends Client { */ deleteUPhoneImage(request?: DeleteUPhoneImageRequest): Promise; /** - * DeleteUPhoneServer - 删除云手机服务器。 注:关机状态下才能执行删除操作。 + * DeleteUPhoneServer - 删除云手机服务器。 * * See also: https://docs.ucloud.cn/api/uphone-api/delete_u_phone_server */ @@ -83,7 +95,7 @@ export default class UPhoneClient extends Client { */ describeUPhoneImage(request?: DescribeUPhoneImageRequest): Promise; /** - * DescribeUPhoneIpRegions - 获取云手机支持绑定独立IP的城市列表 + * DescribeUPhoneIpRegions - 获取云手机所在城市支持绑定独立IP的地域列表 * * See also: https://docs.ucloud.cn/api/uphone-api/describe_u_phone_ip_regions */ @@ -95,7 +107,7 @@ export default class UPhoneClient extends Client { */ describeUPhoneJob(request?: DescribeUPhoneJobRequest): Promise; /** - * DescribeUPhoneModel - + * DescribeUPhoneModel - 获取云手机规格列表。两种类型:uphone代表单云手机场景、uphone-server代表云手机服务器场景。 * * See also: https://docs.ucloud.cn/api/uphone-api/describe_u_phone_model */ @@ -112,6 +124,24 @@ export default class UPhoneClient extends Client { * See also: https://docs.ucloud.cn/api/uphone-api/describe_u_phone_server_model */ describeUPhoneServerModel(request?: DescribeUPhoneServerModelRequest): Promise; + /** + * GetUPhoneAllowance - 获取云手机创建余量 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_allowance + */ + getUPhoneAllowance(request?: GetUPhoneAllowanceRequest): Promise; + /** + * GetUPhonePrice - 根据云手机规格名称,获取UPhone实例的价格。 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_price + */ + getUPhonePrice(request?: GetUPhonePriceRequest): Promise; + /** + * GetUPhoneRenewPrice - 获取云手机续费价格,不包括独立ip价格。 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_renew_price + */ + getUPhoneRenewPrice(request?: GetUPhoneRenewPriceRequest): Promise; /** * GetUPhoneScreenCapture - 云手机截屏 * @@ -180,6 +210,12 @@ export default class UPhoneClient extends Client { * See also: https://docs.ucloud.cn/api/uphone-api/reboot_u_phone */ rebootUPhone(request?: RebootUPhoneRequest): Promise; + /** + * RenewUPhone - 修改UPhone的device_id、imei、meid 以及其他相关配置,达到一键新机的效果 + * + * See also: https://docs.ucloud.cn/api/uphone-api/renew_u_phone + */ + renewUPhone(request?: RenewUPhoneRequest): Promise; /** * ResetUPhone - 将云手机恢复为创建时的状态。 * @@ -198,6 +234,12 @@ export default class UPhoneClient extends Client { * See also: https://docs.ucloud.cn/api/uphone-api/run_sync_command */ runSyncCommand(request?: RunSyncCommandRequest): Promise; + /** + * SetUPhoneCallback - 设置云手机异步操作以及状态更新回调,支持云手机重置,安装应用,卸载应用,设备占用状态回调 + * + * See also: https://docs.ucloud.cn/api/uphone-api/set_u_phone_callback + */ + setUPhoneCallback(request?: SetUPhoneCallbackRequest): Promise; /** * SetUPhoneConfig - 设置云手机画面参数(分辨率、DPI、帧率、码率) * @@ -216,6 +258,12 @@ export default class UPhoneClient extends Client { * See also: https://docs.ucloud.cn/api/uphone-api/set_u_phone_manager_mode */ setUPhoneManagerMode(request?: SetUPhoneManagerModeRequest): Promise; + /** + * SetUPhoneRootMode - 设置云手机Root模式 + * + * See also: https://docs.ucloud.cn/api/uphone-api/set_u_phone_root_mode + */ + setUPhoneRootMode(request?: SetUPhoneRootModeRequest): Promise; /** * SetUPhoneSplashScreen - 设置云手机启动画面,通过DescribeUPhone接口可以查询该地址 * @@ -241,6 +289,76 @@ export default class UPhoneClient extends Client { */ updateUPhoneImage(request?: UpdateUPhoneImageRequest): Promise; } +/** + * CreateUPhone - 创建云手机 + */ +export interface CreateUPhoneRequest { + /** + * 云手机实例名称,默认:UPhone。如果同时创建多个,则增加数字后缀,如UPhone-1 + */ + Name: string; + /** + * 云手机规格名称,不超过64个字节。可通过[查询云手机规格列表]()查询支持的云手机规格。 + */ + UPhoneModelName: string; + /** + * 云手机画面带宽,默认2M + */ + MediaBandwidth: number; + /** + * 云手机镜像ID,不超过32个字节。可通过[查询手机镜像]()查询云手机规格对应的镜像ID。 + */ + ImageId: string; + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 创建云手机的个数 + */ + UPhoneCount: number; + /** + * 计费模式。枚举值为: > 年 Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 默认为月付 + */ + ChargeType?: string; + /** + * 购买时长。默认值: 1。月付时,此参数传0,代表购买至月末。 + */ + Quantity?: string; + /** + * 购买独立IP必须有此参数。绑定的目的地域。参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + IpDestRegion?: string; + /** + * 业务组。默认:Default(Default即为未分组)。请遵照[[api:uhost-api:specification|字段规范]]设定业务组。 + */ + Tag?: string; + /** + * 绑定独立IP + */ + BindIp?: boolean; + /** + * 独立IP带宽 + */ + Bandwidth?: number; + /** + * 独立IP参数。需要独立IP的比例。eg: [4:1]->4, [3:1]->3。 + */ + IpProportion?: number; + /** + * 云手机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看。注:代金券对带宽不适用,仅适用于云手机计费 + */ + CouponId?: string; +} +/** + * CreateUPhone - 创建云手机 + */ +export interface CreateUPhoneResponse { + /** + * 任务ID,用来查询创建云手机任务状态 + */ + JobId: string; +} /** * CreateUPhoneApp - 一个 app 对应多个 app_version。 */ @@ -253,6 +371,10 @@ export interface CreateUPhoneAppRequest { * 应用描述。 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * CreateUPhoneApp - 一个 app 对应多个 app_version。 @@ -284,6 +406,10 @@ export interface CreateUPhoneAppVersionRequest { * 应用版本描述。 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * CreateUPhoneAppVersion - 创建云手机应用版本。 @@ -300,7 +426,7 @@ export interface CreateUPhoneAppVersionResponse { */ export interface CreateUPhoneImageRequest { /** - * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + * 城市Id,通过[获取城市列表](https://cms-docs.ucloudadmin.com/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; /** @@ -315,6 +441,10 @@ export interface CreateUPhoneImageRequest { * 镜像的描述信息。长度为2~256个英文或中文字符 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * CreateUPhoneImage - 创建云手机镜像。 @@ -324,6 +454,10 @@ export interface CreateUPhoneImageResponse { * 云手机自定义镜像资源 ID */ ImageId?: string; + /** + * 请求的唯一标识Id,`RetCode`为0时返回,可根据此ID查询请求的执行状态 + */ + JobId?: string; } /** * CreateUPhoneServer - 创建云手机服务器 @@ -391,6 +525,32 @@ export interface CreateUPhoneServerResponse { */ ServerId: string; } +/** + * DeleteUPhone - 删除云手机 + */ +export interface DeleteUPhoneRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望获取信息的云手机 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId + */ + UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; +} +/** + * DeleteUPhone - 删除云手机 + */ +export interface DeleteUPhoneResponse { + /** + * 任务ID,用来查询删除云手机任务状态 + */ + JobId: string; +} /** * DeleteUPhoneImage - 删除自制云手机镜像。 */ @@ -410,7 +570,7 @@ export interface DeleteUPhoneImageResponse { ImageId: string; } /** - * DeleteUPhoneServer - 删除云手机服务器。 注:关机状态下才能执行删除操作。 + * DeleteUPhoneServer - 删除云手机服务器。 */ export interface DeleteUPhoneServerRequest { /** @@ -431,7 +591,7 @@ export interface DeleteUPhoneServerRequest { ReleaseUDisk?: boolean; } /** - * DeleteUPhoneServer - 删除云手机服务器。 注:关机状态下才能执行删除操作。 + * DeleteUPhoneServer - 删除云手机服务器。 */ export interface DeleteUPhoneServerResponse { } @@ -467,6 +627,10 @@ export interface DescribeUPhoneRequest { * 是否返回全部。如果有此参数,分页不生效。 */ IsAll?: boolean; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * DescribeUPhone - 获取云手机列表信息。 @@ -556,6 +720,22 @@ export interface DescribeUPhoneResponse { * 备注 */ Remark?: string; + /** + * 计费模式。枚举值为: > 年 Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 默认为月付 + */ + ChargeType?: string; + /** + * 到期时间;格式为Unix时间戳 + */ + ExpireTime?: number; + /** + * IP所属地域Id,eg: hk,th-bkk + */ + IpRegion?: string; + /** + * 云手机IP地址 + */ + Ip?: string; }[]; } /** @@ -574,6 +754,10 @@ export interface DescribeUPhoneAppRequest { * 返回数据长度,默认为20,最大100 */ Limit?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * DescribeUPhoneApp - 获取应用列表。 @@ -633,6 +817,10 @@ export interface DescribeUPhoneAppVersionRequest { * 列表起始位置偏移量,默认为0 */ Offset?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * DescribeUPhoneAppVersion - 获取应用版本列表。 @@ -684,6 +872,10 @@ export interface DescribeUPhoneAppVersionResponse { * DescribeUPhoneCities - 获取云手机提供服务的城市列表 */ export interface DescribeUPhoneCitiesRequest { + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * DescribeUPhoneCities - 获取云手机提供服务的城市列表 @@ -735,6 +927,10 @@ export interface DescribeUPhoneDetailByAppRequest { * 返回数据长度,默认为20,最大100 */ Limit?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * DescribeUPhoneDetailByApp - 根据AppId,查询安装该应用的云手机以及相关的应用版本信息 @@ -753,9 +949,13 @@ export interface DescribeUPhoneDetailByAppResponse { */ UPhoneName?: string; /** - * 云手机规格名称 + * 云手机的唯一标识,不超过32个字节。 */ UPhoneId?: string; + /** + * 云手机规格名称 + */ + UPhoneModelName?: string; /** * 虚拟CPU核数。 */ @@ -867,6 +1067,10 @@ export interface DescribeUPhoneImageRequest { * 最大返回镜像数量,默认为20,最大100 */ Limit?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * DescribeUPhoneImage - 获取云手机镜像信息列表。 @@ -956,16 +1160,20 @@ export interface DescribeUPhoneImageResponse { TotalCount?: number; } /** - * DescribeUPhoneIpRegions - 获取云手机支持绑定独立IP的城市列表 + * DescribeUPhoneIpRegions - 获取云手机所在城市支持绑定独立IP的地域列表 */ export interface DescribeUPhoneIpRegionsRequest { /** - * 城市Id,eg: cn-shanghai, cn-hangzhou + * 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** - * DescribeUPhoneIpRegions - 获取云手机支持绑定独立IP的城市列表 + * DescribeUPhoneIpRegions - 获取云手机所在城市支持绑定独立IP的地域列表 */ export interface DescribeUPhoneIpRegionsResponse { /** @@ -995,7 +1203,7 @@ export interface DescribeUPhoneJobRequest { */ CityId: string; /** - * 【数组】Job 的唯一标识 Id,调用方式举例:ServerIds.0=希望查询状态的 Job1,ServerIds.1=Job2。 如果不传入,则返回当前 城市 所有符合条件的 Job 。 + * 【数组】Job 的唯一标识 Id,调用方式举例:JobIds.0=希望查询状态的 Job1,JobIds.1=Job2。 如果不传入,则返回当前 城市 所有符合条件的 Job 。 */ JobIds?: string[]; /** @@ -1014,6 +1222,10 @@ export interface DescribeUPhoneJobRequest { * 【数组】Job 类型,调用方式举例:JobTypes.0=希望查询的 Job 类型 1,JobTypes.1=Job 类型 2。 如果不传入,则返回当前 城市 所有符合条件的 Job 类型。Job 类型仅支持 INSTALL_APP、UNINSTALL_APP、RUN_ASYNC_COMMAND、CREATE_SERVER_AND_UPHONE、SET_UPHONE_GPS、SET_UPHONE_CONFIG、UPLOAD_FILE、DELETE_UPHONE */ Types?: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * DescribeUPhoneJob - 查询Job的执行状态。 @@ -1099,7 +1311,7 @@ export interface DescribeUPhoneJobResponse { TotalCount?: number; } /** - * DescribeUPhoneModel - + * DescribeUPhoneModel - 获取云手机规格列表。两种类型:uphone代表单云手机场景、uphone-server代表云手机服务器场景。 */ export interface DescribeUPhoneModelRequest { /** @@ -1114,9 +1326,13 @@ export interface DescribeUPhoneModelRequest { * 返回数据长度,默认为20,最大100 */ Limit?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** - * DescribeUPhoneModel - + * DescribeUPhoneModel - 获取云手机规格列表。两种类型:uphone代表单云手机场景、uphone-server代表云手机服务器场景。 */ export interface DescribeUPhoneModelResponse { /** @@ -1151,6 +1367,14 @@ export interface DescribeUPhoneModelResponse { * 刷新率 */ Refresh: number; + /** + * DPI + */ + Dpi?: number; + /** + * 型号描述信息 + */ + Description?: string; }[]; } /** @@ -1345,10 +1569,23 @@ export interface DescribeUPhoneServerModelResponse { * ServerModelInstance总数 */ TotalCount: number; + /** + * 服务器model的库存 + */ + Stock?: { + /** + * ServerModel名称 + */ + ModelName?: string; + /** + * 资源余量 + */ + StockCount?: number; + }[]; /** * ServerModel实例列表,每项参数可见数据模型 ServerModelInstance */ - ServerModels: { + ServerModels?: { /** * ServerModel名称 */ @@ -1405,6 +1642,143 @@ export interface DescribeUPhoneServerModelResponse { ServerModelState?: string; }[]; } +/** + * GetUPhoneAllowance - 获取云手机创建余量 + */ +export interface GetUPhoneAllowanceRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; +} +/** + * GetUPhoneAllowance - 获取云手机创建余量 + */ +export interface GetUPhoneAllowanceResponse { + /** + * 手机型号以及可创建数量 + */ + UPhoneAllowance: { + /** + * 枚举值,云手机型号名称,取值:UPhone X,UPhone Plus,UPhone Pro + */ + ModelName: string; + /** + * 可创建云手机个数 + */ + Allowance: number; + }[]; +} +/** + * GetUPhonePrice - 根据云手机规格名称,获取UPhone实例的价格。 + */ +export interface GetUPhonePriceRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 云手机规格名称 + */ + UPhoneModelName?: number; + /** + * 云手机画面带宽值,画面带宽和手机强绑定关系,必须和手机数量对应。 + */ + MediaBandwidth?: number; + /** + * 云手机个数 + */ + UPhoneCount?: number; + /** + * 计费模式。枚举值为: > Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 如果不传某个枚举值,默认返回年付、月付的价格组合集。 + */ + ChargeType?: string; + /** + * 购买时长。默认: 1。 月付时,此参数传0,代表了购买至月末。 + */ + Quantity?: number; + /** + * 购买独立IP必须此参数。绑定的目的地域。参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + IpDestRegion?: string; + /** + * 购买独立IP需要此参数,其中一个ip的带宽值。 + */ + INetBandwidth?: number; + /** + * 购买独立IP需要此参数。需要的eip数量。 + */ + IpCount?: number; +} +/** + * GetUPhonePrice - 根据云手机规格名称,获取UPhone实例的价格。 + */ +export interface GetUPhonePriceResponse { + /** + * 价格列表,每项参数见UPhonePriceSet + */ + PriceSet: { + /** + * 计费类型,枚举值:Year,Month,Dynamic + */ + ChargeType: string; + /** + * 价格,单位: 元,保留小数点后两位有效数字 + */ + Price: number; + /** + * 限时优惠的折前原价(即列表价乘以商务折扣后的单价) + */ + OriginalPrice: number; + /** + * 产品列表价 + */ + ListPrice?: number; + }[]; +} +/** + * GetUPhoneRenewPrice - 获取云手机续费价格,不包括独立ip价格。 + */ +export interface GetUPhoneRenewPriceRequest { + /** + * 云手机的唯一标识,可通过[查询云手机列表]获取。 + */ + UPhoneId: string; + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 计费模式。枚举值为: > Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 默认返回全部计费方式对应的价格 + */ + ChargeType?: string; +} +/** + * GetUPhoneRenewPrice - 获取云手机续费价格,不包括独立ip价格。 + */ +export interface GetUPhoneRenewPriceResponse { + /** + * 价格列表,具体参数见UPhonePriceSet + */ + PriceSet: { + /** + * 计费类型,枚举值:Year,Month,Dynamic + */ + ChargeType: string; + /** + * 价格,单位: 元,保留小数点后两位有效数字 + */ + Price: number; + /** + * 限时优惠的折前原价(即列表价乘以商务折扣后的单价) + */ + OriginalPrice: number; + /** + * 产品列表价 + */ + ListPrice?: number; + }[]; +} /** * GetUPhoneScreenCapture - 云手机截屏 */ @@ -1414,9 +1788,13 @@ export interface GetUPhoneScreenCaptureRequest { */ UPhoneID: string; /** - * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + * 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * GetUPhoneScreenCapture - 云手机截屏 @@ -1469,7 +1847,7 @@ export interface GetUPhoneServerPriceResponse { */ PriceSet: { /** - * 计费类型,枚举值:Year,Month + * 计费类型,枚举值:Year,Month, Dynamic */ ChargeType: string; /** @@ -1516,7 +1894,7 @@ export interface GetUPhoneServerRenewPriceResponse { */ PriceSet: { /** - * 计费类型,枚举值:Year,Month + * 计费类型,枚举值:Year,Month, Dynamic */ ChargeType: string; /** @@ -1549,6 +1927,10 @@ export interface InstallUPhoneAppVersionRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望安装应用的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * InstallUPhoneAppVersion - 在云手机中安装应用版本相关的Apk文件。系统会根据AppVersionId将对应的Apk文件下载后安装到云手机中。一次只支持安装一个Apk。 @@ -1675,6 +2057,10 @@ export interface PoweroffUPhoneRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * PoweroffUPhone - 关闭处于运行状态的云手机实例 @@ -1693,6 +2079,10 @@ export interface PoweronUPhoneRequest { * 【数组】云手机实例的资源ID,调用方式举例:UPhoneIds.0=希望开启的云手机实例1的UPhoneId,UPhoneIds.1=云手机实例2的UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * PoweronUPhone - 启动处于关闭状态的云手机实例 @@ -1711,11 +2101,141 @@ export interface RebootUPhoneRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * RebootUPhone - 重新启动云手机实例 */ export interface RebootUPhoneResponse { + /** + * 异步请求成功后返回JobId,用以查询Job状态 + */ + JobId?: string; +} +/** + * RenewUPhone - 修改UPhone的device_id、imei、meid 以及其他相关配置,达到一键新机的效果 + */ +export interface RenewUPhoneRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重启的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 + */ + UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; + /** + * 自定义设备参数设置的开关,true时会读取用户设置的下列设备参数信息;false时随机读取ucloud内置设备参数。默认false + */ + Customize?: boolean; + /** + * 品牌 + */ + Brand?: string; + /** + * 设备型号 + */ + Model?: string; + /** + * 厂商 + */ + Manufacture?: string; + /** + * 序列号 + */ + SerialNumber?: string; + /** + * 基带版本 + */ + BaseBand?: string; + /** + * 主板名 + */ + Board?: string; + /** + * 显示的版本号 + */ + DisplayID?: string; + /** + * 设备名 + */ + Device?: string; + /** + * 系统指纹 + */ + FingerPrint?: string; + /** + * 产品名称 + */ + ProductName?: string; + /** + * build的版本号 + */ + BuildID?: string; + /** + * 固件编译主机 + */ + BuildHost?: string; + /** + * bootloader版本号 + */ + BootLoader?: string; + /** + * 系统标记 + */ + BuildTags?: string; + /** + * 版本增加说明 + */ + BuildVersionInc?: string; + /** + * 串号 + */ + IMEI?: string; + /** + * 手机号码 + */ + PhoneNumber?: string; + /** + * SIM卡唯一标识 + */ + ICCID?: string; + /** + * 移动识别码 + */ + IMSI?: string; + /** + * 移动设备标识码软件 + */ + IMEISV?: string; + /** + * 移动网络mac地址 + */ + RadioMac?: string; + /** + * 当前连接Wi-Fi名称 + */ + WiFiName?: string; + /** + * Wi-Fi 物理地址 + */ + BSSID?: string; + /** + * AOSP唯一标识 + */ + AndroidID?: string; +} +/** + * RenewUPhone - 修改UPhone的device_id、imei、meid 以及其他相关配置,达到一键新机的效果 + */ +export interface RenewUPhoneResponse { } /** * ResetUPhone - 将云手机恢复为创建时的状态。 @@ -1729,11 +2249,19 @@ export interface ResetUPhoneRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重置的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * ResetUPhone - 将云手机恢复为创建时的状态。 */ export interface ResetUPhoneResponse { + /** + * 异步请求成功后返回JobId,用以查询Job状态 + */ + JobId?: string; } /** * RunAsyncCommand - 在云手机中执行异步shell命令。 @@ -1751,6 +2279,10 @@ export interface RunAsyncCommandRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望执行命令的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * RunAsyncCommand - 在云手机中执行异步shell命令。 @@ -1777,6 +2309,10 @@ export interface RunSyncCommandRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望执行命令的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * RunSyncCommand - 在云手机中执行同步shell命令。 @@ -1796,6 +2332,32 @@ export interface RunSyncCommandResponse { ExecuteMsg?: string; }[]; } +/** + * SetUPhoneCallback - 设置云手机异步操作以及状态更新回调,支持云手机重置,安装应用,卸载应用,设备占用状态回调 + */ +export interface SetUPhoneCallbackRequest { + /** + * 城市ID + */ + CityId: string; + /** + * 云手机ID。 + */ + UPhoneId: string; + /** + * 接收POST请求的http接口。Content-Type:application/json; charset=UTF-8,Accept:application/json。 + */ + URL: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; +} +/** + * SetUPhoneCallback - 设置云手机异步操作以及状态更新回调,支持云手机重置,安装应用,卸载应用,设备占用状态回调 + */ +export interface SetUPhoneCallbackResponse { +} /** * SetUPhoneConfig - 设置云手机画面参数(分辨率、DPI、帧率、码率) */ @@ -1805,7 +2367,7 @@ export interface SetUPhoneConfigRequest { */ CityId: string; /** - * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重启的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; /** @@ -1817,7 +2379,7 @@ export interface SetUPhoneConfigRequest { */ Refresh?: string; /** - * 云手机画面传输码率(例,8000)取值范围[100,5000] + * 云手机画面传输码率(例,8000)取值范围[100,50000] */ Bitrate?: string; /** @@ -1828,6 +2390,10 @@ export interface SetUPhoneConfigRequest { * 云手机dpi,取值范围[100,1000] */ Dpi?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * SetUPhoneConfig - 设置云手机画面参数(分辨率、DPI、帧率、码率) @@ -1884,6 +2450,10 @@ export interface SetUPhoneGPSRequest { */ Altitude?: number; }[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * SetUPhoneGPS - 设置云手机GPS信息 @@ -1910,12 +2480,46 @@ export interface SetUPhoneManagerModeRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * SetUPhoneManagerMode - 管理员模式支持所有按键,普通用户模式禁用返回桌面 */ export interface SetUPhoneManagerModeResponse { } +/** + * SetUPhoneRootMode - 设置云手机Root模式 + */ +export interface SetUPhoneRootModeRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重启的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 + */ + UPhoneIds: string[]; + /** + * true则打开Root权限;false则关闭Root权限 + */ + Root: boolean; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; +} +/** + * SetUPhoneRootMode - 设置云手机Root模式 + */ +export interface SetUPhoneRootModeResponse { + /** + * 异步请求成功后返回JobId,用以查询Job状态 + */ + JobId: string; +} /** * SetUPhoneSplashScreen - 设置云手机启动画面,通过DescribeUPhone接口可以查询该地址 */ @@ -1932,6 +2536,10 @@ export interface SetUPhoneSplashScreenRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * SetUPhoneSplashScreen - 设置云手机启动画面,通过DescribeUPhone接口可以查询该地址 @@ -1947,13 +2555,17 @@ export interface SetUPhoneTokenRequest { */ UPhoneId: string; /** - * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + * 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; /** * RTC连接Token,为空表示清空Token */ Token?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * SetUPhoneToken - 设置云手机RTC连接Token提高安全性 @@ -1976,6 +2588,10 @@ export interface UnInstallUPhoneAppVersionRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望卸载应用的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * UnInstallUPhoneAppVersion - 传入应用版本Id,在云手机中根据应用版本的PackageName卸载相关应用。一次只支持卸载一个应用。 @@ -2002,6 +2618,10 @@ export interface UpdateUPhoneImageRequest { * 镜像的描述信息。长度为2~256个英文或中文字符 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * UpdateUPhoneImage - 更新云手机镜像信息。 diff --git a/lib/services/uphone/index.js b/lib/services/uphone/index.js index aac84d3..091941a 100644 --- a/lib/services/uphone/index.js +++ b/lib/services/uphone/index.js @@ -12,6 +12,15 @@ class UPhoneClient extends client_1.default { constructor({ config, credential, }) { super({ config, credential }); } + /** + * CreateUPhone - 创建云手机 + * + * See also: https://docs.ucloud.cn/api/uphone-api/create_u_phone + */ + createUPhone(request) { + const args = Object.assign({ Action: 'CreateUPhone' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * CreateUPhoneApp - 一个 app 对应多个 app_version。 * @@ -49,6 +58,15 @@ class UPhoneClient extends client_1.default { const args = Object.assign({ Action: 'CreateUPhoneServer' }, (request || {})); return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } + /** + * DeleteUPhone - 删除云手机 + * + * See also: https://docs.ucloud.cn/api/uphone-api/delete_u_phone + */ + deleteUPhone(request) { + const args = Object.assign({ Action: 'DeleteUPhone' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * DeleteUPhoneImage - 删除自制云手机镜像。 * @@ -59,7 +77,7 @@ class UPhoneClient extends client_1.default { return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } /** - * DeleteUPhoneServer - 删除云手机服务器。 注:关机状态下才能执行删除操作。 + * DeleteUPhoneServer - 删除云手机服务器。 * * See also: https://docs.ucloud.cn/api/uphone-api/delete_u_phone_server */ @@ -122,7 +140,7 @@ class UPhoneClient extends client_1.default { return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } /** - * DescribeUPhoneIpRegions - 获取云手机支持绑定独立IP的城市列表 + * DescribeUPhoneIpRegions - 获取云手机所在城市支持绑定独立IP的地域列表 * * See also: https://docs.ucloud.cn/api/uphone-api/describe_u_phone_ip_regions */ @@ -140,7 +158,7 @@ class UPhoneClient extends client_1.default { return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } /** - * DescribeUPhoneModel - + * DescribeUPhoneModel - 获取云手机规格列表。两种类型:uphone代表单云手机场景、uphone-server代表云手机服务器场景。 * * See also: https://docs.ucloud.cn/api/uphone-api/describe_u_phone_model */ @@ -166,6 +184,33 @@ class UPhoneClient extends client_1.default { const args = Object.assign({ Action: 'DescribeUPhoneServerModel' }, (request || {})); return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } + /** + * GetUPhoneAllowance - 获取云手机创建余量 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_allowance + */ + getUPhoneAllowance(request) { + const args = Object.assign({ Action: 'GetUPhoneAllowance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUPhonePrice - 根据云手机规格名称,获取UPhone实例的价格。 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_price + */ + getUPhonePrice(request) { + const args = Object.assign({ Action: 'GetUPhonePrice' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUPhoneRenewPrice - 获取云手机续费价格,不包括独立ip价格。 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_renew_price + */ + getUPhoneRenewPrice(request) { + const args = Object.assign({ Action: 'GetUPhoneRenewPrice' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * GetUPhoneScreenCapture - 云手机截屏 * @@ -267,6 +312,15 @@ class UPhoneClient extends client_1.default { const args = Object.assign({ Action: 'RebootUPhone' }, (request || {})); return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } + /** + * RenewUPhone - 修改UPhone的device_id、imei、meid 以及其他相关配置,达到一键新机的效果 + * + * See also: https://docs.ucloud.cn/api/uphone-api/renew_u_phone + */ + renewUPhone(request) { + const args = Object.assign({ Action: 'RenewUPhone' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * ResetUPhone - 将云手机恢复为创建时的状态。 * @@ -294,6 +348,15 @@ class UPhoneClient extends client_1.default { const args = Object.assign({ Action: 'RunSyncCommand' }, (request || {})); return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } + /** + * SetUPhoneCallback - 设置云手机异步操作以及状态更新回调,支持云手机重置,安装应用,卸载应用,设备占用状态回调 + * + * See also: https://docs.ucloud.cn/api/uphone-api/set_u_phone_callback + */ + setUPhoneCallback(request) { + const args = Object.assign({ Action: 'SetUPhoneCallback' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * SetUPhoneConfig - 设置云手机画面参数(分辨率、DPI、帧率、码率) * @@ -321,6 +384,15 @@ class UPhoneClient extends client_1.default { const args = Object.assign({ Action: 'SetUPhoneManagerMode' }, (request || {})); return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } + /** + * SetUPhoneRootMode - 设置云手机Root模式 + * + * See also: https://docs.ucloud.cn/api/uphone-api/set_u_phone_root_mode + */ + setUPhoneRootMode(request) { + const args = Object.assign({ Action: 'SetUPhoneRootMode' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * SetUPhoneSplashScreen - 设置云手机启动画面,通过DescribeUPhone接口可以查询该地址 * diff --git a/lib/services/uvms/index.d.ts b/lib/services/uvms/index.d.ts index b4a3f68..bdceb43 100644 --- a/lib/services/uvms/index.d.ts +++ b/lib/services/uvms/index.d.ts @@ -20,10 +20,6 @@ export default class UVMSClient extends Client { * SendUVMSMessage - 向指定号码拨打电话 */ export interface SendUVMSMessageRequest { - /** - * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) - */ - Zone: string; /** * 被叫号码,采用 E.164 标准,格式为+[国家代码][用户号码]。例如:+8613512345678, 其中前面有一个+号 ,86为国家码,13512345678为手机号 */ diff --git a/lib/services/vpc/index.d.ts b/lib/services/vpc/index.d.ts index 14b5a0e..43a2e1f 100644 --- a/lib/services/vpc/index.d.ts +++ b/lib/services/vpc/index.d.ts @@ -27,6 +27,12 @@ export default class VPCClient extends Client { * See also: https://docs.ucloud.cn/api/vpc2.0-api/add_white_list_resource */ addWhiteListResource(request?: AddWhiteListResourceRequest): Promise; + /** + * AllocateBatchSecondaryIp - 批量申请虚拟网卡辅助IP + * + * See also: https://docs.ucloud.cn/api/vpc2.0-api/allocate_batch_secondary_ip + */ + allocateBatchSecondaryIp(request?: AllocateBatchSecondaryIpRequest): Promise; /** * AllocateSecondaryIp - 分配ip(用于uk8s使用) * @@ -81,6 +87,12 @@ export default class VPCClient extends Client { * See also: https://docs.ucloud.cn/api/vpc2.0-api/create_network_acl_entry */ createNetworkAclEntry(request?: CreateNetworkAclEntryRequest): Promise; + /** + * CreateNetworkInterface - 创建虚拟网卡 + * + * See also: https://docs.ucloud.cn/api/vpc2.0-api/create_network_interface + */ + createNetworkInterface(request?: CreateNetworkInterfaceRequest): Promise; /** * CreateRouteTable - 创建路由表 * @@ -474,6 +486,86 @@ export interface AddWhiteListResourceRequest { */ export interface AddWhiteListResourceResponse { } +/** + * AllocateBatchSecondaryIp - 批量申请虚拟网卡辅助IP + */ +export interface AllocateBatchSecondaryIpRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 节点mac + */ + Mac: string; + /** + * 资源Id + */ + ObjectId: string; + /** + * 子网Id(若未指定,则根据zone获取默认子网进行创建) + */ + SubnetId?: string; + /** + * vpcId + */ + VPCId?: string; + /** + * 【arry】支持按如下方式申请:①按网段:如192.168.1.32/27,掩码数字最小为27   ②指定IP地址,如192.168.1.3 + */ + Ip?: string[]; + /** + * 申请的内网IP数量 + */ + Count?: number; +} +/** + * AllocateBatchSecondaryIp - 批量申请虚拟网卡辅助IP + */ +export interface AllocateBatchSecondaryIpResponse { + /** + * 详见IpsInfo + */ + IpsInfo: { + /** + * 内网IP地址 + */ + Ip?: string; + /** + * 掩码 + */ + Mask?: string; + /** + * 网关 + */ + Gateway?: string; + /** + * MAC地址 + */ + Mac?: string; + /** + * 子网资源ID + */ + SubnetId?: string; + /** + * VPC资源ID + */ + VPCId?: string; + /** + * IP分配结果,详见StatusInfo + */ + Status?: { + /** + * 枚举值:Succeeded,Failed + */ + StatusCode?: string; + /** + * IP分配失败原因 + */ + Message?: string; + }; + }[]; +} /** * AllocateSecondaryIp - 分配ip(用于uk8s使用) */ @@ -851,6 +943,105 @@ export interface CreateNetworkAclEntryResponse { */ EntryId: string; } +/** + * CreateNetworkInterface - 创建虚拟网卡 + */ +export interface CreateNetworkInterfaceRequest { + /** + * 所属VPCID + */ + VPCId: string; + /** + * 所属子网ID + */ + SubnetId: string; + /** + * 虚拟网卡名称,默认为 NetworkInterface + */ + Name?: string; + /** + * 指定内网IP。当前一个网卡仅支持绑定一个内网IP + */ + PrivateIp?: string[]; + /** + * 防火墙GroupId,默认:Web推荐防火墙 可由DescribeSecurityGroupResponse中的GroupId取得 + */ + SecurityGroupId?: string; + /** + * 业务组 + */ + Tag?: string; + /** + * 备注 + */ + Remark?: string; +} +/** + * CreateNetworkInterface - 创建虚拟网卡 + */ +export interface CreateNetworkInterfaceResponse { + /** + * 若创建成功,则返回虚拟网卡信息。创建失败,无此参数 + */ + NetworkInterface?: { + /** + * 虚拟网卡资源ID + */ + InterfaceId: string; + /** + * 所属VPC + */ + VPCId: string; + /** + * 所属子网 + */ + SubnetId: string; + /** + * 关联内网IP。当前一个网卡仅支持绑定一个内网IP + */ + PrivateIpSet: string[]; + /** + * 关联Mac + */ + MacAddress: string; + /** + * 绑定状态 + */ + Status: number; + /** + * 虚拟网卡名称 + */ + Name?: string; + /** + * 内网IP掩码 + */ + Netmask?: string; + /** + * 默认网关 + */ + Gateway?: string; + /** + * 绑定实例资源ID + */ + AttachInstanceId?: string; + /** + * 是否是绑定实例的默认网卡 false:不是 true:是 + */ + Default?: boolean; + /** + * 创建时间 + */ + CreateTime?: number; + /** + * 备注 + */ + Remark?: string; + /** + * 业务组 + */ + Tag?: string; + }; +} /** * CreateRouteTable - 创建路由表 */ @@ -1292,10 +1483,6 @@ export interface DescribeInstanceNetworkInterfaceResponse { * 绑定状态 */ Status: number; - /** - * 网卡的内网IP信息 - */ - PrivateIp: string[]; /** * 虚拟网卡名称 */ @@ -1336,10 +1523,6 @@ export interface DescribeInstanceNetworkInterfaceResponse { * 虚拟网卡绑定的防火墙ID信息 */ FirewallIdSet?: string[]; - /** - * 网卡的内网IP配额信息 - */ - PrivateIplimit?: string[]; }[]; } /** @@ -1374,35 +1557,35 @@ export interface DescribeNATGWResponse { /** * natgw id */ - NATGWId?: string; + NATGWId: string; /** * natgw名称 */ - NATGWName?: string; + NATGWName: string; /** * 业务组 */ - Tag?: string; + Tag: string; /** * 备注 */ - Remark?: string; + Remark: string; /** * natgw创建时间 */ - CreateTime?: number; + CreateTime: number; /** * 绑定的防火墙Id */ - FirewallId?: string; + FirewallId: string; /** * 所属VPC Id */ - VPCId?: string; + VPCId: string; /** * 子网 Id */ - SubnetSet?: { + SubnetSet: { /** * 子网id */ @@ -1419,7 +1602,7 @@ export interface DescribeNATGWResponse { /** * 绑定的EIP 信息 */ - IPSet?: { + IPSet: { /** * 外网IP的 EIPId */ @@ -1453,15 +1636,15 @@ export interface DescribeNATGWResponse { /** * VPC名称 */ - VPCName?: string; + VPCName: string; /** * 枚举值,“enable”,默认出口规则使用了负载均衡;“disable”,默认出口规则未使用负载均衡。 */ - IsSnatpoolEnabled?: string; + IsSnatpoolEnabled: string; /** * 转发策略Id */ - PolicyId?: string[]; + PolicyId: string[]; }[]; } /** @@ -1939,7 +2122,16 @@ export interface DescribeNetworkInterfaceResponse { /** * 网卡的内网IP信息 */ - PrivateIp: string[]; + PrivateIp?: { + /** + * ip类型 SecondaryIp/PrimaryIp + */ + IpType?: string; + /** + * ip 地址 + */ + IpAddr?: string[]; + }[]; /** * 虚拟网卡名称 */ @@ -1983,7 +2175,16 @@ export interface DescribeNetworkInterfaceResponse { /** * 网卡的内网IP配额信息 */ - PrivateIplimit?: string[]; + PrivateIpLimit?: { + /** + * 网卡拥有的内网IP数量 + */ + PrivateIpCount?: number; + /** + * 网卡内网IP配额 + */ + PrivateIpQuota?: number; + }; }[]; /** * 虚拟网卡总数 @@ -2014,6 +2215,14 @@ export interface DescribeRouteTableRequest { * 业务组ID */ BusinessId?: string; + /** + * 默认为 false, 返回详细路由规则信息 + */ + Brief?: boolean; + /** + * 默认为 false, 表示路由表是短 ID + */ + LongId?: string; } /** * DescribeRouteTable - 获取路由表详细信息(包括路由策略) @@ -2035,6 +2244,10 @@ export interface DescribeRouteTableResponse { * 绑定该路由表的子网数量 */ SubnetCount?: number; + /** + * 绑定该路由表的子网 + */ + SubnetIds?: string[]; /** * 路由表所属的VPC资源ID */ @@ -2079,6 +2292,10 @@ export interface DescribeRouteTableResponse { * 路由表下一跳类型。LOCAL,本VPC内部通信路由;PUBLIC,公共服务路由;CNAT,外网路由;UDPN,跨域高速通道路由;HYBRIDGW,混合云路由;INSTANCE,实例路由;VNET,VPC联通路由;IPSEC VPN,指向VPN网关的路由。 */ NexthopType?: string; + /** + * 实例类型,枚举值:UHOST,云主机;UNI,虚拟网卡;PHOST,物理云主机 + */ + InstanceType?: string; /** * 保留字段,暂未使用 */ diff --git a/lib/services/vpc/index.js b/lib/services/vpc/index.js index 9a57ea8..eceebca 100644 --- a/lib/services/vpc/index.js +++ b/lib/services/vpc/index.js @@ -39,6 +39,15 @@ class VPCClient extends client_1.default { const args = Object.assign({ Action: 'AddWhiteListResource' }, (request || {})); return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } + /** + * AllocateBatchSecondaryIp - 批量申请虚拟网卡辅助IP + * + * See also: https://docs.ucloud.cn/api/vpc2.0-api/allocate_batch_secondary_ip + */ + allocateBatchSecondaryIp(request) { + const args = Object.assign({ Action: 'AllocateBatchSecondaryIp' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * AllocateSecondaryIp - 分配ip(用于uk8s使用) * @@ -120,6 +129,15 @@ class VPCClient extends client_1.default { const args = Object.assign({ Action: 'CreateNetworkAclEntry' }, (request || {})); return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); } + /** + * CreateNetworkInterface - 创建虚拟网卡 + * + * See also: https://docs.ucloud.cn/api/vpc2.0-api/create_network_interface + */ + createNetworkInterface(request) { + const args = Object.assign({ Action: 'CreateNetworkInterface' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } /** * CreateRouteTable - 创建路由表 * diff --git a/package-lock.json b/package-lock.json index 5a04e90..32633fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ucloud-sdks/ucloud-sdk-js", - "version": "0.2.2", + "version": "0.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 33ae695..aa9b5d1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ucloud-sdks/ucloud-sdk-js", "description": "ucloud-sdk-js", - "version": "0.2.2", + "version": "0.2.3", "author": "oas@ucloud.cn", "license": "MIT", "private": false, diff --git a/src/services/uhost/index.ts b/src/services/uhost/index.ts index 6f506f7..ad95c55 100644 --- a/src/services/uhost/index.ts +++ b/src/services/uhost/index.ts @@ -961,7 +961,7 @@ export interface DescribeAvailableInstanceTypesResponse { * 返回Arm的CPU平台信息,例如:Ampere: ['Ampere/Altra'] */ Ampere?: string[]; - }[]; + }; /** * 磁盘信息。磁盘主要分类如下:云盘|cloudDisk、普通本地盘|normalLocalDisk和SSD本地盘|ssdLocalDisk。其中云盘主要包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。MinimalSize为磁盘最小值,如果没有该字段,最小值取基础镜像Size值即可(linux为20G,windows为40G)。MaximalSize为磁盘最大值。InstantResize表示系统盘是否允许扩容,如果是本地盘,则不允许扩容,InstantResize为false。Features为磁盘可支持的服务:数据方舟|DATAARK,快照服务|SNAPSHOT,加密盘|Encrypted。 */ diff --git a/src/services/unet/index.ts b/src/services/unet/index.ts index eeb3b44..b055ff2 100644 --- a/src/services/unet/index.ts +++ b/src/services/unet/index.ts @@ -547,7 +547,7 @@ export interface AllocateEIPResponse { */ EIPAddr?: { /** - * 运营商信息如: 国际: International, BGP: BGP + * 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp */ OperatorName?: string; /** @@ -633,6 +633,10 @@ export interface BindEIPRequest { * 弹性IP请求绑定的资源ID */ ResourceId: string; + /** + * EIP与内网IP进行绑定时需要传入UNI下未绑定过EIP的内网IP + */ + PrivateIP?: string; } /** @@ -957,7 +961,7 @@ export interface DescribeEIPResponse { */ EIPAddr?: { /** - * 运营商信息如: 国际: International, BGP: BGP + * 运营商信息如: 电信: Telecom, 联通: Unicom, 国际: International, Duplet: 双线IP(电信+联通), BGP: Bgp */ OperatorName?: string; /** diff --git a/src/services/uphone/index.ts b/src/services/uphone/index.ts index 2ad8d03..643622f 100644 --- a/src/services/uphone/index.ts +++ b/src/services/uphone/index.ts @@ -17,6 +17,18 @@ export default class UPhoneClient extends Client { super({ config, credential }); } + /** + * CreateUPhone - 创建云手机 + * + * See also: https://docs.ucloud.cn/api/uphone-api/create_u_phone + */ + createUPhone(request?: CreateUPhoneRequest): Promise { + const args = { Action: 'CreateUPhone', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as CreateUPhoneResponse + ); + } + /** * CreateUPhoneApp - 一个 app 对应多个 app_version。 * @@ -74,6 +86,18 @@ export default class UPhoneClient extends Client { ); } + /** + * DeleteUPhone - 删除云手机 + * + * See also: https://docs.ucloud.cn/api/uphone-api/delete_u_phone + */ + deleteUPhone(request?: DeleteUPhoneRequest): Promise { + const args = { Action: 'DeleteUPhone', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DeleteUPhoneResponse + ); + } + /** * DeleteUPhoneImage - 删除自制云手机镜像。 * @@ -89,7 +113,7 @@ export default class UPhoneClient extends Client { } /** - * DeleteUPhoneServer - 删除云手机服务器。 注:关机状态下才能执行删除操作。 + * DeleteUPhoneServer - 删除云手机服务器。 * * See also: https://docs.ucloud.cn/api/uphone-api/delete_u_phone_server */ @@ -187,7 +211,7 @@ export default class UPhoneClient extends Client { } /** - * DescribeUPhoneIpRegions - 获取云手机支持绑定独立IP的城市列表 + * DescribeUPhoneIpRegions - 获取云手机所在城市支持绑定独立IP的地域列表 * * See also: https://docs.ucloud.cn/api/uphone-api/describe_u_phone_ip_regions */ @@ -215,7 +239,7 @@ export default class UPhoneClient extends Client { } /** - * DescribeUPhoneModel - + * DescribeUPhoneModel - 获取云手机规格列表。两种类型:uphone代表单云手机场景、uphone-server代表云手机服务器场景。 * * See also: https://docs.ucloud.cn/api/uphone-api/describe_u_phone_model */ @@ -256,6 +280,48 @@ export default class UPhoneClient extends Client { ); } + /** + * GetUPhoneAllowance - 获取云手机创建余量 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_allowance + */ + getUPhoneAllowance( + request?: GetUPhoneAllowanceRequest + ): Promise { + const args = { Action: 'GetUPhoneAllowance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUPhoneAllowanceResponse + ); + } + + /** + * GetUPhonePrice - 根据云手机规格名称,获取UPhone实例的价格。 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_price + */ + getUPhonePrice( + request?: GetUPhonePriceRequest + ): Promise { + const args = { Action: 'GetUPhonePrice', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUPhonePriceResponse + ); + } + + /** + * GetUPhoneRenewPrice - 获取云手机续费价格,不包括独立ip价格。 + * + * See also: https://docs.ucloud.cn/api/uphone-api/get_u_phone_renew_price + */ + getUPhoneRenewPrice( + request?: GetUPhoneRenewPriceRequest + ): Promise { + const args = { Action: 'GetUPhoneRenewPrice', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUPhoneRenewPriceResponse + ); + } + /** * GetUPhoneScreenCapture - 云手机截屏 * @@ -410,6 +476,18 @@ export default class UPhoneClient extends Client { ); } + /** + * RenewUPhone - 修改UPhone的device_id、imei、meid 以及其他相关配置,达到一键新机的效果 + * + * See also: https://docs.ucloud.cn/api/uphone-api/renew_u_phone + */ + renewUPhone(request?: RenewUPhoneRequest): Promise { + const args = { Action: 'RenewUPhone', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as RenewUPhoneResponse + ); + } + /** * ResetUPhone - 将云手机恢复为创建时的状态。 * @@ -450,6 +528,20 @@ export default class UPhoneClient extends Client { ); } + /** + * SetUPhoneCallback - 设置云手机异步操作以及状态更新回调,支持云手机重置,安装应用,卸载应用,设备占用状态回调 + * + * See also: https://docs.ucloud.cn/api/uphone-api/set_u_phone_callback + */ + setUPhoneCallback( + request?: SetUPhoneCallbackRequest + ): Promise { + const args = { Action: 'SetUPhoneCallback', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as SetUPhoneCallbackResponse + ); + } + /** * SetUPhoneConfig - 设置云手机画面参数(分辨率、DPI、帧率、码率) * @@ -490,6 +582,20 @@ export default class UPhoneClient extends Client { ); } + /** + * SetUPhoneRootMode - 设置云手机Root模式 + * + * See also: https://docs.ucloud.cn/api/uphone-api/set_u_phone_root_mode + */ + setUPhoneRootMode( + request?: SetUPhoneRootModeRequest + ): Promise { + const args = { Action: 'SetUPhoneRootMode', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as SetUPhoneRootModeResponse + ); + } + /** * SetUPhoneSplashScreen - 设置云手机启动画面,通过DescribeUPhone接口可以查询该地址 * @@ -547,6 +653,78 @@ export default class UPhoneClient extends Client { } } +/** + * CreateUPhone - 创建云手机 + */ +export interface CreateUPhoneRequest { + /** + * 云手机实例名称,默认:UPhone。如果同时创建多个,则增加数字后缀,如UPhone-1 + */ + Name: string; + /** + * 云手机规格名称,不超过64个字节。可通过[查询云手机规格列表]()查询支持的云手机规格。 + */ + UPhoneModelName: string; + /** + * 云手机画面带宽,默认2M + */ + MediaBandwidth: number; + /** + * 云手机镜像ID,不超过32个字节。可通过[查询手机镜像]()查询云手机规格对应的镜像ID。 + */ + ImageId: string; + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 创建云手机的个数 + */ + UPhoneCount: number; + /** + * 计费模式。枚举值为: > 年 Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 默认为月付 + */ + ChargeType?: string; + /** + * 购买时长。默认值: 1。月付时,此参数传0,代表购买至月末。 + */ + Quantity?: string; + /** + * 购买独立IP必须有此参数。绑定的目的地域。参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + IpDestRegion?: string; + /** + * 业务组。默认:Default(Default即为未分组)。请遵照[[api:uhost-api:specification|字段规范]]设定业务组。 + */ + Tag?: string; + /** + * 绑定独立IP + */ + BindIp?: boolean; + /** + * 独立IP带宽 + */ + Bandwidth?: number; + /** + * 独立IP参数。需要独立IP的比例。eg: [4:1]->4, [3:1]->3。 + */ + IpProportion?: number; + /** + * 云手机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看。注:代金券对带宽不适用,仅适用于云手机计费 + */ + CouponId?: string; +} + +/** + * CreateUPhone - 创建云手机 + */ +export interface CreateUPhoneResponse { + /** + * 任务ID,用来查询创建云手机任务状态 + */ + JobId: string; +} + /** * CreateUPhoneApp - 一个 app 对应多个 app_version。 */ @@ -559,6 +737,10 @@ export interface CreateUPhoneAppRequest { * 应用描述。 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -592,6 +774,10 @@ export interface CreateUPhoneAppVersionRequest { * 应用版本描述。 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -610,7 +796,7 @@ export interface CreateUPhoneAppVersionResponse { */ export interface CreateUPhoneImageRequest { /** - * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + * 城市Id,通过[获取城市列表](https://cms-docs.ucloudadmin.com/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; /** @@ -625,6 +811,10 @@ export interface CreateUPhoneImageRequest { * 镜像的描述信息。长度为2~256个英文或中文字符 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -635,6 +825,10 @@ export interface CreateUPhoneImageResponse { * 云手机自定义镜像资源 ID */ ImageId?: string; + /** + * 请求的唯一标识Id,`RetCode`为0时返回,可根据此ID查询请求的执行状态 + */ + JobId?: string; } /** @@ -705,6 +899,34 @@ export interface CreateUPhoneServerResponse { ServerId: string; } +/** + * DeleteUPhone - 删除云手机 + */ +export interface DeleteUPhoneRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望获取信息的云手机 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId + */ + UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; +} + +/** + * DeleteUPhone - 删除云手机 + */ +export interface DeleteUPhoneResponse { + /** + * 任务ID,用来查询删除云手机任务状态 + */ + JobId: string; +} + /** * DeleteUPhoneImage - 删除自制云手机镜像。 */ @@ -726,7 +948,7 @@ export interface DeleteUPhoneImageResponse { } /** - * DeleteUPhoneServer - 删除云手机服务器。 注:关机状态下才能执行删除操作。 + * DeleteUPhoneServer - 删除云手机服务器。 */ export interface DeleteUPhoneServerRequest { /** @@ -748,7 +970,7 @@ export interface DeleteUPhoneServerRequest { } /** - * DeleteUPhoneServer - 删除云手机服务器。 注:关机状态下才能执行删除操作。 + * DeleteUPhoneServer - 删除云手机服务器。 */ export interface DeleteUPhoneServerResponse {} @@ -784,6 +1006,10 @@ export interface DescribeUPhoneRequest { * 是否返回全部。如果有此参数,分页不生效。 */ IsAll?: boolean; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -874,6 +1100,22 @@ export interface DescribeUPhoneResponse { * 备注 */ Remark?: string; + /** + * 计费模式。枚举值为: > 年 Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 默认为月付 + */ + ChargeType?: string; + /** + * 到期时间;格式为Unix时间戳 + */ + ExpireTime?: number; + /** + * IP所属地域Id,eg: hk,th-bkk + */ + IpRegion?: string; + /** + * 云手机IP地址 + */ + Ip?: string; }[]; } @@ -893,6 +1135,10 @@ export interface DescribeUPhoneAppRequest { * 返回数据长度,默认为20,最大100 */ Limit?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -954,6 +1200,10 @@ export interface DescribeUPhoneAppVersionRequest { * 列表起始位置偏移量,默认为0 */ Offset?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -1006,7 +1256,12 @@ export interface DescribeUPhoneAppVersionResponse { /** * DescribeUPhoneCities - 获取云手机提供服务的城市列表 */ -export interface DescribeUPhoneCitiesRequest {} +export interface DescribeUPhoneCitiesRequest { + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; +} /** * DescribeUPhoneCities - 获取云手机提供服务的城市列表 @@ -1059,6 +1314,10 @@ export interface DescribeUPhoneDetailByAppRequest { * 返回数据长度,默认为20,最大100 */ Limit?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -1078,9 +1337,13 @@ export interface DescribeUPhoneDetailByAppResponse { */ UPhoneName?: string; /** - * 云手机规格名称 + * 云手机的唯一标识,不超过32个字节。 */ UPhoneId?: string; + /** + * 云手机规格名称 + */ + UPhoneModelName?: string; /** * 虚拟CPU核数。 */ @@ -1193,6 +1456,10 @@ export interface DescribeUPhoneImageRequest { * 最大返回镜像数量,默认为20,最大100 */ Limit?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -1284,17 +1551,21 @@ export interface DescribeUPhoneImageResponse { } /** - * DescribeUPhoneIpRegions - 获取云手机支持绑定独立IP的城市列表 + * DescribeUPhoneIpRegions - 获取云手机所在城市支持绑定独立IP的地域列表 */ export interface DescribeUPhoneIpRegionsRequest { /** - * 城市Id,eg: cn-shanghai, cn-hangzhou + * 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** - * DescribeUPhoneIpRegions - 获取云手机支持绑定独立IP的城市列表 + * DescribeUPhoneIpRegions - 获取云手机所在城市支持绑定独立IP的地域列表 */ export interface DescribeUPhoneIpRegionsResponse { /** @@ -1325,7 +1596,7 @@ export interface DescribeUPhoneJobRequest { */ CityId: string; /** - * 【数组】Job 的唯一标识 Id,调用方式举例:ServerIds.0=希望查询状态的 Job1,ServerIds.1=Job2。 如果不传入,则返回当前 城市 所有符合条件的 Job 。 + * 【数组】Job 的唯一标识 Id,调用方式举例:JobIds.0=希望查询状态的 Job1,JobIds.1=Job2。 如果不传入,则返回当前 城市 所有符合条件的 Job 。 */ JobIds?: string[]; /** @@ -1344,6 +1615,10 @@ export interface DescribeUPhoneJobRequest { * 【数组】Job 类型,调用方式举例:JobTypes.0=希望查询的 Job 类型 1,JobTypes.1=Job 类型 2。 如果不传入,则返回当前 城市 所有符合条件的 Job 类型。Job 类型仅支持 INSTALL_APP、UNINSTALL_APP、RUN_ASYNC_COMMAND、CREATE_SERVER_AND_UPHONE、SET_UPHONE_GPS、SET_UPHONE_CONFIG、UPLOAD_FILE、DELETE_UPHONE */ Types?: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -1431,7 +1706,7 @@ export interface DescribeUPhoneJobResponse { } /** - * DescribeUPhoneModel - + * DescribeUPhoneModel - 获取云手机规格列表。两种类型:uphone代表单云手机场景、uphone-server代表云手机服务器场景。 */ export interface DescribeUPhoneModelRequest { /** @@ -1446,10 +1721,14 @@ export interface DescribeUPhoneModelRequest { * 返回数据长度,默认为20,最大100 */ Limit?: number; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** - * DescribeUPhoneModel - + * DescribeUPhoneModel - 获取云手机规格列表。两种类型:uphone代表单云手机场景、uphone-server代表云手机服务器场景。 */ export interface DescribeUPhoneModelResponse { /** @@ -1484,6 +1763,14 @@ export interface DescribeUPhoneModelResponse { * 刷新率 */ Refresh: number; + /** + * DPI + */ + Dpi?: number; + /** + * 型号描述信息 + */ + Description?: string; }[]; } @@ -1682,10 +1969,23 @@ export interface DescribeUPhoneServerModelResponse { * ServerModelInstance总数 */ TotalCount: number; + /** + * 服务器model的库存 + */ + Stock?: { + /** + * ServerModel名称 + */ + ModelName?: string; + /** + * 资源余量 + */ + StockCount?: number; + }[]; /** * ServerModel实例列表,每项参数可见数据模型 ServerModelInstance */ - ServerModels: { + ServerModels?: { /** * ServerModel名称 */ @@ -1743,6 +2043,149 @@ export interface DescribeUPhoneServerModelResponse { }[]; } +/** + * GetUPhoneAllowance - 获取云手机创建余量 + */ +export interface GetUPhoneAllowanceRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; +} + +/** + * GetUPhoneAllowance - 获取云手机创建余量 + */ +export interface GetUPhoneAllowanceResponse { + /** + * 手机型号以及可创建数量 + */ + UPhoneAllowance: { + /** + * 枚举值,云手机型号名称,取值:UPhone X,UPhone Plus,UPhone Pro + */ + ModelName: string; + /** + * 可创建云手机个数 + */ + Allowance: number; + }[]; +} + +/** + * GetUPhonePrice - 根据云手机规格名称,获取UPhone实例的价格。 + */ +export interface GetUPhonePriceRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 云手机规格名称 + */ + UPhoneModelName?: number; + /** + * 云手机画面带宽值,画面带宽和手机强绑定关系,必须和手机数量对应。 + */ + MediaBandwidth?: number; + /** + * 云手机个数 + */ + UPhoneCount?: number; + /** + * 计费模式。枚举值为: > Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 如果不传某个枚举值,默认返回年付、月付的价格组合集。 + */ + ChargeType?: string; + /** + * 购买时长。默认: 1。 月付时,此参数传0,代表了购买至月末。 + */ + Quantity?: number; + /** + * 购买独立IP必须此参数。绑定的目的地域。参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + IpDestRegion?: string; + /** + * 购买独立IP需要此参数,其中一个ip的带宽值。 + */ + INetBandwidth?: number; + /** + * 购买独立IP需要此参数。需要的eip数量。 + */ + IpCount?: number; +} + +/** + * GetUPhonePrice - 根据云手机规格名称,获取UPhone实例的价格。 + */ +export interface GetUPhonePriceResponse { + /** + * 价格列表,每项参数见UPhonePriceSet + */ + PriceSet: { + /** + * 计费类型,枚举值:Year,Month,Dynamic + */ + ChargeType: string; + /** + * 价格,单位: 元,保留小数点后两位有效数字 + */ + Price: number; + /** + * 限时优惠的折前原价(即列表价乘以商务折扣后的单价) + */ + OriginalPrice: number; + /** + * 产品列表价 + */ + ListPrice?: number; + }[]; +} + +/** + * GetUPhoneRenewPrice - 获取云手机续费价格,不包括独立ip价格。 + */ +export interface GetUPhoneRenewPriceRequest { + /** + * 云手机的唯一标识,可通过[查询云手机列表]获取。 + */ + UPhoneId: string; + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 计费模式。枚举值为: > Year,按年付费; > Month,按月付费; > Dynamic,按小时预付费; 默认返回全部计费方式对应的价格 + */ + ChargeType?: string; +} + +/** + * GetUPhoneRenewPrice - 获取云手机续费价格,不包括独立ip价格。 + */ +export interface GetUPhoneRenewPriceResponse { + /** + * 价格列表,具体参数见UPhonePriceSet + */ + PriceSet: { + /** + * 计费类型,枚举值:Year,Month,Dynamic + */ + ChargeType: string; + /** + * 价格,单位: 元,保留小数点后两位有效数字 + */ + Price: number; + /** + * 限时优惠的折前原价(即列表价乘以商务折扣后的单价) + */ + OriginalPrice: number; + /** + * 产品列表价 + */ + ListPrice?: number; + }[]; +} + /** * GetUPhoneScreenCapture - 云手机截屏 */ @@ -1752,9 +2195,13 @@ export interface GetUPhoneScreenCaptureRequest { */ UPhoneID: string; /** - * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + * 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -1810,7 +2257,7 @@ export interface GetUPhoneServerPriceResponse { */ PriceSet: { /** - * 计费类型,枚举值:Year,Month + * 计费类型,枚举值:Year,Month, Dynamic */ ChargeType: string; /** @@ -1859,7 +2306,7 @@ export interface GetUPhoneServerRenewPriceResponse { */ PriceSet: { /** - * 计费类型,枚举值:Year,Month + * 计费类型,枚举值:Year,Month, Dynamic */ ChargeType: string; /** @@ -1893,6 +2340,10 @@ export interface InstallUPhoneAppVersionRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望安装应用的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2029,6 +2480,10 @@ export interface PoweroffUPhoneRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2048,6 +2503,10 @@ export interface PoweronUPhoneRequest { * 【数组】云手机实例的资源ID,调用方式举例:UPhoneIds.0=希望开启的云手机实例1的UPhoneId,UPhoneIds.1=云手机实例2的UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2067,12 +2526,144 @@ export interface RebootUPhoneRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * RebootUPhone - 重新启动云手机实例 */ -export interface RebootUPhoneResponse {} +export interface RebootUPhoneResponse { + /** + * 异步请求成功后返回JobId,用以查询Job状态 + */ + JobId?: string; +} + +/** + * RenewUPhone - 修改UPhone的device_id、imei、meid 以及其他相关配置,达到一键新机的效果 + */ +export interface RenewUPhoneRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重启的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 + */ + UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; + /** + * 自定义设备参数设置的开关,true时会读取用户设置的下列设备参数信息;false时随机读取ucloud内置设备参数。默认false + */ + Customize?: boolean; + /** + * 品牌 + */ + Brand?: string; + /** + * 设备型号 + */ + Model?: string; + /** + * 厂商 + */ + Manufacture?: string; + /** + * 序列号 + */ + SerialNumber?: string; + /** + * 基带版本 + */ + BaseBand?: string; + /** + * 主板名 + */ + Board?: string; + /** + * 显示的版本号 + */ + DisplayID?: string; + /** + * 设备名 + */ + Device?: string; + /** + * 系统指纹 + */ + FingerPrint?: string; + /** + * 产品名称 + */ + ProductName?: string; + /** + * build的版本号 + */ + BuildID?: string; + /** + * 固件编译主机 + */ + BuildHost?: string; + /** + * bootloader版本号 + */ + BootLoader?: string; + /** + * 系统标记 + */ + BuildTags?: string; + /** + * 版本增加说明 + */ + BuildVersionInc?: string; + /** + * 串号 + */ + IMEI?: string; + /** + * 手机号码 + */ + PhoneNumber?: string; + /** + * SIM卡唯一标识 + */ + ICCID?: string; + /** + * 移动识别码 + */ + IMSI?: string; + /** + * 移动设备标识码软件 + */ + IMEISV?: string; + /** + * 移动网络mac地址 + */ + RadioMac?: string; + /** + * 当前连接Wi-Fi名称 + */ + WiFiName?: string; + /** + * Wi-Fi 物理地址 + */ + BSSID?: string; + /** + * AOSP唯一标识 + */ + AndroidID?: string; +} + +/** + * RenewUPhone - 修改UPhone的device_id、imei、meid 以及其他相关配置,达到一键新机的效果 + */ +export interface RenewUPhoneResponse {} /** * ResetUPhone - 将云手机恢复为创建时的状态。 @@ -2086,12 +2677,21 @@ export interface ResetUPhoneRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重置的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** * ResetUPhone - 将云手机恢复为创建时的状态。 */ -export interface ResetUPhoneResponse {} +export interface ResetUPhoneResponse { + /** + * 异步请求成功后返回JobId,用以查询Job状态 + */ + JobId?: string; +} /** * RunAsyncCommand - 在云手机中执行异步shell命令。 @@ -2109,6 +2709,10 @@ export interface RunAsyncCommandRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望执行命令的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2137,6 +2741,10 @@ export interface RunSyncCommandRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望执行命令的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2158,6 +2766,33 @@ export interface RunSyncCommandResponse { }[]; } +/** + * SetUPhoneCallback - 设置云手机异步操作以及状态更新回调,支持云手机重置,安装应用,卸载应用,设备占用状态回调 + */ +export interface SetUPhoneCallbackRequest { + /** + * 城市ID + */ + CityId: string; + /** + * 云手机ID。 + */ + UPhoneId: string; + /** + * 接收POST请求的http接口。Content-Type:application/json; charset=UTF-8,Accept:application/json。 + */ + URL: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; +} + +/** + * SetUPhoneCallback - 设置云手机异步操作以及状态更新回调,支持云手机重置,安装应用,卸载应用,设备占用状态回调 + */ +export interface SetUPhoneCallbackResponse {} + /** * SetUPhoneConfig - 设置云手机画面参数(分辨率、DPI、帧率、码率) */ @@ -2167,7 +2802,7 @@ export interface SetUPhoneConfigRequest { */ CityId: string; /** - * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重启的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; /** @@ -2179,7 +2814,7 @@ export interface SetUPhoneConfigRequest { */ Refresh?: string; /** - * 云手机画面传输码率(例,8000)取值范围[100,5000] + * 云手机画面传输码率(例,8000)取值范围[100,50000] */ Bitrate?: string; /** @@ -2190,6 +2825,10 @@ export interface SetUPhoneConfigRequest { * 云手机dpi,取值范围[100,1000] */ Dpi?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2248,6 +2887,10 @@ export interface SetUPhoneGPSRequest { */ Altitude?: number; }[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2276,6 +2919,10 @@ export interface SetUPhoneManagerModeRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2283,6 +2930,38 @@ export interface SetUPhoneManagerModeRequest { */ export interface SetUPhoneManagerModeResponse {} +/** + * SetUPhoneRootMode - 设置云手机Root模式 + */ +export interface SetUPhoneRootModeRequest { + /** + * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + */ + CityId: string; + /** + * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望重启的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 + */ + UPhoneIds: string[]; + /** + * true则打开Root权限;false则关闭Root权限 + */ + Root: boolean; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; +} + +/** + * SetUPhoneRootMode - 设置云手机Root模式 + */ +export interface SetUPhoneRootModeResponse { + /** + * 异步请求成功后返回JobId,用以查询Job状态 + */ + JobId: string; +} + /** * SetUPhoneSplashScreen - 设置云手机启动画面,通过DescribeUPhone接口可以查询该地址 */ @@ -2299,6 +2978,10 @@ export interface SetUPhoneSplashScreenRequest { * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 */ CityId: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2315,13 +2998,17 @@ export interface SetUPhoneTokenRequest { */ UPhoneId: string; /** - * 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取 + * 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取 */ CityId: string; /** * RTC连接Token,为空表示清空Token */ Token?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2345,6 +3032,10 @@ export interface UnInstallUPhoneAppVersionRequest { * 【数组】云手机实例的资源 ID,调用方式举例:UPhoneIds.0=希望卸载应用的云手机实例 1 的 UPhoneId,UPhoneIds.1=云手机实例 2 的 UPhoneId。 */ UPhoneIds: string[]; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** @@ -2373,6 +3064,10 @@ export interface UpdateUPhoneImageRequest { * 镜像的描述信息。长度为2~256个英文或中文字符 */ Description?: string; + /** + * 枚举值。当前操作的产品类型,1、uphone:云手机场景;2、uphone-server:云手机服务器场景。默认云手机服务器场景。 + */ + ProductType?: string; } /** diff --git a/src/services/uvms/index.ts b/src/services/uvms/index.ts index 4eadd01..0dcfc43 100644 --- a/src/services/uvms/index.ts +++ b/src/services/uvms/index.ts @@ -36,10 +36,6 @@ export default class UVMSClient extends Client { * SendUVMSMessage - 向指定号码拨打电话 */ export interface SendUVMSMessageRequest { - /** - * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) - */ - Zone: string; /** * 被叫号码,采用 E.164 标准,格式为+[国家代码][用户号码]。例如:+8613512345678, 其中前面有一个+号 ,86为国家码,13512345678为手机号 */ diff --git a/src/services/vpc/index.ts b/src/services/vpc/index.ts index 75bb1a3..757f6fc 100644 --- a/src/services/vpc/index.ts +++ b/src/services/vpc/index.ts @@ -57,6 +57,20 @@ export default class VPCClient extends Client { ); } + /** + * AllocateBatchSecondaryIp - 批量申请虚拟网卡辅助IP + * + * See also: https://docs.ucloud.cn/api/vpc2.0-api/allocate_batch_secondary_ip + */ + allocateBatchSecondaryIp( + request?: AllocateBatchSecondaryIpRequest + ): Promise { + const args = { Action: 'AllocateBatchSecondaryIp', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as AllocateBatchSecondaryIpResponse + ); + } + /** * AllocateSecondaryIp - 分配ip(用于uk8s使用) * @@ -179,6 +193,20 @@ export default class VPCClient extends Client { ); } + /** + * CreateNetworkInterface - 创建虚拟网卡 + * + * See also: https://docs.ucloud.cn/api/vpc2.0-api/create_network_interface + */ + createNetworkInterface( + request?: CreateNetworkInterfaceRequest + ): Promise { + const args = { Action: 'CreateNetworkInterface', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as CreateNetworkInterfaceResponse + ); + } + /** * CreateRouteTable - 创建路由表 * @@ -1017,6 +1045,88 @@ export interface AddWhiteListResourceRequest { */ export interface AddWhiteListResourceResponse {} +/** + * AllocateBatchSecondaryIp - 批量申请虚拟网卡辅助IP + */ +export interface AllocateBatchSecondaryIpRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 节点mac + */ + Mac: string; + /** + * 资源Id + */ + ObjectId: string; + /** + * 子网Id(若未指定,则根据zone获取默认子网进行创建) + */ + SubnetId?: string; + /** + * vpcId + */ + VPCId?: string; + /** + * 【arry】支持按如下方式申请:①按网段:如192.168.1.32/27,掩码数字最小为27   ②指定IP地址,如192.168.1.3 + */ + Ip?: string[]; + /** + * 申请的内网IP数量 + */ + Count?: number; +} + +/** + * AllocateBatchSecondaryIp - 批量申请虚拟网卡辅助IP + */ +export interface AllocateBatchSecondaryIpResponse { + /** + * 详见IpsInfo + */ + IpsInfo: { + /** + * 内网IP地址 + */ + Ip?: string; + /** + * 掩码 + */ + Mask?: string; + /** + * 网关 + */ + Gateway?: string; + /** + * MAC地址 + */ + Mac?: string; + /** + * 子网资源ID + */ + SubnetId?: string; + /** + * VPC资源ID + */ + VPCId?: string; + /** + * IP分配结果,详见StatusInfo + */ + Status?: { + /** + * 枚举值:Succeeded,Failed + */ + StatusCode?: string; + /** + * IP分配失败原因 + */ + Message?: string; + }; + }[]; +} + /** * AllocateSecondaryIp - 分配ip(用于uk8s使用) */ @@ -1411,6 +1521,107 @@ export interface CreateNetworkAclEntryResponse { EntryId: string; } +/** + * CreateNetworkInterface - 创建虚拟网卡 + */ +export interface CreateNetworkInterfaceRequest { + /** + * 所属VPCID + */ + VPCId: string; + /** + * 所属子网ID + */ + SubnetId: string; + /** + * 虚拟网卡名称,默认为 NetworkInterface + */ + Name?: string; + /** + * 指定内网IP。当前一个网卡仅支持绑定一个内网IP + */ + PrivateIp?: string[]; + /** + * 防火墙GroupId,默认:Web推荐防火墙 可由DescribeSecurityGroupResponse中的GroupId取得 + */ + SecurityGroupId?: string; + /** + * 业务组 + */ + Tag?: string; + /** + * 备注 + */ + Remark?: string; +} + +/** + * CreateNetworkInterface - 创建虚拟网卡 + */ +export interface CreateNetworkInterfaceResponse { + /** + * 若创建成功,则返回虚拟网卡信息。创建失败,无此参数 + */ + NetworkInterface?: { + /** + * 虚拟网卡资源ID + */ + InterfaceId: string; + /** + * 所属VPC + */ + VPCId: string; + /** + * 所属子网 + */ + SubnetId: string; + /** + * 关联内网IP。当前一个网卡仅支持绑定一个内网IP + */ + PrivateIpSet: string[]; + /** + * 关联Mac + */ + MacAddress: string; + /** + * 绑定状态 + */ + Status: number; + /** + * 虚拟网卡名称 + */ + Name?: string; + /** + * 内网IP掩码 + */ + Netmask?: string; + /** + * 默认网关 + */ + Gateway?: string; + /** + * 绑定实例资源ID + */ + AttachInstanceId?: string; + /** + * 是否是绑定实例的默认网卡 false:不是 true:是 + */ + Default?: boolean; + /** + * 创建时间 + */ + CreateTime?: number; + /** + * 备注 + */ + Remark?: string; + /** + * 业务组 + */ + Tag?: string; + }; +} + /** * CreateRouteTable - 创建路由表 */ @@ -1874,10 +2085,6 @@ export interface DescribeInstanceNetworkInterfaceResponse { * 绑定状态 */ Status: number; - /** - * 网卡的内网IP信息 - */ - PrivateIp: string[]; /** * 虚拟网卡名称 */ @@ -1918,10 +2125,6 @@ export interface DescribeInstanceNetworkInterfaceResponse { * 虚拟网卡绑定的防火墙ID信息 */ FirewallIdSet?: string[]; - /** - * 网卡的内网IP配额信息 - */ - PrivateIplimit?: string[]; }[]; } @@ -1958,35 +2161,35 @@ export interface DescribeNATGWResponse { /** * natgw id */ - NATGWId?: string; + NATGWId: string; /** * natgw名称 */ - NATGWName?: string; + NATGWName: string; /** * 业务组 */ - Tag?: string; + Tag: string; /** * 备注 */ - Remark?: string; + Remark: string; /** * natgw创建时间 */ - CreateTime?: number; + CreateTime: number; /** * 绑定的防火墙Id */ - FirewallId?: string; + FirewallId: string; /** * 所属VPC Id */ - VPCId?: string; + VPCId: string; /** * 子网 Id */ - SubnetSet?: { + SubnetSet: { /** * 子网id */ @@ -2003,7 +2206,7 @@ export interface DescribeNATGWResponse { /** * 绑定的EIP 信息 */ - IPSet?: { + IPSet: { /** * 外网IP的 EIPId */ @@ -2037,15 +2240,15 @@ export interface DescribeNATGWResponse { /** * VPC名称 */ - VPCName?: string; + VPCName: string; /** * 枚举值,“enable”,默认出口规则使用了负载均衡;“disable”,默认出口规则未使用负载均衡。 */ - IsSnatpoolEnabled?: string; + IsSnatpoolEnabled: string; /** * 转发策略Id */ - PolicyId?: string[]; + PolicyId: string[]; }[]; } @@ -2535,7 +2738,16 @@ export interface DescribeNetworkInterfaceResponse { /** * 网卡的内网IP信息 */ - PrivateIp: string[]; + PrivateIp?: { + /** + * ip类型 SecondaryIp/PrimaryIp + */ + IpType?: string; + /** + * ip 地址 + */ + IpAddr?: string[]; + }[]; /** * 虚拟网卡名称 */ @@ -2579,7 +2791,16 @@ export interface DescribeNetworkInterfaceResponse { /** * 网卡的内网IP配额信息 */ - PrivateIplimit?: string[]; + PrivateIpLimit?: { + /** + * 网卡拥有的内网IP数量 + */ + PrivateIpCount?: number; + /** + * 网卡内网IP配额 + */ + PrivateIpQuota?: number; + }; }[]; /** * 虚拟网卡总数 @@ -2611,6 +2832,14 @@ export interface DescribeRouteTableRequest { * 业务组ID */ BusinessId?: string; + /** + * 默认为 false, 返回详细路由规则信息 + */ + Brief?: boolean; + /** + * 默认为 false, 表示路由表是短 ID + */ + LongId?: string; } /** @@ -2633,6 +2862,10 @@ export interface DescribeRouteTableResponse { * 绑定该路由表的子网数量 */ SubnetCount?: number; + /** + * 绑定该路由表的子网 + */ + SubnetIds?: string[]; /** * 路由表所属的VPC资源ID */ @@ -2677,6 +2910,10 @@ export interface DescribeRouteTableResponse { * 路由表下一跳类型。LOCAL,本VPC内部通信路由;PUBLIC,公共服务路由;CNAT,外网路由;UDPN,跨域高速通道路由;HYBRIDGW,混合云路由;INSTANCE,实例路由;VNET,VPC联通路由;IPSEC VPN,指向VPN网关的路由。 */ NexthopType?: string; + /** + * 实例类型,枚举值:UHOST,云主机;UNI,虚拟网卡;PHOST,物理云主机 + */ + InstanceType?: string; /** * 保留字段,暂未使用 */