ucloud-sdk-python3 0.11.81__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. ucloud/__init__.py +0 -0
  2. ucloud/client.py +469 -0
  3. ucloud/core/__init__.py +0 -0
  4. ucloud/core/auth/__init__.py +3 -0
  5. ucloud/core/auth/_cfg.py +72 -0
  6. ucloud/core/client/__init__.py +8 -0
  7. ucloud/core/client/_cfg.py +96 -0
  8. ucloud/core/client/_client.py +176 -0
  9. ucloud/core/exc/__init__.py +9 -0
  10. ucloud/core/exc/_exc.py +94 -0
  11. ucloud/core/transport/__init__.py +4 -0
  12. ucloud/core/transport/_requests.py +135 -0
  13. ucloud/core/transport/http.py +120 -0
  14. ucloud/core/transport/utils.py +40 -0
  15. ucloud/core/typesystem/__init__.py +0 -0
  16. ucloud/core/typesystem/abstract.py +60 -0
  17. ucloud/core/typesystem/encoder.py +33 -0
  18. ucloud/core/typesystem/fields.py +149 -0
  19. ucloud/core/typesystem/schema.py +97 -0
  20. ucloud/core/utils/__init__.py +0 -0
  21. ucloud/core/utils/compat.py +15 -0
  22. ucloud/core/utils/deco.py +31 -0
  23. ucloud/core/utils/log.py +29 -0
  24. ucloud/core/utils/middleware.py +63 -0
  25. ucloud/helpers/__init__.py +0 -0
  26. ucloud/helpers/utils.py +90 -0
  27. ucloud/helpers/wait.py +108 -0
  28. ucloud/services/__init__.py +0 -0
  29. ucloud/services/cube/__init__.py +0 -0
  30. ucloud/services/cube/client.py +618 -0
  31. ucloud/services/cube/schemas/__init__.py +0 -0
  32. ucloud/services/cube/schemas/apis.py +548 -0
  33. ucloud/services/cube/schemas/models.py +58 -0
  34. ucloud/services/iam/__init__.py +0 -0
  35. ucloud/services/iam/client.py +1078 -0
  36. ucloud/services/iam/schemas/__init__.py +0 -0
  37. ucloud/services/iam/schemas/apis.py +973 -0
  38. ucloud/services/iam/schemas/models.py +127 -0
  39. ucloud/services/ipsecvpn/__init__.py +0 -0
  40. ucloud/services/ipsecvpn/client.py +522 -0
  41. ucloud/services/ipsecvpn/schemas/__init__.py +0 -0
  42. ucloud/services/ipsecvpn/schemas/apis.py +455 -0
  43. ucloud/services/ipsecvpn/schemas/models.py +134 -0
  44. ucloud/services/ipv6gw/__init__.py +0 -0
  45. ucloud/services/ipv6gw/client.py +44 -0
  46. ucloud/services/ipv6gw/schemas/__init__.py +0 -0
  47. ucloud/services/ipv6gw/schemas/apis.py +34 -0
  48. ucloud/services/ipv6gw/schemas/models.py +3 -0
  49. ucloud/services/isms/__init__.py +0 -0
  50. ucloud/services/isms/client.py +330 -0
  51. ucloud/services/isms/schemas/__init__.py +0 -0
  52. ucloud/services/isms/schemas/apis.py +272 -0
  53. ucloud/services/isms/schemas/models.py +50 -0
  54. ucloud/services/pathx/__init__.py +0 -0
  55. ucloud/services/pathx/client.py +1656 -0
  56. ucloud/services/pathx/schemas/__init__.py +0 -0
  57. ucloud/services/pathx/schemas/apis.py +1289 -0
  58. ucloud/services/pathx/schemas/models.py +420 -0
  59. ucloud/services/stepflow/__init__.py +0 -0
  60. ucloud/services/stepflow/client.py +98 -0
  61. ucloud/services/stepflow/schemas/__init__.py +0 -0
  62. ucloud/services/stepflow/schemas/apis.py +67 -0
  63. ucloud/services/stepflow/schemas/models.py +37 -0
  64. ucloud/services/sts/__init__.py +0 -0
  65. ucloud/services/sts/client.py +46 -0
  66. ucloud/services/sts/schemas/__init__.py +0 -0
  67. ucloud/services/sts/schemas/apis.py +35 -0
  68. ucloud/services/sts/schemas/models.py +16 -0
  69. ucloud/services/tidb/__init__.py +0 -0
  70. ucloud/services/tidb/client.py +120 -0
  71. ucloud/services/tidb/schemas/__init__.py +0 -0
  72. ucloud/services/tidb/schemas/apis.py +103 -0
  73. ucloud/services/tidb/schemas/models.py +11 -0
  74. ucloud/services/uaaa/__init__.py +0 -0
  75. ucloud/services/uaaa/client.py +311 -0
  76. ucloud/services/uaaa/schemas/__init__.py +0 -0
  77. ucloud/services/uaaa/schemas/apis.py +252 -0
  78. ucloud/services/uaaa/schemas/models.py +47 -0
  79. ucloud/services/uaccount/__init__.py +0 -0
  80. ucloud/services/uaccount/client.py +547 -0
  81. ucloud/services/uaccount/schemas/__init__.py +0 -0
  82. ucloud/services/uaccount/schemas/apis.py +442 -0
  83. ucloud/services/uaccount/schemas/models.py +128 -0
  84. ucloud/services/uads/__init__.py +0 -0
  85. ucloud/services/uads/client.py +1148 -0
  86. ucloud/services/uads/schemas/__init__.py +0 -0
  87. ucloud/services/uads/schemas/apis.py +983 -0
  88. ucloud/services/uads/schemas/models.py +199 -0
  89. ucloud/services/ubill/__init__.py +0 -0
  90. ucloud/services/ubill/client.py +248 -0
  91. ucloud/services/ubill/schemas/__init__.py +0 -0
  92. ucloud/services/ubill/schemas/apis.py +183 -0
  93. ucloud/services/ubill/schemas/models.py +107 -0
  94. ucloud/services/ucdn/__init__.py +0 -0
  95. ucloud/services/ucdn/client.py +1964 -0
  96. ucloud/services/ucdn/schemas/__init__.py +0 -0
  97. ucloud/services/ucdn/schemas/apis.py +1395 -0
  98. ucloud/services/ucdn/schemas/models.py +576 -0
  99. ucloud/services/ucloudstack/__init__.py +0 -0
  100. ucloud/services/ucloudstack/client.py +3352 -0
  101. ucloud/services/ucloudstack/schemas/__init__.py +0 -0
  102. ucloud/services/ucloudstack/schemas/apis.py +2887 -0
  103. ucloud/services/ucloudstack/schemas/models.py +560 -0
  104. ucloud/services/ucompshare/__init__.py +0 -0
  105. ucloud/services/ucompshare/client.py +820 -0
  106. ucloud/services/ucompshare/schemas/__init__.py +0 -0
  107. ucloud/services/ucompshare/schemas/apis.py +623 -0
  108. ucloud/services/ucompshare/schemas/models.py +241 -0
  109. ucloud/services/udb/__init__.py +0 -0
  110. ucloud/services/udb/client.py +2463 -0
  111. ucloud/services/udb/schemas/__init__.py +0 -0
  112. ucloud/services/udb/schemas/apis.py +2053 -0
  113. ucloud/services/udb/schemas/models.py +319 -0
  114. ucloud/services/udbproxy/__init__.py +0 -0
  115. ucloud/services/udbproxy/client.py +67 -0
  116. ucloud/services/udbproxy/schemas/__init__.py +0 -0
  117. ucloud/services/udbproxy/schemas/apis.py +38 -0
  118. ucloud/services/udbproxy/schemas/models.py +31 -0
  119. ucloud/services/uddb/__init__.py +0 -0
  120. ucloud/services/uddb/client.py +456 -0
  121. ucloud/services/uddb/schemas/__init__.py +0 -0
  122. ucloud/services/uddb/schemas/apis.py +520 -0
  123. ucloud/services/uddb/schemas/models.py +96 -0
  124. ucloud/services/udi/__init__.py +0 -0
  125. ucloud/services/udi/client.py +250 -0
  126. ucloud/services/udi/schemas/__init__.py +0 -0
  127. ucloud/services/udi/schemas/apis.py +205 -0
  128. ucloud/services/udi/schemas/models.py +58 -0
  129. ucloud/services/udisk/__init__.py +0 -0
  130. ucloud/services/udisk/client.py +832 -0
  131. ucloud/services/udisk/schemas/__init__.py +0 -0
  132. ucloud/services/udisk/schemas/apis.py +741 -0
  133. ucloud/services/udisk/schemas/models.py +100 -0
  134. ucloud/services/udns/__init__.py +0 -0
  135. ucloud/services/udns/client.py +380 -0
  136. ucloud/services/udns/schemas/__init__.py +0 -0
  137. ucloud/services/udns/schemas/apis.py +293 -0
  138. ucloud/services/udns/schemas/models.py +58 -0
  139. ucloud/services/udpn/__init__.py +0 -0
  140. ucloud/services/udpn/client.py +240 -0
  141. ucloud/services/udpn/schemas/__init__.py +0 -0
  142. ucloud/services/udpn/schemas/apis.py +203 -0
  143. ucloud/services/udpn/schemas/models.py +29 -0
  144. ucloud/services/udts/__init__.py +0 -0
  145. ucloud/services/udts/client.py +410 -0
  146. ucloud/services/udts/schemas/__init__.py +0 -0
  147. ucloud/services/udts/schemas/apis.py +403 -0
  148. ucloud/services/udts/schemas/models.py +93 -0
  149. ucloud/services/uec/__init__.py +0 -0
  150. ucloud/services/uec/client.py +1510 -0
  151. ucloud/services/uec/schemas/__init__.py +0 -0
  152. ucloud/services/uec/schemas/apis.py +1195 -0
  153. ucloud/services/uec/schemas/models.py +316 -0
  154. ucloud/services/ufile/__init__.py +0 -0
  155. ucloud/services/ufile/client.py +698 -0
  156. ucloud/services/ufile/schemas/__init__.py +0 -0
  157. ucloud/services/ufile/schemas/apis.py +542 -0
  158. ucloud/services/ufile/schemas/models.py +139 -0
  159. ucloud/services/ufs/__init__.py +0 -0
  160. ucloud/services/ufs/client.py +328 -0
  161. ucloud/services/ufs/schemas/__init__.py +0 -0
  162. ucloud/services/ufs/schemas/apis.py +265 -0
  163. ucloud/services/ufs/schemas/models.py +52 -0
  164. ucloud/services/ugn/__init__.py +0 -0
  165. ucloud/services/ugn/client.py +857 -0
  166. ucloud/services/ugn/schemas/__init__.py +0 -0
  167. ucloud/services/ugn/schemas/apis.py +678 -0
  168. ucloud/services/ugn/schemas/models.py +191 -0
  169. ucloud/services/uhost/__init__.py +0 -0
  170. ucloud/services/uhost/client.py +1647 -0
  171. ucloud/services/uhost/schemas/__init__.py +0 -0
  172. ucloud/services/uhost/schemas/apis.py +1483 -0
  173. ucloud/services/uhost/schemas/models.py +427 -0
  174. ucloud/services/uhub/__init__.py +0 -0
  175. ucloud/services/uhub/client.py +229 -0
  176. ucloud/services/uhub/schemas/__init__.py +0 -0
  177. ucloud/services/uhub/schemas/apis.py +194 -0
  178. ucloud/services/uhub/schemas/models.py +39 -0
  179. ucloud/services/uk8s/__init__.py +0 -0
  180. ucloud/services/uk8s/client.py +729 -0
  181. ucloud/services/uk8s/schemas/__init__.py +0 -0
  182. ucloud/services/uk8s/schemas/apis.py +639 -0
  183. ucloud/services/uk8s/schemas/models.py +179 -0
  184. ucloud/services/ulb/__init__.py +0 -0
  185. ucloud/services/ulb/client.py +2285 -0
  186. ucloud/services/ulb/schemas/__init__.py +0 -0
  187. ucloud/services/ulb/schemas/apis.py +1678 -0
  188. ucloud/services/ulb/schemas/models.py +591 -0
  189. ucloud/services/ulighthost/__init__.py +0 -0
  190. ucloud/services/ulighthost/client.py +576 -0
  191. ucloud/services/ulighthost/schemas/__init__.py +0 -0
  192. ucloud/services/ulighthost/schemas/apis.py +445 -0
  193. ucloud/services/ulighthost/schemas/models.py +133 -0
  194. ucloud/services/umem/__init__.py +0 -0
  195. ucloud/services/umem/client.py +1829 -0
  196. ucloud/services/umem/schemas/__init__.py +0 -0
  197. ucloud/services/umem/schemas/apis.py +1477 -0
  198. ucloud/services/umem/schemas/models.py +327 -0
  199. ucloud/services/umongodb/__init__.py +0 -0
  200. ucloud/services/umongodb/client.py +752 -0
  201. ucloud/services/umongodb/schemas/__init__.py +0 -0
  202. ucloud/services/umongodb/schemas/apis.py +567 -0
  203. ucloud/services/umongodb/schemas/models.py +220 -0
  204. ucloud/services/unet/__init__.py +0 -0
  205. ucloud/services/unet/client.py +1278 -0
  206. ucloud/services/unet/schemas/__init__.py +0 -0
  207. ucloud/services/unet/schemas/apis.py +1006 -0
  208. ucloud/services/unet/schemas/models.py +275 -0
  209. ucloud/services/unvs/__init__.py +0 -0
  210. ucloud/services/unvs/client.py +87 -0
  211. ucloud/services/unvs/schemas/__init__.py +0 -0
  212. ucloud/services/unvs/schemas/apis.py +66 -0
  213. ucloud/services/unvs/schemas/models.py +19 -0
  214. ucloud/services/upfs/__init__.py +0 -0
  215. ucloud/services/upfs/client.py +252 -0
  216. ucloud/services/upfs/schemas/__init__.py +0 -0
  217. ucloud/services/upfs/schemas/apis.py +204 -0
  218. ucloud/services/upfs/schemas/models.py +36 -0
  219. ucloud/services/upgsql/__init__.py +0 -0
  220. ucloud/services/upgsql/client.py +1007 -0
  221. ucloud/services/upgsql/schemas/__init__.py +0 -0
  222. ucloud/services/upgsql/schemas/apis.py +827 -0
  223. ucloud/services/upgsql/schemas/models.py +158 -0
  224. ucloud/services/uphone/__init__.py +0 -0
  225. ucloud/services/uphone/client.py +2122 -0
  226. ucloud/services/uphone/schemas/__init__.py +0 -0
  227. ucloud/services/uphone/schemas/apis.py +1799 -0
  228. ucloud/services/uphone/schemas/models.py +357 -0
  229. ucloud/services/uphost/__init__.py +0 -0
  230. ucloud/services/uphost/client.py +847 -0
  231. ucloud/services/uphost/schemas/__init__.py +0 -0
  232. ucloud/services/uphost/schemas/apis.py +689 -0
  233. ucloud/services/uphost/schemas/models.py +175 -0
  234. ucloud/services/urocketmq/__init__.py +0 -0
  235. ucloud/services/urocketmq/client.py +117 -0
  236. ucloud/services/urocketmq/schemas/__init__.py +0 -0
  237. ucloud/services/urocketmq/schemas/apis.py +92 -0
  238. ucloud/services/urocketmq/schemas/models.py +14 -0
  239. ucloud/services/uslk/__init__.py +0 -0
  240. ucloud/services/uslk/client.py +249 -0
  241. ucloud/services/uslk/schemas/__init__.py +0 -0
  242. ucloud/services/uslk/schemas/apis.py +191 -0
  243. ucloud/services/uslk/schemas/models.py +74 -0
  244. ucloud/services/usms/__init__.py +0 -0
  245. ucloud/services/usms/client.py +759 -0
  246. ucloud/services/usms/schemas/__init__.py +0 -0
  247. ucloud/services/usms/schemas/apis.py +653 -0
  248. ucloud/services/usms/schemas/models.py +215 -0
  249. ucloud/services/utsdb/__init__.py +0 -0
  250. ucloud/services/utsdb/client.py +604 -0
  251. ucloud/services/utsdb/schemas/__init__.py +0 -0
  252. ucloud/services/utsdb/schemas/apis.py +515 -0
  253. ucloud/services/utsdb/schemas/models.py +61 -0
  254. ucloud/services/uvms/__init__.py +0 -0
  255. ucloud/services/uvms/client.py +119 -0
  256. ucloud/services/uvms/schemas/__init__.py +0 -0
  257. ucloud/services/uvms/schemas/apis.py +88 -0
  258. ucloud/services/uvms/schemas/models.py +40 -0
  259. ucloud/services/vpc/__init__.py +0 -0
  260. ucloud/services/vpc/client.py +3233 -0
  261. ucloud/services/vpc/schemas/__init__.py +0 -0
  262. ucloud/services/vpc/schemas/apis.py +2529 -0
  263. ucloud/services/vpc/schemas/models.py +651 -0
  264. ucloud/testing/__init__.py +0 -0
  265. ucloud/testing/driver/__init__.py +5 -0
  266. ucloud/testing/driver/_scenario.py +93 -0
  267. ucloud/testing/driver/_specification.py +57 -0
  268. ucloud/testing/driver/_step.py +166 -0
  269. ucloud/testing/env.py +28 -0
  270. ucloud/testing/exc.py +18 -0
  271. ucloud/testing/funcs.py +68 -0
  272. ucloud/testing/mock.py +28 -0
  273. ucloud/testing/op.py +177 -0
  274. ucloud/testing/utest.py +195 -0
  275. ucloud/version.py +1 -0
  276. ucloud_sdk_python3-0.11.81.dist-info/LICENSE +202 -0
  277. ucloud_sdk_python3-0.11.81.dist-info/METADATA +71 -0
  278. ucloud_sdk_python3-0.11.81.dist-info/RECORD +280 -0
  279. ucloud_sdk_python3-0.11.81.dist-info/WHEEL +5 -0
  280. ucloud_sdk_python3-0.11.81.dist-info/top_level.txt +1 -0
