File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change @@ -370,6 +370,36 @@ def get_cube_price(
370
370
resp = self .invoke ("GetCubePrice" , d , ** kwargs )
371
371
return apis .GetCubePriceResponseSchema ().loads (resp )
372
372
373
+ def get_cube_token (
374
+ self , req : typing .Optional [dict ] = None , ** kwargs
375
+ ) -> dict :
376
+ """GetCubeToken - 获取Cube的token,可用于terminal登录、log获取
377
+
378
+ **Request**
379
+
380
+ - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
381
+ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
382
+ - **ContainerName** (str) - (Required) 容器名称
383
+ - **CubeId** (str) - CubeId 和 Uid 中必须填写任意一个。CubeId 是所有 Cube 资源的唯一 ID,如非在 UK8S 通过 Virtual Kubelet 插件创建的 Cube, 则必填 CubeId
384
+ - **Uid** (str) - CubeId 和 Uid 中必须填写任意一个。Uid 是在 UK8S 中通过 Virtual Kubelet 插件创建出的 Cube 的唯一标识
385
+ - **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
386
+
387
+ **Response**
388
+
389
+ - **Token** (str) - 有效时间5min
390
+
391
+ """
392
+ # build request
393
+ d = {
394
+ "ProjectId" : self .config .project_id ,
395
+ "Region" : self .config .region ,
396
+ }
397
+ req and d .update (req )
398
+ d = apis .GetCubeTokenRequestSchema ().dumps (d )
399
+
400
+ resp = self .invoke ("GetCubeToken" , d , ** kwargs )
401
+ return apis .GetCubeTokenResponseSchema ().loads (resp )
402
+
373
403
def list_cube_deployment (
374
404
self , req : typing .Optional [dict ] = None , ** kwargs
375
405
) -> dict :
Original file line number Diff line number Diff line change @@ -304,6 +304,34 @@ class GetCubePriceResponseSchema(schema.ResponseSchema):
304
304
}
305
305
306
306
307
+ """
308
+ API: GetCubeToken
309
+
310
+ 获取Cube的token,可用于terminal登录、log获取
311
+ """
312
+
313
+
314
+ class GetCubeTokenRequestSchema (schema .RequestSchema ):
315
+ """GetCubeToken - 获取Cube的token,可用于terminal登录、log获取"""
316
+
317
+ fields = {
318
+ "ContainerName" : fields .Str (required = True , dump_to = "ContainerName" ),
319
+ "CubeId" : fields .Str (required = False , dump_to = "CubeId" ),
320
+ "ProjectId" : fields .Str (required = True , dump_to = "ProjectId" ),
321
+ "Region" : fields .Str (required = True , dump_to = "Region" ),
322
+ "Uid" : fields .Str (required = False , dump_to = "Uid" ),
323
+ "Zone" : fields .Str (required = False , dump_to = "Zone" ),
324
+ }
325
+
326
+
327
+ class GetCubeTokenResponseSchema (schema .ResponseSchema ):
328
+ """GetCubeToken - 获取Cube的token,可用于terminal登录、log获取"""
329
+
330
+ fields = {
331
+ "Token" : fields .Str (required = True , load_from = "Token" ),
332
+ }
333
+
334
+
307
335
"""
308
336
API: ListCubeDeployment
309
337
You can’t perform that action at this time.
0 commit comments