From 4de7607d64c615059827cd7f434bbc25358e0495 Mon Sep 17 00:00:00 2001 From: UCloud Date: Fri, 12 Jul 2024 15:16:34 +0800 Subject: [PATCH] sdk: rolling update for 0.22.22 (#424) --- services/udb/apis.go | 3 + services/udb/models.go | 2 +- services/uhost/apis.go | 42 ++++++------ services/uhost/models.go | 140 +++++++++++++++++++------------------- services/unet/apis.go | 89 ++++++++++++++++++++++-- services/unet/models.go | 30 ++++++++ ucloud/version/version.go | 2 +- 7 files changed, 209 insertions(+), 99 deletions(-) diff --git a/services/udb/apis.go b/services/udb/apis.go index 5f1c2ce2..44008c57 100644 --- a/services/udb/apis.go +++ b/services/udb/apis.go @@ -3431,6 +3431,9 @@ type ResizeUDBInstanceRequest struct { // [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) // Zone *string `required:"false"` + // 数据库的CPU核数(只对普通版的SQLServer有用) + CPU *int `required:"false"` + // 使用的代金券id CouponId *string `required:"false"` diff --git a/services/udb/models.go b/services/udb/models.go index bd7c4697..9bb0d1c6 100644 --- a/services/udb/models.go +++ b/services/udb/models.go @@ -140,7 +140,7 @@ type UDBSlaveInstanceSet struct { SSDType string // 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType - SpecificationType string + SpecificationType int // 对mysql的slave而言是master的DBId,对master则为空, 对mongodb则是副本集id SrcDBId string diff --git a/services/uhost/apis.go b/services/uhost/apis.go index 6498466f..ace0f989 100644 --- a/services/uhost/apis.go +++ b/services/uhost/apis.go @@ -231,6 +231,27 @@ UHostDiskCustomBackup is request schema for complex param type UHostDiskCustomBackup struct { } +/* +CreateUHostInstanceParamFeatures is request schema for complex param +*/ +type CreateUHostInstanceParamFeatures struct { + + // 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启。 + UNI *bool `required:"false"` +} + +/* +CreateUHostInstanceParamSecGroupId is request schema for complex param +*/ +type CreateUHostInstanceParamSecGroupId struct { + + // 安全组 ID。至多可以同时绑定5个安全组。 + Id *string `required:"false"` + + // 安全组优先级。取值范围[1, 5] + Priority *int `required:"false"` +} + /* CreateUHostInstanceParamNetworkInterface is request schema for complex param */ @@ -255,27 +276,6 @@ type CreateUHostInstanceParamVolumes struct { IsBoot *string `required:"false" deprecated:"true"` } -/* -CreateUHostInstanceParamSecGroupId is request schema for complex param -*/ -type CreateUHostInstanceParamSecGroupId struct { - - // 安全组 ID。至多可以同时绑定5个安全组。 - Id *string `required:"false"` - - // 安全组优先级。取值范围[1, 5] - Priority *int `required:"false"` -} - -/* -CreateUHostInstanceParamFeatures is request schema for complex param -*/ -type CreateUHostInstanceParamFeatures struct { - - // 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启。 - UNI *bool `required:"false"` -} - /* UHostDisk is request schema for complex param */ diff --git a/services/uhost/models.go b/services/uhost/models.go index fc8ff641..08fb0771 100644 --- a/services/uhost/models.go +++ b/services/uhost/models.go @@ -92,18 +92,6 @@ type BootDiskInfo struct { Name string } -/* -Performance - GPU的性能指标 -*/ -type Performance struct { - - // 交互展示参数,可忽略 - Rate int - - // 值,单位是TFlops - Value float64 -} - /* MachineSizes - GPU、CPU和内存信息 */ @@ -116,18 +104,6 @@ type MachineSizes struct { Gpu int } -/* -GraphicsMemory - GPU的显存指标 -*/ -type GraphicsMemory struct { - - // 交互展示参数,可忽略 - Rate int - - // 值,单位是GB - Value int -} - /* Features - 虚机可支持的特性 */ @@ -170,6 +146,30 @@ type CpuPlatforms struct { Intel []string } +/* +Performance - GPU的性能指标 +*/ +type Performance struct { + + // 交互展示参数,可忽略 + Rate int + + // 值,单位是TFlops + Value float64 +} + +/* +GraphicsMemory - GPU的显存指标 +*/ +type GraphicsMemory struct { + + // 交互展示参数,可忽略 + Rate int + + // 值,单位是GB + Value int +} + /* AvailableInstanceTypes - https://ushare.ucloudadmin.com/pages/viewpage.action?pageId=104662646 */ @@ -303,36 +303,24 @@ type IsolationGroup struct { } /* -UHostDiskSet - DescribeUHostInstance +SpotAttribute - 竞价实例属性 */ -type UHostDiskSet struct { - - // 备份方案。若开通了数据方舟,则为DATAARK - BackupType string - - // 磁盘ID - DiskId string - - // 磁盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。 - DiskType string - - // 磁盘盘符 - Drive string - - // "true": 加密盘 "false":非加密盘 - Encrypted string +type SpotAttribute struct { - // 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。 - IsBoot string + // 回收时间 + RecycleTime int +} - // UDisk名字(仅当磁盘是UDisk时返回) - Name string +/* +UHostKeyPair - 主机密钥信息 +*/ +type UHostKeyPair struct { - // 磁盘大小,单位: GB - Size int + // 密钥对ID + KeyPairId string - // 【建议不再使用】磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk - Type string + // 主机密钥对状态,Normal 正常,Deleted 删除 + KeyPairState string } /* @@ -375,39 +363,51 @@ type UHostIPSet struct { } /* -UDSetUDHostAttribute - 私有专区对应的宿主机属性 +UHostDiskSet - DescribeUHostInstance */ -type UDSetUDHostAttribute struct { +type UHostDiskSet struct { - // 是否绑定私有专区宿主机 - HostBinding bool + // 备份方案。若开通了数据方舟,则为DATAARK + BackupType string - // 私有专区宿主机 - UDHostId string + // 磁盘ID + DiskId string - // 私有专区 - UDSetId string -} + // 磁盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。 + DiskType string -/* -SpotAttribute - 竞价实例属性 -*/ -type SpotAttribute struct { + // 磁盘盘符 + Drive string - // 回收时间 - RecycleTime int + // "true": 加密盘 "false":非加密盘 + Encrypted string + + // 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。 + IsBoot string + + // UDisk名字(仅当磁盘是UDisk时返回) + Name string + + // 磁盘大小,单位: GB + Size int + + // 【建议不再使用】磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk + Type string } /* -UHostKeyPair - 主机密钥信息 +UDSetUDHostAttribute - 私有专区对应的宿主机属性 */ -type UHostKeyPair struct { +type UDSetUDHostAttribute struct { - // 密钥对ID - KeyPairId string + // 是否绑定私有专区宿主机 + HostBinding bool - // 主机密钥对状态,Normal 正常,Deleted 删除 - KeyPairState string + // 私有专区宿主机 + UDHostId string + + // 私有专区 + UDSetId string } /* diff --git a/services/unet/apis.go b/services/unet/apis.go index ba6c516e..ed5f3268 100644 --- a/services/unet/apis.go +++ b/services/unet/apis.go @@ -122,6 +122,9 @@ type AllocateShareBandwidthRequest struct { // 【该字段已废弃,请谨慎使用】 ShareBandwidthGuarantee *int `required:"false" deprecated:"true"` + + // 业务组名称, 默认为 "Default" + Tag *string `required:"false"` } // AllocateShareBandwidthResponse is response schema for AllocateShareBandwidth action @@ -356,7 +359,7 @@ type CreateFirewallRequest struct { // 防火墙描述,默认为空 Remark *string `required:"false"` - // 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注,bj1不支持添加备注 + // 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注,备注最大长度64 Rule []string `required:"true"` // 防火墙业务组,默认为Default @@ -565,15 +568,21 @@ func (c *UNetClient) DescribeBandwidthPackage(req *DescribeBandwidthPackageReque type DescribeBandwidthUsageRequest struct { request.CommonBase - // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) // ProjectId *string `required:"false"` - // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) // Region *string `required:"true"` + // 统计开始时间 + BeginTime *int `required:"false"` + // 弹性IP的资源Id. 如果为空, 则返回当前 Region中符合条件的所有EIP的带宽用量, n为自然数 EIPIds []string `required:"false"` + // 统计结束时间 + EndTime *int `required:"false"` + // 返回数据分页值, 取值范围为 [0,10000000] 之间的整数, 默认为20 Limit *int `required:"false"` @@ -824,6 +833,74 @@ func (c *UNetClient) DescribeFirewallResource(req *DescribeFirewallResourceReque return &res, nil } +// DescribePrivateIPRequest is request schema for DescribePrivateIP action +type DescribePrivateIPRequest struct { + request.CommonBase + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + // ProjectId *string `required:"true"` + + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + // Region *string `required:"true"` + + // 获取信息数量 ,默认20;不允许为0 + Limit *int `required:"false"` + + // 虚拟网卡的资源ID; ObjectId为空时,则获取项目下所有的虚拟网卡主辅IP信息 + ObjectId *string `required:"false"` + + // 列表起始位置偏移量,默认为0 + Offset *int `required:"false"` + + // 子网的ID + SubnetId *string `required:"false"` + + // VPC的ID + VPCId *string `required:"false"` +} + +// DescribePrivateIPResponse is response schema for DescribePrivateIP action +type DescribePrivateIPResponse struct { + response.CommonBase + + // 辅助IP的详细信息 + DataSet []DescribeSecondaryIPDataSet + + // 返回资源数量 + TotalCount int +} + +// NewDescribePrivateIPRequest will create request of DescribePrivateIP action. +func (c *UNetClient) NewDescribePrivateIPRequest() *DescribePrivateIPRequest { + req := &DescribePrivateIPRequest{} + + // setup request with client config + c.Client.SetupRequest(req) + + // setup retryable with default retry policy (retry for non-create action and common error) + req.SetRetryable(true) + return req +} + +/* +API: DescribePrivateIP + +获取资源绑定的内网IP信息 +*/ +func (c *UNetClient) DescribePrivateIP(req *DescribePrivateIPRequest) (*DescribePrivateIPResponse, error) { + var err error + var res DescribePrivateIPResponse + + reqCopier := *req + + err = c.Client.InvokeAction("DescribePrivateIP", &reqCopier, &res) + if err != nil { + return &res, err + } + + return &res, nil +} + // DescribeShareBandwidthRequest is request schema for DescribeShareBandwidth action type DescribeShareBandwidthRequest struct { request.CommonBase @@ -1904,16 +1981,16 @@ func (c *UNetClient) UpdateEIPAttribute(req *UpdateEIPAttributeRequest) (*Update type UpdateFirewallRequest struct { request.CommonBase - // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) // ProjectId *string `required:"false"` - // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) // Region *string `required:"true"` // 防火墙资源ID FWId *string `required:"true"` - // 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注 + // 防火墙规则,例如:TCP|22|192.168.1.1/22|DROP|LOW|禁用22端口,第一个参数代表协议:第二个参数代表端口号,第三个参数为ip,第四个参数为ACCEPT(接受)和DROP(拒绝),第五个参数优先级:HIGH(高),MEDIUM(中),LOW(低),第六个参数为该条规则的自定义备注, 备注最大长度64 Rule []string `required:"true"` } diff --git a/services/unet/models.go b/services/unet/models.go index b1d7f118..3dc3a9e4 100644 --- a/services/unet/models.go +++ b/services/unet/models.go @@ -290,6 +290,36 @@ type ResourceSet struct { Zone int } +/* +DescribeSecondaryIPDataSet - 描述内网IP的具体信息 +*/ +type DescribeSecondaryIPDataSet struct { + + // 外网IP + EIP string + + // EIP资源ID + EIPId string + + // 内网IP + PrivateIP string + + // 内网IP类型;枚举值:PrimaryIP:主内网IP,SecondaryIP:辅助内网IP + PrivateIPType string + + // 资源ID + ResourceID string + + // 资源名称 + ResourceName string + + // 子网ID + SubnetID string + + // VPCID + VPCID string +} + /* EIPSetData - describeShareBandwidth */ diff --git a/ucloud/version/version.go b/ucloud/version/version.go index 48c55fbc..7f3bf579 100644 --- a/ucloud/version/version.go +++ b/ucloud/version/version.go @@ -1,3 +1,3 @@ package version -const Version = "0.22.21" +const Version = "0.22.22"