@@ -0,0 +1,250 @@
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.udi.schemas import apis
8
+
9
+
10
+ class UDIClient(Client):
11
+ def __init__(
12
+ self, config: dict, transport=None, middleware=None, logger=None
13
+ ):
14
+ super(UDIClient, self).__init__(config, transport, middleware, logger)
15
+
16
+ def create_function_template(
17
+ self, req: typing.Optional[dict] = None, **kwargs
18
+ ) -> dict:
19
+ """CreateFunctionTemplate - 创建功能参数模板
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
+ - **ContainerFormat** (str) - (Required) 文件输出格式
26
+ - **EncodeFormat** (str) - (Required) 编码格式
27
+ - **Function** (str) - (Required) 功能名称
28
+ - **ProjectName** (str) - (Required) 项目名称
29
+ - **TemplateName** (str) - (Required) 模板名称
30
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
31
+ - **AudioBitRate** (str) - 音频比特率
32
+ - **AudioBitRateCustom** (str) - 自定义音频比特率
33
+ - **AudioChannel** (str) - 音频声道
34
+ - **AudioSampleRate** (str) - 音频采样率
35
+ - **CRF** (str) - CRF压缩率
36
+ - **CRFCustom** (str) - 自定义CRF压缩率
37
+ - **FrameRate** (str) - 帧率
38
+ - **FrameRateCustom** (str) - 自定义帧率
39
+ - **Resolution** (str) - 分辨率
40
+ - **ResolutionHeight** (str) - 分辨率高
41
+ - **ResolutionWidth** (str) - 分辨率宽
42
+ - **VideoBitRate** (str) - 视频比特率
43
+ - **VideoBitRateCustom** (str) - 自定义视频比特率
44
+
45
+ **Response**
46
+
47
+ - **TemplateId** (str) - 创建的模板ID
48
+
49
+ """
50
+ # build request
51
+ d = {
52
+ "ProjectId": self.config.project_id,
53
+ "Region": self.config.region,
54
+ }
55
+ req and d.update(req)
56
+ d = apis.CreateFunctionTemplateRequestSchema().dumps(d)
57
+
58
+ # build options
59
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
60
+
61
+ resp = self.invoke("CreateFunctionTemplate", d, **kwargs)
62
+ return apis.CreateFunctionTemplateResponseSchema().loads(resp)
63
+
64
+ def create_media_task(
65
+ self, req: typing.Optional[dict] = None, **kwargs
66
+ ) -> dict:
67
+ """CreateMediaTask - 创建一个多媒体任务
68
+
69
+ **Request**
70
+
71
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
72
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
73
+ - **Bucket** (str) - (Required) Bucket名称
74
+ - **DstKey** (str) - (Required) 目标生成文件
75
+ - **Function** (str) - (Required) 功能名称:例VideoTranscode
76
+ - **FunctionParamTemplateId** (str) - (Required) 功能的参数模板ID,需要事先创建模板才可用,也可以使用预设模板,详细可通过DescribeFunctionTemplate接口查询
77
+ - **SrcKey** (str) - (Required) 源文件
78
+ - **StorageBackend** (str) - (Required) 存储源
79
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
80
+
81
+ **Response**
82
+
83
+ - **TaskId** (str) - 任务ID
84
+
85
+ """
86
+ # build request
87
+ d = {
88
+ "ProjectId": self.config.project_id,
89
+ "Region": self.config.region,
90
+ }
91
+ req and d.update(req)
92
+ d = apis.CreateMediaTaskRequestSchema().dumps(d)
93
+
94
+ # build options
95
+ kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
96
+
97
+ resp = self.invoke("CreateMediaTask", d, **kwargs)
98
+ return apis.CreateMediaTaskResponseSchema().loads(resp)
99
+
100
+ def delete_function_template(
101
+ self, req: typing.Optional[dict] = None, **kwargs
102
+ ) -> dict:
103
+ """DeleteFunctionTemplate - 删除功能模板
104
+
105
+ **Request**
106
+
107
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
108
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
109
+ - **TemplateId** (str) - (Required) 要删除的模板ID
110
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
111
+
112
+ **Response**
113
+
114
+
115
+ """
116
+ # build request
117
+ d = {
118
+ "ProjectId": self.config.project_id,
119
+ "Region": self.config.region,
120
+ }
121
+ req and d.update(req)
122
+ d = apis.DeleteFunctionTemplateRequestSchema().dumps(d)
123
+
124
+ resp = self.invoke("DeleteFunctionTemplate", d, **kwargs)
125
+ return apis.DeleteFunctionTemplateResponseSchema().loads(resp)
126
+
127
+ def describe_function_template(
128
+ self, req: typing.Optional[dict] = None, **kwargs
129
+ ) -> dict:
130
+ """DescribeFunctionTemplate - 获取功能模板
131
+
132
+ **Request**
133
+
134
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
135
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
136
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
137
+ - **Type** (str) - 功能模板类型:预设(preset)自定义(custom),为空则获取两种类型
138
+
139
+ **Response**
140
+
141
+ - **Templates** (list) - 见 **FunctionTemplate** 模型定义
142
+
143
+ **Response Model**
144
+
145
+ **FunctionTemplate**
146
+ - **FunctionName** (str) -
147
+ - **Id** (str) -
148
+ - **Name** (str) -
149
+
150
+
151
+ """
152
+ # build request
153
+ d = {
154
+ "ProjectId": self.config.project_id,
155
+ "Region": self.config.region,
156
+ }
157
+ req and d.update(req)
158
+ d = apis.DescribeFunctionTemplateRequestSchema().dumps(d)
159
+
160
+ resp = self.invoke("DescribeFunctionTemplate", d, **kwargs)
161
+ return apis.DescribeFunctionTemplateResponseSchema().loads(resp)
162
+
163
+ def describe_media_functions(
164
+ self, req: typing.Optional[dict] = None, **kwargs
165
+ ) -> dict:
166
+ """DescribeMediaFunctions - 描述当前支持的多媒体功能以及对应功能需要的参数信息
167
+
168
+ **Request**
169
+
170
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
171
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
172
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
173
+ - **Function** (str) - 要查询的Function名称,为空则返回所有支持的Function
174
+
175
+ **Response**
176
+
177
+ - **Functions** (list) - 见 **Function** 模型定义
178
+
179
+ **Response Model**
180
+
181
+ **Function**
182
+ - **DisplayName** (str) -
183
+ - **FunctionName** (str) -
184
+ - **InputType** (str) -
185
+ - **OutputType** (str) -
186
+ - **SupportParams** (list) - 见 **ParamOption** 模型定义
187
+
188
+
189
+ **ParamOption**
190
+ - **DisplayName** (str) -
191
+ - **OptionalValues** (list) -
192
+ - **ParamName** (str) -
193
+ - **Required** (bool) -
194
+ - **WhenValueCustom** (list) - 见 **ParamCustom** 模型定义
195
+
196
+
197
+ **ParamCustom**
198
+ - **Max** (int) -
199
+ - **Min** (int) -
200
+ - **ParamName** (str) -
201
+ - **ParamType** (str) -
202
+
203
+
204
+ """
205
+ # build request
206
+ d = {
207
+ "ProjectId": self.config.project_id,
208
+ "Region": self.config.region,
209
+ }
210
+ req and d.update(req)
211
+ d = apis.DescribeMediaFunctionsRequestSchema().dumps(d)
212
+
213
+ resp = self.invoke("DescribeMediaFunctions", d, **kwargs)
214
+ return apis.DescribeMediaFunctionsResponseSchema().loads(resp)
215
+
216
+ def describe_media_task(
217
+ self, req: typing.Optional[dict] = None, **kwargs
218
+ ) -> dict:
219
+ """DescribeMediaTask - 查询任务状态
220
+
221
+ **Request**
222
+
223
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
224
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
225
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
226
+ - **TaskId** (str) - 要查询的任务ID,为空则查询所有
227
+
228
+ **Response**
229
+
230
+ - **Tasks** (list) - 见 **MediaTask** 模型定义
231
+
232
+ **Response Model**
233
+
234
+ **MediaTask**
235
+ - **Function** (str) -
236
+ - **Id** (str) -
237
+ - **Status** (str) -
238
+
239
+
240
+ """
241
+ # build request
242
+ d = {
243
+ "ProjectId": self.config.project_id,
244
+ "Region": self.config.region,
245
+ }
246
+ req and d.update(req)
247
+ d = apis.DescribeMediaTaskRequestSchema().dumps(d)
248
+
249
+ resp = self.invoke("DescribeMediaTask", d, **kwargs)
250
+ return apis.DescribeMediaTaskResponseSchema().loads(resp)
File without changes
@@ -0,0 +1,205 @@
1
+ """ Code is generated by ucloud-model, DO NOT EDIT IT. """
2
+
3
+ from ucloud.core.typesystem import schema, fields
4
+ from ucloud.services.udi.schemas import models
5
+
6
+ """ UDI API Schema
7
+ """
8
+
9
+
10
+ """
11
+ API: CreateFunctionTemplate
12
+
13
+ 创建功能参数模板
14
+ """
15
+
16
+
17
+ class CreateFunctionTemplateRequestSchema(schema.RequestSchema):
18
+ """CreateFunctionTemplate - 创建功能参数模板"""
19
+
20
+ fields = {
21
+ "AudioBitRate": fields.Str(required=False, dump_to="AudioBitRate"),
22
+ "AudioBitRateCustom": fields.Str(
23
+ required=False, dump_to="AudioBitRateCustom"
24
+ ),
25
+ "AudioChannel": fields.Str(required=False, dump_to="AudioChannel"),
26
+ "AudioSampleRate": fields.Str(
27
+ required=False, dump_to="AudioSampleRate"
28
+ ),
29
+ "CRF": fields.Str(required=False, dump_to="CRF"),
30
+ "CRFCustom": fields.Str(required=False, dump_to="CRFCustom"),
31
+ "ContainerFormat": fields.Str(required=True, dump_to="ContainerFormat"),
32
+ "EncodeFormat": fields.Str(required=True, dump_to="EncodeFormat"),
33
+ "FrameRate": fields.Str(required=False, dump_to="FrameRate"),
34
+ "FrameRateCustom": fields.Str(
35
+ required=False, dump_to="FrameRateCustom"
36
+ ),
37
+ "Function": fields.Str(required=True, dump_to="Function"),
38
+ "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
39
+ "ProjectName": fields.Str(required=True, dump_to="ProjectName"),
40
+ "Region": fields.Str(required=True, dump_to="Region"),
41
+ "Resolution": fields.Str(required=False, dump_to="Resolution"),
42
+ "ResolutionHeight": fields.Str(
43
+ required=False, dump_to="ResolutionHeight"
44
+ ),
45
+ "ResolutionWidth": fields.Str(
46
+ required=False, dump_to="ResolutionWidth"
47
+ ),
48
+ "TemplateName": fields.Str(required=True, dump_to="TemplateName"),
49
+ "VideoBitRate": fields.Str(required=False, dump_to="VideoBitRate"),
50
+ "VideoBitRateCustom": fields.Str(
51
+ required=False, dump_to="VideoBitRateCustom"
52
+ ),
53
+ "Zone": fields.Str(required=True, dump_to="Zone"),
54
+ }
55
+
56
+
57
+ class CreateFunctionTemplateResponseSchema(schema.ResponseSchema):
58
+ """CreateFunctionTemplate - 创建功能参数模板"""
59
+
60
+ fields = {
61
+ "TemplateId": fields.Str(required=True, load_from="TemplateId"),
62
+ }
63
+
64
+
65
+ """
66
+ API: CreateMediaTask
67
+
68
+ 创建一个多媒体任务
69
+ """
70
+
71
+
72
+ class CreateMediaTaskRequestSchema(schema.RequestSchema):
73
+ """CreateMediaTask - 创建一个多媒体任务"""
74
+
75
+ fields = {
76
+ "Bucket": fields.Str(required=True, dump_to="Bucket"),
77
+ "DstKey": fields.Str(required=True, dump_to="DstKey"),
78
+ "Function": fields.Str(required=True, dump_to="Function"),
79
+ "FunctionParamTemplateId": fields.Str(
80
+ required=True, dump_to="FunctionParamTemplateId"
81
+ ),
82
+ "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
83
+ "Region": fields.Str(required=True, dump_to="Region"),
84
+ "SrcKey": fields.Str(required=True, dump_to="SrcKey"),
85
+ "StorageBackend": fields.Str(required=True, dump_to="StorageBackend"),
86
+ "Zone": fields.Str(required=True, dump_to="Zone"),
87
+ }
88
+
89
+
90
+ class CreateMediaTaskResponseSchema(schema.ResponseSchema):
91
+ """CreateMediaTask - 创建一个多媒体任务"""
92
+
93
+ fields = {
94
+ "TaskId": fields.Str(required=False, load_from="TaskId"),
95
+ }
96
+
97
+
98
+ """
99
+ API: DeleteFunctionTemplate
100
+
101
+ 删除功能模板
102
+ """
103
+
104
+
105
+ class DeleteFunctionTemplateRequestSchema(schema.RequestSchema):
106
+ """DeleteFunctionTemplate - 删除功能模板"""
107
+
108
+ fields = {
109
+ "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
110
+ "Region": fields.Str(required=True, dump_to="Region"),
111
+ "TemplateId": fields.Str(required=True, dump_to="TemplateId"),
112
+ "Zone": fields.Str(required=True, dump_to="Zone"),
113
+ }
114
+
115
+
116
+ class DeleteFunctionTemplateResponseSchema(schema.ResponseSchema):
117
+ """DeleteFunctionTemplate - 删除功能模板"""
118
+
119
+ fields = {}
120
+
121
+
122
+ """
123
+ API: DescribeFunctionTemplate
124
+
125
+ 获取功能模板
126
+ """
127
+
128
+
129
+ class DescribeFunctionTemplateRequestSchema(schema.RequestSchema):
130
+ """DescribeFunctionTemplate - 获取功能模板"""
131
+
132
+ fields = {
133
+ "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
134
+ "Region": fields.Str(required=True, dump_to="Region"),
135
+ "Type": fields.Str(required=False, dump_to="Type"),
136
+ "Zone": fields.Str(required=True, dump_to="Zone"),
137
+ }
138
+
139
+
140
+ class DescribeFunctionTemplateResponseSchema(schema.ResponseSchema):
141
+ """DescribeFunctionTemplate - 获取功能模板"""
142
+
143
+ fields = {
144
+ "Templates": fields.List(
145
+ models.FunctionTemplateSchema(),
146
+ required=False,
147
+ load_from="Templates",
148
+ ),
149
+ }
150
+
151
+
152
+ """
153
+ API: DescribeMediaFunctions
154
+
155
+ 描述当前支持的多媒体功能以及对应功能需要的参数信息
156
+ """
157
+
158
+
159
+ class DescribeMediaFunctionsRequestSchema(schema.RequestSchema):
160
+ """DescribeMediaFunctions - 描述当前支持的多媒体功能以及对应功能需要的参数信息"""
161
+
162
+ fields = {
163
+ "Function": fields.Str(required=False, dump_to="Function"),
164
+ "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
165
+ "Region": fields.Str(required=True, dump_to="Region"),
166
+ "Zone": fields.Str(required=True, dump_to="Zone"),
167
+ }
168
+
169
+
170
+ class DescribeMediaFunctionsResponseSchema(schema.ResponseSchema):
171
+ """DescribeMediaFunctions - 描述当前支持的多媒体功能以及对应功能需要的参数信息"""
172
+
173
+ fields = {
174
+ "Functions": fields.List(
175
+ models.FunctionSchema(), required=False, load_from="Functions"
176
+ ),
177
+ }
178
+
179
+
180
+ """
181
+ API: DescribeMediaTask
182
+
183
+ 查询任务状态
184
+ """
185
+
186
+
187
+ class DescribeMediaTaskRequestSchema(schema.RequestSchema):
188
+ """DescribeMediaTask - 查询任务状态"""
189
+
190
+ fields = {
191
+ "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
192
+ "Region": fields.Str(required=True, dump_to="Region"),
193
+ "TaskId": fields.Str(required=False, dump_to="TaskId"),
194
+ "Zone": fields.Str(required=True, dump_to="Zone"),
195
+ }
196
+
197
+
198
+ class DescribeMediaTaskResponseSchema(schema.ResponseSchema):
199
+ """DescribeMediaTask - 查询任务状态"""
200
+
201
+ fields = {
202
+ "Tasks": fields.List(
203
+ models.MediaTaskSchema(), required=False, load_from="Tasks"
204
+ ),
205
+ }
@@ -0,0 +1,58 @@
1
+ """ Code is generated by ucloud-model, DO NOT EDIT IT. """
2
+
3
+ from ucloud.core.typesystem import schema, fields
4
+
5
+
6
+ class FunctionTemplateSchema(schema.ResponseSchema):
7
+ """FunctionTemplate -"""
8
+
9
+ fields = {
10
+ "FunctionName": fields.Str(required=False, load_from="FunctionName"),
11
+ "Id": fields.Str(required=False, load_from="Id"),
12
+ "Name": fields.Str(required=False, load_from="Name"),
13
+ }
14
+
15
+
16
+ class ParamCustomSchema(schema.ResponseSchema):
17
+ """ParamCustom -"""
18
+
19
+ fields = {
20
+ "Max": fields.Int(required=False, load_from="Max"),
21
+ "Min": fields.Int(required=False, load_from="Min"),
22
+ "ParamName": fields.Str(required=False, load_from="ParamName"),
23
+ "ParamType": fields.Str(required=False, load_from="ParamType"),
24
+ }
25
+
26
+
27
+ class ParamOptionSchema(schema.ResponseSchema):
28
+ """ParamOption -"""
29
+
30
+ fields = {
31
+ "DisplayName": fields.Str(required=False, load_from="DisplayName"),
32
+ "OptionalValues": fields.List(fields.Str()),
33
+ "ParamName": fields.Str(required=False, load_from="ParamName"),
34
+ "Required": fields.Bool(required=False, load_from="Required"),
35
+ "WhenValueCustom": fields.List(ParamCustomSchema()),
36
+ }
37
+
38
+
39
+ class FunctionSchema(schema.ResponseSchema):
40
+ """Function -"""
41
+
42
+ fields = {
43
+ "DisplayName": fields.Str(required=False, load_from="DisplayName"),
44
+ "FunctionName": fields.Str(required=False, load_from="FunctionName"),
45
+ "InputType": fields.Str(required=False, load_from="InputType"),
46
+ "OutputType": fields.Str(required=False, load_from="OutputType"),
47
+ "SupportParams": fields.List(ParamOptionSchema()),
48
+ }
49
+
50
+
51
+ class MediaTaskSchema(schema.ResponseSchema):
52
+ """MediaTask -"""
53
+
54
+ fields = {
55
+ "Function": fields.Str(required=False, load_from="Function"),
56
+ "Id": fields.Str(required=False, load_from="Id"),
57
+ "Status": fields.Str(required=False, load_from="Status"),
58
+ }
File without changes