Skip to content

Commit

Permalink
sdk: rolling update for 0.22.14 (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucloud-bot authored Feb 4, 2024
1 parent 4306407 commit 2b2a462
Show file tree
Hide file tree
Showing 7 changed files with 453 additions and 275 deletions.
168 changes: 164 additions & 4 deletions services/udb/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,17 +643,17 @@ type CreateUDBInstanceRequest struct {
// 磁盘空间(GB), 暂时支持20G - 32T
DiskSpace *int `required:"true"`

// 是否创建使用ipv6 资源, 默认为false, 或者不填, 创建ipv6为true
EnableIpV6 *bool `required:"false"`

// UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例 "HA": 高可用版UDB实例 默认是"Normal"
InstanceMode *string `required:"false"`

// 【该字段已废弃,请谨慎使用】
InstanceType *string `required:"false" deprecated:"true"`

// 规格类型ID,当SpecificationType为1时有效
MachineType *string `required:"false"`

// 内存限制(MB),目前支持以下几档 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M/128000M/192000M/256000M/320000M
MemoryLimit *int `required:"true"`
MemoryLimit *int `required:"false"`

// 实例名称,至少6位
Name *string `required:"true"`
Expand All @@ -670,6 +670,9 @@ type CreateUDBInstanceRequest struct {
// SSD类型,可选值为"SATA"、“NVMe”,默认为“SATA”
SSDType *string `required:"false"`

// 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
SpecificationType *string `required:"false"`

// 子网ID
SubnetId *string `required:"false"`

Expand Down Expand Up @@ -750,6 +753,9 @@ type CreateUDBInstanceByRecoveryRequest struct {
// 是否创建使用ipv6 资源, 默认为false, 或者不填, 创建ipv6为true
EnableIpV6 *bool `required:"false"`

// 规格类型ID,当SpecificationType为1时有效
MachineType *string `required:"false"`

// 实例名称,至少6位
Name *string `required:"true"`

Expand All @@ -759,6 +765,9 @@ type CreateUDBInstanceByRecoveryRequest struct {
// 恢复到某个时间点的时间戳(UTC时间格式,默认单位秒)
RecoveryTime *int `required:"true"`

// 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
SpecificationType *int `required:"false"`

// 源实例的Id
SrcDBId *string `required:"true"`

Expand Down Expand Up @@ -1088,6 +1097,9 @@ type CreateUDBSlaveRequest struct {
// 是否锁主库,默认为true
IsLock *bool `required:"false"`

// 规格类型ID,当SpecificationType为1时有效
MachineType *string `required:"false"`

// 内存限制(MB),目前支持以下几档 2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M/128000M/192000M/256000M/320000M
MemoryLimit *int `required:"false"`

Expand All @@ -1106,6 +1118,9 @@ type CreateUDBSlaveRequest struct {
// 仅对主为SSD型实例有效。 可选值"SATA","NVMe"
SSDType *string `required:"false"`

// 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
SpecificationType *int `required:"false"`

// master实例的DBId,该值可以通过DescribeUDBInstance获取
SrcId *string `required:"true"`

Expand Down Expand Up @@ -1999,6 +2014,12 @@ type DescribeUDBInstancePriceRequest struct {
// 实例的部署类型。可选值为:Normal: 普通单点实例,Slave: 从库实例,HA: 高可用部署实例,默认是Normal
InstanceMode *string `required:"false"`

// UDB数据库机型: "SATA_SSD": "SSD机型" , "PCIE_SSD": "SSD高性能机型" , "Normal_Volume": "标准大容量机型", "SATA_SSD_Volume": "SSD大容量机型" , "PCIE_SSD_Volume": "SSD高性能大容量机型", "NVMe_SSD": "快杰机型"
InstanceType *string `required:"false"`

// 规格类型ID,当SpecificationType为1时有效
MachineType *string `required:"false"`

// 内存限制(MB),单位为MB.目前支持:2000-96000
MemoryLimit *int `required:"true"`

Expand All @@ -2008,6 +2029,9 @@ type DescribeUDBInstancePriceRequest struct {
// SSD类型,可选值为"SATA"、“NVMe”. 默认为“SATA”
SSDType *string `required:"false"`

// 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
SpecificationType *int `required:"false"`

// 【该字段已废弃,请谨慎使用】
UseSSD *bool `required:"false" deprecated:"true"`
}
Expand Down Expand Up @@ -2120,6 +2144,9 @@ type DescribeUDBInstanceUpgradePriceRequest struct {
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"false"`

// CPU核数 快杰SQLServer升降级必传
CPU *int `required:"false"`

// 实例的Id
DBId *string `required:"true"`

Expand All @@ -2129,6 +2156,9 @@ type DescribeUDBInstanceUpgradePriceRequest struct {
// "SATA_SSD", "NVMe_SSD"
InstanceType *string `required:"false"`

// 规格类型ID,当SpecificationType为1时有效
MachineType *string `required:"false"`

// 内存限制(MB)
MemoryLimit *int `required:"true"`

Expand All @@ -2138,6 +2168,9 @@ type DescribeUDBInstanceUpgradePriceRequest struct {
// "SATA", "NVMe"
SSDType *string `required:"false"`

// 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
SpecificationType *int `required:"false"`

// 【该字段已废弃,请谨慎使用】
UseSSD *bool `required:"false" deprecated:"true"`
}
Expand Down Expand Up @@ -2872,6 +2905,68 @@ func (c *UDBClient) GetUDBClientConnNum(req *GetUDBClientConnNumRequest) (*GetUD
return &res, nil
}

// GetUDBInstanceSSLCertURLRequest is request schema for GetUDBInstanceSSLCertURL action
type GetUDBInstanceSSLCertURLRequest struct {
request.CommonBase

// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`

// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`

// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`

// 实例ID
DBId *string `required:"true"`

// URL的过期时间,该值最小默认1小时,最大7天。(单位/秒)
ExpireTime *int `required:"false"`
}

// GetUDBInstanceSSLCertURLResponse is response schema for GetUDBInstanceSSLCertURL action
type GetUDBInstanceSSLCertURLResponse struct {
response.CommonBase

// 内网链接
InnerUrl string

// 外网链接
InternetUrl string
}

// NewGetUDBInstanceSSLCertURLRequest will create request of GetUDBInstanceSSLCertURL action.
func (c *UDBClient) NewGetUDBInstanceSSLCertURLRequest() *GetUDBInstanceSSLCertURLRequest {
req := &GetUDBInstanceSSLCertURLRequest{}

// 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: GetUDBInstanceSSLCertURL
获取SSL证书下载地址
*/
func (c *UDBClient) GetUDBInstanceSSLCertURL(req *GetUDBInstanceSSLCertURLRequest) (*GetUDBInstanceSSLCertURLResponse, error) {
var err error
var res GetUDBInstanceSSLCertURLResponse

reqCopier := *req

err = c.Client.InvokeAction("GetUDBInstanceSSLCertURL", &reqCopier, &res)
if err != nil {
return &res, err
}

return &res, nil
}

// ModifyUDBInstanceNameRequest is request schema for ModifyUDBInstanceName action
type ModifyUDBInstanceNameRequest struct {
request.CommonBase
Expand Down Expand Up @@ -3043,6 +3138,65 @@ func (c *UDBClient) ModifyUDBInstanceRemarkName(req *ModifyUDBInstanceRemarkName
return &res, nil
}

// ModifyUDBInstanceSSLRequest is request schema for ModifyUDBInstanceSSL action
type ModifyUDBInstanceSSLRequest struct {
request.CommonBase

// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`

// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`

// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`

// 实例ID
DBId *string `required:"true"`

// 是否开启SSL 1->关闭 2->开启
EnableSSL *int `required:"true"`

// SSL证书有效时间,1-5年,默认为1年
ValidTime *int `required:"false"`
}

// ModifyUDBInstanceSSLResponse is response schema for ModifyUDBInstanceSSL action
type ModifyUDBInstanceSSLResponse struct {
response.CommonBase
}

// NewModifyUDBInstanceSSLRequest will create request of ModifyUDBInstanceSSL action.
func (c *UDBClient) NewModifyUDBInstanceSSLRequest() *ModifyUDBInstanceSSLRequest {
req := &ModifyUDBInstanceSSLRequest{}

// 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: ModifyUDBInstanceSSL
调整SSL的信息
*/
func (c *UDBClient) ModifyUDBInstanceSSL(req *ModifyUDBInstanceSSLRequest) (*ModifyUDBInstanceSSLResponse, error) {
var err error
var res ModifyUDBInstanceSSLResponse

reqCopier := *req

err = c.Client.InvokeAction("ModifyUDBInstanceSSL", &reqCopier, &res)
if err != nil {
return &res, err
}

return &res, nil
}

// PromoteUDBInstanceToHARequest is request schema for PromoteUDBInstanceToHA action
type PromoteUDBInstanceToHARequest struct {
request.CommonBase
Expand Down Expand Up @@ -3180,12 +3334,18 @@ type ResizeUDBInstanceRequest struct {
// UDB数据库机型: "Normal": "标准机型" , "SATA_SSD": "SSD机型" , "PCIE_SSD": "SSD高性能机型" , "Normal_Volume": "标准大容量机型", "SATA_SSD_Volume": "SSD大容量机型" , "PCIE_SSD_Volume": "SSD高性能大容量机型",“NVMe_SSD”:“快杰机型”
InstanceType *string `required:"false"`

// 规格类型ID,当SpecificationType为1时有效
MachineType *string `required:"false"`

// 内存限制(MB),目前支持以下几档 2000M/4000M/ 6000M/8000M/ 12000M/16000M/ 24000M/32000M/ 48000M/64000M/96000M/128000M/192000M/256000M/320000M。
MemoryLimit *int `required:"true"`

// SSD类型,可选值为"SATA"、“NVMe”
SSDType *string `required:"false"`

// 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
SpecificationType *string `required:"false"`

// DB关闭状态下升降级,升降级后是否启动DB,默认为false
StartAfterUpgrade *bool `required:"false"`

Expand Down
28 changes: 23 additions & 5 deletions services/udb/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ type UDBSlaveInstanceSet struct {
// DB实例过期时间,采用UTC计时时间戳
ExpiredTime int

// 获取该实例的IPv6地址
IPv6Address string

// UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例;"HA": 高可用版UDB实例
InstanceMode string

Expand All @@ -115,6 +112,9 @@ type UDBSlaveInstanceSet struct {
// DB实例日志文件大小,单位GB
LogFileSize float64

// 规格类型ID,当SpecificationType为1时有效
MachineType string

// 内存限制(MB),默认根据配置机型
MemoryLimit int

Expand All @@ -139,10 +139,13 @@ type UDBSlaveInstanceSet struct {
// SSD类型,SATA/PCI-E
SSDType string

// 实例计算规格类型,0或不传代表使用内存方式购买,1代表使用内存-cpu可选配比方式购买,需要填写MachineType
SpecificationType string

// 对mysql的slave而言是master的DBId,对master则为空, 对mongodb则是副本集id
SrcDBId string

// DB状态标记 Init:初始化中,Fail:安装失败,Starting:启动中,Running:运行,Shutdown:关闭中,Shutoff:已关闭,Delete:已删除,Upgrading:升级中,Promoting:提升为独库进行中,Recovering:恢复中,Recover fail:恢复失败,Remakeing:重做中,RemakeFail:重做失败
// DB状态标记 Init:初始化中,Fail:安装失败,Starting:启动中,Running:运行,Shutdown:关闭中,Shutoff:已关闭,Delete:已删除,Upgrading:升级中,Promoting:提升为独库进行中,Recovering:恢复中,Recover fail:恢复失败,Remakeing:重做中,RemakeFail:重做失败, MajorVersionUpgrading:小版本升级中,MajorVersionUpgradeWaitForSwitch:高可用等待切换,MajorVersionUpgradeFail
State string

// 子网ID
Expand Down Expand Up @@ -205,6 +208,9 @@ type UDBInstanceSet struct {
// 备份策略,一天内备份时间间隔,单位小时,默认24小时
BackupDuration int

// 默认的备份方式,nobackup表示不备份, snapshot 表示使用快照备份,logic 表示使用逻辑备份,xtrabackup表示使用物理备份。
BackupMethod string

// 跨可用区高可用备库所在可用区
BackupZone string

Expand Down Expand Up @@ -244,6 +250,9 @@ type UDBInstanceSet struct {
// DB实例磁盘已使用空间,单位GB
DiskUsedSize float64

// mysql是否开启了SSL;1->未开启 2->开启
EnableSSL int

// DB实例过期时间,采用UTC计时时间戳
ExpiredTime int

Expand All @@ -262,6 +271,9 @@ type UDBInstanceSet struct {
// DB实例日志文件大小,单位GB
LogFileSize float64

// 数据库机型规格
MachineType string

// 内存限制(MB),默认根据配置机型
MemoryLimit int

Expand All @@ -283,10 +295,16 @@ type UDBInstanceSet struct {
// SSD类型,SATA/PCI-E/NVMe
SSDType string

// SSL到期时间
SSLExpirationTime int

// 是否使用可选cpu类型规格
SpecificationType int

// 对mysql的slave而言是master的DBId,对master则为空, 对mongodb则是副本集id
SrcDBId string

// DB状态标记 Init:初始化中,Fail:安装失败,Starting:启动中,Running:运行,Shutdown:关闭中,Shutoff:已关闭,Delete:已删除,Upgrading:升级中,Promoting:提升为独库进行中,Recovering:恢复中,Recover fail:恢复失败, Remakeing:重做中,RemakeFail:重做失败,VersionUpgrading:小版本升级中,VersionUpgradeWaitForSwitch:高可用等待切换,VersionUpgradeFail:小版本升级失败
// DB状态标记 Init:初始化中,Fail:安装失败,Starting:启动中,Running:运行,Shutdown:关闭中,Shutoff:已关闭,Delete:已删除,Upgrading:升级中,Promoting:提升为独库进行中,Recovering:恢复中,Recover fail:恢复失败, Remakeing:重做中,RemakeFail:重做失败,VersionUpgrading:小版本升级中,VersionUpgradeWaitForSwitch:高可用等待切换,VersionUpgradeFail:小版本升级失败,UpdatingSSL:修改SSL中,UpdateSSLFail:修改SSL失败,MajorVersionUpgrading:小版本升级中,MajorVersionUpgradeWaitForSwitch:高可用等待切换,MajorVersionUpgradeFail
State string

// 子网ID
Expand Down
Loading

0 comments on commit 2b2a462

Please sign in to comment.