From 4cdc607e2729a0c1080c4355c475787c7e6b42c9 Mon Sep 17 00:00:00 2001 From: ucloud-bot Date: Thu, 23 Apr 2026 06:19:20 +0000 Subject: [PATCH] sdk: rolling update for 0.2.8 --- VERSION | 2 +- lib/services/index.d.ts | 4 + lib/services/index.js | 28 + lib/services/uclickhouse/index.d.ts | 877 +++++++++++++++++++++++++ lib/services/uclickhouse/index.js | 88 +++ lib/services/ues/index.d.ts | 635 ++++++++++++++++++ lib/services/ues/index.js | 106 +++ lib/services/uhadoop/index.d.ts | 771 ++++++++++++++++++++++ lib/services/uhadoop/index.js | 115 ++++ lib/services/ukafka/index.d.ts | 797 +++++++++++++++++++++++ lib/services/ukafka/index.js | 133 ++++ package-lock.json | 2 +- package.json | 2 +- src/services/index.ts | 32 + src/services/uclickhouse/index.ts | 964 ++++++++++++++++++++++++++++ src/services/ues/index.ts | 738 +++++++++++++++++++++ src/services/uhadoop/index.ts | 887 +++++++++++++++++++++++++ src/services/ukafka/index.ts | 930 +++++++++++++++++++++++++++ 18 files changed, 7108 insertions(+), 3 deletions(-) create mode 100644 lib/services/uclickhouse/index.d.ts create mode 100644 lib/services/uclickhouse/index.js create mode 100644 lib/services/ues/index.d.ts create mode 100644 lib/services/ues/index.js create mode 100644 lib/services/uhadoop/index.d.ts create mode 100644 lib/services/uhadoop/index.js create mode 100644 lib/services/ukafka/index.d.ts create mode 100644 lib/services/ukafka/index.js create mode 100644 src/services/uclickhouse/index.ts create mode 100644 src/services/ues/index.ts create mode 100644 src/services/uhadoop/index.ts create mode 100644 src/services/ukafka/index.ts diff --git a/VERSION b/VERSION index b003284..a45be46 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.7 +0.2.8 diff --git a/lib/services/index.d.ts b/lib/services/index.d.ts index af44929..72bf5e6 100644 --- a/lib/services/index.d.ts +++ b/lib/services/index.d.ts @@ -12,16 +12,20 @@ export declare class Client extends BaseClient { uaccount(): any; ubill(): any; ucdn(): any; + uclickhouse(): any; udb(): any; uddb(): any; udisk(): any; udns(): any; udpn(): any; uec(): any; + ues(): any; ufile(): any; ufs(): any; + uhadoop(): any; uhost(): any; uk8s(): any; + ukafka(): any; ulb(): any; ulight_host(): any; umem(): any; diff --git a/lib/services/index.js b/lib/services/index.js index bff710e..11ebdde 100644 --- a/lib/services/index.js +++ b/lib/services/index.js @@ -8,16 +8,20 @@ const PathXClient = require('./pathx').default; const UAccountClient = require('./uaccount').default; const UBillClient = require('./ubill').default; const UCDNClient = require('./ucdn').default; +const UClickhouseClient = require('./uclickhouse').default; const UDBClient = require('./udb').default; const UDDBClient = require('./uddb').default; const UDiskClient = require('./udisk').default; const UDNSClient = require('./udns').default; const UDPNClient = require('./udpn').default; const UECClient = require('./uec').default; +const UESClient = require('./ues').default; const UFileClient = require('./ufile').default; const UFSClient = require('./ufs').default; +const UHadoopClient = require('./uhadoop').default; const UHostClient = require('./uhost').default; const UK8SClient = require('./uk8s').default; +const UKafkaClient = require('./ukafka').default; const ULBClient = require('./ulb').default; const ULightHostClient = require('./ulight_host').default; const UMemClient = require('./umem').default; @@ -68,6 +72,12 @@ class Client extends BaseClient { credential: this.credential, }); } + uclickhouse() { + return new UClickhouseClient({ + config: this.config, + credential: this.credential, + }); + } udb() { return new UDBClient({ config: this.config, @@ -104,6 +114,12 @@ class Client extends BaseClient { credential: this.credential, }); } + ues() { + return new UESClient({ + config: this.config, + credential: this.credential, + }); + } ufile() { return new UFileClient({ config: this.config, @@ -116,6 +132,12 @@ class Client extends BaseClient { credential: this.credential, }); } + uhadoop() { + return new UHadoopClient({ + config: this.config, + credential: this.credential, + }); + } uhost() { return new UHostClient({ config: this.config, @@ -128,6 +150,12 @@ class Client extends BaseClient { credential: this.credential, }); } + ukafka() { + return new UKafkaClient({ + config: this.config, + credential: this.credential, + }); + } ulb() { return new ULBClient({ config: this.config, diff --git a/lib/services/uclickhouse/index.d.ts b/lib/services/uclickhouse/index.d.ts new file mode 100644 index 0000000..8d7ddad --- /dev/null +++ b/lib/services/uclickhouse/index.d.ts @@ -0,0 +1,877 @@ +import Client from '../../core/client'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; +/** + * This client is used to call actions of **uclickhouse** service + */ +export default class UClickhouseClient extends Client { + constructor({ config, credential, }: { + config: ConfigOptions; + credential: CredentialOptions; + }); + /** + * CreateUClickhouseCluster - 创建UClickhouse集群 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/create_u_clickhouse_cluster + */ + createUClickhouseCluster(request?: CreateUClickhouseClusterRequest): Promise; + /** + * DescribeUClickhouseCluster - 获取集群信息 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/describe_u_clickhouse_cluster + */ + describeUClickhouseCluster(request?: DescribeUClickhouseClusterRequest): Promise; + /** + * DestroyUClickhouseCluster - 删除CK集群 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/destroy_u_clickhouse_cluster + */ + destroyUClickhouseCluster(request?: DestroyUClickhouseClusterRequest): Promise; + /** + * ExpandUClickhouseCluster - 集群水平扩容 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/expand_u_clickhouse_cluster + */ + expandUClickhouseCluster(request?: ExpandUClickhouseClusterRequest): Promise; + /** + * GetUClickhouseClusterCreateOption - 获取Clickhouse的创建配置项 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/get_u_clickhouse_cluster_create_option + */ + getUClickhouseClusterCreateOption(request?: GetUClickhouseClusterCreateOptionRequest): Promise; + /** + * ListUClickhouseCluster - 获取UClickhouse集群列表 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/list_u_clickhouse_cluster + */ + listUClickhouseCluster(request?: ListUClickhouseClusterRequest): Promise; + /** + * ResizeUClickhouseCluster - 集群改配 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/resize_u_clickhouse_cluster + */ + resizeUClickhouseCluster(request?: ResizeUClickhouseClusterRequest): Promise; + /** + * RestartUClickhouseClusterService - 重启集群的UClickhouse服务 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/restart_u_clickhouse_cluster_service + */ + restartUClickhouseClusterService(request?: RestartUClickhouseClusterServiceRequest): Promise; +} +/** + * CreateUClickhouseCluster - 创建UClickhouse集群 + */ +export interface CreateUClickhouseClusterRequest { + /** + * 集群机型,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + ClickhouseMachineTypeId: string; + /** + * 数据盘类型,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + DataDiskType: string; + /** + * Clickhouse版本,可通过GetUClickhouseClusterCreateOption接口获取具体版本 + */ + ClickhouseVersion: string; + /** + * VPC ID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群管理员密码,密码规则:1.密码长度限8-32个字符2.不能包含[A-Z],[a-z],[0-9]和[@#%^*+=_;:,?!&()-]之外的字符3.需要同时包含两项或以上(大写字母/小写字母/数字/特殊符号) + */ + AdminPassword: string; + /** + * 分片数量,若传递,则至少1个分片,默认值为1 + */ + ShardCount?: number; + /** + * 副本数量,取值为1或2,1为单副本(非高可用),2为双副本(高可用),默认值为高可用(即为2) + */ + ReplicateCount?: number; + /** + * 数据盘大小,最小100,步长为50,默认值为100,单位GB + */ + DataDiskSize?: number; + /** + * 付费类型,枚举值:Year(年付),Month(月付),Dynamic(时付),默认值为Month,月付 + */ + ChargeType?: string; + /** + * 购买时长,默认值为1。月付时,此参数传0,代表购买至月末 + */ + Quantity?: number; + /** + * 备份任务ID,从备份恢复时,该字段必传,此值为备份任务ID,可以从原集群备份任务列表(ListUClickhouseBackups)获取 + */ + BackupId?: string; + /** + * 实例名称名称规则:1.长度为1-50位的字符2.不能包含_,中文,[A-Z],[a-z],[0-9]之外的非法字符,集群名称默认为clickhouse + */ + ClusterName?: string; + /** + * 是否Zookeeper高可用,true为zookeeper高可用,false为非高可用,默认为true,高可用 + */ + IsZookeeperHA?: boolean; + /** + * 是否开启安全组,true为开启,false为不开启,默认为false,不开启安全组 + */ + IsSecGroup?: string; + /** + * 是否多可用区,默认为false + */ + IsMultiZone?: string; + /** + * Zookeeper机型ID,IsZookeeperHA为true时,必传,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + ZookeeperMachineTypeId?: string; + /** + * Zookeeper数据盘类型,IsZookeeperHA为true时,必传,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + ZookeeperDataDiskType?: string; + /** + * Zookeeper数据盘大小,IsZookeeperHA为true时,必传,最小100,步长为50 + */ + ZookeeperDataDiskSize?: string; + /** + * 安全组ID,IsSecGroup为true时,必传 + */ + SecGroupIds?: string; + /** + * 【数组】可用区名称,IsMultiZone为true时,必传,可通过ListUClickhouseAvailableZone获取支持的可用区 + */ + MultiZones?: string[]; + /** + * + */ + Labels?: { + /** + * 标签的key + */ + Key?: string; + /** + * 标签的value + */ + Value?: string; + }[]; +} +/** + * CreateUClickhouseCluster - 创建UClickhouse集群 + */ +export interface CreateUClickhouseClusterResponse { + /** + * 返回数据 + */ + Data: { + /** + * 集群ID + */ + ClusterId: string; + }; +} +/** + * DescribeUClickhouseCluster - 获取集群信息 + */ +export interface DescribeUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; +} +/** + * DescribeUClickhouseCluster - 获取集群信息 + */ +export interface DescribeUClickhouseClusterResponse { + /** + * 返回数据 + */ + Data: { + /** + * Zookeeper节点列表,为空时,说明该集群没有zookeeper集群 + */ + ZookeeperNodes: { + /** + * 可用区名称 + */ + Zone: string; + /** + * 节点ID + */ + NodeId: string; + /** + * 集群ID + */ + ClusterId: string; + /** + * 节点名称 + */ + NodeName: string; + /** + * CPU + */ + CPU: number; + /** + * 内存 + */ + Memory: number; + /** + * 系统盘大小 + */ + SysDiskSize: number; + /** + * 系统盘类型 + */ + SysDiskType: string; + /** + * 数据盘大小 + */ + DataDiskSize: number; + /** + * 数据盘类型 + */ + DataDiskType: string; + /** + * 创建时间 + */ + CreateTimestamp: number; + /** + * 机型 + */ + MachineType: string; + /** + * zookeeper的myid + */ + ZookeeperMyId: string; + /** + * 服务状态:RUNNING(运行中)、STARTING(启动中)、STOPPED(已停止)、RESTARTING(重启中) + */ + ServiceStatus: string; + /** + * 资源ID + */ + ResourceId: string; + }[]; + /** + * Clickhouse节点列表 + */ + ClickhouseNodes: { + /** + * 可用区名称 + */ + Zone: string; + /** + * 节点ID + */ + NodeId: string; + /** + * 集群ID + */ + ClusterId: string; + /** + * 节点名称 + */ + NodeName: string; + /** + * CPU大小 + */ + CPU: number; + /** + * 内存,GB + */ + Memory: number; + /** + * 系统盘大小,GB + */ + SysDiskSize: number; + /** + * 系统盘类型 + */ + SysDiskType: string; + /** + * 数据盘大小,GB + */ + DataDiskSize: number; + /** + * 数据盘类型 + */ + DataDiskType: string; + /** + * ipv4 + */ + IPv4: string; + /** + * 创建时间 + */ + CreateTimestamp: number; + /** + * 机型 + */ + MachineType: string; + /** + * 分片组 + */ + ShardGroup: string; + /** + * 服务状态:RUNNING(运行中)、STARTING(启动中)、STOPPED(已停止)、RESTARTING(重启中) + */ + ServiceStatus: string; + /** + * 资源ID + */ + ResourceId: string; + }[]; + /** + * 支付信息 + */ + Payment: { + /** + * 创建时间 + */ + CreateTimestamp: number; + /** + * 过期时间 + */ + ExpireTimestamp: number; + /** + * 支付类型 + */ + ChargeType: string; + /** + * 价格 + */ + Price: number; + /** + * 原始价格 + */ + OriginalPrice: number; + /** + * 资源ID + */ + ResourceId: string; + }; + /** + * 集群信息 + */ + Cluster: { + /** + * 集群ID + */ + ClusterId: string; + /** + * 公司ID + */ + TopOrganizationId: number; + /** + * 项目ID + */ + OrganizationId: number; + /** + * 集群名称 + */ + ClusterName: string; + /** + * VPCID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群版本 + */ + ClickhouseVersion: string; + /** + * Zookeeper版本 + */ + ZookeeperVersion: string; + /** + * 机型 + */ + MachineType: string; + /** + * 集群状态:CREATING(创建中)、RUNNING(运行中)、RESIZING(变配中)、RESTARTING(重启中)、UPGRADING(升级中)、DESTROYING(销毁中)、DESTROYED(已删除)、CREATE_FAILED(创建失败)、RESTART_FAILED(重启失败)、DESTROY_FAILED(删除失败)、RESIZE_FAILED(变配失败)、BACKUP_RESTORING(备份恢复中)、BACKUP_RESTORE_FAILED(备份恢复失败)、EXPANDING(扩容中)、EXPAND_FAILED(扩容失败) + */ + Status: string; + /** + * 分片数 + */ + ShardCount: number; + /** + * 副本数 + */ + ReplicateCount: number; + /** + * 集群创建时间 + */ + CreateTimestamp: number; + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * Clickhouse机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * 地域ID + */ + RegionId: number; + /** + * Zookeeper机型ID + */ + ZookeeperMachineTypeId: string; + /** + * Zookeeper机型名称 + */ + ZookeeperMachineTypeName: string; + /** + * Clickhouse数据盘类型 + */ + ClickhouseDataDiskType: string; + /** + * Clickhouse数据盘大小 + */ + ClickhouseDataDiskSize: number; + /** + * Zookeeper数据盘类型 + */ + ZookeeperDataDiskType: string; + /** + * Zookeeper数据盘大小 + */ + ZookeeperDataDiskSize: number; + /** + * Clickhouse节点CPU + */ + ClickhouseNodeCPU: number; + /** + * Clickhouse内存 + */ + ClickhouseNodeMemory: number; + /** + * Zookeeper节点CPU + */ + ZookeeperNodeCPU: number; + /** + * Zookeeper节点内存 + */ + ZookeeperNodeMemory: number; + /** + * Zookeeper是否高可用 + */ + IsZookeeperHA: string; + /** + * 实例是否开启安全组 + */ + IsSecgroup: string; + /** + * 实例是否开启备份 + */ + IsBackup: string; + /** + * 实例是否开启冷热分层 + */ + IsTieredStorage: string; + /** + * 实例所在可用区 + */ + MultiZones: string[]; + /** + * 实例过期时间 + */ + ExpireTimestamp: number; + }; + }; +} +/** + * DestroyUClickhouseCluster - 删除CK集群 + */ +export interface DestroyUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; +} +/** + * DestroyUClickhouseCluster - 删除CK集群 + */ +export interface DestroyUClickhouseClusterResponse { +} +/** + * ExpandUClickhouseCluster - 集群水平扩容 + */ +export interface ExpandUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; + /** + * 扩容后集群的节点数量,集群为高可用时,需要传入偶数个节点 + */ + TotalNodeCount: number; + /** + * 水平扩容时,选择某一个原节点的ID,用于同步表结构/用户信息。不传递时,表示不同步表结构/用户信息,仅水平扩容节点数量 + */ + SyncNodeId?: string; +} +/** + * ExpandUClickhouseCluster - 集群水平扩容 + */ +export interface ExpandUClickhouseClusterResponse { +} +/** + * GetUClickhouseClusterCreateOption - 获取Clickhouse的创建配置项 + */ +export interface GetUClickhouseClusterCreateOptionRequest { +} +/** + * GetUClickhouseClusterCreateOption - 获取Clickhouse的创建配置项 + */ +export interface GetUClickhouseClusterCreateOptionResponse { + /** + * 数据 + */ + Data: { + /** + * 支持的CK版本 + */ + ClickhouseVersions: { + /** + * 版本号 + */ + Version: string; + /** + * 版本名称 + */ + VersionName: string; + }[]; + /** + * 支持的CK机型 + */ + ClickhouseMachineTypes: { + /** + * CK机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * CK机型可选项 + */ + ClickhouseMachineTypeOptions: { + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * 机型 + */ + MachineType: string; + /** + * CPU大小 + */ + CPU: number; + /** + * 内存大小,GB + */ + Memory: number; + /** + * 数据盘列表 + */ + DataDisks: { + /** + * 磁盘类型 + */ + DiskType: string; + /** + * 最小值,GB + */ + MinDiskSize: number; + /** + * 最大值,GB + */ + MaxDiskSize: number; + /** + * 默认大小,GB + */ + DefaultDataDiskSize: number; + /** + * 步长,GB + */ + Step: number; + }[]; + /** + * 允许创建的节点个数 + */ + NodeCounts: number[]; + }[]; + /** + * 机型是否支持安全组 + */ + IsSecgroupMachineType: string; + }[]; + /** + * 实例可创建的最大节点数量 + */ + MaxNodeCount: number; + /** + * 支持的Zookeeper机型 + */ + ZookeeperMachineTypes: { + /** + * CK机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * CK机型可选项 + */ + ClickhouseMachineTypeOptions: { + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * 机型 + */ + MachineType: string; + /** + * CPU大小 + */ + CPU: number; + /** + * 内存大小,GB + */ + Memory: number; + /** + * 数据盘列表 + */ + DataDisks: { + /** + * 磁盘类型 + */ + DiskType: string; + /** + * 最小值,GB + */ + MinDiskSize: number; + /** + * 最大值,GB + */ + MaxDiskSize: number; + /** + * 默认大小,GB + */ + DefaultDataDiskSize: number; + /** + * 步长,GB + */ + Step: number; + }[]; + /** + * 允许创建的节点个数 + */ + NodeCounts: number[]; + }[]; + /** + * 机型是否支持安全组 + */ + IsSecgroupMachineType: string; + }[]; + }; +} +/** + * ListUClickhouseCluster - 获取UClickhouse集群列表 + */ +export interface ListUClickhouseClusterRequest { +} +/** + * ListUClickhouseCluster - 获取UClickhouse集群列表 + */ +export interface ListUClickhouseClusterResponse { + /** + * 返回数据 + */ + Data: { + /** + * 集群列表 + */ + Clusters: { + /** + * 集群ID + */ + ClusterId: string; + /** + * 公司ID + */ + TopOrganizationId: number; + /** + * 项目ID + */ + OrganizationId: number; + /** + * 集群名称 + */ + ClusterName: string; + /** + * VPCID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群版本 + */ + ClickhouseVersion: string; + /** + * Zookeeper版本 + */ + ZookeeperVersion: string; + /** + * 机型 + */ + MachineType: string; + /** + * 集群状态:CREATING(创建中)、RUNNING(运行中)、RESIZING(变配中)、RESTARTING(重启中)、UPGRADING(升级中)、DESTROYING(销毁中)、DESTROYED(已删除)、CREATE_FAILED(创建失败)、RESTART_FAILED(重启失败)、DESTROY_FAILED(删除失败)、RESIZE_FAILED(变配失败)、BACKUP_RESTORING(备份恢复中)、BACKUP_RESTORE_FAILED(备份恢复失败)、EXPANDING(扩容中)、EXPAND_FAILED(扩容失败) + */ + Status: string; + /** + * 分片数 + */ + ShardCount: number; + /** + * 副本数 + */ + ReplicateCount: number; + /** + * 集群创建时间 + */ + CreateTimestamp: number; + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * Clickhouse机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * 地域ID + */ + RegionId: number; + /** + * Zookeeper机型ID + */ + ZookeeperMachineTypeId: string; + /** + * Zookeeper机型名称 + */ + ZookeeperMachineTypeName: string; + /** + * Clickhouse数据盘类型 + */ + ClickhouseDataDiskType: string; + /** + * Clickhouse数据盘大小 + */ + ClickhouseDataDiskSize: number; + /** + * Zookeeper数据盘类型 + */ + ZookeeperDataDiskType: string; + /** + * Zookeeper数据盘大小 + */ + ZookeeperDataDiskSize: number; + /** + * Clickhouse节点CPU + */ + ClickhouseNodeCPU: number; + /** + * Clickhouse内存 + */ + ClickhouseNodeMemory: number; + /** + * Zookeeper节点CPU + */ + ZookeeperNodeCPU: number; + /** + * Zookeeper节点内存 + */ + ZookeeperNodeMemory: number; + /** + * Zookeeper是否高可用 + */ + IsZookeeperHA: string; + /** + * 实例是否开启安全组 + */ + IsSecgroup: string; + /** + * 实例是否开启备份 + */ + IsBackup: string; + /** + * 实例是否开启冷热分层 + */ + IsTieredStorage: string; + /** + * 实例所在可用区 + */ + MultiZones: string[]; + /** + * 实例过期时间 + */ + ExpireTimestamp: number; + }; + /** + * 集群总数 + */ + TotalCount: number; + }; +} +/** + * ResizeUClickhouseCluster - 集群改配 + */ +export interface ResizeUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; + /** + * 目标机型ID,可通过GetUClickhouseClusterCreateOption接口获取具体值,与TargetDataDiskSize不能同时为空 + */ + TargetMachineTypeId?: string; + /** + * 目标磁盘大小,单位GB,只能扩容,与TargetMachineTypeId不能同时为空 + */ + TargetDataDiskSize?: number; + /** + * 是否为zookeeper节点,为true时表示升级zookeeper节点规格,为false时表示升级clickhouse节点规格,默认为false + */ + IsZooKeeperNode?: boolean; +} +/** + * ResizeUClickhouseCluster - 集群改配 + */ +export interface ResizeUClickhouseClusterResponse { +} +/** + * RestartUClickhouseClusterService - 重启集群的UClickhouse服务 + */ +export interface RestartUClickhouseClusterServiceRequest { + /** + * 集群ID + */ + ClusterId: string; +} +/** + * RestartUClickhouseClusterService - 重启集群的UClickhouse服务 + */ +export interface RestartUClickhouseClusterServiceResponse { +} diff --git a/lib/services/uclickhouse/index.js b/lib/services/uclickhouse/index.js new file mode 100644 index 0000000..efdc759 --- /dev/null +++ b/lib/services/uclickhouse/index.js @@ -0,0 +1,88 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const client_1 = __importDefault(require("../../core/client")); +const request_1 = __importDefault(require("../../core/request")); +/** + * This client is used to call actions of **uclickhouse** service + */ +class UClickhouseClient extends client_1.default { + constructor({ config, credential, }) { + super({ config, credential }); + } + /** + * CreateUClickhouseCluster - 创建UClickhouse集群 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/create_u_clickhouse_cluster + */ + createUClickhouseCluster(request) { + const args = Object.assign({ Action: 'CreateUClickhouseCluster' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DescribeUClickhouseCluster - 获取集群信息 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/describe_u_clickhouse_cluster + */ + describeUClickhouseCluster(request) { + const args = Object.assign({ Action: 'DescribeUClickhouseCluster' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DestroyUClickhouseCluster - 删除CK集群 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/destroy_u_clickhouse_cluster + */ + destroyUClickhouseCluster(request) { + const args = Object.assign({ Action: 'DestroyUClickhouseCluster' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ExpandUClickhouseCluster - 集群水平扩容 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/expand_u_clickhouse_cluster + */ + expandUClickhouseCluster(request) { + const args = Object.assign({ Action: 'ExpandUClickhouseCluster' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUClickhouseClusterCreateOption - 获取Clickhouse的创建配置项 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/get_u_clickhouse_cluster_create_option + */ + getUClickhouseClusterCreateOption(request) { + const args = Object.assign({ Action: 'GetUClickhouseClusterCreateOption' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUClickhouseCluster - 获取UClickhouse集群列表 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/list_u_clickhouse_cluster + */ + listUClickhouseCluster(request) { + const args = Object.assign({ Action: 'ListUClickhouseCluster' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ResizeUClickhouseCluster - 集群改配 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/resize_u_clickhouse_cluster + */ + resizeUClickhouseCluster(request) { + const args = Object.assign({ Action: 'ResizeUClickhouseCluster' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * RestartUClickhouseClusterService - 重启集群的UClickhouse服务 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/restart_u_clickhouse_cluster_service + */ + restartUClickhouseClusterService(request) { + const args = Object.assign({ Action: 'RestartUClickhouseClusterService' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } +} +exports.default = UClickhouseClient; diff --git a/lib/services/ues/index.d.ts b/lib/services/ues/index.d.ts new file mode 100644 index 0000000..eb851c6 --- /dev/null +++ b/lib/services/ues/index.d.ts @@ -0,0 +1,635 @@ +import Client from '../../core/client'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; +/** + * This client is used to call actions of **ues** service + */ +export default class UESClient extends Client { + constructor({ config, credential, }: { + config: ConfigOptions; + credential: CredentialOptions; + }); + /** + * CreateUESInstance - 创建实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/create_ues_instance + */ + createUESInstance(request?: CreateUESInstanceRequest): Promise; + /** + * DeleteUESInstance - 删除实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/delete_ues_instance + */ + deleteUESInstance(request?: DeleteUESInstanceRequest): Promise; + /** + * DescribeUESInstanceV2 - 查询指定实例详细信息 + * + * See also: https://docs.ucloud.cn/api/ues-api/describe_ues_instance_v2 + */ + describeUESInstanceV2(request?: DescribeUESInstanceV2Request): Promise; + /** + * ExpandUESInstance - 扩容实例节点 + * + * See also: https://docs.ucloud.cn/api/ues-api/expand_ues_instance + */ + expandUESInstance(request?: ExpandUESInstanceRequest): Promise; + /** + * GetUESAppVersion - 获取服务应用版本列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_app_version + */ + getUESAppVersion(request?: GetUESAppVersionRequest): Promise; + /** + * GetUESDiskSizeLimitation - 获取磁盘容量限制 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_disk_size_limitation + */ + getUESDiskSizeLimitation(request?: GetUESDiskSizeLimitationRequest): Promise; + /** + * GetUESNodeConf - 获取节点配置列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_node_conf + */ + getUESNodeConf(request?: GetUESNodeConfRequest): Promise; + /** + * ListUESInstance - 获取实例列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/list_ues_instance + */ + listUESInstance(request?: ListUESInstanceRequest): Promise; + /** + * ResizeUESInstance - 改配实例节点配置 + * + * See also: https://docs.ucloud.cn/api/ues-api/resize_ues_instance + */ + resizeUESInstance(request?: ResizeUESInstanceRequest): Promise; + /** + * RestartUESInstance - 重启实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/restart_ues_instance + */ + restartUESInstance(request?: RestartUESInstanceRequest): Promise; +} +/** + * CreateUESInstance - 创建实例 + */ +export interface CreateUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 节点配置标识, 支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf + */ + NodeConf: string; + /** + * VPCID标识 + */ + VPCId: string; + /** + * 子网ID标识 + */ + SubnetId: string; + /** + * Kibana节点配置, 支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf + */ + KibanaNodeConf: string; + /** + * Kibana节点磁盘类型 + */ + KibanaNodeDiskConf: string; + /** + * 应用服务版本号,支持的类型通过GetUESAppVersion AppVersionList[].AppVersion + */ + AppVersion: string; + /** + * 磁盘类型 + */ + NodeDiskConf: string; + /** + * 节点个数,默认数目为3 + */ + NodeSize?: number; + /** + * 节点磁盘大小,默认为100G + */ + NodeDiskSize?: number; + /** + * elasticsearch 服务用户名称,默认为elastic;OpenSearch 服务用户名称,固定为admin + */ + ServiceUserName?: string; + /** + * 服务用户密码,默认为changeme + */ + ServicePasswd?: string; + /** + * 应用名称,支持的类型通过GetUESAppVersion AppVersionList[].AppName, 默认为elasticsearch + */ + AppName?: string; + /** + * 备注,默认为空 + */ + Remark?: string; + /** + * 计费类型,默认为Month + */ + ChargeType?: string; + /** + * 计费长度,默认为1 + */ + Quantity?: number; + /** + * 主节点类型标示,支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf, 默认为空 + */ + MasterConf?: string; + /** + * 业务组ID标识 + */ + BusinessId?: string; + /** + * Coordinating节点机型配置,, 支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf, 默认为空 + */ + CoordinatingNodeConf?: string; + /** + * Coordinating节点数量 + */ + CoordinatingNodeSize?: number; + /** + * Coordinating节点磁盘类型 + */ + CoordinatingNodeDiskConf?: string; + /** + * 是否开启安全组,默认为false + */ + IsSecGroup?: boolean; + /** + * 安全组ID,开启安全组必填,至多可以同时绑定5个安全组 + */ + SecGroupIds?: string[]; + /** + * 是否为多可用区,默认为false + */ + IsMultiZone?: boolean; + /** + * 多可用区名称,默认空数组 [] + */ + MultiZones?: string[]; +} +/** + * CreateUESInstance - 创建实例 + */ +export interface CreateUESInstanceResponse { + /** + * 实例ID + */ + InstanceId?: string; +} +/** + * DeleteUESInstance - 删除实例 + */ +export interface DeleteUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; +} +/** + * DeleteUESInstance - 删除实例 + */ +export interface DeleteUESInstanceResponse { +} +/** + * DescribeUESInstanceV2 - 查询指定实例详细信息 + */ +export interface DescribeUESInstanceV2Request { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 集群实例ID + */ + InstanceId: string; +} +/** + * DescribeUESInstanceV2 - 查询指定实例详细信息 + */ +export interface DescribeUESInstanceV2Response { + /** + * 返回结果 + */ + Result?: { + /** + * + */ + RequestId?: string; + /** + * + */ + ClusterInfo?: { + /** + * 地域 + */ + Region?: string; + /** + * 可用区 + */ + Zone?: string; + /** + * 服务集群ID标识 + */ + UESInstanceId: string; + /** + * 服务集群名称 + */ + UESInstanceName: string; + /** + * 服务版本号 + */ + ServiceVersion: string; + /** + * VPCID标识 + */ + VPCId: string; + /** + * 服务集群状态 + */ + State: string; + /** + * 项目组ID标识 + */ + BusinessId?: string; + /** + * 子网ID标识 + */ + SubnetId?: string; + /** + * Vip + */ + Vip?: string; + }; + /** + * + */ + NodeInfoList?: { + /** + * 节点ID + */ + NodeId: string; + /** + * 节点名称 + */ + NodeName: string; + /** + * 节点类型 + */ + NodeRole: string; + /** + * 节点IP + */ + NodeIP: string; + /** + * 节点配置标识 + */ + NodeConf: string; + /** + * 节点状态 + */ + NodeState: string; + /** + * 节点磁盘类型 + */ + DiskType: string; + /** + * 节点磁盘大小 + */ + DiskSize: number; + /** + * 节点内存大小 + */ + Memory: number; + /** + * 节点cpu数量 + */ + CPU: number; + }[]; + }; +} +/** + * ExpandUESInstance - 扩容实例节点 + */ +export interface ExpandUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 扩容后对应类型节点的数目 + */ + NodeCount: number; + /** + * 节点类型(compute、coordinating) + */ + NodeRole: string; +} +/** + * ExpandUESInstance - 扩容实例节点 + */ +export interface ExpandUESInstanceResponse { +} +/** + * GetUESAppVersion - 获取服务应用版本列表 + */ +export interface GetUESAppVersionRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} +/** + * GetUESAppVersion - 获取服务应用版本列表 + */ +export interface GetUESAppVersionResponse { + /** + * 服务应用版本个数 + */ + TotalCount: number; + /** + * 服务应用版本列表 + */ + AppVersionList: { + /** + * 应用名称,默认值为elasticsearch + */ + AppName: string; + /** + * 应用版本号 + */ + AppVersion: string; + /** + * 是否支持多区部署,默认为false + */ + IsMultiZone: boolean; + }[]; +} +/** + * GetUESDiskSizeLimitation - 获取磁盘容量限制 + */ +export interface GetUESDiskSizeLimitationRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} +/** + * GetUESDiskSizeLimitation - 获取磁盘容量限制 + */ +export interface GetUESDiskSizeLimitationResponse { + /** + * 各磁盘类型容量限制列表 + */ + DiskSizeLimitationSet?: { + /** + * 数据盘类别,包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。 + */ + DiskType?: string; + /** + * 最大值,单位GB + */ + MaxSize?: number; + /** + * 最小值,单位GB + */ + MinSize?: number; + }[]; +} +/** + * GetUESNodeConf - 获取节点配置列表 + */ +export interface GetUESNodeConfRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} +/** + * GetUESNodeConf - 获取节点配置列表 + */ +export interface GetUESNodeConfResponse { + /** + * 所有节点配置信息的个数 + */ + TotalCount: number; + /** + * 服务节点配置信息列表 + */ + NodeConfList: { + /** + * 内存,单位为GB + */ + Memory: number; + /** + * CPU数量 + */ + CPU: number; + /** + * 节点配置标识 + */ + NodeConf: string; + /** + * 磁盘类型[RSSD|SSD] + */ + DiskType: string; + /** + * 磁盘大小,单位为GB + */ + DiskSize: number; + /** + * 是否支持安全组[true|false] + */ + IsSecGroup: boolean; + }[]; +} +/** + * ListUESInstance - 获取实例列表 + */ +export interface ListUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 数据偏移量, 默认为0 + */ + Offset?: number; + /** + * 返回数据长度, 默认为30 + */ + Limit?: number; +} +/** + * ListUESInstance - 获取实例列表 + */ +export interface ListUESInstanceResponse { + /** + * 实例信息列表 + */ + ClusterSet: { + /** + * 可用区 + */ + Zone: string; + /** + * 项目组ID标识 + */ + BusinessId: string; + /** + * 计费类型,默认为Month + */ + ChargeType: string; + /** + * 创建时间 + */ + CreateTime: number; + /** + * 失效时间 + */ + ExpireTime: number; + /** + * 节点个数,默认为集群大小 + */ + NodeCount: number; + /** + * 实例运行时长 + */ + RunTime: number; + /** + * 应用服务版本号 + */ + AppVersion: string; + /** + * 实例状态 + */ + State: string; + /** + * 实例资源ID + */ + InstanceId: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 应用名称 + */ + AppName: string; + /** + * 服务集群ID标识(弃用) + */ + UESInstanceId?: string; + /** + * 服务集群名称(弃用) + */ + UESInstanceName?: string; + /** + * 服务版本号(弃用) + */ + ServiceVersion?: string; + /** + * 子网ID标识 + */ + SubnetId?: string; + /** + * 业务组 + */ + Tag?: string; + /** + * VPCID标识 + */ + VPCId?: string; + /** + * VIP地址信息 + */ + Vip?: string; + /** + * 是否开启安全组 + */ + IsSecGroup?: boolean; + /** + * 多可用区 + */ + MultiZones?: string[]; + /** + * 是否支持改配 + */ + Resizable?: boolean; + }[]; + /** + * 实例个数 + */ + TotalCount: number; +} +/** + * ResizeUESInstance - 改配实例节点配置 + */ +export interface ResizeUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 节点类型(compute、master、coordinating、kibana、dashboard) + */ + NodeRole: string; + /** + * 改配节点类型,NodeDiskSize为0,基于NodeRole 进行改配 + */ + NodeConf?: string; + /** + * 改配节点磁盘大小,NodeConf 为空字符串,基于NodeRole 进行改配 + */ + NodeDiskSize?: number; + /** + * 进行改配操作是否强制检查集群健康状态,默认为false + */ + ForceResizing?: boolean; +} +/** + * ResizeUESInstance - 改配实例节点配置 + */ +export interface ResizeUESInstanceResponse { +} +/** + * RestartUESInstance - 重启实例 + */ +export interface RestartUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; +} +/** + * RestartUESInstance - 重启实例 + */ +export interface RestartUESInstanceResponse { +} diff --git a/lib/services/ues/index.js b/lib/services/ues/index.js new file mode 100644 index 0000000..6a3ed55 --- /dev/null +++ b/lib/services/ues/index.js @@ -0,0 +1,106 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const client_1 = __importDefault(require("../../core/client")); +const request_1 = __importDefault(require("../../core/request")); +/** + * This client is used to call actions of **ues** service + */ +class UESClient extends client_1.default { + constructor({ config, credential, }) { + super({ config, credential }); + } + /** + * CreateUESInstance - 创建实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/create_ues_instance + */ + createUESInstance(request) { + const args = Object.assign({ Action: 'CreateUESInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DeleteUESInstance - 删除实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/delete_ues_instance + */ + deleteUESInstance(request) { + const args = Object.assign({ Action: 'DeleteUESInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DescribeUESInstanceV2 - 查询指定实例详细信息 + * + * See also: https://docs.ucloud.cn/api/ues-api/describe_ues_instance_v2 + */ + describeUESInstanceV2(request) { + const args = Object.assign({ Action: 'DescribeUESInstanceV2' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ExpandUESInstance - 扩容实例节点 + * + * See also: https://docs.ucloud.cn/api/ues-api/expand_ues_instance + */ + expandUESInstance(request) { + const args = Object.assign({ Action: 'ExpandUESInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUESAppVersion - 获取服务应用版本列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_app_version + */ + getUESAppVersion(request) { + const args = Object.assign({ Action: 'GetUESAppVersion' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUESDiskSizeLimitation - 获取磁盘容量限制 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_disk_size_limitation + */ + getUESDiskSizeLimitation(request) { + const args = Object.assign({ Action: 'GetUESDiskSizeLimitation' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUESNodeConf - 获取节点配置列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_node_conf + */ + getUESNodeConf(request) { + const args = Object.assign({ Action: 'GetUESNodeConf' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUESInstance - 获取实例列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/list_ues_instance + */ + listUESInstance(request) { + const args = Object.assign({ Action: 'ListUESInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ResizeUESInstance - 改配实例节点配置 + * + * See also: https://docs.ucloud.cn/api/ues-api/resize_ues_instance + */ + resizeUESInstance(request) { + const args = Object.assign({ Action: 'ResizeUESInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * RestartUESInstance - 重启实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/restart_ues_instance + */ + restartUESInstance(request) { + const args = Object.assign({ Action: 'RestartUESInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } +} +exports.default = UESClient; diff --git a/lib/services/uhadoop/index.d.ts b/lib/services/uhadoop/index.d.ts new file mode 100644 index 0000000..0475d60 --- /dev/null +++ b/lib/services/uhadoop/index.d.ts @@ -0,0 +1,771 @@ +import Client from '../../core/client'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; +/** + * This client is used to call actions of **uhadoop** service + */ +export default class UHadoopClient extends Client { + constructor({ config, credential, }: { + config: ConfigOptions; + credential: CredentialOptions; + }); + /** + * AddUHadoopInstanceNode - 给已有集群添加一定数量的节点 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/add_uhadoop_instance_node + */ + addUHadoopInstanceNode(request?: AddUHadoopInstanceNodeRequest): Promise; + /** + * CreateUHadoopInstance - 新建一个uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/create_uhadoop_instance + */ + createUHadoopInstance(request?: CreateUHadoopInstanceRequest): Promise; + /** + * DeleteUHadoopInstance - 删除掉一个uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/delete_uhadoop_instance + */ + deleteUHadoopInstance(request?: DeleteUHadoopInstanceRequest): Promise; + /** + * DescribeUHadoopInstance - 描述集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/describe_uhadoop_instance + */ + describeUHadoopInstance(request?: DescribeUHadoopInstanceRequest): Promise; + /** + * GetUHadoopNodeType - 获取节点类型信息 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/get_uhadoop_node_type + */ + getUHadoopNodeType(request?: GetUHadoopNodeTypeRequest): Promise; + /** + * ListUHadoopFrameworkApp - 列举可选app + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_framework_app + */ + listUHadoopFrameworkApp(request?: ListUHadoopFrameworkAppRequest): Promise; + /** + * ListUHadoopFrameworkAppByUseCase - 按使用场景列出uhadoop的框架和框架中的应用 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_framework_app_by_use_case + */ + listUHadoopFrameworkAppByUseCase(request?: ListUHadoopFrameworkAppByUseCaseRequest): Promise; + /** + * ListUHadoopInstance - 列出用户所有的uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_instance + */ + listUHadoopInstance(request?: ListUHadoopInstanceRequest): Promise; + /** + * RestartUHadoopService - 重启集群服务(包含start|stop|restart) + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/restart_uhadoop_service + */ + restartUHadoopService(request?: RestartUHadoopServiceRequest): Promise; + /** + * UpgradeUHadoopNode - 升级uhadoop节点 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/upgrade_uhadoop_node + */ + upgradeUHadoopNode(request?: UpgradeUHadoopNodeRequest): Promise; + /** + * UpgradeUHadoopNodeDisk - 扩容集群节点磁盘 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/upgrade_uhadoop_node_disk + */ + upgradeUHadoopNodeDisk(request?: UpgradeUHadoopNodeDiskRequest): Promise; +} +/** + * AddUHadoopInstanceNode - 给已有集群添加一定数量的节点 + */ +export interface AddUHadoopInstanceNodeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 节点的角色,值为task|core|client之一 + */ + NodeRole: string; + /** + * 机型,如:o.hadoop2m.medium,可从GetUHadoopNodeType接口获取 + */ + NodeType: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 数据盘数量,非裸金属机型时必填 + */ + DataDiskNum?: string; + /** + * 密码,NodeRole为client时必填 + */ + Password?: string; + /** + * 系统盘容量,非裸金属机型必填 + */ + BootDiskSize?: string; + /** + * 系统盘类型,非裸金属机型必填,例如:CLOUD_RSSD + */ + BootDiskType?: string; + /** + * 数据盘容量,非裸金属机型必填 + */ + DataDiskSize?: string; + /** + * 数据盘类型,非裸金属机型必填,例如:CLOUD_RSSD + */ + DataDiskType?: string; + /** + * 节点数量,默认为1 + */ + NodeCount?: number; +} +/** + * AddUHadoopInstanceNode - 给已有集群添加一定数量的节点 + */ +export interface AddUHadoopInstanceNodeResponse { +} +/** + * CreateUHadoopInstance - 新建一个uhadoop集群 + */ +export interface CreateUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 集群机器的登录密码 + */ + Password: string; + /** + * 版本,例如:3.2.1-udh3.0,通过ListUHadoopFrameworkApp接口获取 + */ + FrameworkVersion: string; + /** + * 节点配置,里面包括NodeType(机型),NodeRole(节点类别,值为其中之一:master|core|task),Count(数量),DataDiskType(数据盘类别),DataDiskSize(数据盘大小),DataDiskNum(数据盘数量),BootDiskType(系统盘类型),BootDiskSize(系统盘大小),通过GetUHadoopNodeType接口获取,示例为:InstanceGroupConfigs.0.NodeType=o.hadoop2m.xlargeInstanceGroupConfigs.0.NodeRole=masterInstanceGroupConfigs.0.Count=2InstanceGroupConfigs.0.DataDiskType=CLOUD_RSSDInstanceGroupConfigs.0.DataDiskSize=100InstanceGroupConfigs.0.DataDiskNum=1InstanceGroupConfigs.0.BootDiskType=CLOUD_RSSDInstanceGroupConfigs.0.BootDiskSize=50InstanceGroupConfigs.1.NodeType=o.hadoop2m.xlargeInstanceGroupConfigs.1.NodeRole=coreInstanceGroupConfigs.1.Count=3InstanceGroupConfigs.1.DataDiskType=CLOUD_RSSDInstanceGroupConfigs.1.DataDiskSize=200InstanceGroupConfigs.1.DataDiskNum=1InstanceGroupConfigs.1.BootDiskType=CLOUD_RSSDInstanceGroupConfigs.1.BootDiskSize=50 + */ + InstanceGroupConfigs: string[]; + /** + * VPCId + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群需要安装的组件,格式:组件#版本通过ListUHadoopFrameworkApp接口获取,例如:Spark#3.3.0 + */ + AppConfig: string[]; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * 支付类别,默认:Month + */ + ChargeType?: string; + /** + * 数量,默认1 + */ + Quantity?: number; + /** + * 工作组ID,默认Default + */ + BusinessId?: string; + /** + * Framework为‘MR’时,存储集群ID + */ + StorgeClusterId?: string; + /** + * 目前只支持传‘udb’ + */ + StandAloneMetaStore?: string; + /** + * 是否开启安全组 + */ + IsSecurityEnabled?: string; + /** + * 安全组ID,字符串数组,IsSecurityEnabled为true时生效 + */ + SecGroupIds?: string; + /** + * US3 bucket名称,仅支持框架为StarRocks存算分离时传入 + */ + US3Bucket?: string; + /** + * US3 配置公钥,仅支持框架为StarRocks存算分离时传入 + */ + US3AccessKey?: string; + /** + * US3 配置私钥,仅支持框架为StarRocks存算分离时传入 + */ + US3SecretKey?: string; + /** + * US3 Token名称,仅支持框架为StarRocks存算分离时传入 + */ + US3TokenName?: string; + /** + * 实例名称,默认为实例ID + */ + InstanceName?: string; +} +/** + * CreateUHadoopInstance - 新建一个uhadoop集群 + */ +export interface CreateUHadoopInstanceResponse { + /** + * 实例ID + */ + InstanceId?: string; +} +/** + * DeleteUHadoopInstance - 删除掉一个uhadoop集群 + */ +export interface DeleteUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 是否释放绑定的EIP。true: 解绑EIP后,并释放;其他值或不填:解绑EIP。 + */ + ReleaseEIP?: boolean; +} +/** + * DeleteUHadoopInstance - 删除掉一个uhadoop集群 + */ +export interface DeleteUHadoopInstanceResponse { +} +/** + * DescribeUHadoopInstance - 描述集群 + */ +export interface DescribeUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * VPCID + */ + VPCId?: string; + /** + * 子网ID + */ + SubnetId?: string; +} +/** + * DescribeUHadoopInstance - 描述集群 + */ +export interface DescribeUHadoopInstanceResponse { + /** + * 集群信息 + */ + ClusterSet?: { + /** + * 可用区 + */ + Zone: string; + /** + * 集群Tag + */ + Tag: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * VPC ID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 业务组ID + */ + BusinessId: string; + /** + * Uhadoop版本,值为 uhadoop 3.0|uhadoop 2.2|uhadoop 3.1 + */ + ReleaseVersion: string; + /** + * Hadoop版本,值为 hadoop3.2.1-udh3.0|hadoop3.3.4-udh3.1|hadoop2.8.5-udh2.2 + */ + HadoopVersion: string; + /** + * 创建时间 + */ + CreateTime: string; + /** + * 付费类型 + */ + ChargeType: string; + /** + * 到期时间 + */ + ExpireTime: string; + /** + * 状态,值为以下其中之一,Running(运行中)|Creating(创建中)|CreateFailed(创建失败)|Deploying(部署中)|Updating(变更中) + */ + State: string; + /** + * Master节点数量 + */ + MasterCount: string; + /** + * core节点数量 + */ + CoreCount: string; + /** + * Task节点数量 + */ + TaskCount: string; + /** + * 运行时间 + */ + RunningTime?: string; + /** + * 组件集合 + */ + AppConfigSet?: string; + /** + * 组件数量 + */ + AppConfigCount?: string; + /** + * 是否开启安全组 + */ + IsOpenSecGroup?: string; + /** + * 节点集合 + */ + NodeSet?: string; + /** + * 节点数量 + */ + NodeCount?: string; + }[]; +} +/** + * GetUHadoopNodeType - 获取节点类型信息 + */ +export interface GetUHadoopNodeTypeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 框架版本,例如3.2.1-udh3.0,通过ListUHadoopFrameworkApp接口获取 + */ + FrameworkVersion?: string; + /** + * 角色,master|core|task + */ + NodeRole?: string; + /** + * 机型名称 + */ + NodeType?: string; + /** + * 框架,例如Hadoop|MR|HDFS|StarRocks,Hadoop框架包含存储与计算服务,MR集群包含计算服务,HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework?: string; +} +/** + * GetUHadoopNodeType - 获取节点类型信息 + */ +export interface GetUHadoopNodeTypeResponse { + /** + * 类型信息 + */ + InstanceTypeSet: { + /** + * 机型名称 + */ + NodeType: string; + /** + * 机型种类,可选Outstanding(快杰机型)|General(普通机型)|BareMetal(裸金属机型)|GPU(GPU机型)四种类型 + */ + HostType: string; + /** + * 可用的节点类型,值为core|task|master之一 + */ + SuitableRole: string[]; + /** + * cpu大小 + */ + CPU: string; + /** + * cpu内存比 + */ + CPUToMemoryRatio: string; + /** + * 内存大小 + */ + Memory: string; + /** + * 磁盘信息 + */ + DiskSet: { + /** + * 总磁盘大小 + */ + Size: number; + /** + * 磁盘角色,分Data数据盘和Boot系统盘 + */ + Type: string; + /** + * 可支持的磁盘类型 + */ + DiskType: string[]; + /** + * 单块盘大小 + */ + SingleDiskSize?: number; + /** + * 磁盘数量 + */ + DiskNum?: number; + /** + * 最大磁盘数量 + */ + DiskMaxNum?: string; + /** + * 最大单块盘容量,单位GB + */ + DiskMaxSize?: string; + /** + * 最小磁盘数量 + */ + DiskMinNum?: string; + /** + * 最小单块盘容量,单位GB + */ + DiskMinSize?: string; + }[]; + /** + * 是否可用,该机型是否支持创建 + */ + IsUsable: string; + /** + * 是否支持开启安全组 + */ + IsOpenSecgroup?: string; + /** + * GPU型号 + */ + GpuType?: string; + /** + * GPU数量 + */ + GpuCount?: number; + }[]; + /** + * 当前可用区是否支持元数据库使用UDB + */ + MetaDataUDBUsable?: boolean; + /** + * 机型可支持的节点类型 + */ + HostTypeSupportNodeType?: string; +} +/** + * ListUHadoopFrameworkApp - 列举可选app + */ +export interface ListUHadoopFrameworkAppRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * 实例ID,可选。传的话,过滤出适合此集群的app信息。 + */ + InstanceId?: string; +} +/** + * ListUHadoopFrameworkApp - 列举可选app + */ +export interface ListUHadoopFrameworkAppResponse { + /** + * 应用配置详情 + */ + AppConfigSet?: { + /** + * 需要安装的应用如:Hive,HBase, Spark,Hue,Pig等其他组件 + */ + AppName?: string; + /** + * 应用的版本号(0.13.1,0.98.6 等等) + */ + AppVersion?: string; + /** + * 应用的状态(运行中)'Running'|(已停止)'Stopped'|(启动中)'Starting'|(停止中)'Stopping'|(启动失败)'StartFailed'|(停止失败)'StopFailed'|(安装中)'Installing'|(安装失败)'InstallFailed'|(未安装)'NotInstalled', + */ + AppStatus?: string; + }[]; +} +/** + * ListUHadoopFrameworkAppByUseCase - 按使用场景列出uhadoop的框架和框架中的应用 + */ +export interface ListUHadoopFrameworkAppByUseCaseRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} +/** + * ListUHadoopFrameworkAppByUseCase - 按使用场景列出uhadoop的框架和框架中的应用 + */ +export interface ListUHadoopFrameworkAppByUseCaseResponse { + /** + * 使用场景的app版本信息 + */ + AppConfigSet?: { + /** + * UHadoop版本,值为 uhadoop 3.0|uhadoop 2.2|uhadoop 3.1 + */ + ReleaseVersion?: string; + /** + * Hadoop版本,值为 hadoop3.2.1-udh3.0|hadoop3.3.4-udh3.1 |hadoop2.8.5-udh2.2 + */ + HadoopVersion?: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework?: string; + /** + * 框架版本 + */ + FrameworkVersion?: string; + /** + * 框架示例 + */ + UseCases?: { + /** + * 集群种类 + */ + Case?: string; + /** + * 依赖的组件 + */ + MustHas?: string; + /** + * 组件版本 + */ + AppVersion?: string; + }[]; + }[]; +} +/** + * ListUHadoopInstance - 列出用户所有的uhadoop集群 + */ +export interface ListUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 获取列表的长度限制,默认值为60 + */ + Limit?: number; + /** + * 获取列表的偏移,默认值为0 + */ + Offset?: number; +} +/** + * ListUHadoopInstance - 列出用户所有的uhadoop集群 + */ +export interface ListUHadoopInstanceResponse { + /** + * 集群信息集合 + */ + ClusterSet: { + /** + * 可用区 + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,Hadoop框架包含存储与计算服务,MR集群包含计算服务,HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * VPC ID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 业务组ID + */ + BusinessId: string; + /** + * Uhadoop版本,值为 uhadoop 3.0|uhadoop 2.2|uhadoop 3.1 + */ + ReleaseVersion: string; + /** + * Hadoop版本,值为 hadoop3.2.1-udh3.0|hadoop3.3.4-udh3.1 |hadoop2.8.5-udh2.2 + */ + HadoopVersion: string; + /** + * 创建时间 + */ + CreateTime: string; + /** + * 状态,值为以下其中之一,Running(运行中)|Creating(创建中)|CreateFailed(创建失败)|Deploying(部署中)|Updating(变更中) + */ + State: string; + }[]; + /** + * 总数 + */ + TotalCount: number; +} +/** + * RestartUHadoopService - 重启集群服务(包含start|stop|restart) + */ +export interface RestartUHadoopServiceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 要操作的服务名。可通过ListUHadoopFrameworkApp接口获取 + */ + ServiceName: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 应用版本,ApplicationVersion传参时,表示这次操作是整个应用所有服务。 + */ + ApplicationVersion?: string; + /** + * 只启动。值为false|true之一,默认false,当OnlyStart和OnlyStop同时置为true,则重启。 + */ + OnlyStart?: boolean; + /** + * 只停止。值为false|true之一,默认false。当OnlyStart和OnlyStop同时置为true,则重启。 + */ + OnlyStop?: boolean; + /** + * 要操作的NodeId数组。如果传入,则用于过滤操作哪些Node。 + */ + NodeId?: string[]; + /** + * 要操作的NodeRole数组。如果传入,则用于过滤操作哪些Node。值为以下之一master|core|task + */ + NodeRole?: string[]; +} +/** + * RestartUHadoopService - 重启集群服务(包含start|stop|restart) + */ +export interface RestartUHadoopServiceResponse { + /** + * 当前执行状态,running(操作运行中)|success(操作成功)|failed(操作失败)|killed(操作被终止)。 + */ + State?: string; +} +/** + * UpgradeUHadoopNode - 升级uhadoop节点 + */ +export interface UpgradeUHadoopNodeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 节点角色,支持"master"|"core"|"task" + */ + NodeRole: string; + /** + * 节点新机型,通过GetUHadoopNodeType接口获取 + */ + NodeType: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 节点名称,当NodeRole不为master时必填 + */ + NodeNames?: string[]; +} +/** + * UpgradeUHadoopNode - 升级uhadoop节点 + */ +export interface UpgradeUHadoopNodeResponse { +} +/** + * UpgradeUHadoopNodeDisk - 扩容集群节点磁盘 + */ +export interface UpgradeUHadoopNodeDiskRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 节点角色,值为master|core|task之一 + */ + NodeRole: string; + /** + * 新的数据盘磁盘大小 + */ + DataDiskSize: number; + /** + * 实例ID + */ + InstanceId: string; + /** + * 节点名称集合,当NodeRole不为master时必填 + */ + NodeNames?: string[]; + /** + * 系统盘磁盘大小,仅支持云盘裸金属机型(系统盘和数据盘数值同时增加、只会处理系统盘参数) + */ + BootDiskSize?: number; +} +/** + * UpgradeUHadoopNodeDisk - 扩容集群节点磁盘 + */ +export interface UpgradeUHadoopNodeDiskResponse { +} diff --git a/lib/services/uhadoop/index.js b/lib/services/uhadoop/index.js new file mode 100644 index 0000000..a838c28 --- /dev/null +++ b/lib/services/uhadoop/index.js @@ -0,0 +1,115 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const client_1 = __importDefault(require("../../core/client")); +const request_1 = __importDefault(require("../../core/request")); +/** + * This client is used to call actions of **uhadoop** service + */ +class UHadoopClient extends client_1.default { + constructor({ config, credential, }) { + super({ config, credential }); + } + /** + * AddUHadoopInstanceNode - 给已有集群添加一定数量的节点 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/add_uhadoop_instance_node + */ + addUHadoopInstanceNode(request) { + const args = Object.assign({ Action: 'AddUHadoopInstanceNode' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * CreateUHadoopInstance - 新建一个uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/create_uhadoop_instance + */ + createUHadoopInstance(request) { + const args = Object.assign({ Action: 'CreateUHadoopInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DeleteUHadoopInstance - 删除掉一个uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/delete_uhadoop_instance + */ + deleteUHadoopInstance(request) { + const args = Object.assign({ Action: 'DeleteUHadoopInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DescribeUHadoopInstance - 描述集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/describe_uhadoop_instance + */ + describeUHadoopInstance(request) { + const args = Object.assign({ Action: 'DescribeUHadoopInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUHadoopNodeType - 获取节点类型信息 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/get_uhadoop_node_type + */ + getUHadoopNodeType(request) { + const args = Object.assign({ Action: 'GetUHadoopNodeType' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUHadoopFrameworkApp - 列举可选app + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_framework_app + */ + listUHadoopFrameworkApp(request) { + const args = Object.assign({ Action: 'ListUHadoopFrameworkApp' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUHadoopFrameworkAppByUseCase - 按使用场景列出uhadoop的框架和框架中的应用 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_framework_app_by_use_case + */ + listUHadoopFrameworkAppByUseCase(request) { + const args = Object.assign({ Action: 'ListUHadoopFrameworkAppByUseCase' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUHadoopInstance - 列出用户所有的uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_instance + */ + listUHadoopInstance(request) { + const args = Object.assign({ Action: 'ListUHadoopInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * RestartUHadoopService - 重启集群服务(包含start|stop|restart) + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/restart_uhadoop_service + */ + restartUHadoopService(request) { + const args = Object.assign({ Action: 'RestartUHadoopService' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * UpgradeUHadoopNode - 升级uhadoop节点 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/upgrade_uhadoop_node + */ + upgradeUHadoopNode(request) { + const args = Object.assign({ Action: 'UpgradeUHadoopNode' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * UpgradeUHadoopNodeDisk - 扩容集群节点磁盘 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/upgrade_uhadoop_node_disk + */ + upgradeUHadoopNodeDisk(request) { + const args = Object.assign({ Action: 'UpgradeUHadoopNodeDisk' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } +} +exports.default = UHadoopClient; diff --git a/lib/services/ukafka/index.d.ts b/lib/services/ukafka/index.d.ts new file mode 100644 index 0000000..4c00fb6 --- /dev/null +++ b/lib/services/ukafka/index.d.ts @@ -0,0 +1,797 @@ +import Client from '../../core/client'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; +/** + * This client is used to call actions of **ukafka** service + */ +export default class UKafkaClient extends Client { + constructor({ config, credential, }: { + config: ConfigOptions; + credential: CredentialOptions; + }); + /** + * AddUKafkaInstanceNode - 给实例添加节点 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/add_ukafka_instance_node + */ + addUKafkaInstanceNode(request?: AddUKafkaInstanceNodeRequest): Promise; + /** + * CreateUKafkaInstance - 创建一个ukafka实例 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/create_ukafka_instance + */ + createUKafkaInstance(request?: CreateUKafkaInstanceRequest): Promise; + /** + * DeleteUKafkaInstance - 删除实例 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/delete_ukafka_instance + */ + deleteUKafkaInstance(request?: DeleteUKafkaInstanceRequest): Promise; + /** + * DescribeUKafkaConsumer - 获取 Kafka 消费组信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/describe_ukafka_consumer + */ + describeUKafkaConsumer(request?: DescribeUKafkaConsumerRequest): Promise; + /** + * DescribeUKafkaInstance - 获取整个集群的信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/describe_ukafka_instance + */ + describeUKafkaInstance(request?: DescribeUKafkaInstanceRequest): Promise; + /** + * GetUKafkaNodeType - 获取节点机型配置 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/get_ukafka_node_type + */ + getUKafkaNodeType(request?: GetUKafkaNodeTypeRequest): Promise; + /** + * IsUKafkaTopicNameExist - 检查一个topic名称是否已经在集群中了 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/is_ukafka_topic_name_exist + */ + isUKafkaTopicNameExist(request?: IsUKafkaTopicNameExistRequest): Promise; + /** + * ListUKafkaConsumers - 列出 Kafka 消费组 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_consumers + */ + listUKafkaConsumers(request?: ListUKafkaConsumersRequest): Promise; + /** + * ListUKafkaFrameworkVersion - 列举ukafka框架版本 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_framework_version + */ + listUKafkaFrameworkVersion(request?: ListUKafkaFrameworkVersionRequest): Promise; + /** + * ListUKafkaInstance - 列举集群信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_instance + */ + listUKafkaInstance(request?: ListUKafkaInstanceRequest): Promise; + /** + * ListUKafkaTopics - 展示kafka集群上所有topic + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_topics + */ + listUKafkaTopics(request?: ListUKafkaTopicsRequest): Promise; + /** + * ModifyUKafkaInstanceType - 规格升降级 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/modify_ukafka_instance_type + */ + modifyUKafkaInstanceType(request?: ModifyUKafkaInstanceTypeRequest): Promise; + /** + * ResizeUKafkaDisk - 磁盘扩容 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/resize_ukafka_disk + */ + resizeUKafkaDisk(request?: ResizeUKafkaDiskRequest): Promise; +} +/** + * AddUKafkaInstanceNode - 给实例添加节点 + */ +export interface AddUKafkaInstanceNodeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 机型,支持的机型可通过GetUKafkaNodeType 接口返回的InstanceTypeSet[].InstanceTypeName + */ + NodeType: string; + /** + * 新添加节点数量 + */ + NodeCount: number; +} +/** + * AddUKafkaInstanceNode - 给实例添加节点 + */ +export interface AddUKafkaInstanceNodeResponse { +} +/** + * CreateUKafkaInstance - 创建一个ukafka实例 + */ +export interface CreateUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * kafka版本,支持的版本可通过ListUKafkaFrameworkVersion 接口返回字段的FrameworkVersions获取 + */ + FrameworkVersion: string; + /** + * VPCID + */ + VPCId: string; + /** + * 子网 ID + */ + SubnetId: string; + /** + * 付费方式 + */ + ChargeType: string; + /** + * 机型,支持的机型可通过GetUKafkaNodeType 接口返回的InstanceTypeSet[].InstanceTypeName + */ + NodeType: string; + /** + * 数据盘大小。支持范围根据GetUKafkaNodeType 接口返回的InstanceTypeSet[].MaxDiskSize 和MinDiskSize获取 + */ + DiskSize: number; + /** + * 实例名,可自定义 + */ + InstanceName: string; + /** + * 业务组,默认Default + */ + BusinessId?: string; + /** + * 实例数量,默认 1 + */ + Quantity?: string; + /** + * 集群节点数量。默认 3 节点 + */ + NodeCount?: number; + /** + * kafka 日志保存时间,支持范围[1,240]。默认 72 小时 + */ + LogRetentionHours?: string; + /** + * 磁盘管理方式,支持值:NONE、CLEAN。默认值:NONE + */ + DiskControllerType?: string; + /** + * 磁盘清理阈值,支持范围[70,90]。DiskControllerType 为CLEAN 时必填。默认值 90 + */ + DiskThreshold?: string; + /** + * 是否开启安全组,支持"true","false",默认 false + */ + IsSecurityEnabled?: string; +} +/** + * CreateUKafkaInstance - 创建一个ukafka实例 + */ +export interface CreateUKafkaInstanceResponse { + /** + * 实例资源 ID + */ + InstanceId: string; +} +/** + * DeleteUKafkaInstance - 删除实例 + */ +export interface DeleteUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; +} +/** + * DeleteUKafkaInstance - 删除实例 + */ +export interface DeleteUKafkaInstanceResponse { +} +/** + * DescribeUKafkaConsumer - 获取 Kafka 消费组信息 + */ +export interface DescribeUKafkaConsumerRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * Kafka 集群 ID + */ + ClusterInstanceId: string; + /** + * 消费组组名 + */ + ConsumerGroup: string; + /** + * 消费者组类型(同消费者组列表返回的类型值) + */ + Type: string; +} +/** + * DescribeUKafkaConsumer - 获取 Kafka 消费组信息 + */ +export interface DescribeUKafkaConsumerResponse { + /** + * 消费者组组名 + */ + GroupName?: string; + /** + * 消费者组类型 + */ + Type?: string; + /** + * 消费者组所订阅 topic 信息 + */ + Topics?: string; +} +/** + * DescribeUKafkaInstance - 获取整个集群的信息 + */ +export interface DescribeUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID,可以通过ListUKafkaInstance 接口的ClusterSet. ClusterInstanceId 获取 + */ + ClusterInstanceId: string; +} +/** + * DescribeUKafkaInstance - 获取整个集群的信息 + */ +export interface DescribeUKafkaInstanceResponse { + /** + * 集群信息列表 + */ + ClusterSet: { + /** + * 所属可用区 + */ + Zone?: string; + /** + * 是否开启自动续费 + */ + AutoRenew?: string; + /** + * 业务组 ID + */ + BusinessId?: string; + /** + * 付费类型 + */ + ChargeType?: string; + /** + * 实例id + */ + ClusterInstanceId?: string; + /** + * 实例名称 + */ + ClusterInstanceName?: string; + /** + * 实例创建时间 + */ + CreateTime?: number; + /** + * 实例过期时间 + */ + ExpireTime?: number; + /** + * 实例框架 + */ + Framework?: string; + /** + * 实例框架版本 + */ + FrameworkVersion?: string; + /** + * 网络 id(已废弃) + */ + NetworkId?: string; + /** + * 实例备注 + */ + Remark?: string; + /** + * 实例运行时间 + */ + RunningTime?: number; + /** + * 实例当前状态,实例状态:"Running"| "Abnormal"| "Creating"| "Deleting"| "CreateFailed"| "DeleteFailed"| "Unavailable"| "Deleted"| "Updating"| "Deploying"| "Migrating"| "ExpandFailed" + */ + State?: string; + /** + * 所属子网 id + */ + SubnetId?: string; + /** + * 实例标记 + */ + Tag?: string; + /** + * 实例节点个数 + */ + UHostCount?: number; + /** + * 节点信息列表 + */ + UHostSet?: { + /** + * broker 访问端点 + */ + Endpoints: { + /** + * PLAINTEXT 协议访问信息 + */ + PlainText: { + /** + * 访问协议 + */ + Protocal?: string; + /** + * 访问地址 + */ + Addr?: string; + }; + /** + * SASL_PLAINTEXT 协议访问信息 + */ + SaslPlainText?: { + /** + * 访问协议 + */ + Protocal?: string; + /** + * 访问地址 + */ + Addr?: string; + }; + }; + /** + * broker id + */ + BrokerId?: string; + /** + * broker 关联topic 信息 + */ + BrokerInfo?: { + /** + * topic 在 broker 上分布的 partition 数量 + */ + PartitionOnBroker?: string; + /** + * topic 在 broker上 partition 列表 + */ + Partitions?: string; + /** + * Topic 副本数 + */ + Replication?: number; + /** + * topic 名称 + */ + TopicName?: string; + /** + * partition 数量 + */ + TotalPartitions?: number; + }[]; + /** + * broker 创建信息 + */ + CreateTime?: string; + /** + * broker 域名 + */ + DomainName?: string; + /** + * broker 过期时间 + */ + ExpireTime?: number; + /** + * broker IP 信息 + */ + IPSet?: { + /** + * IP地址 + */ + IP?: string; + /** + * IP类型 + */ + Type?: string; + }[]; + /** + * broker 机型信息 + */ + InstanceGroupType?: string; + /** + * kafka 服务端口 + */ + KafkaPort?: number; + /** + * broker 备注信息 + */ + Remark?: string; + /** + * broker 注册资源信息 + */ + ResourceId?: string; + /** + * 安全组 id + */ + SecurityGroupId?: string; + /** + * broker 当前状态 + */ + State?: string; + /** + * broker 节点配置 + */ + UHostConfig?: { + /** + * 节点数据盘类型 + */ + DiskType?: string; + /** + * 节点系统盘大小(单位G)【删除】 + */ + BootDiskSize?: number; + /** + * 节点 CPU 核心数 + */ + CPU?: number; + /** + * 节点数据盘大小(单位G) + */ + DataDiskSize?: number; + /** + * 节点内存(单位MB) + */ + Memory?: number; + /** + * 节点内部系统名称【删除】 + */ + OS?: string; + }; + /** + * 节点 id + */ + UHostId?: string; + /** + * 节点名称 + */ + UHostName?: string; + /** + * 节点类型 + */ + UHostRole?: string; + /** + * 节点是否部署 zookeeper + */ + ZooKeeper?: string; + /** + * zookeeper 服务端口 + */ + ZooKeeperPort?: number; + }[]; + /** + * 所属 VPC id + */ + VPCId?: string; + /** + * 可用节点个数 + */ + ValidBrokerNum?: number; + /** + * 是否开启安全组 + */ + IsOpenSecgroup?: string; + }[]; +} +/** + * GetUKafkaNodeType - 获取节点机型配置 + */ +export interface GetUKafkaNodeTypeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 传参时返回指定机型信息,参数为空时返回所有机型信息 + */ + NodeType?: string; +} +/** + * GetUKafkaNodeType - 获取节点机型配置 + */ +export interface GetUKafkaNodeTypeResponse { + /** + * 机型信息列表 + */ + NodeTypeSet: { + /** + * 机型磁盘类型信息 + */ + DiskSet?: { + /** + * 磁盘类型。Boot 表示系统盘,Data 表示数据盘 + */ + Type: string; + /** + * 磁盘大小 + */ + Size: string; + }; + /** + * CPU核心数 + */ + CPU?: number; + /** + * 磁盘类型。RSSD 表示固态云盘,SSD 表示本地固态盘,COMMON 表示本地 SATA 盘 + */ + DiskType?: string; + /** + * 机型名称 + */ + NodeTypeName?: string; + /** + * 内存大小(单位 MB) + */ + Memory?: string; + }[]; +} +/** + * IsUKafkaTopicNameExist - 检查一个topic名称是否已经在集群中了 + */ +export interface IsUKafkaTopicNameExistRequest { + /** + * 可用区。参见 [可用区列表](../summary/regionlist.html) + */ + Zone: string; + /** + * 集群ID + */ + ClusterInstanceId: string; + /** + * 待检查的topic名称 + */ + TopicName: string; +} +/** + * IsUKafkaTopicNameExist - 检查一个topic名称是否已经在集群中了 + */ +export interface IsUKafkaTopicNameExistResponse { + /** + * 是否已经存在 + */ + IsExist: string; +} +/** + * ListUKafkaConsumers - 列出 Kafka 消费组 + */ +export interface ListUKafkaConsumersRequest { + /** + * 可用区。参见 [可用区列表](../summary/regionlist.html) + */ + Zone: string; + /** + * Kafka 集群 ID + */ + ClusterInstanceId: string; +} +/** + * ListUKafkaConsumers - 列出 Kafka 消费组 + */ +export interface ListUKafkaConsumersResponse { + /** + * 消费者组列表 + */ + Groups?: { + /** + * 消费者组组名 + */ + GroupName?: string; + /** + * 消费者组类型 + */ + Type?: string; + /** + * 订阅 Topic 数量 + */ + NumOfTopics?: number; + }[]; +} +/** + * ListUKafkaFrameworkVersion - 列举ukafka框架版本 + */ +export interface ListUKafkaFrameworkVersionRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} +/** + * ListUKafkaFrameworkVersion - 列举ukafka框架版本 + */ +export interface ListUKafkaFrameworkVersionResponse { + /** + * kafka版本 + */ + FrameworkVersions: { + /** + * kafka版本 + */ + Version?: string; + /** + * kafka 版本标签。recommend 表示推荐版本,beta 表示公测版本 + */ + Label?: string; + }[]; +} +/** + * ListUKafkaInstance - 列举集群信息 + */ +export interface ListUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 默认为60 + */ + Limit?: string; + /** + * 默认为0 + */ + Offset?: string; + /** + * 是否过滤删除了的节点,默认为‘true’ + */ + Filter?: string; + /** + * VPCId + */ + VPCId?: string; + /** + * SubnetId + */ + SubnetId?: string; + /** + * 业务组 ID + */ + BusinessId?: string; + /** + * 实例ID + */ + ClusterInstanceId?: string; +} +/** + * ListUKafkaInstance - 列举集群信息 + */ +export interface ListUKafkaInstanceResponse { + /** + * 信息 + */ + ClusterSet: string; + /** + * 总数 + */ + TotalCount: string; +} +/** + * ListUKafkaTopics - 展示kafka集群上所有topic + */ +export interface ListUKafkaTopicsRequest { + /** + * 可用区。参见 [可用区列表](../summary/regionlist.html) + */ + Zone: string; + /** + * 集群资源id + */ + ClusterInstanceId: string; +} +/** + * ListUKafkaTopics - 展示kafka集群上所有topic + */ +export interface ListUKafkaTopicsResponse { + /** + * topic 信息列表 + */ + TopicList: { + /** + * topic 名称 + */ + Topic?: string; + /** + * 分区数量 + */ + NumOfPartition?: number; + /** + * 占用 broker 数量 + */ + NumOfOccupyBroker?: number; + /** + * 副本数量 + */ + NumOfReplica?: number; + /** + * 落后副本占比 + */ + UnderReplicasPer?: number; + /** + * topic 状态 + */ + Status?: string; + }[]; + /** + * 列表长度 + */ + Length?: number; +} +/** + * ModifyUKafkaInstanceType - 规格升降级 + */ +export interface ModifyUKafkaInstanceTypeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 目标机型,支持的机型可通过GetUKafkaNodeType 接口返回的InstanceTypeSet[].InstanceTypeName + */ + NodeType: string; +} +/** + * ModifyUKafkaInstanceType - 规格升降级 + */ +export interface ModifyUKafkaInstanceTypeResponse { +} +/** + * ResizeUKafkaDisk - 磁盘扩容 + */ +export interface ResizeUKafkaDiskRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 数据盘大小。支持范围根据GetUKafkaNodeType 接口返回的InstanceTypeSet[].MaxDiskSize 和MinDiskSize获取 + */ + DiskSize: number; +} +/** + * ResizeUKafkaDisk - 磁盘扩容 + */ +export interface ResizeUKafkaDiskResponse { +} diff --git a/lib/services/ukafka/index.js b/lib/services/ukafka/index.js new file mode 100644 index 0000000..f6133a0 --- /dev/null +++ b/lib/services/ukafka/index.js @@ -0,0 +1,133 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const client_1 = __importDefault(require("../../core/client")); +const request_1 = __importDefault(require("../../core/request")); +/** + * This client is used to call actions of **ukafka** service + */ +class UKafkaClient extends client_1.default { + constructor({ config, credential, }) { + super({ config, credential }); + } + /** + * AddUKafkaInstanceNode - 给实例添加节点 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/add_ukafka_instance_node + */ + addUKafkaInstanceNode(request) { + const args = Object.assign({ Action: 'AddUKafkaInstanceNode' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * CreateUKafkaInstance - 创建一个ukafka实例 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/create_ukafka_instance + */ + createUKafkaInstance(request) { + const args = Object.assign({ Action: 'CreateUKafkaInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DeleteUKafkaInstance - 删除实例 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/delete_ukafka_instance + */ + deleteUKafkaInstance(request) { + const args = Object.assign({ Action: 'DeleteUKafkaInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DescribeUKafkaConsumer - 获取 Kafka 消费组信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/describe_ukafka_consumer + */ + describeUKafkaConsumer(request) { + const args = Object.assign({ Action: 'DescribeUKafkaConsumer' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * DescribeUKafkaInstance - 获取整个集群的信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/describe_ukafka_instance + */ + describeUKafkaInstance(request) { + const args = Object.assign({ Action: 'DescribeUKafkaInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * GetUKafkaNodeType - 获取节点机型配置 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/get_ukafka_node_type + */ + getUKafkaNodeType(request) { + const args = Object.assign({ Action: 'GetUKafkaNodeType' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * IsUKafkaTopicNameExist - 检查一个topic名称是否已经在集群中了 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/is_ukafka_topic_name_exist + */ + isUKafkaTopicNameExist(request) { + const args = Object.assign({ Action: 'IsUKafkaTopicNameExist' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUKafkaConsumers - 列出 Kafka 消费组 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_consumers + */ + listUKafkaConsumers(request) { + const args = Object.assign({ Action: 'ListUKafkaConsumers' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUKafkaFrameworkVersion - 列举ukafka框架版本 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_framework_version + */ + listUKafkaFrameworkVersion(request) { + const args = Object.assign({ Action: 'ListUKafkaFrameworkVersion' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUKafkaInstance - 列举集群信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_instance + */ + listUKafkaInstance(request) { + const args = Object.assign({ Action: 'ListUKafkaInstance' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ListUKafkaTopics - 展示kafka集群上所有topic + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_topics + */ + listUKafkaTopics(request) { + const args = Object.assign({ Action: 'ListUKafkaTopics' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ModifyUKafkaInstanceType - 规格升降级 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/modify_ukafka_instance_type + */ + modifyUKafkaInstanceType(request) { + const args = Object.assign({ Action: 'ModifyUKafkaInstanceType' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } + /** + * ResizeUKafkaDisk - 磁盘扩容 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/resize_ukafka_disk + */ + resizeUKafkaDisk(request) { + const args = Object.assign({ Action: 'ResizeUKafkaDisk' }, (request || {})); + return this.invoke(new request_1.default(args)).then((resp) => resp.toObject()); + } +} +exports.default = UKafkaClient; diff --git a/package-lock.json b/package-lock.json index 4901a9d..051d2ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ucloud-sdks/ucloud-sdk-js", - "version": "0.2.6", + "version": "0.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 97dd6b7..e32632d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ucloud-sdks/ucloud-sdk-js", "description": "ucloud-sdk-js", - "version": "0.2.7", + "version": "0.2.8", "author": "oas@ucloud.cn", "license": "MIT", "private": false, diff --git a/src/services/index.ts b/src/services/index.ts index e0eab4d..15e56b2 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -8,16 +8,20 @@ const PathXClient = require('./pathx').default; const UAccountClient = require('./uaccount').default; const UBillClient = require('./ubill').default; const UCDNClient = require('./ucdn').default; +const UClickhouseClient = require('./uclickhouse').default; const UDBClient = require('./udb').default; const UDDBClient = require('./uddb').default; const UDiskClient = require('./udisk').default; const UDNSClient = require('./udns').default; const UDPNClient = require('./udpn').default; const UECClient = require('./uec').default; +const UESClient = require('./ues').default; const UFileClient = require('./ufile').default; const UFSClient = require('./ufs').default; +const UHadoopClient = require('./uhadoop').default; const UHostClient = require('./uhost').default; const UK8SClient = require('./uk8s').default; +const UKafkaClient = require('./ukafka').default; const ULBClient = require('./ulb').default; const ULightHostClient = require('./ulight_host').default; const UMemClient = require('./umem').default; @@ -82,6 +86,13 @@ export class Client extends BaseClient { }); } + uclickhouse() { + return new UClickhouseClient({ + config: this.config, + credential: this.credential, + }); + } + udb() { return new UDBClient({ config: this.config, @@ -124,6 +135,13 @@ export class Client extends BaseClient { }); } + ues() { + return new UESClient({ + config: this.config, + credential: this.credential, + }); + } + ufile() { return new UFileClient({ config: this.config, @@ -138,6 +156,13 @@ export class Client extends BaseClient { }); } + uhadoop() { + return new UHadoopClient({ + config: this.config, + credential: this.credential, + }); + } + uhost() { return new UHostClient({ config: this.config, @@ -152,6 +177,13 @@ export class Client extends BaseClient { }); } + ukafka() { + return new UKafkaClient({ + config: this.config, + credential: this.credential, + }); + } + ulb() { return new ULBClient({ config: this.config, diff --git a/src/services/uclickhouse/index.ts b/src/services/uclickhouse/index.ts new file mode 100644 index 0000000..a31e761 --- /dev/null +++ b/src/services/uclickhouse/index.ts @@ -0,0 +1,964 @@ +import Client from '../../core/client'; +import Request from '../../core/request'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; + +/** + * This client is used to call actions of **uclickhouse** service + */ +export default class UClickhouseClient extends Client { + constructor({ + config, + credential, + }: { + config: ConfigOptions; + credential: CredentialOptions; + }) { + super({ config, credential }); + } + + /** + * CreateUClickhouseCluster - 创建UClickhouse集群 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/create_u_clickhouse_cluster + */ + createUClickhouseCluster( + request?: CreateUClickhouseClusterRequest + ): Promise { + const args = { Action: 'CreateUClickhouseCluster', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as CreateUClickhouseClusterResponse + ); + } + + /** + * DescribeUClickhouseCluster - 获取集群信息 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/describe_u_clickhouse_cluster + */ + describeUClickhouseCluster( + request?: DescribeUClickhouseClusterRequest + ): Promise { + const args = { Action: 'DescribeUClickhouseCluster', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DescribeUClickhouseClusterResponse + ); + } + + /** + * DestroyUClickhouseCluster - 删除CK集群 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/destroy_u_clickhouse_cluster + */ + destroyUClickhouseCluster( + request?: DestroyUClickhouseClusterRequest + ): Promise { + const args = { Action: 'DestroyUClickhouseCluster', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DestroyUClickhouseClusterResponse + ); + } + + /** + * ExpandUClickhouseCluster - 集群水平扩容 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/expand_u_clickhouse_cluster + */ + expandUClickhouseCluster( + request?: ExpandUClickhouseClusterRequest + ): Promise { + const args = { Action: 'ExpandUClickhouseCluster', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ExpandUClickhouseClusterResponse + ); + } + + /** + * GetUClickhouseClusterCreateOption - 获取Clickhouse的创建配置项 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/get_u_clickhouse_cluster_create_option + */ + getUClickhouseClusterCreateOption( + request?: GetUClickhouseClusterCreateOptionRequest + ): Promise { + const args = { + Action: 'GetUClickhouseClusterCreateOption', + ...(request || {}), + }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUClickhouseClusterCreateOptionResponse + ); + } + + /** + * ListUClickhouseCluster - 获取UClickhouse集群列表 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/list_u_clickhouse_cluster + */ + listUClickhouseCluster( + request?: ListUClickhouseClusterRequest + ): Promise { + const args = { Action: 'ListUClickhouseCluster', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUClickhouseClusterResponse + ); + } + + /** + * ResizeUClickhouseCluster - 集群改配 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/resize_u_clickhouse_cluster + */ + resizeUClickhouseCluster( + request?: ResizeUClickhouseClusterRequest + ): Promise { + const args = { Action: 'ResizeUClickhouseCluster', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ResizeUClickhouseClusterResponse + ); + } + + /** + * RestartUClickhouseClusterService - 重启集群的UClickhouse服务 + * + * See also: https://docs.ucloud.cn/api/uclickhouse-api/restart_u_clickhouse_cluster_service + */ + restartUClickhouseClusterService( + request?: RestartUClickhouseClusterServiceRequest + ): Promise { + const args = { + Action: 'RestartUClickhouseClusterService', + ...(request || {}), + }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as RestartUClickhouseClusterServiceResponse + ); + } +} + +/** + * CreateUClickhouseCluster - 创建UClickhouse集群 + */ +export interface CreateUClickhouseClusterRequest { + /** + * 集群机型,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + ClickhouseMachineTypeId: string; + /** + * 数据盘类型,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + DataDiskType: string; + /** + * Clickhouse版本,可通过GetUClickhouseClusterCreateOption接口获取具体版本 + */ + ClickhouseVersion: string; + /** + * VPC ID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群管理员密码,密码规则:1.密码长度限8-32个字符2.不能包含[A-Z],[a-z],[0-9]和[@#%^*+=_;:,?!&()-]之外的字符3.需要同时包含两项或以上(大写字母/小写字母/数字/特殊符号) + */ + AdminPassword: string; + /** + * 分片数量,若传递,则至少1个分片,默认值为1 + */ + ShardCount?: number; + /** + * 副本数量,取值为1或2,1为单副本(非高可用),2为双副本(高可用),默认值为高可用(即为2) + */ + ReplicateCount?: number; + /** + * 数据盘大小,最小100,步长为50,默认值为100,单位GB + */ + DataDiskSize?: number; + /** + * 付费类型,枚举值:Year(年付),Month(月付),Dynamic(时付),默认值为Month,月付 + */ + ChargeType?: string; + /** + * 购买时长,默认值为1。月付时,此参数传0,代表购买至月末 + */ + Quantity?: number; + /** + * 备份任务ID,从备份恢复时,该字段必传,此值为备份任务ID,可以从原集群备份任务列表(ListUClickhouseBackups)获取 + */ + BackupId?: string; + /** + * 实例名称名称规则:1.长度为1-50位的字符2.不能包含_,中文,[A-Z],[a-z],[0-9]之外的非法字符,集群名称默认为clickhouse + */ + ClusterName?: string; + /** + * 是否Zookeeper高可用,true为zookeeper高可用,false为非高可用,默认为true,高可用 + */ + IsZookeeperHA?: boolean; + /** + * 是否开启安全组,true为开启,false为不开启,默认为false,不开启安全组 + */ + IsSecGroup?: string; + /** + * 是否多可用区,默认为false + */ + IsMultiZone?: string; + /** + * Zookeeper机型ID,IsZookeeperHA为true时,必传,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + ZookeeperMachineTypeId?: string; + /** + * Zookeeper数据盘类型,IsZookeeperHA为true时,必传,可通过GetUClickhouseClusterCreateOption接口获取具体值 + */ + ZookeeperDataDiskType?: string; + /** + * Zookeeper数据盘大小,IsZookeeperHA为true时,必传,最小100,步长为50 + */ + ZookeeperDataDiskSize?: string; + /** + * 安全组ID,IsSecGroup为true时,必传 + */ + SecGroupIds?: string; + /** + * 【数组】可用区名称,IsMultiZone为true时,必传,可通过ListUClickhouseAvailableZone获取支持的可用区 + */ + MultiZones?: string[]; + /** + * + */ + Labels?: { + /** + * 标签的key + */ + Key?: string; + /** + * 标签的value + */ + Value?: string; + }[]; +} + +/** + * CreateUClickhouseCluster - 创建UClickhouse集群 + */ +export interface CreateUClickhouseClusterResponse { + /** + * 返回数据 + */ + Data: { + /** + * 集群ID + */ + ClusterId: string; + }; +} + +/** + * DescribeUClickhouseCluster - 获取集群信息 + */ +export interface DescribeUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; +} + +/** + * DescribeUClickhouseCluster - 获取集群信息 + */ +export interface DescribeUClickhouseClusterResponse { + /** + * 返回数据 + */ + Data: { + /** + * Zookeeper节点列表,为空时,说明该集群没有zookeeper集群 + */ + ZookeeperNodes: { + /** + * 可用区名称 + */ + Zone: string; + /** + * 节点ID + */ + NodeId: string; + /** + * 集群ID + */ + ClusterId: string; + /** + * 节点名称 + */ + NodeName: string; + /** + * CPU + */ + CPU: number; + /** + * 内存 + */ + Memory: number; + /** + * 系统盘大小 + */ + SysDiskSize: number; + /** + * 系统盘类型 + */ + SysDiskType: string; + /** + * 数据盘大小 + */ + DataDiskSize: number; + /** + * 数据盘类型 + */ + DataDiskType: string; + /** + * 创建时间 + */ + CreateTimestamp: number; + /** + * 机型 + */ + MachineType: string; + /** + * zookeeper的myid + */ + ZookeeperMyId: string; + /** + * 服务状态:RUNNING(运行中)、STARTING(启动中)、STOPPED(已停止)、RESTARTING(重启中) + */ + ServiceStatus: string; + /** + * 资源ID + */ + ResourceId: string; + }[]; + /** + * Clickhouse节点列表 + */ + ClickhouseNodes: { + /** + * 可用区名称 + */ + Zone: string; + /** + * 节点ID + */ + NodeId: string; + /** + * 集群ID + */ + ClusterId: string; + /** + * 节点名称 + */ + NodeName: string; + /** + * CPU大小 + */ + CPU: number; + /** + * 内存,GB + */ + Memory: number; + /** + * 系统盘大小,GB + */ + SysDiskSize: number; + /** + * 系统盘类型 + */ + SysDiskType: string; + /** + * 数据盘大小,GB + */ + DataDiskSize: number; + /** + * 数据盘类型 + */ + DataDiskType: string; + /** + * ipv4 + */ + IPv4: string; + /** + * 创建时间 + */ + CreateTimestamp: number; + /** + * 机型 + */ + MachineType: string; + /** + * 分片组 + */ + ShardGroup: string; + /** + * 服务状态:RUNNING(运行中)、STARTING(启动中)、STOPPED(已停止)、RESTARTING(重启中) + */ + ServiceStatus: string; + /** + * 资源ID + */ + ResourceId: string; + }[]; + /** + * 支付信息 + */ + Payment: { + /** + * 创建时间 + */ + CreateTimestamp: number; + /** + * 过期时间 + */ + ExpireTimestamp: number; + /** + * 支付类型 + */ + ChargeType: string; + /** + * 价格 + */ + Price: number; + /** + * 原始价格 + */ + OriginalPrice: number; + /** + * 资源ID + */ + ResourceId: string; + }; + /** + * 集群信息 + */ + Cluster: { + /** + * 集群ID + */ + ClusterId: string; + /** + * 公司ID + */ + TopOrganizationId: number; + /** + * 项目ID + */ + OrganizationId: number; + /** + * 集群名称 + */ + ClusterName: string; + /** + * VPCID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群版本 + */ + ClickhouseVersion: string; + /** + * Zookeeper版本 + */ + ZookeeperVersion: string; + /** + * 机型 + */ + MachineType: string; + /** + * 集群状态:CREATING(创建中)、RUNNING(运行中)、RESIZING(变配中)、RESTARTING(重启中)、UPGRADING(升级中)、DESTROYING(销毁中)、DESTROYED(已删除)、CREATE_FAILED(创建失败)、RESTART_FAILED(重启失败)、DESTROY_FAILED(删除失败)、RESIZE_FAILED(变配失败)、BACKUP_RESTORING(备份恢复中)、BACKUP_RESTORE_FAILED(备份恢复失败)、EXPANDING(扩容中)、EXPAND_FAILED(扩容失败) + */ + Status: string; + /** + * 分片数 + */ + ShardCount: number; + /** + * 副本数 + */ + ReplicateCount: number; + /** + * 集群创建时间 + */ + CreateTimestamp: number; + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * Clickhouse机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * 地域ID + */ + RegionId: number; + /** + * Zookeeper机型ID + */ + ZookeeperMachineTypeId: string; + /** + * Zookeeper机型名称 + */ + ZookeeperMachineTypeName: string; + /** + * Clickhouse数据盘类型 + */ + ClickhouseDataDiskType: string; + /** + * Clickhouse数据盘大小 + */ + ClickhouseDataDiskSize: number; + /** + * Zookeeper数据盘类型 + */ + ZookeeperDataDiskType: string; + /** + * Zookeeper数据盘大小 + */ + ZookeeperDataDiskSize: number; + /** + * Clickhouse节点CPU + */ + ClickhouseNodeCPU: number; + /** + * Clickhouse内存 + */ + ClickhouseNodeMemory: number; + /** + * Zookeeper节点CPU + */ + ZookeeperNodeCPU: number; + /** + * Zookeeper节点内存 + */ + ZookeeperNodeMemory: number; + /** + * Zookeeper是否高可用 + */ + IsZookeeperHA: string; + /** + * 实例是否开启安全组 + */ + IsSecgroup: string; + /** + * 实例是否开启备份 + */ + IsBackup: string; + /** + * 实例是否开启冷热分层 + */ + IsTieredStorage: string; + /** + * 实例所在可用区 + */ + MultiZones: string[]; + /** + * 实例过期时间 + */ + ExpireTimestamp: number; + }; + }; +} + +/** + * DestroyUClickhouseCluster - 删除CK集群 + */ +export interface DestroyUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; +} + +/** + * DestroyUClickhouseCluster - 删除CK集群 + */ +export interface DestroyUClickhouseClusterResponse {} + +/** + * ExpandUClickhouseCluster - 集群水平扩容 + */ +export interface ExpandUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; + /** + * 扩容后集群的节点数量,集群为高可用时,需要传入偶数个节点 + */ + TotalNodeCount: number; + /** + * 水平扩容时,选择某一个原节点的ID,用于同步表结构/用户信息。不传递时,表示不同步表结构/用户信息,仅水平扩容节点数量 + */ + SyncNodeId?: string; +} + +/** + * ExpandUClickhouseCluster - 集群水平扩容 + */ +export interface ExpandUClickhouseClusterResponse {} + +/** + * GetUClickhouseClusterCreateOption - 获取Clickhouse的创建配置项 + */ +export interface GetUClickhouseClusterCreateOptionRequest {} + +/** + * GetUClickhouseClusterCreateOption - 获取Clickhouse的创建配置项 + */ +export interface GetUClickhouseClusterCreateOptionResponse { + /** + * 数据 + */ + Data: { + /** + * 支持的CK版本 + */ + ClickhouseVersions: { + /** + * 版本号 + */ + Version: string; + /** + * 版本名称 + */ + VersionName: string; + }[]; + /** + * 支持的CK机型 + */ + ClickhouseMachineTypes: { + /** + * CK机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * CK机型可选项 + */ + ClickhouseMachineTypeOptions: { + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * 机型 + */ + MachineType: string; + /** + * CPU大小 + */ + CPU: number; + /** + * 内存大小,GB + */ + Memory: number; + /** + * 数据盘列表 + */ + DataDisks: { + /** + * 磁盘类型 + */ + DiskType: string; + /** + * 最小值,GB + */ + MinDiskSize: number; + /** + * 最大值,GB + */ + MaxDiskSize: number; + /** + * 默认大小,GB + */ + DefaultDataDiskSize: number; + /** + * 步长,GB + */ + Step: number; + }[]; + /** + * 允许创建的节点个数 + */ + NodeCounts: number[]; + }[]; + /** + * 机型是否支持安全组 + */ + IsSecgroupMachineType: string; + }[]; + /** + * 实例可创建的最大节点数量 + */ + MaxNodeCount: number; + /** + * 支持的Zookeeper机型 + */ + ZookeeperMachineTypes: { + /** + * CK机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * CK机型可选项 + */ + ClickhouseMachineTypeOptions: { + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * 机型 + */ + MachineType: string; + /** + * CPU大小 + */ + CPU: number; + /** + * 内存大小,GB + */ + Memory: number; + /** + * 数据盘列表 + */ + DataDisks: { + /** + * 磁盘类型 + */ + DiskType: string; + /** + * 最小值,GB + */ + MinDiskSize: number; + /** + * 最大值,GB + */ + MaxDiskSize: number; + /** + * 默认大小,GB + */ + DefaultDataDiskSize: number; + /** + * 步长,GB + */ + Step: number; + }[]; + /** + * 允许创建的节点个数 + */ + NodeCounts: number[]; + }[]; + /** + * 机型是否支持安全组 + */ + IsSecgroupMachineType: string; + }[]; + }; +} + +/** + * ListUClickhouseCluster - 获取UClickhouse集群列表 + */ +export interface ListUClickhouseClusterRequest {} + +/** + * ListUClickhouseCluster - 获取UClickhouse集群列表 + */ +export interface ListUClickhouseClusterResponse { + /** + * 返回数据 + */ + Data: { + /** + * 集群列表 + */ + Clusters: { + /** + * 集群ID + */ + ClusterId: string; + /** + * 公司ID + */ + TopOrganizationId: number; + /** + * 项目ID + */ + OrganizationId: number; + /** + * 集群名称 + */ + ClusterName: string; + /** + * VPCID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群版本 + */ + ClickhouseVersion: string; + /** + * Zookeeper版本 + */ + ZookeeperVersion: string; + /** + * 机型 + */ + MachineType: string; + /** + * 集群状态:CREATING(创建中)、RUNNING(运行中)、RESIZING(变配中)、RESTARTING(重启中)、UPGRADING(升级中)、DESTROYING(销毁中)、DESTROYED(已删除)、CREATE_FAILED(创建失败)、RESTART_FAILED(重启失败)、DESTROY_FAILED(删除失败)、RESIZE_FAILED(变配失败)、BACKUP_RESTORING(备份恢复中)、BACKUP_RESTORE_FAILED(备份恢复失败)、EXPANDING(扩容中)、EXPAND_FAILED(扩容失败) + */ + Status: string; + /** + * 分片数 + */ + ShardCount: number; + /** + * 副本数 + */ + ReplicateCount: number; + /** + * 集群创建时间 + */ + CreateTimestamp: number; + /** + * Clickhouse机型ID + */ + ClickhouseMachineTypeId: string; + /** + * Clickhouse机型名称 + */ + ClickhouseMachineTypeName: string; + /** + * 地域ID + */ + RegionId: number; + /** + * Zookeeper机型ID + */ + ZookeeperMachineTypeId: string; + /** + * Zookeeper机型名称 + */ + ZookeeperMachineTypeName: string; + /** + * Clickhouse数据盘类型 + */ + ClickhouseDataDiskType: string; + /** + * Clickhouse数据盘大小 + */ + ClickhouseDataDiskSize: number; + /** + * Zookeeper数据盘类型 + */ + ZookeeperDataDiskType: string; + /** + * Zookeeper数据盘大小 + */ + ZookeeperDataDiskSize: number; + /** + * Clickhouse节点CPU + */ + ClickhouseNodeCPU: number; + /** + * Clickhouse内存 + */ + ClickhouseNodeMemory: number; + /** + * Zookeeper节点CPU + */ + ZookeeperNodeCPU: number; + /** + * Zookeeper节点内存 + */ + ZookeeperNodeMemory: number; + /** + * Zookeeper是否高可用 + */ + IsZookeeperHA: string; + /** + * 实例是否开启安全组 + */ + IsSecgroup: string; + /** + * 实例是否开启备份 + */ + IsBackup: string; + /** + * 实例是否开启冷热分层 + */ + IsTieredStorage: string; + /** + * 实例所在可用区 + */ + MultiZones: string[]; + /** + * 实例过期时间 + */ + ExpireTimestamp: number; + }; + /** + * 集群总数 + */ + TotalCount: number; + }; +} + +/** + * ResizeUClickhouseCluster - 集群改配 + */ +export interface ResizeUClickhouseClusterRequest { + /** + * 集群ID + */ + ClusterId: string; + /** + * 目标机型ID,可通过GetUClickhouseClusterCreateOption接口获取具体值,与TargetDataDiskSize不能同时为空 + */ + TargetMachineTypeId?: string; + /** + * 目标磁盘大小,单位GB,只能扩容,与TargetMachineTypeId不能同时为空 + */ + TargetDataDiskSize?: number; + /** + * 是否为zookeeper节点,为true时表示升级zookeeper节点规格,为false时表示升级clickhouse节点规格,默认为false + */ + IsZooKeeperNode?: boolean; +} + +/** + * ResizeUClickhouseCluster - 集群改配 + */ +export interface ResizeUClickhouseClusterResponse {} + +/** + * RestartUClickhouseClusterService - 重启集群的UClickhouse服务 + */ +export interface RestartUClickhouseClusterServiceRequest { + /** + * 集群ID + */ + ClusterId: string; +} + +/** + * RestartUClickhouseClusterService - 重启集群的UClickhouse服务 + */ +export interface RestartUClickhouseClusterServiceResponse {} diff --git a/src/services/ues/index.ts b/src/services/ues/index.ts new file mode 100644 index 0000000..86fd23d --- /dev/null +++ b/src/services/ues/index.ts @@ -0,0 +1,738 @@ +import Client from '../../core/client'; +import Request from '../../core/request'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; + +/** + * This client is used to call actions of **ues** service + */ +export default class UESClient extends Client { + constructor({ + config, + credential, + }: { + config: ConfigOptions; + credential: CredentialOptions; + }) { + super({ config, credential }); + } + + /** + * CreateUESInstance - 创建实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/create_ues_instance + */ + createUESInstance( + request?: CreateUESInstanceRequest + ): Promise { + const args = { Action: 'CreateUESInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as CreateUESInstanceResponse + ); + } + + /** + * DeleteUESInstance - 删除实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/delete_ues_instance + */ + deleteUESInstance( + request?: DeleteUESInstanceRequest + ): Promise { + const args = { Action: 'DeleteUESInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DeleteUESInstanceResponse + ); + } + + /** + * DescribeUESInstanceV2 - 查询指定实例详细信息 + * + * See also: https://docs.ucloud.cn/api/ues-api/describe_ues_instance_v2 + */ + describeUESInstanceV2( + request?: DescribeUESInstanceV2Request + ): Promise { + const args = { Action: 'DescribeUESInstanceV2', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DescribeUESInstanceV2Response + ); + } + + /** + * ExpandUESInstance - 扩容实例节点 + * + * See also: https://docs.ucloud.cn/api/ues-api/expand_ues_instance + */ + expandUESInstance( + request?: ExpandUESInstanceRequest + ): Promise { + const args = { Action: 'ExpandUESInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ExpandUESInstanceResponse + ); + } + + /** + * GetUESAppVersion - 获取服务应用版本列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_app_version + */ + getUESAppVersion( + request?: GetUESAppVersionRequest + ): Promise { + const args = { Action: 'GetUESAppVersion', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUESAppVersionResponse + ); + } + + /** + * GetUESDiskSizeLimitation - 获取磁盘容量限制 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_disk_size_limitation + */ + getUESDiskSizeLimitation( + request?: GetUESDiskSizeLimitationRequest + ): Promise { + const args = { Action: 'GetUESDiskSizeLimitation', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUESDiskSizeLimitationResponse + ); + } + + /** + * GetUESNodeConf - 获取节点配置列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/get_ues_node_conf + */ + getUESNodeConf( + request?: GetUESNodeConfRequest + ): Promise { + const args = { Action: 'GetUESNodeConf', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUESNodeConfResponse + ); + } + + /** + * ListUESInstance - 获取实例列表 + * + * See also: https://docs.ucloud.cn/api/ues-api/list_ues_instance + */ + listUESInstance( + request?: ListUESInstanceRequest + ): Promise { + const args = { Action: 'ListUESInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUESInstanceResponse + ); + } + + /** + * ResizeUESInstance - 改配实例节点配置 + * + * See also: https://docs.ucloud.cn/api/ues-api/resize_ues_instance + */ + resizeUESInstance( + request?: ResizeUESInstanceRequest + ): Promise { + const args = { Action: 'ResizeUESInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ResizeUESInstanceResponse + ); + } + + /** + * RestartUESInstance - 重启实例 + * + * See also: https://docs.ucloud.cn/api/ues-api/restart_ues_instance + */ + restartUESInstance( + request?: RestartUESInstanceRequest + ): Promise { + const args = { Action: 'RestartUESInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as RestartUESInstanceResponse + ); + } +} + +/** + * CreateUESInstance - 创建实例 + */ +export interface CreateUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 节点配置标识, 支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf + */ + NodeConf: string; + /** + * VPCID标识 + */ + VPCId: string; + /** + * 子网ID标识 + */ + SubnetId: string; + /** + * Kibana节点配置, 支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf + */ + KibanaNodeConf: string; + /** + * Kibana节点磁盘类型 + */ + KibanaNodeDiskConf: string; + /** + * 应用服务版本号,支持的类型通过GetUESAppVersion AppVersionList[].AppVersion + */ + AppVersion: string; + /** + * 磁盘类型 + */ + NodeDiskConf: string; + /** + * 节点个数,默认数目为3 + */ + NodeSize?: number; + /** + * 节点磁盘大小,默认为100G + */ + NodeDiskSize?: number; + /** + * elasticsearch 服务用户名称,默认为elastic;OpenSearch 服务用户名称,固定为admin + */ + ServiceUserName?: string; + /** + * 服务用户密码,默认为changeme + */ + ServicePasswd?: string; + /** + * 应用名称,支持的类型通过GetUESAppVersion AppVersionList[].AppName, 默认为elasticsearch + */ + AppName?: string; + /** + * 备注,默认为空 + */ + Remark?: string; + /** + * 计费类型,默认为Month + */ + ChargeType?: string; + /** + * 计费长度,默认为1 + */ + Quantity?: number; + /** + * 主节点类型标示,支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf, 默认为空 + */ + MasterConf?: string; + /** + * 业务组ID标识 + */ + BusinessId?: string; + /** + * Coordinating节点机型配置,, 支持的机型可通过GetUESNodeConf NodeConfList[].NodeConf, 默认为空 + */ + CoordinatingNodeConf?: string; + /** + * Coordinating节点数量 + */ + CoordinatingNodeSize?: number; + /** + * Coordinating节点磁盘类型 + */ + CoordinatingNodeDiskConf?: string; + /** + * 是否开启安全组,默认为false + */ + IsSecGroup?: boolean; + /** + * 安全组ID,开启安全组必填,至多可以同时绑定5个安全组 + */ + SecGroupIds?: string[]; + /** + * 是否为多可用区,默认为false + */ + IsMultiZone?: boolean; + /** + * 多可用区名称,默认空数组 [] + */ + MultiZones?: string[]; +} + +/** + * CreateUESInstance - 创建实例 + */ +export interface CreateUESInstanceResponse { + /** + * 实例ID + */ + InstanceId?: string; +} + +/** + * DeleteUESInstance - 删除实例 + */ +export interface DeleteUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; +} + +/** + * DeleteUESInstance - 删除实例 + */ +export interface DeleteUESInstanceResponse {} + +/** + * DescribeUESInstanceV2 - 查询指定实例详细信息 + */ +export interface DescribeUESInstanceV2Request { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 集群实例ID + */ + InstanceId: string; +} + +/** + * DescribeUESInstanceV2 - 查询指定实例详细信息 + */ +export interface DescribeUESInstanceV2Response { + /** + * 返回结果 + */ + Result?: { + /** + * + */ + RequestId?: string; + /** + * + */ + ClusterInfo?: { + /** + * 地域 + */ + Region?: string; + /** + * 可用区 + */ + Zone?: string; + /** + * 服务集群ID标识 + */ + UESInstanceId: string; + /** + * 服务集群名称 + */ + UESInstanceName: string; + /** + * 服务版本号 + */ + ServiceVersion: string; + /** + * VPCID标识 + */ + VPCId: string; + /** + * 服务集群状态 + */ + State: string; + /** + * 项目组ID标识 + */ + BusinessId?: string; + /** + * 子网ID标识 + */ + SubnetId?: string; + /** + * Vip + */ + Vip?: string; + }; + /** + * + */ + NodeInfoList?: { + /** + * 节点ID + */ + NodeId: string; + /** + * 节点名称 + */ + NodeName: string; + /** + * 节点类型 + */ + NodeRole: string; + /** + * 节点IP + */ + NodeIP: string; + /** + * 节点配置标识 + */ + NodeConf: string; + /** + * 节点状态 + */ + NodeState: string; + /** + * 节点磁盘类型 + */ + DiskType: string; + /** + * 节点磁盘大小 + */ + DiskSize: number; + /** + * 节点内存大小 + */ + Memory: number; + /** + * 节点cpu数量 + */ + CPU: number; + }[]; + }; +} + +/** + * ExpandUESInstance - 扩容实例节点 + */ +export interface ExpandUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 扩容后对应类型节点的数目 + */ + NodeCount: number; + /** + * 节点类型(compute、coordinating) + */ + NodeRole: string; +} + +/** + * ExpandUESInstance - 扩容实例节点 + */ +export interface ExpandUESInstanceResponse {} + +/** + * GetUESAppVersion - 获取服务应用版本列表 + */ +export interface GetUESAppVersionRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} + +/** + * GetUESAppVersion - 获取服务应用版本列表 + */ +export interface GetUESAppVersionResponse { + /** + * 服务应用版本个数 + */ + TotalCount: number; + /** + * 服务应用版本列表 + */ + AppVersionList: { + /** + * 应用名称,默认值为elasticsearch + */ + AppName: string; + /** + * 应用版本号 + */ + AppVersion: string; + /** + * 是否支持多区部署,默认为false + */ + IsMultiZone: boolean; + }[]; +} + +/** + * GetUESDiskSizeLimitation - 获取磁盘容量限制 + */ +export interface GetUESDiskSizeLimitationRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} + +/** + * GetUESDiskSizeLimitation - 获取磁盘容量限制 + */ +export interface GetUESDiskSizeLimitationResponse { + /** + * 各磁盘类型容量限制列表 + */ + DiskSizeLimitationSet?: { + /** + * 数据盘类别,包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。 + */ + DiskType?: string; + /** + * 最大值,单位GB + */ + MaxSize?: number; + /** + * 最小值,单位GB + */ + MinSize?: number; + }[]; +} + +/** + * GetUESNodeConf - 获取节点配置列表 + */ +export interface GetUESNodeConfRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} + +/** + * GetUESNodeConf - 获取节点配置列表 + */ +export interface GetUESNodeConfResponse { + /** + * 所有节点配置信息的个数 + */ + TotalCount: number; + /** + * 服务节点配置信息列表 + */ + NodeConfList: { + /** + * 内存,单位为GB + */ + Memory: number; + /** + * CPU数量 + */ + CPU: number; + /** + * 节点配置标识 + */ + NodeConf: string; + /** + * 磁盘类型[RSSD|SSD] + */ + DiskType: string; + /** + * 磁盘大小,单位为GB + */ + DiskSize: number; + /** + * 是否支持安全组[true|false] + */ + IsSecGroup: boolean; + }[]; +} + +/** + * ListUESInstance - 获取实例列表 + */ +export interface ListUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 数据偏移量, 默认为0 + */ + Offset?: number; + /** + * 返回数据长度, 默认为30 + */ + Limit?: number; +} + +/** + * ListUESInstance - 获取实例列表 + */ +export interface ListUESInstanceResponse { + /** + * 实例信息列表 + */ + ClusterSet: { + /** + * 可用区 + */ + Zone: string; + /** + * 项目组ID标识 + */ + BusinessId: string; + /** + * 计费类型,默认为Month + */ + ChargeType: string; + /** + * 创建时间 + */ + CreateTime: number; + /** + * 失效时间 + */ + ExpireTime: number; + /** + * 节点个数,默认为集群大小 + */ + NodeCount: number; + /** + * 实例运行时长 + */ + RunTime: number; + /** + * 应用服务版本号 + */ + AppVersion: string; + /** + * 实例状态 + */ + State: string; + /** + * 实例资源ID + */ + InstanceId: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 应用名称 + */ + AppName: string; + /** + * 服务集群ID标识(弃用) + */ + UESInstanceId?: string; + /** + * 服务集群名称(弃用) + */ + UESInstanceName?: string; + /** + * 服务版本号(弃用) + */ + ServiceVersion?: string; + /** + * 子网ID标识 + */ + SubnetId?: string; + /** + * 业务组 + */ + Tag?: string; + /** + * VPCID标识 + */ + VPCId?: string; + /** + * VIP地址信息 + */ + Vip?: string; + /** + * 是否开启安全组 + */ + IsSecGroup?: boolean; + /** + * 多可用区 + */ + MultiZones?: string[]; + /** + * 是否支持改配 + */ + Resizable?: boolean; + }[]; + /** + * 实例个数 + */ + TotalCount: number; +} + +/** + * ResizeUESInstance - 改配实例节点配置 + */ +export interface ResizeUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 节点类型(compute、master、coordinating、kibana、dashboard) + */ + NodeRole: string; + /** + * 改配节点类型,NodeDiskSize为0,基于NodeRole 进行改配 + */ + NodeConf?: string; + /** + * 改配节点磁盘大小,NodeConf 为空字符串,基于NodeRole 进行改配 + */ + NodeDiskSize?: number; + /** + * 进行改配操作是否强制检查集群健康状态,默认为false + */ + ForceResizing?: boolean; +} + +/** + * ResizeUESInstance - 改配实例节点配置 + */ +export interface ResizeUESInstanceResponse {} + +/** + * RestartUESInstance - 重启实例 + */ +export interface RestartUESInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; +} + +/** + * RestartUESInstance - 重启实例 + */ +export interface RestartUESInstanceResponse {} diff --git a/src/services/uhadoop/index.ts b/src/services/uhadoop/index.ts new file mode 100644 index 0000000..562ed5e --- /dev/null +++ b/src/services/uhadoop/index.ts @@ -0,0 +1,887 @@ +import Client from '../../core/client'; +import Request from '../../core/request'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; + +/** + * This client is used to call actions of **uhadoop** service + */ +export default class UHadoopClient extends Client { + constructor({ + config, + credential, + }: { + config: ConfigOptions; + credential: CredentialOptions; + }) { + super({ config, credential }); + } + + /** + * AddUHadoopInstanceNode - 给已有集群添加一定数量的节点 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/add_uhadoop_instance_node + */ + addUHadoopInstanceNode( + request?: AddUHadoopInstanceNodeRequest + ): Promise { + const args = { Action: 'AddUHadoopInstanceNode', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as AddUHadoopInstanceNodeResponse + ); + } + + /** + * CreateUHadoopInstance - 新建一个uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/create_uhadoop_instance + */ + createUHadoopInstance( + request?: CreateUHadoopInstanceRequest + ): Promise { + const args = { Action: 'CreateUHadoopInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as CreateUHadoopInstanceResponse + ); + } + + /** + * DeleteUHadoopInstance - 删除掉一个uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/delete_uhadoop_instance + */ + deleteUHadoopInstance( + request?: DeleteUHadoopInstanceRequest + ): Promise { + const args = { Action: 'DeleteUHadoopInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DeleteUHadoopInstanceResponse + ); + } + + /** + * DescribeUHadoopInstance - 描述集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/describe_uhadoop_instance + */ + describeUHadoopInstance( + request?: DescribeUHadoopInstanceRequest + ): Promise { + const args = { Action: 'DescribeUHadoopInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DescribeUHadoopInstanceResponse + ); + } + + /** + * GetUHadoopNodeType - 获取节点类型信息 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/get_uhadoop_node_type + */ + getUHadoopNodeType( + request?: GetUHadoopNodeTypeRequest + ): Promise { + const args = { Action: 'GetUHadoopNodeType', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUHadoopNodeTypeResponse + ); + } + + /** + * ListUHadoopFrameworkApp - 列举可选app + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_framework_app + */ + listUHadoopFrameworkApp( + request?: ListUHadoopFrameworkAppRequest + ): Promise { + const args = { Action: 'ListUHadoopFrameworkApp', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUHadoopFrameworkAppResponse + ); + } + + /** + * ListUHadoopFrameworkAppByUseCase - 按使用场景列出uhadoop的框架和框架中的应用 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_framework_app_by_use_case + */ + listUHadoopFrameworkAppByUseCase( + request?: ListUHadoopFrameworkAppByUseCaseRequest + ): Promise { + const args = { + Action: 'ListUHadoopFrameworkAppByUseCase', + ...(request || {}), + }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUHadoopFrameworkAppByUseCaseResponse + ); + } + + /** + * ListUHadoopInstance - 列出用户所有的uhadoop集群 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/list_uhadoop_instance + */ + listUHadoopInstance( + request?: ListUHadoopInstanceRequest + ): Promise { + const args = { Action: 'ListUHadoopInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUHadoopInstanceResponse + ); + } + + /** + * RestartUHadoopService - 重启集群服务(包含start|stop|restart) + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/restart_uhadoop_service + */ + restartUHadoopService( + request?: RestartUHadoopServiceRequest + ): Promise { + const args = { Action: 'RestartUHadoopService', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as RestartUHadoopServiceResponse + ); + } + + /** + * UpgradeUHadoopNode - 升级uhadoop节点 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/upgrade_uhadoop_node + */ + upgradeUHadoopNode( + request?: UpgradeUHadoopNodeRequest + ): Promise { + const args = { Action: 'UpgradeUHadoopNode', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as UpgradeUHadoopNodeResponse + ); + } + + /** + * UpgradeUHadoopNodeDisk - 扩容集群节点磁盘 + * + * See also: https://docs.ucloud.cn/api/uhadoop-api/upgrade_uhadoop_node_disk + */ + upgradeUHadoopNodeDisk( + request?: UpgradeUHadoopNodeDiskRequest + ): Promise { + const args = { Action: 'UpgradeUHadoopNodeDisk', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as UpgradeUHadoopNodeDiskResponse + ); + } +} + +/** + * AddUHadoopInstanceNode - 给已有集群添加一定数量的节点 + */ +export interface AddUHadoopInstanceNodeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 节点的角色,值为task|core|client之一 + */ + NodeRole: string; + /** + * 机型,如:o.hadoop2m.medium,可从GetUHadoopNodeType接口获取 + */ + NodeType: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 数据盘数量,非裸金属机型时必填 + */ + DataDiskNum?: string; + /** + * 密码,NodeRole为client时必填 + */ + Password?: string; + /** + * 系统盘容量,非裸金属机型必填 + */ + BootDiskSize?: string; + /** + * 系统盘类型,非裸金属机型必填,例如:CLOUD_RSSD + */ + BootDiskType?: string; + /** + * 数据盘容量,非裸金属机型必填 + */ + DataDiskSize?: string; + /** + * 数据盘类型,非裸金属机型必填,例如:CLOUD_RSSD + */ + DataDiskType?: string; + /** + * 节点数量,默认为1 + */ + NodeCount?: number; +} + +/** + * AddUHadoopInstanceNode - 给已有集群添加一定数量的节点 + */ +export interface AddUHadoopInstanceNodeResponse {} + +/** + * CreateUHadoopInstance - 新建一个uhadoop集群 + */ +export interface CreateUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 集群机器的登录密码 + */ + Password: string; + /** + * 版本,例如:3.2.1-udh3.0,通过ListUHadoopFrameworkApp接口获取 + */ + FrameworkVersion: string; + /** + * 节点配置,里面包括NodeType(机型),NodeRole(节点类别,值为其中之一:master|core|task),Count(数量),DataDiskType(数据盘类别),DataDiskSize(数据盘大小),DataDiskNum(数据盘数量),BootDiskType(系统盘类型),BootDiskSize(系统盘大小),通过GetUHadoopNodeType接口获取,示例为:InstanceGroupConfigs.0.NodeType=o.hadoop2m.xlargeInstanceGroupConfigs.0.NodeRole=masterInstanceGroupConfigs.0.Count=2InstanceGroupConfigs.0.DataDiskType=CLOUD_RSSDInstanceGroupConfigs.0.DataDiskSize=100InstanceGroupConfigs.0.DataDiskNum=1InstanceGroupConfigs.0.BootDiskType=CLOUD_RSSDInstanceGroupConfigs.0.BootDiskSize=50InstanceGroupConfigs.1.NodeType=o.hadoop2m.xlargeInstanceGroupConfigs.1.NodeRole=coreInstanceGroupConfigs.1.Count=3InstanceGroupConfigs.1.DataDiskType=CLOUD_RSSDInstanceGroupConfigs.1.DataDiskSize=200InstanceGroupConfigs.1.DataDiskNum=1InstanceGroupConfigs.1.BootDiskType=CLOUD_RSSDInstanceGroupConfigs.1.BootDiskSize=50 + */ + InstanceGroupConfigs: string[]; + /** + * VPCId + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 集群需要安装的组件,格式:组件#版本通过ListUHadoopFrameworkApp接口获取,例如:Spark#3.3.0 + */ + AppConfig: string[]; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * 支付类别,默认:Month + */ + ChargeType?: string; + /** + * 数量,默认1 + */ + Quantity?: number; + /** + * 工作组ID,默认Default + */ + BusinessId?: string; + /** + * Framework为‘MR’时,存储集群ID + */ + StorgeClusterId?: string; + /** + * 目前只支持传‘udb’ + */ + StandAloneMetaStore?: string; + /** + * 是否开启安全组 + */ + IsSecurityEnabled?: string; + /** + * 安全组ID,字符串数组,IsSecurityEnabled为true时生效 + */ + SecGroupIds?: string; + /** + * US3 bucket名称,仅支持框架为StarRocks存算分离时传入 + */ + US3Bucket?: string; + /** + * US3 配置公钥,仅支持框架为StarRocks存算分离时传入 + */ + US3AccessKey?: string; + /** + * US3 配置私钥,仅支持框架为StarRocks存算分离时传入 + */ + US3SecretKey?: string; + /** + * US3 Token名称,仅支持框架为StarRocks存算分离时传入 + */ + US3TokenName?: string; + /** + * 实例名称,默认为实例ID + */ + InstanceName?: string; +} + +/** + * CreateUHadoopInstance - 新建一个uhadoop集群 + */ +export interface CreateUHadoopInstanceResponse { + /** + * 实例ID + */ + InstanceId?: string; +} + +/** + * DeleteUHadoopInstance - 删除掉一个uhadoop集群 + */ +export interface DeleteUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 是否释放绑定的EIP。true: 解绑EIP后,并释放;其他值或不填:解绑EIP。 + */ + ReleaseEIP?: boolean; +} + +/** + * DeleteUHadoopInstance - 删除掉一个uhadoop集群 + */ +export interface DeleteUHadoopInstanceResponse {} + +/** + * DescribeUHadoopInstance - 描述集群 + */ +export interface DescribeUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * VPCID + */ + VPCId?: string; + /** + * 子网ID + */ + SubnetId?: string; +} + +/** + * DescribeUHadoopInstance - 描述集群 + */ +export interface DescribeUHadoopInstanceResponse { + /** + * 集群信息 + */ + ClusterSet?: { + /** + * 可用区 + */ + Zone: string; + /** + * 集群Tag + */ + Tag: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * VPC ID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 业务组ID + */ + BusinessId: string; + /** + * Uhadoop版本,值为 uhadoop 3.0|uhadoop 2.2|uhadoop 3.1 + */ + ReleaseVersion: string; + /** + * Hadoop版本,值为 hadoop3.2.1-udh3.0|hadoop3.3.4-udh3.1|hadoop2.8.5-udh2.2 + */ + HadoopVersion: string; + /** + * 创建时间 + */ + CreateTime: string; + /** + * 付费类型 + */ + ChargeType: string; + /** + * 到期时间 + */ + ExpireTime: string; + /** + * 状态,值为以下其中之一,Running(运行中)|Creating(创建中)|CreateFailed(创建失败)|Deploying(部署中)|Updating(变更中) + */ + State: string; + /** + * Master节点数量 + */ + MasterCount: string; + /** + * core节点数量 + */ + CoreCount: string; + /** + * Task节点数量 + */ + TaskCount: string; + /** + * 运行时间 + */ + RunningTime?: string; + /** + * 组件集合 + */ + AppConfigSet?: string; + /** + * 组件数量 + */ + AppConfigCount?: string; + /** + * 是否开启安全组 + */ + IsOpenSecGroup?: string; + /** + * 节点集合 + */ + NodeSet?: string; + /** + * 节点数量 + */ + NodeCount?: string; + }[]; +} + +/** + * GetUHadoopNodeType - 获取节点类型信息 + */ +export interface GetUHadoopNodeTypeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 框架版本,例如3.2.1-udh3.0,通过ListUHadoopFrameworkApp接口获取 + */ + FrameworkVersion?: string; + /** + * 角色,master|core|task + */ + NodeRole?: string; + /** + * 机型名称 + */ + NodeType?: string; + /** + * 框架,例如Hadoop|MR|HDFS|StarRocks,Hadoop框架包含存储与计算服务,MR集群包含计算服务,HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework?: string; +} + +/** + * GetUHadoopNodeType - 获取节点类型信息 + */ +export interface GetUHadoopNodeTypeResponse { + /** + * 类型信息 + */ + InstanceTypeSet: { + /** + * 机型名称 + */ + NodeType: string; + /** + * 机型种类,可选Outstanding(快杰机型)|General(普通机型)|BareMetal(裸金属机型)|GPU(GPU机型)四种类型 + */ + HostType: string; + /** + * 可用的节点类型,值为core|task|master之一 + */ + SuitableRole: string[]; + /** + * cpu大小 + */ + CPU: string; + /** + * cpu内存比 + */ + CPUToMemoryRatio: string; + /** + * 内存大小 + */ + Memory: string; + /** + * 磁盘信息 + */ + DiskSet: { + /** + * 总磁盘大小 + */ + Size: number; + /** + * 磁盘角色,分Data数据盘和Boot系统盘 + */ + Type: string; + /** + * 可支持的磁盘类型 + */ + DiskType: string[]; + /** + * 单块盘大小 + */ + SingleDiskSize?: number; + /** + * 磁盘数量 + */ + DiskNum?: number; + /** + * 最大磁盘数量 + */ + DiskMaxNum?: string; + /** + * 最大单块盘容量,单位GB + */ + DiskMaxSize?: string; + /** + * 最小磁盘数量 + */ + DiskMinNum?: string; + /** + * 最小单块盘容量,单位GB + */ + DiskMinSize?: string; + }[]; + /** + * 是否可用,该机型是否支持创建 + */ + IsUsable: string; + /** + * 是否支持开启安全组 + */ + IsOpenSecgroup?: string; + /** + * GPU型号 + */ + GpuType?: string; + /** + * GPU数量 + */ + GpuCount?: number; + }[]; + /** + * 当前可用区是否支持元数据库使用UDB + */ + MetaDataUDBUsable?: boolean; + /** + * 机型可支持的节点类型 + */ + HostTypeSupportNodeType?: string; +} + +/** + * ListUHadoopFrameworkApp - 列举可选app + */ +export interface ListUHadoopFrameworkAppRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * 实例ID,可选。传的话,过滤出适合此集群的app信息。 + */ + InstanceId?: string; +} + +/** + * ListUHadoopFrameworkApp - 列举可选app + */ +export interface ListUHadoopFrameworkAppResponse { + /** + * 应用配置详情 + */ + AppConfigSet?: { + /** + * 需要安装的应用如:Hive,HBase, Spark,Hue,Pig等其他组件 + */ + AppName?: string; + /** + * 应用的版本号(0.13.1,0.98.6 等等) + */ + AppVersion?: string; + /** + * 应用的状态(运行中)'Running'|(已停止)'Stopped'|(启动中)'Starting'|(停止中)'Stopping'|(启动失败)'StartFailed'|(停止失败)'StopFailed'|(安装中)'Installing'|(安装失败)'InstallFailed'|(未安装)'NotInstalled', + */ + AppStatus?: string; + }[]; +} + +/** + * ListUHadoopFrameworkAppByUseCase - 按使用场景列出uhadoop的框架和框架中的应用 + */ +export interface ListUHadoopFrameworkAppByUseCaseRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} + +/** + * ListUHadoopFrameworkAppByUseCase - 按使用场景列出uhadoop的框架和框架中的应用 + */ +export interface ListUHadoopFrameworkAppByUseCaseResponse { + /** + * 使用场景的app版本信息 + */ + AppConfigSet?: { + /** + * UHadoop版本,值为 uhadoop 3.0|uhadoop 2.2|uhadoop 3.1 + */ + ReleaseVersion?: string; + /** + * Hadoop版本,值为 hadoop3.2.1-udh3.0|hadoop3.3.4-udh3.1 |hadoop2.8.5-udh2.2 + */ + HadoopVersion?: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,框架,例如Hadoop|MR|HDFS|StarRocks Hadoop框架包含存储与计算服务 MR集群包含计算服务 HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework?: string; + /** + * 框架版本 + */ + FrameworkVersion?: string; + /** + * 框架示例 + */ + UseCases?: { + /** + * 集群种类 + */ + Case?: string; + /** + * 依赖的组件 + */ + MustHas?: string; + /** + * 组件版本 + */ + AppVersion?: string; + }[]; + }[]; +} + +/** + * ListUHadoopInstance - 列出用户所有的uhadoop集群 + */ +export interface ListUHadoopInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 获取列表的长度限制,默认值为60 + */ + Limit?: number; + /** + * 获取列表的偏移,默认值为0 + */ + Offset?: number; +} + +/** + * ListUHadoopInstance - 列出用户所有的uhadoop集群 + */ +export interface ListUHadoopInstanceResponse { + /** + * 集群信息集合 + */ + ClusterSet: { + /** + * 可用区 + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 实例名称 + */ + InstanceName: string; + /** + * 框架,值为'Hadoop'|'HDFS'|'MR'|'StarRocks'之一,Hadoop框架包含存储与计算服务,MR集群包含计算服务,HDFS只包含存储服务,StarRocks为StarRocks集群 + */ + Framework: string; + /** + * VPC ID + */ + VPCId: string; + /** + * 子网ID + */ + SubnetId: string; + /** + * 业务组ID + */ + BusinessId: string; + /** + * Uhadoop版本,值为 uhadoop 3.0|uhadoop 2.2|uhadoop 3.1 + */ + ReleaseVersion: string; + /** + * Hadoop版本,值为 hadoop3.2.1-udh3.0|hadoop3.3.4-udh3.1 |hadoop2.8.5-udh2.2 + */ + HadoopVersion: string; + /** + * 创建时间 + */ + CreateTime: string; + /** + * 状态,值为以下其中之一,Running(运行中)|Creating(创建中)|CreateFailed(创建失败)|Deploying(部署中)|Updating(变更中) + */ + State: string; + }[]; + /** + * 总数 + */ + TotalCount: number; +} + +/** + * RestartUHadoopService - 重启集群服务(包含start|stop|restart) + */ +export interface RestartUHadoopServiceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 要操作的服务名。可通过ListUHadoopFrameworkApp接口获取 + */ + ServiceName: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 应用版本,ApplicationVersion传参时,表示这次操作是整个应用所有服务。 + */ + ApplicationVersion?: string; + /** + * 只启动。值为false|true之一,默认false,当OnlyStart和OnlyStop同时置为true,则重启。 + */ + OnlyStart?: boolean; + /** + * 只停止。值为false|true之一,默认false。当OnlyStart和OnlyStop同时置为true,则重启。 + */ + OnlyStop?: boolean; + /** + * 要操作的NodeId数组。如果传入,则用于过滤操作哪些Node。 + */ + NodeId?: string[]; + /** + * 要操作的NodeRole数组。如果传入,则用于过滤操作哪些Node。值为以下之一master|core|task + */ + NodeRole?: string[]; +} + +/** + * RestartUHadoopService - 重启集群服务(包含start|stop|restart) + */ +export interface RestartUHadoopServiceResponse { + /** + * 当前执行状态,running(操作运行中)|success(操作成功)|failed(操作失败)|killed(操作被终止)。 + */ + State?: string; +} + +/** + * UpgradeUHadoopNode - 升级uhadoop节点 + */ +export interface UpgradeUHadoopNodeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 节点角色,支持"master"|"core"|"task" + */ + NodeRole: string; + /** + * 节点新机型,通过GetUHadoopNodeType接口获取 + */ + NodeType: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 节点名称,当NodeRole不为master时必填 + */ + NodeNames?: string[]; +} + +/** + * UpgradeUHadoopNode - 升级uhadoop节点 + */ +export interface UpgradeUHadoopNodeResponse {} + +/** + * UpgradeUHadoopNodeDisk - 扩容集群节点磁盘 + */ +export interface UpgradeUHadoopNodeDiskRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 节点角色,值为master|core|task之一 + */ + NodeRole: string; + /** + * 新的数据盘磁盘大小 + */ + DataDiskSize: number; + /** + * 实例ID + */ + InstanceId: string; + /** + * 节点名称集合,当NodeRole不为master时必填 + */ + NodeNames?: string[]; + /** + * 系统盘磁盘大小,仅支持云盘裸金属机型(系统盘和数据盘数值同时增加、只会处理系统盘参数) + */ + BootDiskSize?: number; +} + +/** + * UpgradeUHadoopNodeDisk - 扩容集群节点磁盘 + */ +export interface UpgradeUHadoopNodeDiskResponse {} diff --git a/src/services/ukafka/index.ts b/src/services/ukafka/index.ts new file mode 100644 index 0000000..64f79f5 --- /dev/null +++ b/src/services/ukafka/index.ts @@ -0,0 +1,930 @@ +import Client from '../../core/client'; +import Request from '../../core/request'; +import { ConfigOptions } from '../../core/config'; +import { CredentialOptions } from '../../core/credential'; + +/** + * This client is used to call actions of **ukafka** service + */ +export default class UKafkaClient extends Client { + constructor({ + config, + credential, + }: { + config: ConfigOptions; + credential: CredentialOptions; + }) { + super({ config, credential }); + } + + /** + * AddUKafkaInstanceNode - 给实例添加节点 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/add_ukafka_instance_node + */ + addUKafkaInstanceNode( + request?: AddUKafkaInstanceNodeRequest + ): Promise { + const args = { Action: 'AddUKafkaInstanceNode', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as AddUKafkaInstanceNodeResponse + ); + } + + /** + * CreateUKafkaInstance - 创建一个ukafka实例 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/create_ukafka_instance + */ + createUKafkaInstance( + request?: CreateUKafkaInstanceRequest + ): Promise { + const args = { Action: 'CreateUKafkaInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as CreateUKafkaInstanceResponse + ); + } + + /** + * DeleteUKafkaInstance - 删除实例 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/delete_ukafka_instance + */ + deleteUKafkaInstance( + request?: DeleteUKafkaInstanceRequest + ): Promise { + const args = { Action: 'DeleteUKafkaInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DeleteUKafkaInstanceResponse + ); + } + + /** + * DescribeUKafkaConsumer - 获取 Kafka 消费组信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/describe_ukafka_consumer + */ + describeUKafkaConsumer( + request?: DescribeUKafkaConsumerRequest + ): Promise { + const args = { Action: 'DescribeUKafkaConsumer', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DescribeUKafkaConsumerResponse + ); + } + + /** + * DescribeUKafkaInstance - 获取整个集群的信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/describe_ukafka_instance + */ + describeUKafkaInstance( + request?: DescribeUKafkaInstanceRequest + ): Promise { + const args = { Action: 'DescribeUKafkaInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as DescribeUKafkaInstanceResponse + ); + } + + /** + * GetUKafkaNodeType - 获取节点机型配置 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/get_ukafka_node_type + */ + getUKafkaNodeType( + request?: GetUKafkaNodeTypeRequest + ): Promise { + const args = { Action: 'GetUKafkaNodeType', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as GetUKafkaNodeTypeResponse + ); + } + + /** + * IsUKafkaTopicNameExist - 检查一个topic名称是否已经在集群中了 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/is_ukafka_topic_name_exist + */ + isUKafkaTopicNameExist( + request?: IsUKafkaTopicNameExistRequest + ): Promise { + const args = { Action: 'IsUKafkaTopicNameExist', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as IsUKafkaTopicNameExistResponse + ); + } + + /** + * ListUKafkaConsumers - 列出 Kafka 消费组 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_consumers + */ + listUKafkaConsumers( + request?: ListUKafkaConsumersRequest + ): Promise { + const args = { Action: 'ListUKafkaConsumers', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUKafkaConsumersResponse + ); + } + + /** + * ListUKafkaFrameworkVersion - 列举ukafka框架版本 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_framework_version + */ + listUKafkaFrameworkVersion( + request?: ListUKafkaFrameworkVersionRequest + ): Promise { + const args = { Action: 'ListUKafkaFrameworkVersion', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUKafkaFrameworkVersionResponse + ); + } + + /** + * ListUKafkaInstance - 列举集群信息 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_instance + */ + listUKafkaInstance( + request?: ListUKafkaInstanceRequest + ): Promise { + const args = { Action: 'ListUKafkaInstance', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUKafkaInstanceResponse + ); + } + + /** + * ListUKafkaTopics - 展示kafka集群上所有topic + * + * See also: https://docs.ucloud.cn/api/ukafka-api/list_ukafka_topics + */ + listUKafkaTopics( + request?: ListUKafkaTopicsRequest + ): Promise { + const args = { Action: 'ListUKafkaTopics', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ListUKafkaTopicsResponse + ); + } + + /** + * ModifyUKafkaInstanceType - 规格升降级 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/modify_ukafka_instance_type + */ + modifyUKafkaInstanceType( + request?: ModifyUKafkaInstanceTypeRequest + ): Promise { + const args = { Action: 'ModifyUKafkaInstanceType', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ModifyUKafkaInstanceTypeResponse + ); + } + + /** + * ResizeUKafkaDisk - 磁盘扩容 + * + * See also: https://docs.ucloud.cn/api/ukafka-api/resize_ukafka_disk + */ + resizeUKafkaDisk( + request?: ResizeUKafkaDiskRequest + ): Promise { + const args = { Action: 'ResizeUKafkaDisk', ...(request || {}) }; + return this.invoke(new Request(args)).then( + (resp) => resp.toObject() as ResizeUKafkaDiskResponse + ); + } +} + +/** + * AddUKafkaInstanceNode - 给实例添加节点 + */ +export interface AddUKafkaInstanceNodeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 机型,支持的机型可通过GetUKafkaNodeType 接口返回的InstanceTypeSet[].InstanceTypeName + */ + NodeType: string; + /** + * 新添加节点数量 + */ + NodeCount: number; +} + +/** + * AddUKafkaInstanceNode - 给实例添加节点 + */ +export interface AddUKafkaInstanceNodeResponse {} + +/** + * CreateUKafkaInstance - 创建一个ukafka实例 + */ +export interface CreateUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * kafka版本,支持的版本可通过ListUKafkaFrameworkVersion 接口返回字段的FrameworkVersions获取 + */ + FrameworkVersion: string; + /** + * VPCID + */ + VPCId: string; + /** + * 子网 ID + */ + SubnetId: string; + /** + * 付费方式 + */ + ChargeType: string; + /** + * 机型,支持的机型可通过GetUKafkaNodeType 接口返回的InstanceTypeSet[].InstanceTypeName + */ + NodeType: string; + /** + * 数据盘大小。支持范围根据GetUKafkaNodeType 接口返回的InstanceTypeSet[].MaxDiskSize 和MinDiskSize获取 + */ + DiskSize: number; + /** + * 实例名,可自定义 + */ + InstanceName: string; + /** + * 业务组,默认Default + */ + BusinessId?: string; + /** + * 实例数量,默认 1 + */ + Quantity?: string; + /** + * 集群节点数量。默认 3 节点 + */ + NodeCount?: number; + /** + * kafka 日志保存时间,支持范围[1,240]。默认 72 小时 + */ + LogRetentionHours?: string; + /** + * 磁盘管理方式,支持值:NONE、CLEAN。默认值:NONE + */ + DiskControllerType?: string; + /** + * 磁盘清理阈值,支持范围[70,90]。DiskControllerType 为CLEAN 时必填。默认值 90 + */ + DiskThreshold?: string; + /** + * 是否开启安全组,支持"true","false",默认 false + */ + IsSecurityEnabled?: string; +} + +/** + * CreateUKafkaInstance - 创建一个ukafka实例 + */ +export interface CreateUKafkaInstanceResponse { + /** + * 实例资源 ID + */ + InstanceId: string; +} + +/** + * DeleteUKafkaInstance - 删除实例 + */ +export interface DeleteUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; +} + +/** + * DeleteUKafkaInstance - 删除实例 + */ +export interface DeleteUKafkaInstanceResponse {} + +/** + * DescribeUKafkaConsumer - 获取 Kafka 消费组信息 + */ +export interface DescribeUKafkaConsumerRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * Kafka 集群 ID + */ + ClusterInstanceId: string; + /** + * 消费组组名 + */ + ConsumerGroup: string; + /** + * 消费者组类型(同消费者组列表返回的类型值) + */ + Type: string; +} + +/** + * DescribeUKafkaConsumer - 获取 Kafka 消费组信息 + */ +export interface DescribeUKafkaConsumerResponse { + /** + * 消费者组组名 + */ + GroupName?: string; + /** + * 消费者组类型 + */ + Type?: string; + /** + * 消费者组所订阅 topic 信息 + */ + Topics?: string; +} + +/** + * DescribeUKafkaInstance - 获取整个集群的信息 + */ +export interface DescribeUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID,可以通过ListUKafkaInstance 接口的ClusterSet. ClusterInstanceId 获取 + */ + ClusterInstanceId: string; +} + +/** + * DescribeUKafkaInstance - 获取整个集群的信息 + */ +export interface DescribeUKafkaInstanceResponse { + /** + * 集群信息列表 + */ + ClusterSet: { + /** + * 所属可用区 + */ + Zone?: string; + /** + * 是否开启自动续费 + */ + AutoRenew?: string; + /** + * 业务组 ID + */ + BusinessId?: string; + /** + * 付费类型 + */ + ChargeType?: string; + /** + * 实例id + */ + ClusterInstanceId?: string; + /** + * 实例名称 + */ + ClusterInstanceName?: string; + /** + * 实例创建时间 + */ + CreateTime?: number; + /** + * 实例过期时间 + */ + ExpireTime?: number; + /** + * 实例框架 + */ + Framework?: string; + /** + * 实例框架版本 + */ + FrameworkVersion?: string; + /** + * 网络 id(已废弃) + */ + NetworkId?: string; + /** + * 实例备注 + */ + Remark?: string; + /** + * 实例运行时间 + */ + RunningTime?: number; + /** + * 实例当前状态,实例状态:"Running"| "Abnormal"| "Creating"| "Deleting"| "CreateFailed"| "DeleteFailed"| "Unavailable"| "Deleted"| "Updating"| "Deploying"| "Migrating"| "ExpandFailed" + */ + State?: string; + /** + * 所属子网 id + */ + SubnetId?: string; + /** + * 实例标记 + */ + Tag?: string; + /** + * 实例节点个数 + */ + UHostCount?: number; + /** + * 节点信息列表 + */ + UHostSet?: { + /** + * broker 访问端点 + */ + Endpoints: { + /** + * PLAINTEXT 协议访问信息 + */ + PlainText: { + /** + * 访问协议 + */ + Protocal?: string; + /** + * 访问地址 + */ + Addr?: string; + }; + /** + * SASL_PLAINTEXT 协议访问信息 + */ + SaslPlainText?: { + /** + * 访问协议 + */ + Protocal?: string; + /** + * 访问地址 + */ + Addr?: string; + }; + }; + /** + * broker id + */ + BrokerId?: string; + /** + * broker 关联topic 信息 + */ + BrokerInfo?: { + /** + * topic 在 broker 上分布的 partition 数量 + */ + PartitionOnBroker?: string; + /** + * topic 在 broker上 partition 列表 + */ + Partitions?: string; + /** + * Topic 副本数 + */ + Replication?: number; + /** + * topic 名称 + */ + TopicName?: string; + /** + * partition 数量 + */ + TotalPartitions?: number; + }[]; + /** + * broker 创建信息 + */ + CreateTime?: string; + /** + * broker 域名 + */ + DomainName?: string; + /** + * broker 过期时间 + */ + ExpireTime?: number; + /** + * broker IP 信息 + */ + IPSet?: { + /** + * IP地址 + */ + IP?: string; + /** + * IP类型 + */ + Type?: string; + }[]; + /** + * broker 机型信息 + */ + InstanceGroupType?: string; + /** + * kafka 服务端口 + */ + KafkaPort?: number; + /** + * broker 备注信息 + */ + Remark?: string; + /** + * broker 注册资源信息 + */ + ResourceId?: string; + /** + * 安全组 id + */ + SecurityGroupId?: string; + /** + * broker 当前状态 + */ + State?: string; + /** + * broker 节点配置 + */ + UHostConfig?: { + /** + * 节点数据盘类型 + */ + DiskType?: string; + /** + * 节点系统盘大小(单位G)【删除】 + */ + BootDiskSize?: number; + /** + * 节点 CPU 核心数 + */ + CPU?: number; + /** + * 节点数据盘大小(单位G) + */ + DataDiskSize?: number; + /** + * 节点内存(单位MB) + */ + Memory?: number; + /** + * 节点内部系统名称【删除】 + */ + OS?: string; + }; + /** + * 节点 id + */ + UHostId?: string; + /** + * 节点名称 + */ + UHostName?: string; + /** + * 节点类型 + */ + UHostRole?: string; + /** + * 节点是否部署 zookeeper + */ + ZooKeeper?: string; + /** + * zookeeper 服务端口 + */ + ZooKeeperPort?: number; + }[]; + /** + * 所属 VPC id + */ + VPCId?: string; + /** + * 可用节点个数 + */ + ValidBrokerNum?: number; + /** + * 是否开启安全组 + */ + IsOpenSecgroup?: string; + }[]; +} + +/** + * GetUKafkaNodeType - 获取节点机型配置 + */ +export interface GetUKafkaNodeTypeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 传参时返回指定机型信息,参数为空时返回所有机型信息 + */ + NodeType?: string; +} + +/** + * GetUKafkaNodeType - 获取节点机型配置 + */ +export interface GetUKafkaNodeTypeResponse { + /** + * 机型信息列表 + */ + NodeTypeSet: { + /** + * 机型磁盘类型信息 + */ + DiskSet?: { + /** + * 磁盘类型。Boot 表示系统盘,Data 表示数据盘 + */ + Type: string; + /** + * 磁盘大小 + */ + Size: string; + }; + /** + * CPU核心数 + */ + CPU?: number; + /** + * 磁盘类型。RSSD 表示固态云盘,SSD 表示本地固态盘,COMMON 表示本地 SATA 盘 + */ + DiskType?: string; + /** + * 机型名称 + */ + NodeTypeName?: string; + /** + * 内存大小(单位 MB) + */ + Memory?: string; + }[]; +} + +/** + * IsUKafkaTopicNameExist - 检查一个topic名称是否已经在集群中了 + */ +export interface IsUKafkaTopicNameExistRequest { + /** + * 可用区。参见 [可用区列表](../summary/regionlist.html) + */ + Zone: string; + /** + * 集群ID + */ + ClusterInstanceId: string; + /** + * 待检查的topic名称 + */ + TopicName: string; +} + +/** + * IsUKafkaTopicNameExist - 检查一个topic名称是否已经在集群中了 + */ +export interface IsUKafkaTopicNameExistResponse { + /** + * 是否已经存在 + */ + IsExist: string; +} + +/** + * ListUKafkaConsumers - 列出 Kafka 消费组 + */ +export interface ListUKafkaConsumersRequest { + /** + * 可用区。参见 [可用区列表](../summary/regionlist.html) + */ + Zone: string; + /** + * Kafka 集群 ID + */ + ClusterInstanceId: string; +} + +/** + * ListUKafkaConsumers - 列出 Kafka 消费组 + */ +export interface ListUKafkaConsumersResponse { + /** + * 消费者组列表 + */ + Groups?: { + /** + * 消费者组组名 + */ + GroupName?: string; + /** + * 消费者组类型 + */ + Type?: string; + /** + * 订阅 Topic 数量 + */ + NumOfTopics?: number; + }[]; +} + +/** + * ListUKafkaFrameworkVersion - 列举ukafka框架版本 + */ +export interface ListUKafkaFrameworkVersionRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; +} + +/** + * ListUKafkaFrameworkVersion - 列举ukafka框架版本 + */ +export interface ListUKafkaFrameworkVersionResponse { + /** + * kafka版本 + */ + FrameworkVersions: { + /** + * kafka版本 + */ + Version?: string; + /** + * kafka 版本标签。recommend 表示推荐版本,beta 表示公测版本 + */ + Label?: string; + }[]; +} + +/** + * ListUKafkaInstance - 列举集群信息 + */ +export interface ListUKafkaInstanceRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone?: string; + /** + * 默认为60 + */ + Limit?: string; + /** + * 默认为0 + */ + Offset?: string; + /** + * 是否过滤删除了的节点,默认为‘true’ + */ + Filter?: string; + /** + * VPCId + */ + VPCId?: string; + /** + * SubnetId + */ + SubnetId?: string; + /** + * 业务组 ID + */ + BusinessId?: string; + /** + * 实例ID + */ + ClusterInstanceId?: string; +} + +/** + * ListUKafkaInstance - 列举集群信息 + */ +export interface ListUKafkaInstanceResponse { + /** + * 信息 + */ + ClusterSet: string; + /** + * 总数 + */ + TotalCount: string; +} + +/** + * ListUKafkaTopics - 展示kafka集群上所有topic + */ +export interface ListUKafkaTopicsRequest { + /** + * 可用区。参见 [可用区列表](../summary/regionlist.html) + */ + Zone: string; + /** + * 集群资源id + */ + ClusterInstanceId: string; +} + +/** + * ListUKafkaTopics - 展示kafka集群上所有topic + */ +export interface ListUKafkaTopicsResponse { + /** + * topic 信息列表 + */ + TopicList: { + /** + * topic 名称 + */ + Topic?: string; + /** + * 分区数量 + */ + NumOfPartition?: number; + /** + * 占用 broker 数量 + */ + NumOfOccupyBroker?: number; + /** + * 副本数量 + */ + NumOfReplica?: number; + /** + * 落后副本占比 + */ + UnderReplicasPer?: number; + /** + * topic 状态 + */ + Status?: string; + }[]; + /** + * 列表长度 + */ + Length?: number; +} + +/** + * ModifyUKafkaInstanceType - 规格升降级 + */ +export interface ModifyUKafkaInstanceTypeRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 目标机型,支持的机型可通过GetUKafkaNodeType 接口返回的InstanceTypeSet[].InstanceTypeName + */ + NodeType: string; +} + +/** + * ModifyUKafkaInstanceType - 规格升降级 + */ +export interface ModifyUKafkaInstanceTypeResponse {} + +/** + * ResizeUKafkaDisk - 磁盘扩容 + */ +export interface ResizeUKafkaDiskRequest { + /** + * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + */ + Zone: string; + /** + * 实例ID + */ + InstanceId: string; + /** + * 数据盘大小。支持范围根据GetUKafkaNodeType 接口返回的InstanceTypeSet[].MaxDiskSize 和MinDiskSize获取 + */ + DiskSize: number; +} + +/** + * ResizeUKafkaDisk - 磁盘扩容 + */ +export interface ResizeUKafkaDiskResponse {}