Skip to content

Commit

Permalink
add UFS and part of USMS to private (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnmssu authored Apr 22, 2019
1 parent c827af7 commit c863d09
Show file tree
Hide file tree
Showing 30 changed files with 1,522 additions and 4 deletions.
53 changes: 53 additions & 0 deletions internal/services/ufs/clear_ufsvolume_white_list.go
Original file line number Diff line number Diff line change
@@ -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
}
19 changes: 19 additions & 0 deletions internal/services/ufs/client.go
Original file line number Diff line number Diff line change
@@ -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,
}
}
6 changes: 3 additions & 3 deletions internal/utest/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
62 changes: 62 additions & 0 deletions private/services/ufs/add_ufsvolume_mount_point.go
Original file line number Diff line number Diff line change
@@ -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
}
19 changes: 19 additions & 0 deletions private/services/ufs/client.go
Original file line number Diff line number Diff line change
@@ -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,
}
}
86 changes: 86 additions & 0 deletions private/services/ufs/create_ufsvolume.go
Original file line number Diff line number Diff line change
@@ -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
}
65 changes: 65 additions & 0 deletions private/services/ufs/describe_ufsvolume.go
Original file line number Diff line number Diff line change
@@ -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
}
68 changes: 68 additions & 0 deletions private/services/ufs/describe_ufsvolume2.go
Original file line number Diff line number Diff line change
@@ -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
}
Loading

0 comments on commit c863d09

Please sign in to comment.