-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cdae33a
commit 1acb6fc
Showing
15 changed files
with
505 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. | ||
//go:generate ucloud-gen-go-api UDB CheckUDBInstanceAllowance | ||
|
||
package udb | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/request" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/response" | ||
) | ||
|
||
// CheckUDBInstanceAllowanceRequest is request schema for CheckUDBInstanceAllowance action | ||
type CheckUDBInstanceAllowanceRequest struct { | ||
request.CommonBase | ||
|
||
// 可用区。参见 [可用区列表](../summary/regionlist.html) | ||
Zone *string `required:"true"` | ||
|
||
// DB种类,分为SQL和NOSQL,取值分别为sql、nosql、postgresql | ||
ClassType *string `required:"true"` | ||
|
||
// 申请资源的内存限制 | ||
MemoryLimit *int `required:"true"` | ||
|
||
// 申请资源的磁盘空间 | ||
DiskSpace *int `required:"true"` | ||
|
||
// 是否使用SSD资源,true代表使用,false代表不使用 | ||
UseSSD *bool `required:"true"` | ||
|
||
// 资源申请个数,默认为一个 | ||
Count *int `required:"true"` | ||
|
||
// UDB实例的部署模式:可选值为:Normal: 普通单点实例,HA: 高可用部署实例 | ||
InstanceMode *string `required:"true"` | ||
|
||
// SSD类型,可选值为"SATA"、"PCI-E",如果UseSSD为true ,则需要指定SSD类型 | ||
SSDType *string `required:"false"` | ||
|
||
// 如果是从库创建核查,需要指定SrcId | ||
SrcId *string `required:"false"` | ||
|
||
// 跨可用区备库所在可用区, 参见 [可用区列表](../summary/regionlist.html) | ||
BackupZone *string `required:"false"` | ||
|
||
// 专区ID | ||
UDBCId *string `required:"false"` | ||
|
||
// 专区里面DB升降级需要原来DB的信息 | ||
DBId *string `required:"false"` | ||
} | ||
|
||
// CheckUDBInstanceAllowanceResponse is response schema for CheckUDBInstanceAllowance action | ||
type CheckUDBInstanceAllowanceResponse struct { | ||
response.CommonBase | ||
|
||
// 资源核查部分成功情况下,成功个数 | ||
Count int | ||
} | ||
|
||
// NewCheckUDBInstanceAllowanceRequest will create request of CheckUDBInstanceAllowance action. | ||
func (c *UDBClient) NewCheckUDBInstanceAllowanceRequest() *CheckUDBInstanceAllowanceRequest { | ||
req := &CheckUDBInstanceAllowanceRequest{} | ||
|
||
// 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 | ||
} | ||
|
||
// CheckUDBInstanceAllowance - 核查UDB资源余量 | ||
func (c *UDBClient) CheckUDBInstanceAllowance(req *CheckUDBInstanceAllowanceRequest) (*CheckUDBInstanceAllowanceResponse, error) { | ||
var err error | ||
var res CheckUDBInstanceAllowanceResponse | ||
|
||
err = c.client.InvokeAction("CheckUDBInstanceAllowance", req, &res) | ||
if err != nil { | ||
return &res, err | ||
} | ||
|
||
return &res, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. | ||
//go:generate ucloud-gen-go-api UDisk CheckUDiskAllowance | ||
|
||
package udisk | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/request" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/response" | ||
) | ||
|
||
// CheckUDiskAllowanceRequest is request schema for CheckUDiskAllowance action | ||
type CheckUDiskAllowanceRequest struct { | ||
request.CommonBase | ||
|
||
// 可用区。参见 [可用区列表](../summary/regionlist.html) | ||
Zone *string `required:"true"` | ||
|
||
// 购买UDisk大小,单位:GB,范围[1~2000], 权限位控制可达8T,若需要请申请开通相关权限。 | ||
Size *int `required:"true"` | ||
|
||
// 资源申请个数,默认为一个 | ||
Count *int `required:"false"` | ||
} | ||
|
||
// CheckUDiskAllowanceResponse is response schema for CheckUDiskAllowance action | ||
type CheckUDiskAllowanceResponse struct { | ||
response.CommonBase | ||
|
||
// 资源核查部分成功情况下,成功个数 | ||
Count int | ||
} | ||
|
||
// NewCheckUDiskAllowanceRequest will create request of CheckUDiskAllowance action. | ||
func (c *UDiskClient) NewCheckUDiskAllowanceRequest() *CheckUDiskAllowanceRequest { | ||
req := &CheckUDiskAllowanceRequest{} | ||
|
||
// 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 | ||
} | ||
|
||
// CheckUDiskAllowance - 检查UDisk资源余量 | ||
func (c *UDiskClient) CheckUDiskAllowance(req *CheckUDiskAllowanceRequest) (*CheckUDiskAllowanceResponse, error) { | ||
var err error | ||
var res CheckUDiskAllowanceResponse | ||
|
||
err = c.client.InvokeAction("CheckUDiskAllowance", req, &res) | ||
if err != nil { | ||
return &res, err | ||
} | ||
|
||
return &res, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. | ||
//go:generate ucloud-gen-go-api UMem CheckUMemSpaceAllowance | ||
|
||
package umem | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/request" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/response" | ||
) | ||
|
||
// CheckUMemSpaceAllowanceRequest is request schema for CheckUMemSpaceAllowance action | ||
type CheckUMemSpaceAllowanceRequest struct { | ||
request.CommonBase | ||
|
||
// 可用区。参见 [可用区列表](../summary/regionlist.html) | ||
Zone *string `required:"true"` | ||
|
||
// 创建实例的容量大小;分布式memcache最低8G, 分布式redis最低16G,两者最高都是1000G | ||
Size *int `required:"true"` | ||
|
||
// 创建实例的数量,[1-10] | ||
Count *int `required:"true"` | ||
|
||
// redis memcache | ||
Protocol *string `required:"false"` | ||
} | ||
|
||
// CheckUMemSpaceAllowanceResponse is response schema for CheckUMemSpaceAllowance action | ||
type CheckUMemSpaceAllowanceResponse struct { | ||
response.CommonBase | ||
|
||
// 可创建的数量 | ||
Count int | ||
} | ||
|
||
// NewCheckUMemSpaceAllowanceRequest will create request of CheckUMemSpaceAllowance action. | ||
func (c *UMemClient) NewCheckUMemSpaceAllowanceRequest() *CheckUMemSpaceAllowanceRequest { | ||
req := &CheckUMemSpaceAllowanceRequest{} | ||
|
||
// 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 | ||
} | ||
|
||
// CheckUMemSpaceAllowance - 检查分布式UMem剩余资源,包括分布式redis,分布式memcache | ||
func (c *UMemClient) CheckUMemSpaceAllowance(req *CheckUMemSpaceAllowanceRequest) (*CheckUMemSpaceAllowanceResponse, error) { | ||
var err error | ||
var res CheckUMemSpaceAllowanceResponse | ||
|
||
err = c.client.InvokeAction("CheckUMemSpaceAllowance", req, &res) | ||
if err != nil { | ||
return &res, err | ||
} | ||
|
||
return &res, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. | ||
//go:generate ucloud-gen-go-api UMem CheckUMemcacheAllowance | ||
|
||
package umem | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/request" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/response" | ||
) | ||
|
||
// CheckUMemcacheAllowanceRequest is request schema for CheckUMemcacheAllowance action | ||
type CheckUMemcacheAllowanceRequest struct { | ||
request.CommonBase | ||
|
||
// 可用区。参见 [可用区列表](../summary/regionlist.html) | ||
Zone *string `required:"true"` | ||
|
||
// 创建实例的容量大小, 单位:GB 目前仅支持1/2/4/8/16五种规格 | ||
Size *int `required:"true"` | ||
|
||
// 创建实例的数量,[1-10] | ||
Count *int `required:"true"` | ||
} | ||
|
||
// CheckUMemcacheAllowanceResponse is response schema for CheckUMemcacheAllowance action | ||
type CheckUMemcacheAllowanceResponse struct { | ||
response.CommonBase | ||
|
||
// 可创建的数量 | ||
Count int | ||
} | ||
|
||
// NewCheckUMemcacheAllowanceRequest will create request of CheckUMemcacheAllowance action. | ||
func (c *UMemClient) NewCheckUMemcacheAllowanceRequest() *CheckUMemcacheAllowanceRequest { | ||
req := &CheckUMemcacheAllowanceRequest{} | ||
|
||
// 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 | ||
} | ||
|
||
// CheckUMemcacheAllowance - 检查UMemcache剩余资源 | ||
func (c *UMemClient) CheckUMemcacheAllowance(req *CheckUMemcacheAllowanceRequest) (*CheckUMemcacheAllowanceResponse, error) { | ||
var err error | ||
var res CheckUMemcacheAllowanceResponse | ||
|
||
err = c.client.InvokeAction("CheckUMemcacheAllowance", req, &res) | ||
if err != nil { | ||
return &res, err | ||
} | ||
|
||
return &res, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package umon | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/auth" | ||
) | ||
|
||
// UMonClient is the client of UMon | ||
type UMonClient struct { | ||
client *ucloud.Client | ||
} | ||
|
||
// NewClient will return a instance of UMonClient | ||
func NewClient(config *ucloud.Config, credential *auth.Credential) *UMonClient { | ||
client := ucloud.NewClient(config, credential) | ||
return &UMonClient{ | ||
client: client, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. | ||
//go:generate ucloud-gen-go-api UMon DescribeResourceMetric | ||
|
||
package umon | ||
|
||
import ( | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/request" | ||
"github.com/ucloud/ucloud-sdk-go/ucloud/response" | ||
) | ||
|
||
// DescribeResourceMetricRequest is request schema for DescribeResourceMetric action | ||
type DescribeResourceMetricRequest struct { | ||
request.CommonBase | ||
|
||
// 资源类型 | ||
ResourceType *string `required:"true"` | ||
} | ||
|
||
// DescribeResourceMetricResponse is response schema for DescribeResourceMetric action | ||
type DescribeResourceMetricResponse struct { | ||
response.CommonBase | ||
|
||
// 指标信息集合 | ||
DataSet []MetricInfo | ||
} | ||
|
||
// NewDescribeResourceMetricRequest will create request of DescribeResourceMetric action. | ||
func (c *UMonClient) NewDescribeResourceMetricRequest() *DescribeResourceMetricRequest { | ||
req := &DescribeResourceMetricRequest{} | ||
|
||
// 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 | ||
} | ||
|
||
// DescribeResourceMetric - 获取资源支持监控指标信息 | ||
func (c *UMonClient) DescribeResourceMetric(req *DescribeResourceMetricRequest) (*DescribeResourceMetricResponse, error) { | ||
var err error | ||
var res DescribeResourceMetricResponse | ||
|
||
err = c.client.InvokeAction("DescribeResourceMetric", req, &res) | ||
if err != nil { | ||
return &res, err | ||
} | ||
|
||
return &res, nil | ||
} |
Oops, something went wrong.