@@ -13,22 +13,64 @@ def __init__(
13
13
):
14
14
super (CubeClient , self ).__init__ (config , transport , middleware , logger )
15
15
16
+ def create_cube_deployment (
17
+ self , req : typing .Optional [dict ] = None , ** kwargs
18
+ ) -> dict :
19
+ """CreateCubeDeployment - 创建Cube的Deployment
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
+ - **Deployment** (str) - (Required) base64编码的Deployment的yaml。大小不超过16KB
26
+ - **SubnetId** (str) - (Required) 子网Id
27
+ - **VPCId** (str) - (Required) VPCId
28
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
29
+ - **ChargeType** (str) - 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Postpay, \\ 后付费;默认为后付费
30
+ - **CpuPlatform** (str) - Cpu平台(V6:Intel、A2:AMD),默认V6。支持的地域(北京2B、北京2E、上海2A、广东、香港 、东京)目前北京2E仅有A2,其余地域仅有V6
31
+ - **KubeConfig** (str) - base64编码的kubeconfig。大小不超过16KB
32
+ - **Name** (str) - Deployment名称
33
+ - **Quantity** (int) - 购买时长。默认:值 1。 月付时,此参数传0,代表购买至月末。
34
+ - **Tag** (str) - 业务组。默认:Default(Default即为未分组)
35
+
36
+ **Response**
37
+
38
+ - **Deployment** (str) - 经过base64编码的Deployment的yaml
39
+ - **DeploymentId** (str) - 控制器ID
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 .CreateCubeDeploymentRequestSchema ().dumps (d )
49
+
50
+ # build options
51
+ kwargs ["max_retries" ] = 0 # ignore retry when api is not idempotent
52
+
53
+ resp = self .invoke ("CreateCubeDeployment" , d , ** kwargs )
54
+ return apis .CreateCubeDeploymentResponseSchema ().loads (resp )
55
+
16
56
def create_cube_pod (
17
57
self , req : typing .Optional [dict ] = None , ** kwargs
18
58
) -> dict :
19
59
"""CreateCubePod - 创建Pod
20
60
21
61
**Request**
22
62
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
- - **Pod** (str) - (Required) base64编码的Pod的yaml
63
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
64
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
65
+ - **Pod** (str) - (Required) base64编码的Pod的yaml。大小不超过16KB
26
66
- **SubnetId** (str) - (Required) 子网Id
27
67
- **VPCId** (str) - (Required) VPCId
28
- - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html >`_
68
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
29
69
- **ChargeType** (str) - 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Postpay, \\ 后付费;默认为后付费
30
- - **CpuPlatform** (str) - Cpu平台(V6、A2),默认V6
70
+ - **CouponId** (str) - 代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
71
+ - **CpuPlatform** (str) - Cpu平台(V6:Intel、A2:AMD、Auto),默认Auto。支持的地域(北京2B、北京2E、上海2A、广东、香港 、东京)目前北京2E仅有A2,其余地域仅有V6
31
72
- **Group** (str) - pod所在组
73
+ - **KubeConfig** (str) - base64编码的kubeconfig。大小不超过16KB
32
74
- **Name** (str) - pod的名字
33
75
- **Quantity** (int) - 购买时长。默认:值 1。 月付时,此参数传0,代表购买至月末。
34
76
- **Tag** (str) - 业务组。默认:Default(Default即为未分组)
@@ -55,6 +97,33 @@ def create_cube_pod(
55
97
resp = self .invoke ("CreateCubePod" , d , ** kwargs )
56
98
return apis .CreateCubePodResponseSchema ().loads (resp )
57
99
100
+ def delete_cube_deployment (
101
+ self , req : typing .Optional [dict ] = None , ** kwargs
102
+ ) -> dict :
103
+ """DeleteCubeDeployment - 删除Cube的Deployment
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
+ - **DeploymentId** (str) - (Required) 控制器Id
110
+ - **Zone** (str) - 可用区。参见 `可用区列表 <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 .DeleteCubeDeploymentRequestSchema ().dumps (d )
123
+
124
+ resp = self .invoke ("DeleteCubeDeployment" , d , ** kwargs )
125
+ return apis .DeleteCubeDeploymentResponseSchema ().loads (resp )
126
+
58
127
def delete_cube_pod (
59
128
self , req : typing .Optional [dict ] = None , ** kwargs
60
129
) -> dict :
@@ -84,6 +153,34 @@ def delete_cube_pod(
84
153
resp = self .invoke ("DeleteCubePod" , d , ** kwargs )
85
154
return apis .DeleteCubePodResponseSchema ().loads (resp )
86
155
156
+ def get_cube_deployment (
157
+ self , req : typing .Optional [dict ] = None , ** kwargs
158
+ ) -> dict :
159
+ """GetCubeDeployment - 获取Deployment的详细信息
160
+
161
+ **Request**
162
+
163
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
164
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
165
+ - **DeploymentId** (str) - (Required) Deployment的Id
166
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
167
+
168
+ **Response**
169
+
170
+ - **Deployment** (str) - 经过base64编码的Deployment的yaml
171
+
172
+ """
173
+ # build request
174
+ d = {
175
+ "ProjectId" : self .config .project_id ,
176
+ "Region" : self .config .region ,
177
+ }
178
+ req and d .update (req )
179
+ d = apis .GetCubeDeploymentRequestSchema ().dumps (d )
180
+
181
+ resp = self .invoke ("GetCubeDeployment" , d , ** kwargs )
182
+ return apis .GetCubeDeploymentResponseSchema ().loads (resp )
183
+
87
184
def get_cube_extend_info (
88
185
self , req : typing .Optional [dict ] = None , ** kwargs
89
186
) -> dict :
@@ -102,13 +199,15 @@ def get_cube_extend_info(
102
199
103
200
**Response Model**
104
201
105
- **EIPAddr**
202
+ **CubeExtendInfo**
203
+ - **CubeId** (str) - Cube的Id
204
+ - **Eip** (list) - 见 **EIPSet** 模型定义
205
+ - **Expiration** (int) - 资源有效期
206
+ - **Name** (str) - Cube的名称
207
+ - **Tag** (str) - 业务组名称
106
208
107
- - **IP** (str) - IP地址
108
- - **OperatorName** (str) - 线路名称BGP或者internalation
109
209
110
210
**EIPSet**
111
-
112
211
- **Bandwidth** (int) - EIP带宽值
113
212
- **BandwidthType** (int) - 带宽类型0标准普通带宽,1表示共享带宽
114
213
- **CreateTime** (int) - EIP创建时间
@@ -119,13 +218,11 @@ def get_cube_extend_info(
119
218
- **Status** (str) - EIP状态,表示使用中或者空闲
120
219
- **Weight** (int) - EIP权重
121
220
122
- **CubeExtendInfo**
123
221
124
- - **CubeId** (str) - Cube的Id
125
- - **Eip** (list) - 见 **EIPSet** 模型定义
126
- - **Expiration** (int) - 资源有效期
127
- - **Name** (str) - Cube的名称
128
- - **Tag** (str) - 业务组名称
222
+ **EIPAddr**
223
+ - **IP** (str) - IP地址
224
+ - **OperatorName** (str) - 线路名称BGP或者internalation
225
+
129
226
130
227
"""
131
228
# build request
@@ -139,6 +236,51 @@ def get_cube_extend_info(
139
236
resp = self .invoke ("GetCubeExtendInfo" , d , ** kwargs )
140
237
return apis .GetCubeExtendInfoResponseSchema ().loads (resp )
141
238
239
+ def get_cube_metrics (
240
+ self , req : typing .Optional [dict ] = None , ** kwargs
241
+ ) -> dict :
242
+ """GetCubeMetrics - 获取Cube实例(Pod,PodX,Deploy等)监控数据时间序列
243
+
244
+ **Request**
245
+
246
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
247
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
248
+ - **BeginTime** (int) - (Required) 开始时间
249
+ - **ContainerName** (str) - (Required) Pod内容器名称
250
+ - **EndTime** (int) - (Required) 结束时间,必须大于开始时间
251
+ - **MetricName** (list) - (Required) 监控指标名称
252
+ - **ResourceId** (str) - (Required) Cube实例资源ID
253
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
254
+
255
+ **Response**
256
+
257
+ - **DataSets** (list) - 见 **MetricDataSet** 模型定义
258
+ - **Message** (str) - 错误信息
259
+
260
+ **Response Model**
261
+
262
+ **ValueSet**
263
+ - **Timestamp** (int) -
264
+ - **Value** (float) -
265
+
266
+
267
+ **MetricDataSet**
268
+ - **MetricName** (str) -
269
+ - **Values** (list) - 见 **ValueSet** 模型定义
270
+
271
+
272
+ """
273
+ # build request
274
+ d = {
275
+ "ProjectId" : self .config .project_id ,
276
+ "Region" : self .config .region ,
277
+ }
278
+ req and d .update (req )
279
+ d = apis .GetCubeMetricsRequestSchema ().dumps (d )
280
+
281
+ resp = self .invoke ("GetCubeMetrics" , d , ** kwargs )
282
+ return apis .GetCubeMetricsResponseSchema ().loads (resp )
283
+
142
284
def get_cube_pod (self , req : typing .Optional [dict ] = None , ** kwargs ) -> dict :
143
285
"""GetCubePod - 获取Pod的详细信息
144
286
@@ -166,6 +308,41 @@ def get_cube_pod(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
166
308
resp = self .invoke ("GetCubePod" , d , ** kwargs )
167
309
return apis .GetCubePodResponseSchema ().loads (resp )
168
310
311
+ def get_cube_price (
312
+ self , req : typing .Optional [dict ] = None , ** kwargs
313
+ ) -> dict :
314
+ """GetCubePrice - 获取cube的价格
315
+
316
+ **Request**
317
+
318
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
319
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
320
+ - **ChargeType** (str) - (Required) 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Dynamic,按小时预付费 \\ > Postpay,按秒后付费,默认为月付
321
+ - **Count** (str) - (Required) 购买数量
322
+ - **Cpu** (str) - (Required) CPU 配置,单位为毫核,例如如 1 核则须输入 1000
323
+ - **Mem** (str) - (Required) 内存配置,单位为 Mi,例如 1Gi 须输入 1024
324
+ - **Quantity** (int) - (Required) 购买时长。默认:值 1。按小时购买(Dynamic/Postpay)时无需此参数。 月付时,此参数传0,代表购买至月末。
325
+ - **Zone** (str) - (Required) 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
326
+
327
+ **Response**
328
+
329
+ - **Action** (str) - 操作名称
330
+ - **OriginalPrice** (int) - 列表价格,单位为分
331
+ - **Price** (int) - 折扣后价格,单位为分
332
+ - **RetCode** (int) - 返回码
333
+
334
+ """
335
+ # build request
336
+ d = {
337
+ "ProjectId" : self .config .project_id ,
338
+ "Region" : self .config .region ,
339
+ }
340
+ req and d .update (req )
341
+ d = apis .GetCubePriceRequestSchema ().dumps (d )
342
+
343
+ resp = self .invoke ("GetCubePrice" , d , ** kwargs )
344
+ return apis .GetCubePriceResponseSchema ().loads (resp )
345
+
169
346
def list_cube_pod (
170
347
self , req : typing .Optional [dict ] = None , ** kwargs
171
348
) -> dict :
@@ -227,6 +404,35 @@ def modify_cube_extend_info(
227
404
resp = self .invoke ("ModifyCubeExtendInfo" , d , ** kwargs )
228
405
return apis .ModifyCubeExtendInfoResponseSchema ().loads (resp )
229
406
407
+ def modify_cube_tag (
408
+ self , req : typing .Optional [dict ] = None , ** kwargs
409
+ ) -> dict :
410
+ """ModifyCubeTag - 修改业务组名字
411
+
412
+ **Request**
413
+
414
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
415
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
416
+ - **CubeId** (str) - (Required) CubeId
417
+ - **Tag** (str) - (Required) 业务组名称
418
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
419
+
420
+ **Response**
421
+
422
+ - **CubeId** (str) - CubeId
423
+
424
+ """
425
+ # build request
426
+ d = {
427
+ "ProjectId" : self .config .project_id ,
428
+ "Region" : self .config .region ,
429
+ }
430
+ req and d .update (req )
431
+ d = apis .ModifyCubeTagRequestSchema ().dumps (d )
432
+
433
+ resp = self .invoke ("ModifyCubeTag" , d , ** kwargs )
434
+ return apis .ModifyCubeTagResponseSchema ().loads (resp )
435
+
230
436
def renew_cube_pod (
231
437
self , req : typing .Optional [dict ] = None , ** kwargs
232
438
) -> dict :
@@ -255,3 +461,33 @@ def renew_cube_pod(
255
461
256
462
resp = self .invoke ("RenewCubePod" , d , ** kwargs )
257
463
return apis .RenewCubePodResponseSchema ().loads (resp )
464
+
465
+ def update_cube_deployment (
466
+ self , req : typing .Optional [dict ] = None , ** kwargs
467
+ ) -> dict :
468
+ """UpdateCubeDeployment - 更新Deployment
469
+
470
+ **Request**
471
+
472
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
473
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
474
+ - **Deployment** (str) - (Required) base64编码的Deployment的yaml。大小不超过16KB
475
+ - **DeploymentId** (str) - (Required) Deployment的Id
476
+ - **Name** (str) - Deployment的name
477
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
478
+
479
+ **Response**
480
+
481
+ - **Deployment** (str) - 经过base64编码的Deployment的yaml
482
+
483
+ """
484
+ # build request
485
+ d = {
486
+ "ProjectId" : self .config .project_id ,
487
+ "Region" : self .config .region ,
488
+ }
489
+ req and d .update (req )
490
+ d = apis .UpdateCubeDeploymentRequestSchema ().dumps (d )
491
+
492
+ resp = self .invoke ("UpdateCubeDeployment" , d , ** kwargs )
493
+ return apis .UpdateCubeDeploymentResponseSchema ().loads (resp )
0 commit comments