-
Notifications
You must be signed in to change notification settings - Fork 38
/
create_ufsvolume.go
86 lines (62 loc) · 2.54 KB
/
create_ufsvolume.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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
}