@ucloud-sdks/ucloud-sdk-js 0.1.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,7 @@ export declare class Client extends BaseClient {
24
24
  ulb(): any;
25
25
  umem(): any;
26
26
  unet(): any;
27
+ uphone(): any;
27
28
  uphost(): any;
28
29
  usms(): any;
29
30
  uvms(): any;
@@ -20,6 +20,7 @@ const UK8SClient = require('./uk8s').default;
20
20
  const ULBClient = require('./ulb').default;
21
21
  const UMemClient = require('./umem').default;
22
22
  const UNetClient = require('./unet').default;
23
+ const UPhoneClient = require('./uphone').default;
23
24
  const UPHostClient = require('./uphost').default;
24
25
  const USMSClient = require('./usms').default;
25
26
  const UVMSClient = require('./uvms').default;
@@ -103,6 +104,12 @@ class Client extends BaseClient {
103
104
  unet() {
104
105
  return new UNetClient({ config: this.config, credential: this.credential });
105
106
  }
107
+ uphone() {
108
+ return new UPhoneClient({
109
+ config: this.config,
110
+ credential: this.credential,
111
+ });
112
+ }
106
113
  uphost() {
107
114
  return new UPHostClient({
108
115
  config: this.config,
@@ -51,6 +51,12 @@ export default class UHostClient extends Client {
51
51
  * See also: https://docs.ucloud.cn/api/uhost-api/delete_uhost_key_pairs
52
52
  */
53
53
  deleteUHostKeyPairs(request?: DeleteUHostKeyPairsRequest): Promise<DeleteUHostKeyPairsResponse>;
54
+ /**
55
+ * DescribeAvailableInstanceTypes - DescribeAvailableInstanceTypes
56
+ *
57
+ * See also: https://docs.ucloud.cn/api/uhost-api/describe_available_instance_types
58
+ */
59
+ describeAvailableInstanceTypes(request?: DescribeAvailableInstanceTypesRequest): Promise<DescribeAvailableInstanceTypesResponse>;
54
60
  /**
55
61
  * DescribeImage - 获取指定数据中心镜像列表,用户可通过指定操作系统类型,镜像Id进行过滤。
56
62
  *
@@ -329,7 +335,7 @@ export interface CreateUHostInstanceRequest {
329
335
  */
330
336
  Type: string;
331
337
  /**
332
- * 磁盘大小,单位GB,必须是10GB的整数倍。请参考[[api:uhost-api:disk_type|磁盘类型]]。
338
+ * 磁盘大小,单位GB。请参考[[api:uhost-api:disk_type|磁盘类型]]。
333
339
  */
334
340
  Size: number;
335
341
  /**
@@ -348,6 +354,10 @@ export interface CreateUHostInstanceRequest {
348
354
  * 云盘代金券id。不适用于系统盘/本地盘。请通过DescribeCoupon接口查询,或登录用户中心查看
349
355
  */
350
356
  CouponId?: string;
357
+ /**
358
+ *
359
+ */
360
+ CustomBackup?: object;
351
361
  }[];
352
362
  /**
353
363
  * 主机登陆模式。密码(默认选项): Password,密钥:KeyPair。
@@ -394,7 +404,7 @@ export interface CreateUHostInstanceRequest {
394
404
  */
395
405
  GPU?: number;
396
406
  /**
397
- * 网络增强特性。枚举值:Normal(默认),不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(仅支持部分可用区,请参考控制台)
407
+ * 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(详情参考官网文档)
398
408
  */
399
409
  NetCapability?: string;
400
410
  /**
@@ -488,7 +498,7 @@ export interface CreateUHostInstanceRequest {
488
498
  */
489
499
  Volumes?: object[];
490
500
  /**
491
- * KeypairId 密钥对ID,LoginMode为KeyPair时此项必须
501
+ * KeypairId 密钥对ID,LoginMode为KeyPair时此项必须。
492
502
  */
493
503
  KeyPairId?: string;
494
504
  /**
@@ -500,6 +510,10 @@ export interface CreateUHostInstanceRequest {
500
510
  */
501
511
  UNI?: boolean;
502
512
  };
513
+ /**
514
+ *
515
+ */
516
+ SecGroupId?: object[];
503
517
  /**
504
518
  * 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
505
519
  */
@@ -601,6 +615,183 @@ export interface DeleteUHostKeyPairsRequest {
601
615
  */
602
616
  export interface DeleteUHostKeyPairsResponse {
603
617
  }
618
+ /**
619
+ * DescribeAvailableInstanceTypes - DescribeAvailableInstanceTypes
620
+ */
621
+ export interface DescribeAvailableInstanceTypesRequest {
622
+ /**
623
+ * 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
624
+ */
625
+ Zone: string;
626
+ }
627
+ /**
628
+ * DescribeAvailableInstanceTypes - DescribeAvailableInstanceTypes
629
+ */
630
+ export interface DescribeAvailableInstanceTypesResponse {
631
+ /**
632
+ * AvailableInstanceTypes
633
+ */
634
+ AvailableInstanceTypes: {
635
+ /**
636
+ * 机型名称:快杰O型|O 、快杰共享型|OM 、快杰内存型|OMEM 、 快杰PRO型|OPRO、通用N型|N、高主频C型|C和GPU G型|G等
637
+ */
638
+ Name?: string;
639
+ /**
640
+ * 机型状态:可售|Normal 、 公测|Beta、售罄|Soldout、隐藏|Hidden
641
+ */
642
+ Status?: string;
643
+ /**
644
+ * 支持的CPU平台,并且按照Intel、AMD和Ampere分类返回
645
+ */
646
+ CpuPlatforms?: {
647
+ /**
648
+ * 返回Intel的CPU平台信息,例如:Intel: ['Intel/CascadeLake','Intel/CascadelakeR','Intel/IceLake']
649
+ */
650
+ Intel?: string[];
651
+ /**
652
+ * 返回AMD的CPU平台信息,例如:AMD: ['Amd/Epyc2']
653
+ */
654
+ Amd?: string[];
655
+ /**
656
+ * 返回Arm的CPU平台信息,例如:Ampere: ['Ampere/Altra']
657
+ */
658
+ Ampere?: string[];
659
+ }[];
660
+ /**
661
+ * 磁盘信息。磁盘主要分类如下:云盘|cloudDisk、普通本地盘|normalLocalDisk和SSD本地盘|ssdLocalDisk。其中云盘主要包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。MinimalSize为磁盘最小值,如果没有该字段,最小值取基础镜像Size值即可(linux为20G,windows为40G)。MaximalSize为磁盘最大值。InstantResize表示系统盘是否允许扩容,如果是本地盘,则不允许扩容,InstantResize为false。Features为磁盘可支持的服务:数据方舟|DATAARK,快照服务|SNAPSHOT,加密盘|Encrypted。
662
+ */
663
+ Disks?: {
664
+ /**
665
+ * 磁盘介质类别信息,磁盘主要分类如下:云盘|cloudDisk、普通本地盘|normalLocalDisk和SSD本地盘|ssdLocalDisk。
666
+ */
667
+ Name?: string;
668
+ /**
669
+ * 系统盘信息
670
+ */
671
+ BootDisk?: {
672
+ /**
673
+ * 系统盘类别,包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。
674
+ */
675
+ Name?: string;
676
+ /**
677
+ * 系统盘是否允许扩容,如果是本地盘,则不允许扩容,InstantResize为false。
678
+ */
679
+ InstantResize?: boolean;
680
+ /**
681
+ * MaximalSize为磁盘最大值
682
+ */
683
+ MaximalSize?: number;
684
+ /**
685
+ * 磁盘可支持的服务
686
+ */
687
+ Features?: string[];
688
+ }[];
689
+ /**
690
+ * 数据盘信息
691
+ */
692
+ DataDisk?: {
693
+ /**
694
+ * 磁盘最小值,如果没有该字段,最小值取基础镜像Size值即可(linux为20G,windows为40G)。
695
+ */
696
+ MinimalSize?: number;
697
+ /**
698
+ * 数据盘类别,包含普通云盘|CLOUD_NORMAL、SSD云盘|CLOUD_SSD和RSSD云盘|CLOUD_RSSD。普通本地盘只包含普通本地盘|LOCAL_NORMAL一种。SSD本地盘只包含SSD本地盘|LOCAL_SSD一种。
699
+ */
700
+ Name?: string;
701
+ /**
702
+ * MaximalSize为磁盘最大值
703
+ */
704
+ MaximalSize?: number;
705
+ /**
706
+ * 数据盘可支持的服务
707
+ */
708
+ Features?: string[];
709
+ }[];
710
+ }[];
711
+ /**
712
+ * GPU、CPU和内存信息。Gpu为GPU可支持的规格,Cpu和Memory分别为CPU和内存可支持的规格。如果非GPU机型,GPU为0。MinimalCpuPlatform代表含义这个CPU和内存规格只能在列出来的CPU平台支持。
713
+ */
714
+ MachineSizes?: {
715
+ /**
716
+ * Gpu为GPU可支持的规格即GPU颗数,非GPU机型,Gpu为0
717
+ */
718
+ Gpu?: number;
719
+ /**
720
+ * CPU和内存可支持的规格
721
+ */
722
+ Collection?: {
723
+ /**
724
+ * CPU规格
725
+ */
726
+ Cpu?: number;
727
+ /**
728
+ * 内存规格
729
+ */
730
+ Memory?: number[];
731
+ /**
732
+ * CPU和内存规格只能在列出来的CPU平台支持
733
+ */
734
+ MinimalCpuPlatform?: string[];
735
+ }[];
736
+ }[];
737
+ /**
738
+ * 虚机可支持的特性。目前支持的特性网络增强|NetCapability、热升级|Hotplug。网络增强分为关闭|Normal、网络增强1.0|Super和网络增强2.0|Ultra。Name为可支持的特性名称,Modes为可以提供的模式类别等,RelatedToImageFeature为镜像上支持这个特性的标签。例如DescribeImage返回的字段Features包含HotPlug,说明该镜像支持热升级。MinimalCpuPlatform表示这个特性必须是列出来的CPU平台及以上的CPU才支持。
739
+ */
740
+ Features?: {
741
+ /**
742
+ * 可支持的特性名称。目前支持的特性网络增强|NetCapability、热升级|Hotplug
743
+ */
744
+ Name?: string;
745
+ /**
746
+ * 可以提供的模式类别
747
+ */
748
+ Modes?: {
749
+ /**
750
+ * 模式|特性名称
751
+ */
752
+ Name?: string;
753
+ /**
754
+ * 为镜像上支持这个特性的标签。例如DescribeImage返回的字段Features包含HotPlug,说明该镜像支持热升级。
755
+ */
756
+ RelatedToImageFeature?: string[];
757
+ /**
758
+ * 这个特性必须是列出来的CPU平台及以上的CPU才支持
759
+ */
760
+ MinimalCpuPlatform?: string[];
761
+ }[];
762
+ }[];
763
+ /**
764
+ * 区分是否是GPU机型:GPU机型|GPU,非GPU机型|Normal。
765
+ */
766
+ MachineClass?: string;
767
+ /**
768
+ * GPU的显存指标,value为值,单位是GB。
769
+ */
770
+ GraphicsMemory?: {
771
+ /**
772
+ * 值,单位是GB
773
+ */
774
+ Value?: number;
775
+ /**
776
+ * 交互展示参数,可忽略
777
+ */
778
+ Rate?: number;
779
+ };
780
+ /**
781
+ * GPU的性能指标,value为值,单位是TFlops。
782
+ */
783
+ Performance?: {
784
+ /**
785
+ * 值,单位是TFlops
786
+ */
787
+ Value?: number;
788
+ /**
789
+ * 交互展示参数,可忽略
790
+ */
791
+ Rate?: number;
792
+ };
793
+ }[];
794
+ }
604
795
  /**
605
796
  * DescribeImage - 获取指定数据中心镜像列表,用户可通过指定操作系统类型,镜像Id进行过滤。
606
797
  */
@@ -75,6 +75,15 @@ class UHostClient extends client_1.default {
75
75
  const args = Object.assign({ Action: 'DeleteUHostKeyPairs' }, (request || {}));
76
76
  return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
77
77
  }
78
+ /**
79
+ * DescribeAvailableInstanceTypes - DescribeAvailableInstanceTypes
80
+ *
81
+ * See also: https://docs.ucloud.cn/api/uhost-api/describe_available_instance_types
82
+ */
83
+ describeAvailableInstanceTypes(request) {
84
+ const args = Object.assign({ Action: 'DescribeAvailableInstanceTypes' }, (request || {}));
85
+ return this.invoke(new request_1.default(args)).then((resp) => resp.toObject());
86
+ }
78
87
  /**
79
88
  * DescribeImage - 获取指定数据中心镜像列表,用户可通过指定操作系统类型,镜像Id进行过滤。
80
89
  *