|
| 1 | +""" Code is generated by ucloud-model, DO NOT EDIT IT. """ |
| 2 | + |
| 3 | +import typing |
| 4 | + |
| 5 | + |
| 6 | +from ucloud.core.client import Client |
| 7 | +from ucloud.services.ufs.schemas import apis |
| 8 | + |
| 9 | + |
| 10 | +class UFSClient(Client): |
| 11 | + def __init__( |
| 12 | + self, config: dict, transport=None, middleware=None, logger=None |
| 13 | + ): |
| 14 | + super(UFSClient, self).__init__(config, transport, middleware, logger) |
| 15 | + |
| 16 | + def create_ufs_volume( |
| 17 | + self, req: typing.Optional[dict] = None, **kwargs |
| 18 | + ) -> dict: |
| 19 | + """ CreateUFSVolume - 创建文件系统 |
| 20 | +
|
| 21 | + **Request** |
| 22 | +
|
| 23 | + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_ |
| 24 | + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_ |
| 25 | + - **ProtocolType** (str) - (Required) 文件系统协议,枚举值,NFSv3表示NFS V3协议,NFSv4表示NFS V4协议 |
| 26 | + - **Size** (int) - (Required) 文件系统大小,单位为GB,最大不超过20T,香港容量型必须为100的整数倍,Size最小为500GB,北京,上海,广州的容量型必须为1024的整数倍,Size最小为1024GB。性能型文件系统Size最小为100GB |
| 27 | + - **StorageType** (str) - (Required) 文件系统存储类型,枚举值,Basic表示容量型,Advanced表示性能型 |
| 28 | + - **ChargeType** (str) - 计费模式,枚举值为: Year,按年付费; Month,按月付费; Dynamic,按需付费(需开启权限); Trial,试用(需开启权限) 默认为Dynamic |
| 29 | + - **CouponId** (str) - 使用的代金券id |
| 30 | + - **Quantity** (int) - 购买时长 默认: 1 |
| 31 | + - **Remark** (str) - 备注 |
| 32 | + - **Tag** (str) - 文件系统所属业务组 |
| 33 | + - **VolumeName** (str) - 文件系统名称 |
| 34 | + |
| 35 | + **Response** |
| 36 | +
|
| 37 | + - **VolumeId** (str) - 文件系统ID |
| 38 | + - **VolumeName** (str) - 文件系统名称 |
| 39 | + - **VolumeStatus** (str) - 文件系统挂载点状态 |
| 40 | + |
| 41 | + """ |
| 42 | + # build request |
| 43 | + d = { |
| 44 | + "ProjectId": self.config.project_id, |
| 45 | + "Region": self.config.region, |
| 46 | + } |
| 47 | + req and d.update(req) |
| 48 | + d = apis.CreateUFSVolumeRequestSchema().dumps(d) |
| 49 | + |
| 50 | + # build options |
| 51 | + kwargs["max_retries"] = 0 # ignore retry when api is not idempotent |
| 52 | + |
| 53 | + resp = self.invoke("CreateUFSVolume", d, **kwargs) |
| 54 | + return apis.CreateUFSVolumeResponseSchema().loads(resp) |
| 55 | + |
| 56 | + def describe_ufs_volume_2( |
| 57 | + self, req: typing.Optional[dict] = None, **kwargs |
| 58 | + ) -> dict: |
| 59 | + """ DescribeUFSVolume2 - 获取文件系统列表 |
| 60 | +
|
| 61 | + **Request** |
| 62 | +
|
| 63 | + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_ |
| 64 | + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_ |
| 65 | + - **Limit** (int) - 文件列表长度 |
| 66 | + - **Offset** (int) - 文件列表起始 |
| 67 | + - **VolumeId** (str) - 文件系统ID |
| 68 | + |
| 69 | + **Response** |
| 70 | +
|
| 71 | + - **DataSet** (list) - 见 **UFSVolumeInfo2** 模型定义 |
| 72 | + - **TotalCount** (int) - 文件系统总数 |
| 73 | + |
| 74 | + **Response Model** |
| 75 | + |
| 76 | + **UFSVolumeInfo2** |
| 77 | + |
| 78 | + - **CreateTime** (int) - 文件系统创建时间(unix时间戳) |
| 79 | + - **ExpiredTime** (int) - 文件系统过期时间(unix时间戳) |
| 80 | + - **IsExpired** (str) - 是否过期 |
| 81 | + - **MaxMountPointNum** (int) - 文件系统允许创建的最大挂载点数目 |
| 82 | + - **ProtocolType** (str) - 文件系统协议,枚举值,NFSv3表示NFS V3协议,NFSv4表示NFS V4协议 |
| 83 | + - **Remark** (str) - 文件系统备注信息 |
| 84 | + - **Size** (int) - 文件系统大小,单位GB |
| 85 | + - **StorageType** (str) - 文件系统存储类型,枚举值,Basic表示容量型,Advanced表示性能型 |
| 86 | + - **Tag** (str) - 文件系统所属业务组 |
| 87 | + - **TotalMountPointNum** (int) - 当前文件系统已创建的挂载点数目 |
| 88 | + - **UsedSize** (int) - 文件系统当前使用容量,单位GB |
| 89 | + - **VolumeId** (str) - 文件系统ID |
| 90 | + - **VolumeName** (str) - 文件系统名称 |
| 91 | +
|
| 92 | + """ |
| 93 | + # build request |
| 94 | + d = { |
| 95 | + "ProjectId": self.config.project_id, |
| 96 | + "Region": self.config.region, |
| 97 | + } |
| 98 | + req and d.update(req) |
| 99 | + d = apis.DescribeUFSVolume2RequestSchema().dumps(d) |
| 100 | + |
| 101 | + resp = self.invoke("DescribeUFSVolume2", d, **kwargs) |
| 102 | + return apis.DescribeUFSVolume2ResponseSchema().loads(resp) |
| 103 | + |
| 104 | + def extend_ufs_volume( |
| 105 | + self, req: typing.Optional[dict] = None, **kwargs |
| 106 | + ) -> dict: |
| 107 | + """ ExtendUFSVolume - 文件系统扩容 |
| 108 | +
|
| 109 | + **Request** |
| 110 | +
|
| 111 | + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_ |
| 112 | + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_ |
| 113 | + - **Size** (int) - (Required) 文件系统大小,单位为GB,最大不超过20T,香港容量型必须为100的整数倍,Size最小为500GB,北京,上海,广州的容量型必须为1024的整数倍,Size最小为1024GB。性能型文件系统Size最小为100GB |
| 114 | + - **VolumeId** (str) - (Required) 文件系统ID |
| 115 | + |
| 116 | + **Response** |
| 117 | +
|
| 118 | + |
| 119 | + """ |
| 120 | + # build request |
| 121 | + d = { |
| 122 | + "ProjectId": self.config.project_id, |
| 123 | + "Region": self.config.region, |
| 124 | + } |
| 125 | + req and d.update(req) |
| 126 | + d = apis.ExtendUFSVolumeRequestSchema().dumps(d) |
| 127 | + |
| 128 | + resp = self.invoke("ExtendUFSVolume", d, **kwargs) |
| 129 | + return apis.ExtendUFSVolumeResponseSchema().loads(resp) |
| 130 | + |
| 131 | + def remove_ufs_volume( |
| 132 | + self, req: typing.Optional[dict] = None, **kwargs |
| 133 | + ) -> dict: |
| 134 | + """ RemoveUFSVolume - 删除UFS文件系统 |
| 135 | +
|
| 136 | + **Request** |
| 137 | +
|
| 138 | + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_ |
| 139 | + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_ |
| 140 | + - **VolumeId** (str) - (Required) 文件系统ID |
| 141 | + |
| 142 | + **Response** |
| 143 | +
|
| 144 | + |
| 145 | + """ |
| 146 | + # build request |
| 147 | + d = { |
| 148 | + "ProjectId": self.config.project_id, |
| 149 | + "Region": self.config.region, |
| 150 | + } |
| 151 | + req and d.update(req) |
| 152 | + d = apis.RemoveUFSVolumeRequestSchema().dumps(d) |
| 153 | + |
| 154 | + resp = self.invoke("RemoveUFSVolume", d, **kwargs) |
| 155 | + return apis.RemoveUFSVolumeResponseSchema().loads(resp) |
0 commit comments