diff --git a/internal/services/ufs/clear_ufsvolume_white_list.go b/internal/services/ufs/clear_ufsvolume_white_list.go new file mode 100644 index 00000000..a77d2183 --- /dev/null +++ b/internal/services/ufs/clear_ufsvolume_white_list.go @@ -0,0 +1,53 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS ClearUFSVolumeWhiteList + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// ClearUFSVolumeWhiteListRequest is request schema for ClearUFSVolumeWhiteList action +type ClearUFSVolumeWhiteListRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` +} + +// ClearUFSVolumeWhiteListResponse is response schema for ClearUFSVolumeWhiteList action +type ClearUFSVolumeWhiteListResponse struct { + response.CommonBase +} + +// NewClearUFSVolumeWhiteListRequest will create request of ClearUFSVolumeWhiteList action. +func (c *UFSClient) NewClearUFSVolumeWhiteListRequest() *ClearUFSVolumeWhiteListRequest { + req := &ClearUFSVolumeWhiteListRequest{} + + // 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 +} + +// ClearUFSVolumeWhiteList - 清除文件系统白名单 +func (c *UFSClient) ClearUFSVolumeWhiteList(req *ClearUFSVolumeWhiteListRequest) (*ClearUFSVolumeWhiteListResponse, error) { + var err error + var res ClearUFSVolumeWhiteListResponse + + err = c.client.InvokeAction("ClearUFSVolumeWhiteList", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/internal/services/ufs/client.go b/internal/services/ufs/client.go new file mode 100644 index 00000000..54e4292e --- /dev/null +++ b/internal/services/ufs/client.go @@ -0,0 +1,19 @@ +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud" + "github.com/ucloud/ucloud-sdk-go/ucloud/auth" +) + +// UFSClient is the client of UFS +type UFSClient struct { + client *ucloud.Client +} + +// NewClient will return a instance of UFSClient +func NewClient(config *ucloud.Config, credential *auth.Credential) *UFSClient { + client := ucloud.NewClient(config, credential) + return &UFSClient{ + client: client, + } +} diff --git a/internal/utest/functions.go b/internal/utest/functions.go index d7870643..fa6bbf54 100644 --- a/internal/utest/functions.go +++ b/internal/utest/functions.go @@ -13,13 +13,13 @@ import ( var zoneImages = map[string]string{ "cn-bj1-01": "uimage-zf2xoa", - "cn-bj2-02": "uimage-ixczxu", // origin is uimage-u0k3m3 + "cn-bj2-02": "uimage-csarne", // origin is uimage-u0k3m3 "cn-bj2-03": "b2689fc412ee5fa108fa5b23ed2e00e6", "cn-bj2-04": "uimage-rq2kat", - "cn-bj2-05": "uimage-kg0w4u", + "cn-bj2-05": "uimage-5rqi0y", "cn-sh-01": "uimage-65fa28", "cn-sh2-01": "uimage-p0c51y", - "cn-sh2-02": "uimage-of3pac", + "cn-sh2-02": "uimage-qnrtyc", "cn-gd-02": "uimage-b54e21", "hk-01": "uimage-g3hvlg", "hk-02": "uimage-gcs1cr", diff --git a/private/services/ufs/add_ufsvolume_mount_point.go b/private/services/ufs/add_ufsvolume_mount_point.go new file mode 100644 index 00000000..90797adf --- /dev/null +++ b/private/services/ufs/add_ufsvolume_mount_point.go @@ -0,0 +1,62 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS AddUFSVolumeMountPoint + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// AddUFSVolumeMountPointRequest is request schema for AddUFSVolumeMountPoint action +type AddUFSVolumeMountPointRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` + + // 挂载点名称 + MountPointName *string `required:"true"` + + // Vpc ID + VpcId *string `required:"true"` + + // Subnet ID + SubnetId *string `required:"true"` +} + +// AddUFSVolumeMountPointResponse is response schema for AddUFSVolumeMountPoint action +type AddUFSVolumeMountPointResponse struct { + response.CommonBase +} + +// NewAddUFSVolumeMountPointRequest will create request of AddUFSVolumeMountPoint action. +func (c *UFSClient) NewAddUFSVolumeMountPointRequest() *AddUFSVolumeMountPointRequest { + req := &AddUFSVolumeMountPointRequest{} + + // 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 +} + +// AddUFSVolumeMountPoint - 添加文件系统挂载点 +func (c *UFSClient) AddUFSVolumeMountPoint(req *AddUFSVolumeMountPointRequest) (*AddUFSVolumeMountPointResponse, error) { + var err error + var res AddUFSVolumeMountPointResponse + + err = c.client.InvokeAction("AddUFSVolumeMountPoint", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/client.go b/private/services/ufs/client.go new file mode 100644 index 00000000..54e4292e --- /dev/null +++ b/private/services/ufs/client.go @@ -0,0 +1,19 @@ +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud" + "github.com/ucloud/ucloud-sdk-go/ucloud/auth" +) + +// UFSClient is the client of UFS +type UFSClient struct { + client *ucloud.Client +} + +// NewClient will return a instance of UFSClient +func NewClient(config *ucloud.Config, credential *auth.Credential) *UFSClient { + client := ucloud.NewClient(config, credential) + return &UFSClient{ + client: client, + } +} diff --git a/private/services/ufs/create_ufsvolume.go b/private/services/ufs/create_ufsvolume.go new file mode 100644 index 00000000..09f6acce --- /dev/null +++ b/private/services/ufs/create_ufsvolume.go @@ -0,0 +1,86 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS CreateUFSVolume + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// CreateUFSVolumeRequest is request schema for CreateUFSVolume action +type CreateUFSVolumeRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统大小,大小1024G ~ 25600G (1T ~ 25T),必须为1024的整数倍。 + Size *int `required:"true"` + + // 文件系统存储类型,枚举值,Basic表示容量型,Advanced表示性能型 + StorageType *string `required:"false"` + + // 文件系统协议,枚举值,NFSv3表示NFS V3协议,NFSv4表示NFS V4协议 + ProtocolType *string `required:"false"` + + // 文件系统名称 + VolumeName *string `required:"false"` + + // 备注 + Remark *string `required:"false"` + + // 文件系统所属业务组 + Tag *string `required:"false"` + + // 计费模式,枚举值为: Year,按年付费; Month,按月付费; Dynamic,按需付费(需开启权限); Trial,试用(需开启权限) 默认为Dynamic + ChargeType *string `required:"false"` + + // 购买时长 默认: 1 + Quantity *int `required:"false"` + + // 使用的代金券id + CouponId *string `required:"false"` +} + +// CreateUFSVolumeResponse is response schema for CreateUFSVolume action +type CreateUFSVolumeResponse struct { + response.CommonBase + + // 文件系统名称 + VolumeName string + + // 文件系统ID + VolumeId string + + // 文件系统挂载点状态 + VolumeStatus string +} + +// NewCreateUFSVolumeRequest will create request of CreateUFSVolume action. +func (c *UFSClient) NewCreateUFSVolumeRequest() *CreateUFSVolumeRequest { + req := &CreateUFSVolumeRequest{} + + // 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 +} + +// CreateUFSVolume - 创建文件系统 +func (c *UFSClient) CreateUFSVolume(req *CreateUFSVolumeRequest) (*CreateUFSVolumeResponse, error) { + var err error + var res CreateUFSVolumeResponse + + err = c.client.InvokeAction("CreateUFSVolume", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/describe_ufsvolume.go b/private/services/ufs/describe_ufsvolume.go new file mode 100644 index 00000000..cb4d63fe --- /dev/null +++ b/private/services/ufs/describe_ufsvolume.go @@ -0,0 +1,65 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS DescribeUFSVolume + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// DescribeUFSVolumeRequest is request schema for DescribeUFSVolume action +type DescribeUFSVolumeRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"false"` + + // 文件列表起始 + Offset *int `required:"false"` + + // 文件列表长度 + Limit *int `required:"false"` +} + +// DescribeUFSVolumeResponse is response schema for DescribeUFSVolume action +type DescribeUFSVolumeResponse struct { + response.CommonBase + + // 文件系统总数 + TotalCount int + + // 文件系统详细信息列表 + DataSet []UFSVolumeInfo +} + +// NewDescribeUFSVolumeRequest will create request of DescribeUFSVolume action. +func (c *UFSClient) NewDescribeUFSVolumeRequest() *DescribeUFSVolumeRequest { + req := &DescribeUFSVolumeRequest{} + + // 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 +} + +// DescribeUFSVolume - 获取文件系统列表 +func (c *UFSClient) DescribeUFSVolume(req *DescribeUFSVolumeRequest) (*DescribeUFSVolumeResponse, error) { + var err error + var res DescribeUFSVolumeResponse + + err = c.client.InvokeAction("DescribeUFSVolume", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/describe_ufsvolume2.go b/private/services/ufs/describe_ufsvolume2.go new file mode 100644 index 00000000..1d7ce553 --- /dev/null +++ b/private/services/ufs/describe_ufsvolume2.go @@ -0,0 +1,68 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS DescribeUFSVolume2 + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// DescribeUFSVolume2Request is request schema for DescribeUFSVolume2 action +type DescribeUFSVolume2Request struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"false"` + + // 文件列表起始 + Offset *int `required:"false"` + + // 文件列表长度 + Limit *int `required:"false"` + + // 枚举值,是否拉取性能型文件系统列表,1表示只拉取容量型文件系统列表,默认为0 + OnlyBasic *int `required:"false"` +} + +// DescribeUFSVolume2Response is response schema for DescribeUFSVolume2 action +type DescribeUFSVolume2Response struct { + response.CommonBase + + // 文件系统总数 + TotalCount int + + // 文件系统详细信息列表 + DataSet []UFSVolumeInfo2 +} + +// NewDescribeUFSVolume2Request will create request of DescribeUFSVolume2 action. +func (c *UFSClient) NewDescribeUFSVolume2Request() *DescribeUFSVolume2Request { + req := &DescribeUFSVolume2Request{} + + // 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 +} + +// DescribeUFSVolume2 - 获取文件系统列表 +func (c *UFSClient) DescribeUFSVolume2(req *DescribeUFSVolume2Request) (*DescribeUFSVolume2Response, error) { + var err error + var res DescribeUFSVolume2Response + + err = c.client.InvokeAction("DescribeUFSVolume2", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/describe_ufsvolume_mountpoint.go b/private/services/ufs/describe_ufsvolume_mountpoint.go new file mode 100644 index 00000000..8bf0e89b --- /dev/null +++ b/private/services/ufs/describe_ufsvolume_mountpoint.go @@ -0,0 +1,62 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS DescribeUFSVolumeMountpoint + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// DescribeUFSVolumeMountpointRequest is request schema for DescribeUFSVolumeMountpoint action +type DescribeUFSVolumeMountpointRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` +} + +// DescribeUFSVolumeMountpointResponse is response schema for DescribeUFSVolumeMountpoint action +type DescribeUFSVolumeMountpointResponse struct { + response.CommonBase + + // + DataSet []MountPointInfo + + // 目前的挂载点总数 + TotalMountPointNum int + + // 文件系统能创建的最大挂载点数目 + MaxMountPointNum int +} + +// NewDescribeUFSVolumeMountpointRequest will create request of DescribeUFSVolumeMountpoint action. +func (c *UFSClient) NewDescribeUFSVolumeMountpointRequest() *DescribeUFSVolumeMountpointRequest { + req := &DescribeUFSVolumeMountpointRequest{} + + // 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 +} + +// DescribeUFSVolumeMountpoint - 获取文件系统挂载点信息 +func (c *UFSClient) DescribeUFSVolumeMountpoint(req *DescribeUFSVolumeMountpointRequest) (*DescribeUFSVolumeMountpointResponse, error) { + var err error + var res DescribeUFSVolumeMountpointResponse + + err = c.client.InvokeAction("DescribeUFSVolumeMountpoint", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/describe_ufsvolume_price.go b/private/services/ufs/describe_ufsvolume_price.go new file mode 100644 index 00000000..f6e20ace --- /dev/null +++ b/private/services/ufs/describe_ufsvolume_price.go @@ -0,0 +1,65 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS DescribeUFSVolumePrice + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// DescribeUFSVolumePriceRequest is request schema for DescribeUFSVolumePrice action +type DescribeUFSVolumePriceRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统大小,大小1024G ~ 25600G (1T ~ 25T),必须为1024的整数倍。 + Size *int `required:"true"` + + // 文件存储类型,枚举值,Basic表示容量型产品,Advanced表示性能型产品 + StorageType *string `required:"true"` + + // 购买UFS的时长, 默认为1 + Quantity *int `required:"false"` + + // Year, Month, Dynamic,Trial,默认: Dynamic + ChargeType *string `required:"false"` +} + +// DescribeUFSVolumePriceResponse is response schema for DescribeUFSVolumePrice action +type DescribeUFSVolumePriceResponse struct { + response.CommonBase + + // ufs 价格信息 + DataSet []UFSPriceDataSet +} + +// NewDescribeUFSVolumePriceRequest will create request of DescribeUFSVolumePrice action. +func (c *UFSClient) NewDescribeUFSVolumePriceRequest() *DescribeUFSVolumePriceRequest { + req := &DescribeUFSVolumePriceRequest{} + + // 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 +} + +// DescribeUFSVolumePrice - 获取文件系统价格 +func (c *UFSClient) DescribeUFSVolumePrice(req *DescribeUFSVolumePriceRequest) (*DescribeUFSVolumePriceResponse, error) { + var err error + var res DescribeUFSVolumePriceResponse + + err = c.client.InvokeAction("DescribeUFSVolumePrice", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/describe_ufsvolume_upgrade_price.go b/private/services/ufs/describe_ufsvolume_upgrade_price.go new file mode 100644 index 00000000..a38ba2d4 --- /dev/null +++ b/private/services/ufs/describe_ufsvolume_upgrade_price.go @@ -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 UFS DescribeUFSVolumeUpgradePrice + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// DescribeUFSVolumeUpgradePriceRequest is request schema for DescribeUFSVolumeUpgradePrice action +type DescribeUFSVolumeUpgradePriceRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` + + // 文件系统大小,大小1024G ~ 25600G (1T ~ 25T),必须为1024的整数倍。 + Size *string `required:"true"` +} + +// DescribeUFSVolumeUpgradePriceResponse is response schema for DescribeUFSVolumeUpgradePrice action +type DescribeUFSVolumeUpgradePriceResponse struct { + response.CommonBase + + // 价格(单位:分) + Price float64 +} + +// NewDescribeUFSVolumeUpgradePriceRequest will create request of DescribeUFSVolumeUpgradePrice action. +func (c *UFSClient) NewDescribeUFSVolumeUpgradePriceRequest() *DescribeUFSVolumeUpgradePriceRequest { + req := &DescribeUFSVolumeUpgradePriceRequest{} + + // 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 +} + +// DescribeUFSVolumeUpgradePrice - 文件系统扩容价格 +func (c *UFSClient) DescribeUFSVolumeUpgradePrice(req *DescribeUFSVolumeUpgradePriceRequest) (*DescribeUFSVolumeUpgradePriceResponse, error) { + var err error + var res DescribeUFSVolumeUpgradePriceResponse + + err = c.client.InvokeAction("DescribeUFSVolumeUpgradePrice", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/describe_ufsvpcsubnet.go b/private/services/ufs/describe_ufsvpcsubnet.go new file mode 100644 index 00000000..fba53cbb --- /dev/null +++ b/private/services/ufs/describe_ufsvpcsubnet.go @@ -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 UFS DescribeUFSVPCSubnet + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// DescribeUFSVPCSubnetRequest is request schema for DescribeUFSVPCSubnet action +type DescribeUFSVPCSubnetRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` +} + +// DescribeUFSVPCSubnetResponse is response schema for DescribeUFSVPCSubnet action +type DescribeUFSVPCSubnetResponse struct { + response.CommonBase + + // 用户的vpc信息 + DataSet []VPCInfo +} + +// NewDescribeUFSVPCSubnetRequest will create request of DescribeUFSVPCSubnet action. +func (c *UFSClient) NewDescribeUFSVPCSubnetRequest() *DescribeUFSVPCSubnetRequest { + req := &DescribeUFSVPCSubnetRequest{} + + // 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 +} + +// DescribeUFSVPCSubnet - 展示可供文件系统挂载的VPC和SUBNET +func (c *UFSClient) DescribeUFSVPCSubnet(req *DescribeUFSVPCSubnetRequest) (*DescribeUFSVPCSubnetResponse, error) { + var err error + var res DescribeUFSVPCSubnetResponse + + err = c.client.InvokeAction("DescribeUFSVPCSubnet", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/extend_ufsvolume.go b/private/services/ufs/extend_ufsvolume.go new file mode 100644 index 00000000..1d0f1402 --- /dev/null +++ b/private/services/ufs/extend_ufsvolume.go @@ -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 UFS ExtendUFSVolume + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// ExtendUFSVolumeRequest is request schema for ExtendUFSVolume action +type ExtendUFSVolumeRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` + + // 文件系统大小,大小1024G ~ 25600G (1T ~ 25T),必须为1024的整数倍。 + Size *string `required:"true"` +} + +// ExtendUFSVolumeResponse is response schema for ExtendUFSVolume action +type ExtendUFSVolumeResponse struct { + response.CommonBase +} + +// NewExtendUFSVolumeRequest will create request of ExtendUFSVolume action. +func (c *UFSClient) NewExtendUFSVolumeRequest() *ExtendUFSVolumeRequest { + req := &ExtendUFSVolumeRequest{} + + // 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 +} + +// ExtendUFSVolume - 文件系统扩容 +func (c *UFSClient) ExtendUFSVolume(req *ExtendUFSVolumeRequest) (*ExtendUFSVolumeResponse, error) { + var err error + var res ExtendUFSVolumeResponse + + err = c.client.InvokeAction("ExtendUFSVolume", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/remove_ufsvolume.go b/private/services/ufs/remove_ufsvolume.go new file mode 100644 index 00000000..7dd5dce8 --- /dev/null +++ b/private/services/ufs/remove_ufsvolume.go @@ -0,0 +1,53 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api UFS RemoveUFSVolume + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// RemoveUFSVolumeRequest is request schema for RemoveUFSVolume action +type RemoveUFSVolumeRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` +} + +// RemoveUFSVolumeResponse is response schema for RemoveUFSVolume action +type RemoveUFSVolumeResponse struct { + response.CommonBase +} + +// NewRemoveUFSVolumeRequest will create request of RemoveUFSVolume action. +func (c *UFSClient) NewRemoveUFSVolumeRequest() *RemoveUFSVolumeRequest { + req := &RemoveUFSVolumeRequest{} + + // 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 +} + +// RemoveUFSVolume - 删除UFS文件系统 +func (c *UFSClient) RemoveUFSVolume(req *RemoveUFSVolumeRequest) (*RemoveUFSVolumeResponse, error) { + var err error + var res RemoveUFSVolumeResponse + + err = c.client.InvokeAction("RemoveUFSVolume", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/remove_ufsvolume_mount_point.go b/private/services/ufs/remove_ufsvolume_mount_point.go new file mode 100644 index 00000000..6019291e --- /dev/null +++ b/private/services/ufs/remove_ufsvolume_mount_point.go @@ -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 UFS RemoveUFSVolumeMountPoint + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// RemoveUFSVolumeMountPointRequest is request schema for RemoveUFSVolumeMountPoint action +type RemoveUFSVolumeMountPointRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` + + // Vpc ID + VpcId *string `required:"true"` + + // Subnet ID + SubnetId *string `required:"true"` +} + +// RemoveUFSVolumeMountPointResponse is response schema for RemoveUFSVolumeMountPoint action +type RemoveUFSVolumeMountPointResponse struct { + response.CommonBase +} + +// NewRemoveUFSVolumeMountPointRequest will create request of RemoveUFSVolumeMountPoint action. +func (c *UFSClient) NewRemoveUFSVolumeMountPointRequest() *RemoveUFSVolumeMountPointRequest { + req := &RemoveUFSVolumeMountPointRequest{} + + // 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 +} + +// RemoveUFSVolumeMountPoint - 删除文件系统挂载点 +func (c *UFSClient) RemoveUFSVolumeMountPoint(req *RemoveUFSVolumeMountPointRequest) (*RemoveUFSVolumeMountPointResponse, error) { + var err error + var res RemoveUFSVolumeMountPointResponse + + err = c.client.InvokeAction("RemoveUFSVolumeMountPoint", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/ufs/types_mount_point_info.go b/private/services/ufs/types_mount_point_info.go new file mode 100644 index 00000000..48ed1dff --- /dev/null +++ b/private/services/ufs/types_mount_point_info.go @@ -0,0 +1,28 @@ +package ufs + +/* +MountPointInfo - 挂载点信息 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type MountPointInfo struct { + + // 挂载点名称 + MountPointName string + + // Vpc ID + VpcId string + + // Subnet ID + SubnetId string + + // 挂载点IP + MountPointIp string + + // 文件系统创建时间(unix时间戳) + CreateTime int + + // Subnet ID + 网段的形式,方便前端展示 + SubnetDescription string +} diff --git a/private/services/ufs/types_subnet_front_end.go b/private/services/ufs/types_subnet_front_end.go new file mode 100644 index 00000000..303a2868 --- /dev/null +++ b/private/services/ufs/types_subnet_front_end.go @@ -0,0 +1,16 @@ +package ufs + +/* +SubnetFrontEnd - 子网展示信息 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type SubnetFrontEnd struct { + + // 子网id + SubnetId string + + // 子网id + 网段 + SubnetDescription string +} diff --git a/private/services/ufs/types_ufsprice_data_set.go b/private/services/ufs/types_ufsprice_data_set.go new file mode 100644 index 00000000..47a84cfb --- /dev/null +++ b/private/services/ufs/types_ufsprice_data_set.go @@ -0,0 +1,19 @@ +package ufs + +/* +UFSPriceDataSet - ufs 价格信息 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type UFSPriceDataSet struct { + + // Year, Month, Dynamic,Trial + ChargeType string + + // 价格 (单位: 分) + Price float64 + + // “UFS” + ChargeName string +} diff --git a/private/services/ufs/types_ufsvolume_info.go b/private/services/ufs/types_ufsvolume_info.go new file mode 100644 index 00000000..4295b1f9 --- /dev/null +++ b/private/services/ufs/types_ufsvolume_info.go @@ -0,0 +1,40 @@ +package ufs + +/* +UFSVolumeInfo - 文件系统信息 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type UFSVolumeInfo struct { + + // 文件系统名称 + VolumeName string + + // 文件系统ID + VolumeId string + + // 文件系统是否已添加挂载点 + VolumeStatus string + + // 文件系统已添加挂载点时返回 + MountPoint string + + // 文件系统备注信息 + Remark string + + // 文件系统所属业务组 + Tag string + + // 文件系统创建时间(unix时间戳) + CreateTime int + + // 文件系统过期时间(unix时间戳) + ExpiredTime int + + // 文件系统大小,单位GB + Size int + + // 是否过期 + IsExpired string +} diff --git a/private/services/ufs/types_ufsvolume_info2.go b/private/services/ufs/types_ufsvolume_info2.go new file mode 100644 index 00000000..6cebc68a --- /dev/null +++ b/private/services/ufs/types_ufsvolume_info2.go @@ -0,0 +1,46 @@ +package ufs + +/* +UFSVolumeInfo2 - 文件系统信息 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type UFSVolumeInfo2 struct { + + // 文件系统名称 + VolumeName string + + // 文件系统ID + VolumeId string + + // 当前文件系统已创建的挂载点数目 + TotalMountPointNum int + + // 文件系统允许创建的最大挂载点数目 + MaxMountPointNum int + + // 文件系统存储类型,枚举值,Basic表示容量型,Advanced表示性能型 + StorageType string + + // 文件系统协议,枚举值,NFSv3表示NFS V3协议,NFSv4表示NFS V4协议 + ProtocolType string + + // 文件系统备注信息 + Remark string + + // 文件系统所属业务组 + Tag string + + // 文件系统创建时间(unix时间戳) + CreateTime int + + // 文件系统过期时间(unix时间戳) + ExpiredTime int + + // 文件系统大小,单位GB + Size int + + // 是否过期 + IsExpired string +} diff --git a/private/services/ufs/types_vpcinfo.go b/private/services/ufs/types_vpcinfo.go new file mode 100644 index 00000000..9458b88f --- /dev/null +++ b/private/services/ufs/types_vpcinfo.go @@ -0,0 +1,19 @@ +package ufs + +/* +VPCInfo - vpc信息 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type VPCInfo struct { + + // Vpc ID + VpcId string + + // subnet信息 + SubnetIds []SubnetFrontEnd + + // 是否创建subnet,如果为false,则提示用户创建subnet。如果为true,同时SubnetIds为空,则表明当前vpc下已经没有subnet可以挂载 + SubnetCreated bool +} diff --git a/private/services/ufs/update_ufsvolume_info.go b/private/services/ufs/update_ufsvolume_info.go new file mode 100644 index 00000000..458f2c87 --- /dev/null +++ b/private/services/ufs/update_ufsvolume_info.go @@ -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 UFS UpdateUFSVolumeInfo + +package ufs + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// UpdateUFSVolumeInfoRequest is request schema for UpdateUFSVolumeInfo action +type UpdateUFSVolumeInfoRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"true"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 文件系统ID + VolumeId *string `required:"true"` + + // 文件系统名称(文件系统名称/备注至少传入其中一个) + VolumeName *string `required:"false"` + + // 文件系统备注(文件系统名称/备注至少传入其中一个) + Remark *string `required:"false"` +} + +// UpdateUFSVolumeInfoResponse is response schema for UpdateUFSVolumeInfo action +type UpdateUFSVolumeInfoResponse struct { + response.CommonBase +} + +// NewUpdateUFSVolumeInfoRequest will create request of UpdateUFSVolumeInfo action. +func (c *UFSClient) NewUpdateUFSVolumeInfoRequest() *UpdateUFSVolumeInfoRequest { + req := &UpdateUFSVolumeInfoRequest{} + + // 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 +} + +// UpdateUFSVolumeInfo - 更改文件系统相关信息(名称/备注) +func (c *UFSClient) UpdateUFSVolumeInfo(req *UpdateUFSVolumeInfoRequest) (*UpdateUFSVolumeInfoResponse, error) { + var err error + var res UpdateUFSVolumeInfoResponse + + err = c.client.InvokeAction("UpdateUFSVolumeInfo", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/usms/client.go b/private/services/usms/client.go new file mode 100644 index 00000000..fa09960e --- /dev/null +++ b/private/services/usms/client.go @@ -0,0 +1,19 @@ +package usms + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud" + "github.com/ucloud/ucloud-sdk-go/ucloud/auth" +) + +// USMSClient is the client of USMS +type USMSClient struct { + client *ucloud.Client +} + +// NewClient will return a instance of USMSClient +func NewClient(config *ucloud.Config, credential *auth.Credential) *USMSClient { + client := ucloud.NewClient(config, credential) + return &USMSClient{ + client: client, + } +} diff --git a/private/services/usms/get_usmssend_receipt.go b/private/services/usms/get_usmssend_receipt.go new file mode 100644 index 00000000..e6607333 --- /dev/null +++ b/private/services/usms/get_usmssend_receipt.go @@ -0,0 +1,62 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api USMS GetUSMSSendReceipt + +package usms + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// GetUSMSSendReceiptRequest is request schema for GetUSMSSendReceipt action +type GetUSMSSendReceiptRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"false"` + + // [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html) + // Zone *string `required:"false"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 发送短信时返回的SessionNo集合,SessionNoSet.0,SessionNoSet.1....格式 + SessionNoSet []string `required:"true"` +} + +// GetUSMSSendReceiptResponse is response schema for GetUSMSSendReceipt action +type GetUSMSSendReceiptResponse struct { + response.CommonBase + + // 错误描述 + Message string + + // 回执信息集合 + Data []ReceiptPerSession +} + +// NewGetUSMSSendReceiptRequest will create request of GetUSMSSendReceipt action. +func (c *USMSClient) NewGetUSMSSendReceiptRequest() *GetUSMSSendReceiptRequest { + req := &GetUSMSSendReceiptRequest{} + + // 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 +} + +// GetUSMSSendReceipt - 获取短信发送回执信息。下游服务提供商回执信息返回会有一定延时,建议发送完短信以后,5-10分钟后再调用该接口拉取回执信息。若超过12小时未返回,则请联系技术支持确认原因 +func (c *USMSClient) GetUSMSSendReceipt(req *GetUSMSSendReceiptRequest) (*GetUSMSSendReceiptResponse, error) { + var err error + var res GetUSMSSendReceiptResponse + + err = c.client.InvokeAction("GetUSMSSendReceipt", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/usms/send_usmsmessage.go b/private/services/usms/send_usmsmessage.go new file mode 100644 index 00000000..bb083091 --- /dev/null +++ b/private/services/usms/send_usmsmessage.go @@ -0,0 +1,71 @@ +//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors. +//go:generate ucloud-gen-go-api USMS SendUSMSMessage + +package usms + +import ( + "github.com/ucloud/ucloud-sdk-go/ucloud/request" + "github.com/ucloud/ucloud-sdk-go/ucloud/response" +) + +// SendUSMSMessageRequest is request schema for SendUSMSMessage action +type SendUSMSMessageRequest struct { + request.CommonBase + + // [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html) + // Region *string `required:"false"` + + // [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html) + // Zone *string `required:"false"` + + // [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + // ProjectId *string `required:"false"` + + // 电话号码数组,电话号码格式为(60)1xxxxxxxx,()中为国际长途区号(如中国为86或0086,两种格式都支持),后面为电话号码.若不传入国际区号,如1851623xxxx,则默认为国内手机号 + PhoneNumbers []string `required:"true"` + + // 模板参数数组,以TempalteParams.0,TempalteParams.1.。。格式。若模板ID指定的模板无可变参数,则不传入该参数。模板参数个数与模板不匹配,则不允许发送 + TemplateParams []string `required:"true"` + + // 模板ID。若指定的模板ID审核未通过(status不等于2)则不允许发送 + TemplateId *string `required:"true"` + + // 使用的签名,如果不输入则使用默认签名,若没有申请默认签名不允许发送;若输入的签名没有申请,则无法发送 + SigContent *string `required:"false"` +} + +// SendUSMSMessageResponse is response schema for SendUSMSMessage action +type SendUSMSMessageResponse struct { + response.CommonBase + + // 发生错误时表示错误描述 + Message string + + // 本次提交发送的短信的唯一ID,可根据该值查询本次发送的短信列表 + SessionNo string +} + +// NewSendUSMSMessageRequest will create request of SendUSMSMessage action. +func (c *USMSClient) NewSendUSMSMessageRequest() *SendUSMSMessageRequest { + req := &SendUSMSMessageRequest{} + + // 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 +} + +// SendUSMSMessage - 发送短信息。短信字数超过70个后,按照每66个进行切割(因为要加上1/3), 2/3)等字样,占用4个字长)。短信最大长度不能超过600个字。每个汉字、数字、字母、字符都按一个字计 +func (c *USMSClient) SendUSMSMessage(req *SendUSMSMessageRequest) (*SendUSMSMessageResponse, error) { + var err error + var res SendUSMSMessageResponse + + err = c.client.InvokeAction("SendUSMSMessage", req, &res) + if err != nil { + return &res, err + } + + return &res, nil +} diff --git a/private/services/usms/types_receipt_per_phone.go b/private/services/usms/types_receipt_per_phone.go new file mode 100644 index 00000000..03700479 --- /dev/null +++ b/private/services/usms/types_receipt_per_phone.go @@ -0,0 +1,25 @@ +package usms + +/* +ReceiptPerPhone - 每个目的手机号的发送回执信息 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type ReceiptPerPhone struct { + + // 手机号码 + Phone string + + // 消耗短信条数 + CostCount int + + // 回执结果 + ReceiptResult string + + // 回执结果描述 + ReceiptDesc string + + // 回执返回时间 + ReceiptTime int +} diff --git a/private/services/usms/types_receipt_per_session.go b/private/services/usms/types_receipt_per_session.go new file mode 100644 index 00000000..5a31e2c5 --- /dev/null +++ b/private/services/usms/types_receipt_per_session.go @@ -0,0 +1,16 @@ +package usms + +/* +ReceiptPerSession - 每个提交的回执结果集合 + +this model is auto created by ucloud code generater for open api, +you can also see https://docs.ucloud.cn for detail. +*/ +type ReceiptPerSession struct { + + // 发送短信时返回的SessionNo + SessionNo string + + // 每个手机号的短信回执信息集合 + ReceiptSet []ReceiptPerPhone +} diff --git a/tests/set_113_test.go b/tests/set_113_test.go new file mode 100644 index 00000000..0a7cca4e --- /dev/null +++ b/tests/set_113_test.go @@ -0,0 +1,310 @@ +package tests + +import ( + "testing" + "time" + + "github.com/ucloud/ucloud-sdk-go/internal/utest" +) + +func TestSet113(t *testing.T) { + t.Parallel() + + ctx := utest.NewTestContext() + ctx.T = t + ctx.Vars = map[string]interface{}{} + + ctx.SetVar("Region", "cn-sh2") + ctx.SetVar("Zone", "cn-sh2-02") + + ctx.SetVar("Region", "cn-bj2") + ctx.SetVar("Zone", "cn-bj2-03") + + testSet113CreateUFSVolume00(&ctx) + testSet113DescribeUFSVolume01(&ctx) + testSet113DescribeUHostLite02(&ctx) + testSet113DescribeUFSVolume03(&ctx) + testSet113ClearUFSVolumeWhiteList04(&ctx) + testSet113DescribeUFSVolume05(&ctx) + testSet113ExtendUFSVolume06(&ctx) + testSet113DescribeUFSVolume07(&ctx) + testSet113RemoveUFSVolume08(&ctx) +} + +func testSet113CreateUFSVolume00(ctx *utest.TestContext) { + time.Sleep(time.Duration(3) * time.Second) + + req := pufsClient.NewCreateUFSVolumeRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + + ctx.NoError(utest.SetReqValue(req, "Size", "1024")) + + ctx.NoError(utest.SetReqValue(req, "Zone", ctx.GetVar("Zone"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return pufsClient.CreateUFSVolume(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + + ctx.Vars["Volume_Id"] = ctx.Must(utest.GetValue(resp, "VolumeId")) + ctx.Vars["Volume_Name"] = ctx.Must(utest.GetValue(resp, "VolumeName")) +} + +func testSet113DescribeUFSVolume01(ctx *utest.TestContext) { + time.Sleep(time.Duration(0) * time.Second) + + req := pufsClient.NewDescribeUFSVolumeRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + ctx.NoError(utest.SetReqValue(req, "VolumeId", ctx.GetVar("Volume_Id"))) + + ctx.NoError(utest.SetReqValue(req, "Zone", ctx.GetVar("Zone"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return pufsClient.DescribeUFSVolume(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} + +func testSet113DescribeUHostLite02(ctx *utest.TestContext) { + time.Sleep(time.Duration(0) * time.Second) + + req := iuhostClient.NewDescribeUHostLiteRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + ctx.NoError(utest.SetReqValue(req, "Zone", ctx.GetVar("Zone"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return iuhostClient.DescribeUHostLite(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} + +func testSet113DescribeUFSVolume03(ctx *utest.TestContext) { + time.Sleep(time.Duration(0) * time.Second) + + req := pufsClient.NewDescribeUFSVolumeRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + ctx.NoError(utest.SetReqValue(req, "VolumeId", "Volume_Id")) + + ctx.NoError(utest.SetReqValue(req, "Zone", ctx.GetVar("Zone"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return pufsClient.DescribeUFSVolume(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} + +func testSet113ClearUFSVolumeWhiteList04(ctx *utest.TestContext) { + time.Sleep(time.Duration(0) * time.Second) + + req := iufsClient.NewClearUFSVolumeWhiteListRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + + ctx.NoError(utest.SetReqValue(req, "VolumeId", ctx.GetVar("Volume_Id"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return iufsClient.ClearUFSVolumeWhiteList(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} + +func testSet113DescribeUFSVolume05(ctx *utest.TestContext) { + time.Sleep(time.Duration(0) * time.Second) + + req := pufsClient.NewDescribeUFSVolumeRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + ctx.NoError(utest.SetReqValue(req, "VolumeId", "Volume_Id")) + + ctx.NoError(utest.SetReqValue(req, "Zone", ctx.GetVar("Zone"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return pufsClient.DescribeUFSVolume(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} + +func testSet113ExtendUFSVolume06(ctx *utest.TestContext) { + time.Sleep(time.Duration(0) * time.Second) + + req := pufsClient.NewExtendUFSVolumeRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + + ctx.NoError(utest.SetReqValue(req, "VolumeId", ctx.GetVar("Volume_Id"))) + ctx.NoError(utest.SetReqValue(req, "Size", "2048")) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return pufsClient.ExtendUFSVolume(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} + +func testSet113DescribeUFSVolume07(ctx *utest.TestContext) { + time.Sleep(time.Duration(0) * time.Second) + + req := pufsClient.NewDescribeUFSVolumeRequest() + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + ctx.NoError(utest.SetReqValue(req, "VolumeId", "Volume_Id")) + + ctx.NoError(utest.SetReqValue(req, "Zone", ctx.GetVar("Zone"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return pufsClient.DescribeUFSVolume(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 0, + RetryInterval: 0 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} + +func testSet113RemoveUFSVolume08(ctx *utest.TestContext) { + time.Sleep(time.Duration(30) * time.Second) + + req := pufsClient.NewRemoveUFSVolumeRequest() + + ctx.NoError(utest.SetReqValue(req, "VolumeId", ctx.GetVar("Volume_Id"))) + + ctx.NoError(utest.SetReqValue(req, "Region", ctx.GetVar("Region"))) + + testCase := utest.TestCase{ + Invoker: func() (interface{}, error) { + return pufsClient.RemoveUFSVolume(req) + }, + Validators: []utest.TestValidator{ + ctx.NewValidator("RetCode", "0", "str_eq"), + }, + MaxRetries: 3, + RetryInterval: 1 * time.Second, + T: ctx.T, + } + + resp, err := testCase.Run() + if resp == nil || err != nil { + + ctx.T.Error(err) + + } + +} diff --git a/tests/setup_test.go b/tests/setup_test.go index bf73a8bc..641077a0 100644 --- a/tests/setup_test.go +++ b/tests/setup_test.go @@ -22,6 +22,7 @@ import ( "github.com/ucloud/ucloud-sdk-go/services/vpc" pudisk "github.com/ucloud/ucloud-sdk-go/private/services/udisk" + pufs "github.com/ucloud/ucloud-sdk-go/private/services/ufs" puhost "github.com/ucloud/ucloud-sdk-go/private/services/uhost" pulb "github.com/ucloud/ucloud-sdk-go/private/services/ulb" pumem "github.com/ucloud/ucloud-sdk-go/private/services/umem" @@ -32,6 +33,7 @@ import ( iudb "github.com/ucloud/ucloud-sdk-go/internal/services/udb" iudisk "github.com/ucloud/ucloud-sdk-go/internal/services/udisk" iudpn "github.com/ucloud/ucloud-sdk-go/internal/services/udpn" + iufs "github.com/ucloud/ucloud-sdk-go/internal/services/ufs" iuhost "github.com/ucloud/ucloud-sdk-go/internal/services/uhost" iulb "github.com/ucloud/ucloud-sdk-go/internal/services/ulb" iumem "github.com/ucloud/ucloud-sdk-go/internal/services/umem" @@ -60,6 +62,7 @@ var pudiskClient *pudisk.UDiskClient var pumemClient *pumem.UMemClient var pumonClient *pumon.UMonClient var pulbClient *pulb.ULBClient +var pufsClient *pufs.UFSClient var iuhostClient *iuhost.UHostClient var iunetClient *iunet.UNetClient @@ -72,6 +75,7 @@ var iumemClient *iumem.UMemClient var iudpnClient *iudpn.UDPNClient var iubillClient *iubill.UBillClient var iuphostClient *iuphost.UPHostClient +var iufsClient *iufs.UFSClient func TestMain(m *testing.M) { testSetup() @@ -122,12 +126,14 @@ func testSetup() { iudpnClient = iudpn.NewClient(&cfg, &credential) iubillClient = iubill.NewClient(&cfg, &credential) iuphostClient = iuphost.NewClient(&cfg, &credential) + iufsClient = iufs.NewClient(&cfg, &credential) pudiskClient = pudisk.NewClient(&cfg, &credential) puhostClient = puhost.NewClient(&cfg, &credential) pumemClient = pumem.NewClient(&cfg, &credential) pumonClient = pumon.NewClient(&cfg, &credential) pulbClient = pulb.NewClient(&cfg, &credential) + pufsClient = pufs.NewClient(&cfg, &credential) log.Info("setup test fixtures ...") } diff --git a/ucloud/version/version.go b/ucloud/version/version.go index 194a3735..72fbb3ab 100644 --- a/ucloud/version/version.go +++ b/ucloud/version/version.go @@ -4,4 +4,4 @@ Package version is the version of sdk package version // Version see also semantic version: https://semver.org/ -const Version = "0.8.2" +const Version = "0.8.3"