Skip to content

Commit 741dec1

Browse files
authored
sdk: rolling update for 0.11.76 (#286)
1 parent 3e2cadd commit 741dec1

File tree

8 files changed

+508
-1
lines changed

8 files changed

+508
-1
lines changed

docs/services.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ UNVS
248248
:members:
249249

250250

251+
UPFS
252+
----
253+
254+
.. autoclass:: ucloud.services.upfs.client.UPFSClient
255+
:members:
256+
257+
251258
UPgSQL
252259
------
253260

ucloud/client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,16 @@ def unet(self):
352352
self.logger,
353353
)
354354

355+
def upfs(self):
356+
from ucloud.services.upfs.client import UPFSClient
357+
358+
return UPFSClient(
359+
self._auto_config("upfs"),
360+
self.transport,
361+
self.middleware,
362+
self.logger,
363+
)
364+
355365
def uphost(self):
356366
from ucloud.services.uphost.client import UPHostClient
357367

ucloud/services/upfs/__init__.py

Whitespace-only changes.

ucloud/services/upfs/client.py

Lines changed: 251 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,251 @@
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.upfs.schemas import apis
8+
9+
10+
class UPFSClient(Client):
11+
def __init__(
12+
self, config: dict, transport=None, middleware=None, logger=None
13+
):
14+
super(UPFSClient, self).__init__(config, transport, middleware, logger)
15+
16+
def create_upfs_volume(
17+
self, req: typing.Optional[dict] = None, **kwargs
18+
) -> dict:
19+
"""CreateUPFSVolume - 创建UPFS文件系统
20+
21+
**Request**
22+
23+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
24+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
25+
- **ProtocolType** (str) - (Required) 文件系统协议,目前仅支持POSIX
26+
- **Size** (int) - (Required) 文件系统大小,单位为GB,必须为100的整数倍,Size最小为500GB
27+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
28+
- **ChargeType** (str) - 计费模式,枚举值为: Year,按年付费; Month,按月付费
29+
- **CouponId** (str) - 使用的代金券id
30+
- **Quantity** (int) - 购买时长 默认: 1
31+
- **Remark** (str) - 备注
32+
- **Tag** (str) - 文件系统所属业务组
33+
- **VolumeName** (str) - 文件系统名称
34+
35+
**Response**
36+
37+
- **VolumeId** (str) - UPFS文件系统ID
38+
- **VolumeName** (str) - UPFS文件系统名称
39+
40+
"""
41+
# build request
42+
d = {
43+
"ProjectId": self.config.project_id,
44+
"Region": self.config.region,
45+
}
46+
req and d.update(req)
47+
d = apis.CreateUPFSVolumeRequestSchema().dumps(d)
48+
49+
# build options
50+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
51+
52+
resp = self.invoke("CreateUPFSVolume", d, **kwargs)
53+
return apis.CreateUPFSVolumeResponseSchema().loads(resp)
54+
55+
def describe_upfs_volume(
56+
self, req: typing.Optional[dict] = None, **kwargs
57+
) -> dict:
58+
"""DescribeUPFSVolume - 获取UPFS文件系统列表
59+
60+
**Request**
61+
62+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
63+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
64+
- **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
65+
- **Limit** (int) - 文件列表长度
66+
- **Offset** (int) - 文件列表起始
67+
- **VolumeId** (str) - 文件系统ID
68+
69+
**Response**
70+
71+
- **DataSet** (list) - 见 **UPFSVolumeInfo** 模型定义
72+
- **TotalCount** (int) - UPFS文件系统总数
73+
74+
**Response Model**
75+
76+
**UPFSVolumeInfo**
77+
- **ChargeType** (str) - 计费类型
78+
- **CreateTime** (int) - 文件系统创建时间(unix时间戳)
79+
- **ExpiredTime** (int) - 文件系统过期时间(unix时间戳)
80+
- **IsExpired** (str) - 是否过期
81+
- **MountAddress** (str) - 文件系统挂载地址
82+
- **MountStatus** (int) - 文件系统挂载状态
83+
- **ProtocolType** (str) - 文件系统协议类型
84+
- **Remark** (str) - 文件系统备注信息
85+
- **Size** (int) - 文件系统大小,单位GB
86+
- **Tag** (str) - 文件系统所属业务组
87+
- **VolumeId** (str) - 文件系统ID
88+
- **VolumeName** (str) - 文件系统名称
89+
- **Zone** (str) - 可用区名字
90+
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.DescribeUPFSVolumeRequestSchema().dumps(d)
100+
101+
resp = self.invoke("DescribeUPFSVolume", d, **kwargs)
102+
return apis.DescribeUPFSVolumeResponseSchema().loads(resp)
103+
104+
def describe_upfs_volume_price(
105+
self, req: typing.Optional[dict] = None, **kwargs
106+
) -> dict:
107+
"""DescribeUPFSVolumePrice - 获取UPFS文件系统价格
108+
109+
**Request**
110+
111+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
112+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
113+
- **Size** (int) - (Required) 文件系统大小,单位为GB,新架构容量型最小容量为500GB,以100GB递增,最大不超过100TB。
114+
- **ChargeType** (str) - Year, Month默认: Month
115+
- **Quantity** (int) - 购买UPFS的时长, 默认为1
116+
- **VolumeId** (str) - UPFS文件系统id,第一次创建文件系统时不需要传这个参数
117+
118+
**Response**
119+
120+
- **DataSet** (list) - 见 **UPFSPriceDataSet** 模型定义
121+
122+
**Response Model**
123+
124+
**UPFSPriceDataSet**
125+
- **ChargeName** (str) - “upfs”
126+
- **ChargeType** (str) - Year, Month
127+
- **OriginalPrice** (float) - 原价格 (单位: 分)
128+
- **Price** (float) - 价格 (单位: 分)
129+
130+
131+
"""
132+
# build request
133+
d = {
134+
"ProjectId": self.config.project_id,
135+
"Region": self.config.region,
136+
}
137+
req and d.update(req)
138+
d = apis.DescribeUPFSVolumePriceRequestSchema().dumps(d)
139+
140+
resp = self.invoke("DescribeUPFSVolumePrice", d, **kwargs)
141+
return apis.DescribeUPFSVolumePriceResponseSchema().loads(resp)
142+
143+
def describe_upfs_volume_upgrade_price(
144+
self, req: typing.Optional[dict] = None, **kwargs
145+
) -> dict:
146+
"""DescribeUPFSVolumeUpgradePrice - UPFS文件系统扩容价格
147+
148+
**Request**
149+
150+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
151+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
152+
- **Size** (str) - (Required) 文件系统大小
153+
- **VolumeId** (str) - (Required) 文件系统ID
154+
155+
**Response**
156+
157+
- **OriginalPrice** (float) - 原价格(单位:分)
158+
- **Price** (float) - 价格(单位:分)
159+
160+
"""
161+
# build request
162+
d = {
163+
"ProjectId": self.config.project_id,
164+
"Region": self.config.region,
165+
}
166+
req and d.update(req)
167+
d = apis.DescribeUPFSVolumeUpgradePriceRequestSchema().dumps(d)
168+
169+
resp = self.invoke("DescribeUPFSVolumeUpgradePrice", d, **kwargs)
170+
return apis.DescribeUPFSVolumeUpgradePriceResponseSchema().loads(resp)
171+
172+
def extend_upfs_volume(
173+
self, req: typing.Optional[dict] = None, **kwargs
174+
) -> dict:
175+
"""ExtendUPFSVolume - UPFS文件系统扩容
176+
177+
**Request**
178+
179+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
180+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
181+
- **Size** (int) - (Required) 文件系统大小,单位为GB,最大不超过20T,香港容量型必须为100的整数倍,Size最小为500GB,北京,上海,广州的容量型必须为1024的整数倍,Size最小为1024GB。性能型文件系统Size最小为100GB
182+
- **VolumeId** (str) - (Required) 文件系统ID
183+
184+
**Response**
185+
186+
187+
"""
188+
# build request
189+
d = {
190+
"ProjectId": self.config.project_id,
191+
"Region": self.config.region,
192+
}
193+
req and d.update(req)
194+
d = apis.ExtendUPFSVolumeRequestSchema().dumps(d)
195+
196+
resp = self.invoke("ExtendUPFSVolume", d, **kwargs)
197+
return apis.ExtendUPFSVolumeResponseSchema().loads(resp)
198+
199+
def remove_upfs_volume(
200+
self, req: typing.Optional[dict] = None, **kwargs
201+
) -> dict:
202+
"""RemoveUPFSVolume - 删除UPFS文件系统
203+
204+
**Request**
205+
206+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
207+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
208+
- **VolumeId** (str) - (Required) 文件系统ID
209+
210+
**Response**
211+
212+
213+
"""
214+
# build request
215+
d = {
216+
"ProjectId": self.config.project_id,
217+
"Region": self.config.region,
218+
}
219+
req and d.update(req)
220+
d = apis.RemoveUPFSVolumeRequestSchema().dumps(d)
221+
222+
resp = self.invoke("RemoveUPFSVolume", d, **kwargs)
223+
return apis.RemoveUPFSVolumeResponseSchema().loads(resp)
224+
225+
def update_upfs_volume_info(
226+
self, req: typing.Optional[dict] = None, **kwargs
227+
) -> dict:
228+
"""UpdateUPFSVolumeInfo - 更改UPFS文件系统相关信息(名称/备注)
229+
230+
**Request**
231+
232+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
233+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
234+
- **VolumeId** (str) - (Required) UPFS文件系统ID
235+
- **Remark** (str) - UPFS文件系统备注(文件系统名称/备注至少传入其中一个)
236+
- **VolumeName** (str) - UPFS文件系统名称(文件系统名称/备注至少传入其中一个)
237+
238+
**Response**
239+
240+
241+
"""
242+
# build request
243+
d = {
244+
"ProjectId": self.config.project_id,
245+
"Region": self.config.region,
246+
}
247+
req and d.update(req)
248+
d = apis.UpdateUPFSVolumeInfoRequestSchema().dumps(d)
249+
250+
resp = self.invoke("UpdateUPFSVolumeInfo", d, **kwargs)
251+
return apis.UpdateUPFSVolumeInfoResponseSchema().loads(resp)

ucloud/services/upfs/schemas/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)