ucloud-sdk-python3 0.11.145__py3-none-any.whl → 0.11.146__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.
- ucloud/services/uk8s/client.py +1051 -271
- ucloud/services/uk8s/schemas/apis.py +551 -154
- ucloud/services/uk8s/schemas/models.py +579 -235
- ucloud/version.py +1 -1
- {ucloud_sdk_python3-0.11.145.dist-info → ucloud_sdk_python3-0.11.146.dist-info}/METADATA +6 -6
- {ucloud_sdk_python3-0.11.145.dist-info → ucloud_sdk_python3-0.11.146.dist-info}/RECORD +9 -9
- {ucloud_sdk_python3-0.11.145.dist-info → ucloud_sdk_python3-0.11.146.dist-info}/LICENSE +0 -0
- {ucloud_sdk_python3-0.11.145.dist-info → ucloud_sdk_python3-0.11.146.dist-info}/WHEEL +0 -0
- {ucloud_sdk_python3-0.11.145.dist-info → ucloud_sdk_python3-0.11.146.dist-info}/top_level.txt +0 -0
ucloud/services/uk8s/client.py
CHANGED
|
@@ -13,6 +13,66 @@ class UK8SClient(Client):
|
|
|
13
13
|
):
|
|
14
14
|
super(UK8SClient, self).__init__(config, transport, middleware, logger)
|
|
15
15
|
|
|
16
|
+
def add_uk8s_auto_scaling_group_v2(
|
|
17
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
18
|
+
) -> dict:
|
|
19
|
+
"""AddUK8SAutoScalingGroupV2 - 创建绑定已有节点池的自动伸缩组。当前请求校验仍要求提供 CPU、Mem、MachineType 和 Zone。
|
|
20
|
+
|
|
21
|
+
**Request**
|
|
22
|
+
|
|
23
|
+
- **ProjectId** (str) - (Config) 项目ID
|
|
24
|
+
- **Region** (str) - (Config) 地域
|
|
25
|
+
- **CPU** (int) - (Required) 节点CPU大小
|
|
26
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
27
|
+
- **MachineType** (str) - (Required) 云主机机型。该参数仍需传入;实际节点规格取自绑定的节点池。
|
|
28
|
+
- **Max** (int) - (Required) 最大节点数,范围 1–100,且不得小于 Min。
|
|
29
|
+
- **Mem** (int) - (Required) 节点Mem大小
|
|
30
|
+
- **Min** (int) - (Required) 最小节点数,范围 0–100,且不得大于 Max。必须显式传入,允许为 0。
|
|
31
|
+
- **Name** (str) - (Required) 伸缩组名字
|
|
32
|
+
- **NodeGroupId** (str) - (Required) 伸缩组绑定的有效节点池 ID。当前实现必须提供,节点配置取自该节点池。
|
|
33
|
+
- **Zone** (str) - (Required) 可用区
|
|
34
|
+
- **BootDiskSize** (int) - 系统盘大小,单位GB。默认40。范围:[40, 500]。注意SSD本地盘无法调整。
|
|
35
|
+
- **BootDiskType** (str) - 磁盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。默认为SSD云盘
|
|
36
|
+
- **ChargeType** (str) - 计费模式:Year、Month、Dynamic、Postpay,默认 Dynamic。此接口不接受 Preemptive。
|
|
37
|
+
- **DataDiskSize** (int) - 数据磁盘大小,单位GB。默认0。范围 :[20, 1000]
|
|
38
|
+
- **DataDiskType** (str) - 磁盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。默认为SSD云盘
|
|
39
|
+
- **GPU** (int) - GPU卡核心数。仅GPU机型支持此字段
|
|
40
|
+
- **GpuType** (str) - GPU 类型;实际节点规格取自绑定的节点池。
|
|
41
|
+
- **ImageId** (str) - 镜像 Id,不填时后台程序会自动选用一个可用的镜像 Id,不支持用户自定义镜像,传入自定义镜像 Id 将报错
|
|
42
|
+
- **InitScript** (str) - Base64 编码的用户脚本,在 UK8S 节点初始化完成后执行。
|
|
43
|
+
- **IsolationGroup** (str) - 硬件隔离组id。可通过DescribeIsolationGroup获取。
|
|
44
|
+
- **KeyPairId** (str) - 登录密钥对 ID。LoginMode 为 KeyPair 时必填。
|
|
45
|
+
- **Labels** (str) - key=value,多组用”,“隔开,最多5组
|
|
46
|
+
- **LoginMode** (str) - 节点登录方式:Password 或 KeyPair,默认 Password。
|
|
47
|
+
- **MaxPods** (int) - 默认110, 支持16-512
|
|
48
|
+
- **MinimalCpuPlatform** (str) - 最低 CPU 平台;优先于兼容字段 MinmalCpuPlatform。
|
|
49
|
+
- **MinmalCpuPlatform** (str) - 最低 CPU 平台的兼容字段;同时提供 MinimalCpuPlatform 时以其为准。
|
|
50
|
+
- **Password** (str) - Base64 编码的节点登录密码。LoginMode 为 Password(默认)时必填,不会自动生成随机密码;KeyPair 模式下可不填。
|
|
51
|
+
- **Priority** (int) - 伸缩组的优先级,取值[1, 100],数值越大优先级越高,在扩容的时候会被更优先考虑。
|
|
52
|
+
- **Tag** (str) - 业务组
|
|
53
|
+
- **Taints** (str) - Node节点污点,形式为key=value:effect,多组taints用”,“隔开,最多支持五组。
|
|
54
|
+
- **UserData** (str) - Base64 编码的 cloud-init 用户数据。
|
|
55
|
+
|
|
56
|
+
**Response**
|
|
57
|
+
|
|
58
|
+
- **AsgId** (str) - 创建的伸缩组 ID。
|
|
59
|
+
- **Message** (str) - 错误描述信息。
|
|
60
|
+
|
|
61
|
+
"""
|
|
62
|
+
# build request
|
|
63
|
+
d = {
|
|
64
|
+
"ProjectId": self.config.project_id,
|
|
65
|
+
"Region": self.config.region,
|
|
66
|
+
}
|
|
67
|
+
req and d.update(req)
|
|
68
|
+
d = apis.AddUK8SAutoScalingGroupV2RequestSchema().dumps(d)
|
|
69
|
+
|
|
70
|
+
# build options
|
|
71
|
+
kwargs["max_retries"] = 0 # ignore retry when api is not idempotent
|
|
72
|
+
|
|
73
|
+
resp = self.invoke("AddUK8SAutoScalingGroupV2", d, **kwargs)
|
|
74
|
+
return apis.AddUK8SAutoScalingGroupV2ResponseSchema().loads(resp)
|
|
75
|
+
|
|
16
76
|
def add_uk8s_existing_uhost(
|
|
17
77
|
self, req: typing.Optional[dict] = None, **kwargs
|
|
18
78
|
) -> dict:
|
|
@@ -111,13 +171,6 @@ class UK8SClient(Client):
|
|
|
111
171
|
- **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
|
|
112
172
|
|
|
113
173
|
|
|
114
|
-
**AddUK8SNodeGroupParamKubeletConfigurationEvictionHard**
|
|
115
|
-
- **ImagefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之容器镜像剩余空间: 需以%结尾。控制台展示为evictionHard - imagefs.available
|
|
116
|
-
- **MemoryAvailable** (str) - 触发Pod驱逐操作的硬性门限之内存用量: 需以Mi或Gi结尾。控制台展示为evictionHard - memory.available
|
|
117
|
-
- **NodefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之节点存储剩余空间: 需以%结尾。控制台展示为evictionHard - nodefs.available
|
|
118
|
-
- **NodefsInodesFree** (str) - 触发Pod驱逐操作的硬性门限节点inode剩余量: 需以%结尾。控制台展示为evictionHard - nodefs.inodesFree
|
|
119
|
-
|
|
120
|
-
|
|
121
174
|
**AddUK8SNodeGroupParamKubeletConfigurationEvictionSoft**
|
|
122
175
|
- **ImagefsAvailable** (str) - 触发Pod驱逐操作的软性门限之容器镜像剩余空间: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.ImagefsAvailable。控制台展示为evictionSoft - imagefs.available
|
|
123
176
|
- **MemoryAvailable** (str) - 触发Pod驱逐操作的软性门限之内存用量: 需以Mi或Gi结尾。配置此值时必须同时配置EvictionSoftGracePeriod.MemoryAvailable。控制台展示为evictionSoft - memory.available
|
|
@@ -125,8 +178,18 @@ class UK8SClient(Client):
|
|
|
125
178
|
- **NodefsInodesFree** (str) - 触发Pod驱逐操作的软性门限节点inode剩余量: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.NodefsInodesFree。控制台展示为evictionSoft - nodefs.inodesFree
|
|
126
179
|
|
|
127
180
|
|
|
128
|
-
**
|
|
129
|
-
- **
|
|
181
|
+
**AddUK8SNodeGroupParamKubeletConfigurationKubeReserved**
|
|
182
|
+
- **CPU** (str) - kubelet预留CPU资源,以m结尾。控制台展示为kubeReserved - cpu
|
|
183
|
+
- **EphemeralStorage** (str) - kubelet预留存储空间,以Gi结尾。控制台展示为kubeReserved - ephemeral-storage
|
|
184
|
+
- **Memory** (str) - kubelet预留内存资源,以Mi结尾。控制台展示为kubeReserved - memory
|
|
185
|
+
- **Pid** (str) - kubelet预留pid数量,必须大于等于500, string方式提供。控制台展示为kubeReserved - pid
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
**AddUK8SNodeGroupParamKubeletConfigurationEvictionHard**
|
|
189
|
+
- **ImagefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之容器镜像剩余空间: 需以%结尾。控制台展示为evictionHard - imagefs.available
|
|
190
|
+
- **MemoryAvailable** (str) - 触发Pod驱逐操作的硬性门限之内存用量: 需以Mi或Gi结尾。控制台展示为evictionHard - memory.available
|
|
191
|
+
- **NodefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之节点存储剩余空间: 需以%结尾。控制台展示为evictionHard - nodefs.available
|
|
192
|
+
- **NodefsInodesFree** (str) - 触发Pod驱逐操作的硬性门限节点inode剩余量: 需以%结尾。控制台展示为evictionHard - nodefs.inodesFree
|
|
130
193
|
|
|
131
194
|
|
|
132
195
|
**AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod**
|
|
@@ -143,13 +206,6 @@ class UK8SClient(Client):
|
|
|
143
206
|
- **Pid** (str) - 系统预留pid数量,必须大于等于500, string方式提供。控制台展示为systemReserved - pid
|
|
144
207
|
|
|
145
208
|
|
|
146
|
-
**AddUK8SNodeGroupParamKubeletConfigurationKubeReserved**
|
|
147
|
-
- **CPU** (str) - kubelet预留CPU资源,以m结尾。控制台展示为kubeReserved - cpu
|
|
148
|
-
- **EphemeralStorage** (str) - kubelet预留存储空间,以Gi结尾。控制台展示为kubeReserved - ephemeral-storage
|
|
149
|
-
- **Memory** (str) - kubelet预留内存资源,以Mi结尾。控制台展示为kubeReserved - memory
|
|
150
|
-
- **Pid** (str) - kubelet预留pid数量,必须大于等于500, string方式提供。控制台展示为kubeReserved - pid
|
|
151
|
-
|
|
152
|
-
|
|
153
209
|
**AddUK8SNodeGroupParamKubeletConfiguration**
|
|
154
210
|
- **ContainerLogMaxFiles** (int) - 容器的日志文件个数上限,需大于等于2。控制台展示为containerLogMaxFiles
|
|
155
211
|
- **ContainerLogMaxSize** (str) - 容器日志文件轮换生成新文件的最大阈值,需以Mi结尾。控制台展示为containerLogMaxSize
|
|
@@ -169,6 +225,10 @@ class UK8SClient(Client):
|
|
|
169
225
|
- **Priority** (str) - 安全组优先级。取值范围[1, 5]
|
|
170
226
|
|
|
171
227
|
|
|
228
|
+
**AddUK8SNodeGroupParamNetworkInterface**
|
|
229
|
+
- **EIP** (dict) - 见 **AddUK8SNodeGroupParamNetworkInterfaceEIP** 模型定义
|
|
230
|
+
|
|
231
|
+
|
|
172
232
|
"""
|
|
173
233
|
# build request
|
|
174
234
|
d = {
|
|
@@ -282,6 +342,15 @@ class UK8SClient(Client):
|
|
|
282
342
|
|
|
283
343
|
**Request Model**
|
|
284
344
|
|
|
345
|
+
**AddUK8SUHostNodeParamUserLabels**
|
|
346
|
+
- **Key** (str) - UK8S用户资源标签的键值
|
|
347
|
+
- **Value** (str) - UK8S用户资源标签的值
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
**AddUK8SUHostNodeParamKubeletConfiguration**
|
|
351
|
+
- **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup
|
|
352
|
+
|
|
353
|
+
|
|
285
354
|
**AddUK8SUHostNodeParamNetworkInterfaceEIP**
|
|
286
355
|
- **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
|
|
287
356
|
- **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
|
|
@@ -294,15 +363,6 @@ class UK8SClient(Client):
|
|
|
294
363
|
- **EIP** (dict) - 见 **AddUK8SUHostNodeParamNetworkInterfaceEIP** 模型定义
|
|
295
364
|
|
|
296
365
|
|
|
297
|
-
**AddUK8SUHostNodeParamUserLabels**
|
|
298
|
-
- **Key** (str) - UK8S用户资源标签的键值
|
|
299
|
-
- **Value** (str) - UK8S用户资源标签的值
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
**AddUK8SUHostNodeParamKubeletConfiguration**
|
|
303
|
-
- **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup
|
|
304
|
-
|
|
305
|
-
|
|
306
366
|
**AddUK8SUHostNodeParamSecGroupId**
|
|
307
367
|
- **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。
|
|
308
368
|
- **Name** (str) - 安全组名称。
|
|
@@ -402,15 +462,6 @@ class UK8SClient(Client):
|
|
|
402
462
|
- **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup
|
|
403
463
|
|
|
404
464
|
|
|
405
|
-
**CreateUK8SClusterV2ParamKubeProxy**
|
|
406
|
-
- **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
**CreateUK8SClusterV2ParamMaster**
|
|
410
|
-
- **SecGroupId** (list) - 见 **CreateUK8SClusterV2ParamMasterSecGroupId** 模型定义
|
|
411
|
-
- **Zone** (str) - Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
412
|
-
|
|
413
|
-
|
|
414
465
|
**CreateUK8SClusterV2ParamNodes**
|
|
415
466
|
- **BootDiskSize** (int) - Node节点的系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。
|
|
416
467
|
- **BootDiskType** (str) - 一组Node节点的系统盘类型,请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。默认为SSD云盘
|
|
@@ -445,6 +496,15 @@ class UK8SClient(Client):
|
|
|
445
496
|
- **Value** (str) - UK8S用户资源标签的值
|
|
446
497
|
|
|
447
498
|
|
|
499
|
+
**CreateUK8SClusterV2ParamKubeProxy**
|
|
500
|
+
- **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
**CreateUK8SClusterV2ParamMaster**
|
|
504
|
+
- **SecGroupId** (list) - 见 **CreateUK8SClusterV2ParamMasterSecGroupId** 模型定义
|
|
505
|
+
- **Zone** (str) - Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
506
|
+
|
|
507
|
+
|
|
448
508
|
"""
|
|
449
509
|
# build request
|
|
450
510
|
d = {
|
|
@@ -482,29 +542,21 @@ class UK8SClient(Client):
|
|
|
482
542
|
|
|
483
543
|
**Request Model**
|
|
484
544
|
|
|
485
|
-
**
|
|
486
|
-
- **
|
|
487
|
-
- **
|
|
488
|
-
- **ValueOperator** (str) - 按 Pod 标签匹配时,标签值的匹配操作符。可选值: in, notin。
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
**CreateUK8SULSConfigParamMatchRulePodLabels**
|
|
492
|
-
- **Labels** (list) - 见 **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义
|
|
493
|
-
- **Namespace** (str) - 命名空间名称
|
|
494
|
-
- **NamespaceOperator** (str) - 指定/排除命名空间, 可选值: in/notin
|
|
545
|
+
**CreateUK8SULSConfigParamInputDetailMetadata**
|
|
546
|
+
- **Container** (str) - 指定具体要采集元数据的容器名。如果留空,则不采集容器的元数据,可选字段:container_name,namespace,pod_name,pod_ip,pod_uid,container_id,image_name。Pod Label 元数据通过指定 InputDetail.Metadata.Labels字段。
|
|
547
|
+
- **Labels** (str) - 定义要采集哪些 Pod 的标签 (Labels)。可选值: * (采集所有标签), "app,version" (仅采集 app 和 version), "" (不采集任何标签)。
|
|
495
548
|
|
|
496
549
|
|
|
497
|
-
**
|
|
498
|
-
- **
|
|
499
|
-
- **
|
|
500
|
-
- **Type** (str) - 按工作负载匹配时,工作负载的类型,例如 deployment, statefulset, daemonset,job, cronjob。
|
|
550
|
+
**CreateUK8SULSConfigParamInputDetailFilePaths**
|
|
551
|
+
- **File** (str) - 定义采集路径的文件名
|
|
552
|
+
- **Path** (str) - 定义采集路径
|
|
501
553
|
|
|
502
554
|
|
|
503
|
-
**
|
|
504
|
-
- **
|
|
505
|
-
- **
|
|
506
|
-
- **
|
|
507
|
-
- **
|
|
555
|
+
**CreateUK8SULSConfigParamInputDetail**
|
|
556
|
+
- **FilePaths** (list) - 见 **CreateUK8SULSConfigParamInputDetailFilePaths** 模型定义
|
|
557
|
+
- **Metadata** (dict) - 见 **CreateUK8SULSConfigParamInputDetailMetadata** 模型定义
|
|
558
|
+
- **Stream** (str) - all、stdout、stderr,默认 all (用于 InputDetail.Type = container_stdout)
|
|
559
|
+
- **Type** (str) - 日志输入类型。支持 container_file 和 container_stdout
|
|
508
560
|
|
|
509
561
|
|
|
510
562
|
**CreateUK8SULSConfigParamExtractRuleExtractRule**
|
|
@@ -528,21 +580,29 @@ class UK8SClient(Client):
|
|
|
528
580
|
- **UnMatchUpload** (str) - 是否上传解析失败的日志。true 表示上传,false 表示丢弃。默认为 false。
|
|
529
581
|
|
|
530
582
|
|
|
531
|
-
**
|
|
532
|
-
- **
|
|
533
|
-
- **
|
|
583
|
+
**CreateUK8SULSConfigParamMatchRulePodLabelsLabels**
|
|
584
|
+
- **Key** (str) - 按 Pod 标签匹配时,要匹配的标签的 Key。
|
|
585
|
+
- **Value** (str) - 按 Pod 标签匹配时,要匹配的标签的值。
|
|
586
|
+
- **ValueOperator** (str) - 按 Pod 标签匹配时,标签值的匹配操作符。可选值: in, notin。
|
|
534
587
|
|
|
535
588
|
|
|
536
|
-
**
|
|
537
|
-
- **
|
|
538
|
-
- **
|
|
589
|
+
**CreateUK8SULSConfigParamMatchRulePodLabels**
|
|
590
|
+
- **Labels** (list) - 见 **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义
|
|
591
|
+
- **Namespace** (str) - 命名空间名称
|
|
592
|
+
- **NamespaceOperator** (str) - 指定/排除命名空间, 可选值: in/notin
|
|
539
593
|
|
|
540
594
|
|
|
541
|
-
**
|
|
542
|
-
- **
|
|
543
|
-
- **
|
|
544
|
-
- **
|
|
545
|
-
|
|
595
|
+
**CreateUK8SULSConfigParamMatchRuleWorkloads**
|
|
596
|
+
- **Name** (str) - 按工作负载匹配时,工作负载的名称。
|
|
597
|
+
- **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。
|
|
598
|
+
- **Type** (str) - 按工作负载匹配时,工作负载的类型,例如 deployment, statefulset, daemonset,job, cronjob。
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
**CreateUK8SULSConfigParamMatchRule**
|
|
602
|
+
- **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔
|
|
603
|
+
- **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含)
|
|
604
|
+
- **PodLabels** (dict) - 见 **CreateUK8SULSConfigParamMatchRulePodLabels** 模型定义
|
|
605
|
+
- **Workloads** (list) - 见 **CreateUK8SULSConfigParamMatchRuleWorkloads** 模型定义
|
|
546
606
|
|
|
547
607
|
|
|
548
608
|
"""
|
|
@@ -616,6 +676,33 @@ class UK8SClient(Client):
|
|
|
616
676
|
resp = self.invoke("DelUK8SClusterNodeV2", d, **kwargs)
|
|
617
677
|
return apis.DelUK8SClusterNodeV2ResponseSchema().loads(resp)
|
|
618
678
|
|
|
679
|
+
def delete_uk8s_auto_scaling_group(
|
|
680
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
681
|
+
) -> dict:
|
|
682
|
+
"""DeleteUK8SAutoScalingGroup - 删除伸缩组
|
|
683
|
+
|
|
684
|
+
**Request**
|
|
685
|
+
|
|
686
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
687
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
688
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
689
|
+
- **Id** (str) - (Required) 伸缩组ID
|
|
690
|
+
|
|
691
|
+
**Response**
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
"""
|
|
695
|
+
# build request
|
|
696
|
+
d = {
|
|
697
|
+
"ProjectId": self.config.project_id,
|
|
698
|
+
"Region": self.config.region,
|
|
699
|
+
}
|
|
700
|
+
req and d.update(req)
|
|
701
|
+
d = apis.DeleteUK8SAutoScalingGroupRequestSchema().dumps(d)
|
|
702
|
+
|
|
703
|
+
resp = self.invoke("DeleteUK8SAutoScalingGroup", d, **kwargs)
|
|
704
|
+
return apis.DeleteUK8SAutoScalingGroupResponseSchema().loads(resp)
|
|
705
|
+
|
|
619
706
|
def delete_uk8s_uls_config(
|
|
620
707
|
self, req: typing.Optional[dict] = None, **kwargs
|
|
621
708
|
) -> dict:
|
|
@@ -644,96 +731,238 @@ class UK8SClient(Client):
|
|
|
644
731
|
resp = self.invoke("DeleteUK8SULSConfig", d, **kwargs)
|
|
645
732
|
return apis.DeleteUK8SULSConfigResponseSchema().loads(resp)
|
|
646
733
|
|
|
647
|
-
def
|
|
734
|
+
def describe_uk8s_autoscaler_group(
|
|
648
735
|
self, req: typing.Optional[dict] = None, **kwargs
|
|
649
736
|
) -> dict:
|
|
650
|
-
"""
|
|
737
|
+
"""DescribeUK8SAutoscalerGroup - 获取autoscaler与auto scaling group信息
|
|
651
738
|
|
|
652
739
|
**Request**
|
|
653
740
|
|
|
654
|
-
- **ProjectId** (str) - (Config) 项目
|
|
655
|
-
- **Region** (str) - (Config)
|
|
656
|
-
- **ClusterId** (str) - (Required)
|
|
741
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
742
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
743
|
+
- **ClusterId** (str) - (Required) 集群id
|
|
744
|
+
- **Zone** (str) - 可用区,可选。此接口按集群 ID 查询。
|
|
657
745
|
|
|
658
746
|
**Response**
|
|
659
747
|
|
|
660
|
-
- **
|
|
748
|
+
- **AutoScalingGroup** (list) - 见 **AutoScalingGroup** 模型定义
|
|
661
749
|
- **Autoscaler** (dict) - 见 **Autoscaler** 模型定义
|
|
662
|
-
- **
|
|
663
|
-
- **CNIMode** (str) - CNI模式,可选值VPC/Calico
|
|
664
|
-
- **ClusterDomain** (str) - 自定义或者默认的clusterdomain
|
|
665
|
-
- **ClusterId** (str) - 集群ID
|
|
666
|
-
- **ClusterName** (str) - 资源名字
|
|
667
|
-
- **ClusterType** (str) - 集群版本
|
|
668
|
-
- **CreateTime** (int) - 创建时间
|
|
669
|
-
- **DedicatedPodSubnet** (bool) - Pod是否使用独立子网
|
|
670
|
-
- **DeleteProtection** (int) - 删除保护开关。0表示不开启,1表示开启。默认不开启
|
|
671
|
-
- **EnableUserAuth** (bool) - 是否开启了授权管理功能
|
|
672
|
-
- **EtcdCert** (str) - 集群etcd服务证书
|
|
673
|
-
- **EtcdKey** (str) - 集群etcd服务密钥
|
|
674
|
-
- **ExternalApiServer** (str) - 集群外部apiserver地址
|
|
675
|
-
- **ExternalUlb** (str) - 外部 API Server 负载均衡实例 ID
|
|
676
|
-
- **InternalUlb** (str) - 内部 API Server 负载均衡实例 ID
|
|
677
|
-
- **KubeProxy** (dict) - 见 **KubeProxy** 模型定义
|
|
678
|
-
- **LbClass** (str) - 负载均衡类型
|
|
679
|
-
- **LoopbackClientCert** (dict) - 见 **LoopbackClientCert** 模型定义
|
|
680
|
-
- **MasterCount** (int) - Master 节点数量
|
|
681
|
-
- **MasterList** (list) - 见 **UhostInfo** 模型定义
|
|
682
|
-
- **MasterResourceStatus** (str) - Master配置预警:Normal正常;Warning 需要升级;Error 需要紧急升级;
|
|
683
|
-
- **MonitorType** (str) - 集群的监控类型:no无监控;cloudwatch统一监控平台;prometheus内置监控
|
|
684
|
-
- **NodeCIDR** (str) - 节点网段
|
|
685
|
-
- **NodeCount** (int) - Node节点数量
|
|
686
|
-
- **NodeList** (list) - 见 **UhostInfo** 模型定义
|
|
687
|
-
- **PodCIDR** (str) - Pod网段
|
|
688
|
-
- **PodSubnetIds** (list) - Pod使用的独立子网列表
|
|
689
|
-
- **PodSubnetSecGroups** (list) - Pod独立子网内的ip使用的安全组
|
|
690
|
-
- **RuntimeName** (str) - 容器运行时名称
|
|
691
|
-
- **RuntimeVersion** (str) - 容器运行时版本
|
|
692
|
-
- **ServiceCIDR** (str) - 服务网段
|
|
693
|
-
- **Status** (str) - 状态
|
|
694
|
-
- **SubnetId** (str) - 所属子网
|
|
695
|
-
- **UpdateTime** (int) - 更新时间
|
|
696
|
-
- **VPCId** (str) - 所属VPC
|
|
697
|
-
- **Version** (str) - K8S版本
|
|
750
|
+
- **Update** (int) - 0:无需更新1:有更新2:强制更新
|
|
698
751
|
|
|
699
752
|
**Response Model**
|
|
700
753
|
|
|
701
754
|
**SecGroupId**
|
|
702
|
-
- **Id** (str) -
|
|
703
|
-
- **Name** (str) -
|
|
755
|
+
- **Id** (str) - 安全组 ID
|
|
756
|
+
- **Name** (str) - 安全组名称
|
|
704
757
|
- **Priority** (str) - 安全组优先级
|
|
705
758
|
|
|
706
759
|
|
|
707
|
-
**
|
|
708
|
-
- **
|
|
760
|
+
**EIP**
|
|
761
|
+
- **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
|
|
762
|
+
- **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
|
|
763
|
+
- **OperatorName** (str) - 【若绑定EIP,此参数必填】弹性IP的线路。枚举值: 国际: International,BGP: Bgp。 各地域允许的线路参数如下: cn-sh1: Bgp cn-sh2: Bgp cn-gd: Bgp cn-bj1: Bgp cn-bj2: Bgp hk: International us-ca: International th-bkk: International kr-seoul:International us-ws:International ge-fra:International sg:International tw-kh:International.其他海外线路均为 International
|
|
764
|
+
- **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth"
|
|
765
|
+
- **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
|
|
709
766
|
|
|
710
767
|
|
|
711
|
-
**
|
|
712
|
-
- **
|
|
713
|
-
- **DiskId** (str) - 磁盘长ID
|
|
714
|
-
- **DiskType** (str) - LOCAL_NOMAL| CLOUD_NORMAL| LOCAL_SSD| CLOUD_SSD|EXCLUSIVE_LOCAL_DISK
|
|
715
|
-
- **Drive** (str) - 磁盘盘符
|
|
716
|
-
- **Encrypted** (str) - Yes: 加密 No: 非加密
|
|
717
|
-
- **IOPS** (int) - 当前主机的IOPS值
|
|
718
|
-
- **IsBoot** (str) - True| False
|
|
719
|
-
- **Name** (str) - UDisk名字(仅当磁盘是UDisk时返回)
|
|
720
|
-
- **Size** (int) - 磁盘大小,单位: GB
|
|
721
|
-
- **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk
|
|
768
|
+
**NetworkInterface**
|
|
769
|
+
- **EIP** (dict) - 见 **EIP** 模型定义
|
|
722
770
|
|
|
723
771
|
|
|
724
|
-
**
|
|
725
|
-
- **
|
|
726
|
-
- **
|
|
727
|
-
- **
|
|
728
|
-
- **
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
- **
|
|
772
|
+
**EvictionCondition**
|
|
773
|
+
- **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。
|
|
774
|
+
- **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。
|
|
775
|
+
- **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。
|
|
776
|
+
- **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
**ReservedResource**
|
|
780
|
+
- **CPU** (str) - CPU
|
|
781
|
+
- **EphemeralStorage** (str) - 存储
|
|
782
|
+
- **Memory** (str) - 内存
|
|
783
|
+
- **Pid** (str) - Pid
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
**KubeletConfiguration**
|
|
787
|
+
- **ContainerLogMaxFiles** (int) - 最大日志文件数量
|
|
788
|
+
- **ContainerLogMaxSize** (str) - 最大日志文件大小
|
|
789
|
+
- **EvictionHard** (dict) - 见 **EvictionCondition** 模型定义
|
|
790
|
+
- **EvictionSoft** (dict) - 见 **EvictionCondition** 模型定义
|
|
791
|
+
- **EvictionSoftGracePeriod** (dict) - 见 **EvictionCondition** 模型定义
|
|
792
|
+
- **ImageGCHighThresholdPercent** (int) - 镜像垃圾收集阈值
|
|
793
|
+
- **ImageGCLowThresholdPercent** (int) - 停止镜像垃圾收集阈值
|
|
794
|
+
- **KubeReserved** (dict) - 见 **ReservedResource** 模型定义
|
|
795
|
+
- **MaxPods** (int) - 最大Pod数量
|
|
796
|
+
- **SystemReserved** (dict) - 见 **ReservedResource** 模型定义
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
**AutoScalingGroup**
|
|
800
|
+
- **BootDiskSize** (int) - 节点系统盘大小
|
|
801
|
+
- **BootDiskType** (str) - 节点系统盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。默认为SSD云盘
|
|
802
|
+
- **CPU** (int) - 节点CPU
|
|
803
|
+
- **ChargeType** (str) - 伸缩组的计费模式。
|
|
804
|
+
- **CreateTime** (int) - 创建时间,Unix 时间戳,单位秒。
|
|
805
|
+
- **CurrentNodeNum** (int) - 当前该伸缩组管理的node数量
|
|
806
|
+
- **DataDiskSize** (int) - 节点数据盘大小
|
|
807
|
+
- **DataDiskType** (str) - 节点数据盘类型。请参考 `磁盘类型 <https://docs.ucloud.cn/api/uhost-api/disk_type>`_ 。默认为SSD云盘
|
|
808
|
+
- **GPU** (int) - GPU 数量。
|
|
809
|
+
- **GpuType** (str) - GPU 类型。
|
|
810
|
+
- **Id** (str) - 伸缩组ID
|
|
811
|
+
- **ImageId** (str) - 镜像 ID。
|
|
812
|
+
- **InitScript** (str) - Base64 编码的节点初始化后脚本。
|
|
813
|
+
- **IsolationGroup** (str) - 硬件隔离组id。可通过DescribeIsolationGroup获取。
|
|
814
|
+
- **KeyPairId** (str) - 登录密钥对 ID。
|
|
815
|
+
- **KubeletConfiguration** (dict) - 见 **KubeletConfiguration** 模型定义
|
|
816
|
+
- **Labels** (str) - 节点标签 key=value,多组用”,“隔开,最多5组
|
|
817
|
+
- **LoginMode** (str) - 节点登录方式:Password 或 KeyPair。
|
|
818
|
+
- **MachineType** (str) - 云主机机型。
|
|
819
|
+
- **Max** (int) - 最大node数量
|
|
820
|
+
- **MaxPods** (int) - Pods数量 默认110, 支持16-512
|
|
821
|
+
- **Mem** (int) - 节点内存
|
|
822
|
+
- **Min** (int) - 最小node数量
|
|
823
|
+
- **MinimalCpuPlatform** (str) - 最低 CPU 平台。
|
|
824
|
+
- **MinmalCpuPlatform** (str) - 最低 CPU 平台的兼容字段,与 MinimalCpuPlatform 相同。
|
|
825
|
+
- **Name** (str) - 伸缩组名字
|
|
826
|
+
- **NetworkInterface** (list) - 见 **NetworkInterface** 模型定义
|
|
827
|
+
- **NodeBootDiskType** (str) - 旧伸缩组的系统盘类型。
|
|
828
|
+
- **NodeCPU** (int) - 节点CPU【兼容】
|
|
829
|
+
- **NodeDataDiskSize** (int) - 节点数据盘大小【兼容】
|
|
830
|
+
- **NodeDataDiskType** (str) - 节点数据盘类型【兼容】
|
|
831
|
+
- **NodeGroupId** (str) - 节点所属节点池id
|
|
832
|
+
- **NodeMem** (int) - 节点内存【兼容】
|
|
833
|
+
- **NodeUHostType** (str) - 节点云主机机型【兼容】
|
|
834
|
+
- **OsName** (str) - 操作系统名称。
|
|
835
|
+
- **Password** (str) - Base64 编码的节点登录密码。
|
|
836
|
+
- **Priority** (int) - 优先级
|
|
837
|
+
- **SecGroupId** (list) - 见 **SecGroupId** 模型定义
|
|
838
|
+
- **SecurityGroupId** (str) - 防火墙 ID。
|
|
839
|
+
- **SecurityMode** (str) - 节点安全模式:Firewall 或 SecGroup。
|
|
840
|
+
- **SubnetId** (str) - 节点子网id【兼容】
|
|
841
|
+
- **Tag** (str) - 业务组。
|
|
842
|
+
- **Taints** (str) - 节点污点配置。
|
|
843
|
+
- **UHostFamily** (str) - 主机规格族
|
|
844
|
+
- **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。
|
|
845
|
+
- **UserData** (str) - Base64 编码的 cloud-init 用户数据。
|
|
846
|
+
- **Zone** (str) - 可用区
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
**Autoscaler**
|
|
850
|
+
- **Enabled** (int) - 打开/关闭
|
|
851
|
+
- **ScaleDownDelayAfterAdd** (int) - 添加节点后等待缩容的时间,单位分钟。
|
|
852
|
+
- **ScaleDownGpuUtilizationThreshold** (int) - GPU 缩容利用率阈值,单位百分比,范围 0–100。
|
|
853
|
+
- **ScaleDownUnneededTime** (int) - 节点持续不需要后触发缩容的等待时间,单位分钟。
|
|
854
|
+
- **ScaleDownUtilizationThreshold** (int) - 节点缩容利用率阈值,单位百分比,范围 0–100。
|
|
855
|
+
- **UpdateTime** (int) - 配置更新时间,Unix 时间戳,单位秒。
|
|
856
|
+
- **Version** (str) - 伸缩器版本
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
"""
|
|
860
|
+
# build request
|
|
861
|
+
d = {
|
|
862
|
+
"ProjectId": self.config.project_id,
|
|
863
|
+
"Region": self.config.region,
|
|
864
|
+
}
|
|
865
|
+
req and d.update(req)
|
|
866
|
+
d = apis.DescribeUK8SAutoscalerGroupRequestSchema().dumps(d)
|
|
867
|
+
|
|
868
|
+
resp = self.invoke("DescribeUK8SAutoscalerGroup", d, **kwargs)
|
|
869
|
+
return apis.DescribeUK8SAutoscalerGroupResponseSchema().loads(resp)
|
|
870
|
+
|
|
871
|
+
def describe_uk8s_cluster(
|
|
872
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
873
|
+
) -> dict:
|
|
874
|
+
"""DescribeUK8SCluster - 获取集群信息
|
|
875
|
+
|
|
876
|
+
**Request**
|
|
877
|
+
|
|
878
|
+
- **ProjectId** (str) - (Config) 项目id
|
|
879
|
+
- **Region** (str) - (Config) 所属区域
|
|
880
|
+
- **ClusterId** (str) - (Required) k8s集群ID
|
|
881
|
+
|
|
882
|
+
**Response**
|
|
883
|
+
|
|
884
|
+
- **ApiServer** (str) - 集群apiserver地址
|
|
885
|
+
- **Autoscaler** (dict) - 见 **Autoscaler** 模型定义
|
|
886
|
+
- **CACert** (str) - 集群CA根证书
|
|
887
|
+
- **CNIMode** (str) - CNI模式,可选值VPC/Calico
|
|
888
|
+
- **ClusterDomain** (str) - 自定义或者默认的clusterdomain
|
|
889
|
+
- **ClusterId** (str) - 集群ID
|
|
890
|
+
- **ClusterName** (str) - 资源名字
|
|
891
|
+
- **ClusterType** (str) - 集群版本
|
|
892
|
+
- **CreateTime** (int) - 创建时间
|
|
893
|
+
- **DedicatedPodSubnet** (bool) - Pod是否使用独立子网
|
|
894
|
+
- **DeleteProtection** (int) - 删除保护开关。0表示不开启,1表示开启。默认不开启
|
|
895
|
+
- **EnableUserAuth** (bool) - 是否开启了授权管理功能
|
|
896
|
+
- **EtcdCert** (str) - 集群etcd服务证书
|
|
897
|
+
- **EtcdKey** (str) - 集群etcd服务密钥
|
|
898
|
+
- **ExternalApiServer** (str) - 集群外部apiserver地址
|
|
899
|
+
- **ExternalUlb** (str) - 外部 API Server 负载均衡实例 ID
|
|
900
|
+
- **InternalUlb** (str) - 内部 API Server 负载均衡实例 ID
|
|
901
|
+
- **KubeProxy** (dict) - 见 **KubeProxy** 模型定义
|
|
902
|
+
- **LbClass** (str) - 负载均衡类型
|
|
903
|
+
- **LoopbackClientCert** (dict) - 见 **LoopbackClientCert** 模型定义
|
|
904
|
+
- **MasterCount** (int) - Master 节点数量
|
|
905
|
+
- **MasterList** (list) - 见 **UhostInfo** 模型定义
|
|
906
|
+
- **MasterResourceStatus** (str) - Master配置预警:Normal正常;Warning 需要升级;Error 需要紧急升级;
|
|
907
|
+
- **MonitorType** (str) - 集群的监控类型:no无监控;cloudwatch统一监控平台;prometheus内置监控
|
|
908
|
+
- **NodeCIDR** (str) - 节点网段
|
|
909
|
+
- **NodeCount** (int) - Node节点数量
|
|
910
|
+
- **NodeList** (list) - 见 **UhostInfo** 模型定义
|
|
911
|
+
- **PodCIDR** (str) - Pod网段
|
|
912
|
+
- **PodSubnetIds** (list) - Pod使用的独立子网列表
|
|
913
|
+
- **PodSubnetSecGroups** (list) - Pod独立子网内的ip使用的安全组
|
|
914
|
+
- **RuntimeName** (str) - 容器运行时名称
|
|
915
|
+
- **RuntimeVersion** (str) - 容器运行时版本
|
|
916
|
+
- **ServiceCIDR** (str) - 服务网段
|
|
917
|
+
- **Status** (str) - 状态
|
|
918
|
+
- **SubnetId** (str) - 所属子网
|
|
919
|
+
- **UpdateTime** (int) - 更新时间
|
|
920
|
+
- **VPCId** (str) - 所属VPC
|
|
921
|
+
- **Version** (str) - K8S版本
|
|
922
|
+
|
|
923
|
+
**Response Model**
|
|
924
|
+
|
|
925
|
+
**KubeProxy**
|
|
926
|
+
- **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables]
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
**SecGroupId**
|
|
930
|
+
- **Id** (str) - 安全组名称
|
|
931
|
+
- **Name** (str) - 安全组id
|
|
932
|
+
- **Priority** (str) - 安全组优先级
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
**DiskSet**
|
|
936
|
+
- **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。
|
|
937
|
+
- **DiskId** (str) - 磁盘长ID
|
|
938
|
+
- **DiskType** (str) - LOCAL_NOMAL| CLOUD_NORMAL| LOCAL_SSD| CLOUD_SSD|EXCLUSIVE_LOCAL_DISK
|
|
939
|
+
- **Drive** (str) - 磁盘盘符
|
|
940
|
+
- **Encrypted** (str) - Yes: 加密 No: 非加密
|
|
941
|
+
- **IOPS** (int) - 当前主机的IOPS值
|
|
942
|
+
- **IsBoot** (str) - True| False
|
|
943
|
+
- **Name** (str) - UDisk名字(仅当磁盘是UDisk时返回)
|
|
944
|
+
- **Size** (int) - 磁盘大小,单位: GB
|
|
945
|
+
- **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
**IPSet**
|
|
949
|
+
- **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息)
|
|
950
|
+
- **Default** (str) - 是否默认的弹性网卡的信息。true: 是默认弹性网卡;其他值:不是。
|
|
951
|
+
- **IP** (str) - IP地址
|
|
952
|
+
- **IPId** (str) - IP资源ID (内网IP无对应的资源ID)
|
|
953
|
+
- **IPMode** (str) - IP 地址分配模式
|
|
954
|
+
- **Mac** (str) - 网卡的 MAC 地址
|
|
955
|
+
- **NetworkInterfaceId** (str) - 虚拟网卡 Id
|
|
956
|
+
- **SubnetId** (str) - IP 所在的 子网 Id
|
|
733
957
|
- **Type** (str) - 国际: Internation,BGP: Bgp,内网: Private
|
|
734
958
|
- **VPCId** (str) - IP 所属的 VPC Id
|
|
735
959
|
|
|
736
960
|
|
|
961
|
+
**LoopbackClientCert**
|
|
962
|
+
- **ExpireTime** (int) - 证书到期时间
|
|
963
|
+
- **Warn** (bool) - 证书是否进入过期告警状态
|
|
964
|
+
|
|
965
|
+
|
|
737
966
|
**UhostInfo**
|
|
738
967
|
- **BasicImageName** (str) - 基础镜像名称
|
|
739
968
|
- **CPU** (int) - Cpu数量
|
|
@@ -756,11 +985,6 @@ class UK8SClient(Client):
|
|
|
756
985
|
- **Zone** (str) - 所在机房
|
|
757
986
|
|
|
758
987
|
|
|
759
|
-
**LoopbackClientCert**
|
|
760
|
-
- **ExpireTime** (int) - 证书到期时间
|
|
761
|
-
- **Warn** (bool) - 证书是否进入过期告警状态
|
|
762
|
-
|
|
763
|
-
|
|
764
988
|
**Autoscaler**
|
|
765
989
|
- **Enabled** (int) - 打开/关闭
|
|
766
990
|
- **ScaleDownDelayAfterAdd** (str) - 静默时间
|
|
@@ -828,96 +1052,589 @@ class UK8SClient(Client):
|
|
|
828
1052
|
"Region": self.config.region,
|
|
829
1053
|
}
|
|
830
1054
|
req and d.update(req)
|
|
831
|
-
d = apis.DescribeUK8SImageRequestSchema().dumps(d)
|
|
1055
|
+
d = apis.DescribeUK8SImageRequestSchema().dumps(d)
|
|
1056
|
+
|
|
1057
|
+
resp = self.invoke("DescribeUK8SImage", d, **kwargs)
|
|
1058
|
+
return apis.DescribeUK8SImageResponseSchema().loads(resp)
|
|
1059
|
+
|
|
1060
|
+
def describe_uk8s_node(
|
|
1061
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1062
|
+
) -> dict:
|
|
1063
|
+
"""DescribeUK8SNode - 用于获取 UK8S 节点详情
|
|
1064
|
+
|
|
1065
|
+
**Request**
|
|
1066
|
+
|
|
1067
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1068
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1069
|
+
- **ClusterId** (str) - (Required) UK8S 集群 Id
|
|
1070
|
+
- **Name** (str) - (Required) K8S 节点IP或者节点ID
|
|
1071
|
+
|
|
1072
|
+
**Response**
|
|
1073
|
+
|
|
1074
|
+
- **Action** (str) - 操作名称
|
|
1075
|
+
- **AllocatedPodCount** (int) - 已分配到当前节点的 Pod 数量
|
|
1076
|
+
- **Annotations** (list) - 字符串数组,每一项是类似 "node.alpha.kubernetes.io/ttl=0" 的注解
|
|
1077
|
+
- **CPUCapacity** (str) - 节点 CPU 总量
|
|
1078
|
+
- **CPULimits** (str) - 节点上已分配 Pod 的 CPU 限制值
|
|
1079
|
+
- **CPULimitsFraction** (str) - 节点上已分配 Pod 的 CPU 限制值占 CPU 总量的比例
|
|
1080
|
+
- **CPURequests** (str) - 节点上已分配 Pod 的 CPU 请求量
|
|
1081
|
+
- **CPURequestsFraction** (str) - 节点上已分配 Pod 的 CPU 请求量占 CPU 总量的比例
|
|
1082
|
+
- **Conditions** (list) - 见 **K8SNodeCondition** 模型定义
|
|
1083
|
+
- **ContainerImages** (list) - 节点上镜像名称数组
|
|
1084
|
+
- **ContainerRuntimeVersion** (str) - 容器运行时版本,如:"docker://18.9.9"
|
|
1085
|
+
- **CreationTimestamp** (int) - 时间戳,单位是 秒
|
|
1086
|
+
- **Hostname** (str) - 主机名
|
|
1087
|
+
- **InternalIP** (str) - 内部 IP 地址
|
|
1088
|
+
- **KernelVersion** (str) - 内核版本,如:"4.19.0-6.el7.ucloud.x86_64"
|
|
1089
|
+
- **KubeProxyVersion** (str) - kubeproxy 版本
|
|
1090
|
+
- **KubeletVersion** (str) - kubelet 版本
|
|
1091
|
+
- **Labels** (list) - 字符串数组,每一项是类似 "kubernetes.io/arch=amd64" 的标签
|
|
1092
|
+
- **MemoryCapacity** (str) - 节点内存总量
|
|
1093
|
+
- **MemoryLimits** (str) - 节点上已分配 Pod 的内存限制量
|
|
1094
|
+
- **MemoryLimitsFraction** (str) - 节点上已分配 Pod 的内存限制量占内存总量的比例,如返回值为 "18",则意味着限制量占总量的 18%
|
|
1095
|
+
- **MemoryRequests** (str) - 节点上已分配 Pod 的内存请求量
|
|
1096
|
+
- **MemoryRequestsFraction** (str) - 节点上已分配 Pod 的内存请求量占内存总量的比例,如返回值为 "4.5",则意味着请求量占总量的 4.5%
|
|
1097
|
+
- **Message** (str) - 操作出错时的提示信息
|
|
1098
|
+
- **Name** (str) - 节点名称
|
|
1099
|
+
- **OSImage** (str) - 操作系统类型,如:"CentOS Linux 7 (Core)"
|
|
1100
|
+
- **PodCapacity** (int) - 节点允许的可分配 Pod 最大数量
|
|
1101
|
+
- **ProviderID** (str) - 字符串,如:"UCloud://cn-sh2-02//uk8s-vsc0vgob-n-mpzxc"
|
|
1102
|
+
- **RetCode** (int) - 返回码
|
|
1103
|
+
- **Taints** (list) - 字符串数组,每一项是类似 "node-role.kubernetes.io/master:NoSchedule" 的污点
|
|
1104
|
+
- **Unschedulable** (bool) - 是否禁止调度
|
|
1105
|
+
|
|
1106
|
+
**Response Model**
|
|
1107
|
+
|
|
1108
|
+
**K8SNodeCondition**
|
|
1109
|
+
- **LastProbeTime** (str) - 最后一次上报状态的时间
|
|
1110
|
+
- **LastTransitionTime** (str) - 最后一次状态转变时间
|
|
1111
|
+
- **Message** (str) - 状态变化的描述信息
|
|
1112
|
+
- **Reason** (str) - 状态变化的原因
|
|
1113
|
+
- **Status** (str) - 状态,False、True
|
|
1114
|
+
- **Type** (str) - Condition 类型,如 MemoryPressure、DiskPressure、PIDPressure、Ready
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
"""
|
|
1118
|
+
# build request
|
|
1119
|
+
d = {
|
|
1120
|
+
"ProjectId": self.config.project_id,
|
|
1121
|
+
"Region": self.config.region,
|
|
1122
|
+
}
|
|
1123
|
+
req and d.update(req)
|
|
1124
|
+
d = apis.DescribeUK8SNodeRequestSchema().dumps(d)
|
|
1125
|
+
|
|
1126
|
+
resp = self.invoke("DescribeUK8SNode", d, **kwargs)
|
|
1127
|
+
return apis.DescribeUK8SNodeResponseSchema().loads(resp)
|
|
1128
|
+
|
|
1129
|
+
def enable_uk8s_autoscaler(
|
|
1130
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1131
|
+
) -> dict:
|
|
1132
|
+
"""EnableUK8SAutoscaler - 开启/关闭伸缩器
|
|
1133
|
+
|
|
1134
|
+
**Request**
|
|
1135
|
+
|
|
1136
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1137
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1138
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
1139
|
+
- **Enabled** (int) - (Required) 1开启;0关闭
|
|
1140
|
+
|
|
1141
|
+
**Response**
|
|
1142
|
+
|
|
1143
|
+
|
|
1144
|
+
"""
|
|
1145
|
+
# build request
|
|
1146
|
+
d = {
|
|
1147
|
+
"ProjectId": self.config.project_id,
|
|
1148
|
+
"Region": self.config.region,
|
|
1149
|
+
}
|
|
1150
|
+
req and d.update(req)
|
|
1151
|
+
d = apis.EnableUK8SAutoscalerRequestSchema().dumps(d)
|
|
1152
|
+
|
|
1153
|
+
resp = self.invoke("EnableUK8SAutoscaler", d, **kwargs)
|
|
1154
|
+
return apis.EnableUK8SAutoscalerResponseSchema().loads(resp)
|
|
1155
|
+
|
|
1156
|
+
def get_cluster_config(
|
|
1157
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1158
|
+
) -> dict:
|
|
1159
|
+
"""GetClusterConfig - 获取集群配置文件,管理集群的凭证
|
|
1160
|
+
|
|
1161
|
+
**Request**
|
|
1162
|
+
|
|
1163
|
+
- **ProjectId** (str) - (Config) 所在项目
|
|
1164
|
+
- **Region** (str) - (Config) 所在区域
|
|
1165
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
1166
|
+
|
|
1167
|
+
**Response**
|
|
1168
|
+
|
|
1169
|
+
- **ExternalKubeConfig** (str) - 开启公网apiserver的情况下,有数据返回。
|
|
1170
|
+
- **KubeConfig** (str) - 配置信息
|
|
1171
|
+
- **Updatable** (bool) - 用于标示 kubeconfig 是否可以进行替换更新
|
|
1172
|
+
|
|
1173
|
+
"""
|
|
1174
|
+
# build request
|
|
1175
|
+
d = {
|
|
1176
|
+
"ProjectId": self.config.project_id,
|
|
1177
|
+
"Region": self.config.region,
|
|
1178
|
+
}
|
|
1179
|
+
req and d.update(req)
|
|
1180
|
+
d = apis.GetClusterConfigRequestSchema().dumps(d)
|
|
1181
|
+
|
|
1182
|
+
resp = self.invoke("GetClusterConfig", d, **kwargs)
|
|
1183
|
+
return apis.GetClusterConfigResponseSchema().loads(resp)
|
|
1184
|
+
|
|
1185
|
+
def get_uk8s_available_instance_types(
|
|
1186
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1187
|
+
) -> dict:
|
|
1188
|
+
"""GetUK8SAvailableInstanceTypes - 获取uk8s节点可用机型
|
|
1189
|
+
|
|
1190
|
+
**Request**
|
|
1191
|
+
|
|
1192
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1193
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1194
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1195
|
+
|
|
1196
|
+
**Response**
|
|
1197
|
+
|
|
1198
|
+
- **AvailableInstanceTypes** (list) - 见 **UK8SAvailableInstanceType** 模型定义
|
|
1199
|
+
- **Status** (str) - 当前区域是否可售
|
|
1200
|
+
|
|
1201
|
+
**Response Model**
|
|
1202
|
+
|
|
1203
|
+
**InstanceTypeBootDisk**
|
|
1204
|
+
- **Features** (list) - 磁盘特性列表
|
|
1205
|
+
- **InstantResize** (bool) - 是否支持即时扩容
|
|
1206
|
+
- **MaximalSize** (int) - 最大磁盘容量
|
|
1207
|
+
- **Name** (str) - 系统盘类型名称
|
|
1208
|
+
|
|
1209
|
+
|
|
1210
|
+
**InstanceTypeDataDisk**
|
|
1211
|
+
- **Features** (list) - 磁盘特性列表
|
|
1212
|
+
- **MaximalSize** (int) - 最大磁盘容量
|
|
1213
|
+
- **MinimalSize** (int) - 最小磁盘容量
|
|
1214
|
+
- **Name** (str) - 数据盘类型名称
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
**InstanceTypeFeatureMode**
|
|
1218
|
+
- **MinimalCpuPlatform** (list) - 最低 CPU 平台列表
|
|
1219
|
+
- **Name** (str) - 模式名称
|
|
1220
|
+
- **RelatedToImageFeature** (list) - 关联的镜像特性
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
**InstanceTypeValueRate**
|
|
1224
|
+
- **Rate** (int) - 评分
|
|
1225
|
+
- **Value** (float) - 数值
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
**InstanceTypeCpuPlatform**
|
|
1229
|
+
- **CpuFrequency** (str) - CPU 频率
|
|
1230
|
+
- **CpuModels** (list) - CPU 型号列表
|
|
1231
|
+
- **Name** (str) - CPU 平台名称
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
**InstanceTypeUHostFamily**
|
|
1235
|
+
- **CpuFrequency** (str) - CPU 频率
|
|
1236
|
+
- **CpuPlatforms** (list) - 见 **InstanceTypeCpuPlatform** 模型定义
|
|
1237
|
+
- **Name** (str) - 规格族名称
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
**InstanceTypeDisk**
|
|
1241
|
+
- **BootDisk** (list) - 见 **InstanceTypeBootDisk** 模型定义
|
|
1242
|
+
- **DataDisk** (list) - 见 **InstanceTypeDataDisk** 模型定义
|
|
1243
|
+
- **Name** (str) - 磁盘配置名称
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
**InstanceTypeFeature**
|
|
1247
|
+
- **Modes** (list) - 见 **InstanceTypeFeatureMode** 模型定义
|
|
1248
|
+
- **Name** (str) - 特性名称
|
|
1249
|
+
|
|
1250
|
+
|
|
1251
|
+
**InstanceTypeMachineSizeCollection**
|
|
1252
|
+
- **Cpu** (int) - CPU 核数
|
|
1253
|
+
- **Memory** (list) - 可用内存容量列表
|
|
1254
|
+
- **MinimalCpuPlatform** (list) - 最低 CPU 平台列表
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
**InstanceTypeMachineSize**
|
|
1258
|
+
- **Collection** (list) - 见 **InstanceTypeMachineSizeCollection** 模型定义
|
|
1259
|
+
- **Gpu** (int) - GPU 数量
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
**UK8SAvailableInstanceType**
|
|
1263
|
+
- **Description** (str) - 机型描述
|
|
1264
|
+
- **Disks** (list) - 见 **InstanceTypeDisk** 模型定义
|
|
1265
|
+
- **Features** (list) - 见 **InstanceTypeFeature** 模型定义
|
|
1266
|
+
- **GraphicsMemory** (dict) - 见 **InstanceTypeValueRate** 模型定义
|
|
1267
|
+
- **InstanceType** (str) - 实例类型
|
|
1268
|
+
- **MachineClass** (str) - 机型类别
|
|
1269
|
+
- **MachineSizes** (list) - 见 **InstanceTypeMachineSize** 模型定义
|
|
1270
|
+
- **Name** (str) - 机型名称
|
|
1271
|
+
- **ParentType** (str) - 父机型类型
|
|
1272
|
+
- **Performance** (dict) - 见 **InstanceTypeValueRate** 模型定义
|
|
1273
|
+
- **Status** (str) - 机型状态
|
|
1274
|
+
- **UHostFamilies** (list) - 见 **InstanceTypeUHostFamily** 模型定义
|
|
1275
|
+
- **Zone** (str) - 可用区
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
"""
|
|
1279
|
+
# build request
|
|
1280
|
+
d = {
|
|
1281
|
+
"ProjectId": self.config.project_id,
|
|
1282
|
+
"Region": self.config.region,
|
|
1283
|
+
}
|
|
1284
|
+
req and d.update(req)
|
|
1285
|
+
d = apis.GetUK8SAvailableInstanceTypesRequestSchema().dumps(d)
|
|
1286
|
+
|
|
1287
|
+
resp = self.invoke("GetUK8SAvailableInstanceTypes", d, **kwargs)
|
|
1288
|
+
return apis.GetUK8SAvailableInstanceTypesResponseSchema().loads(resp)
|
|
1289
|
+
|
|
1290
|
+
def get_uk8s_cni_node_info(
|
|
1291
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1292
|
+
) -> dict:
|
|
1293
|
+
"""GetUK8SCNINodeInfo - 获取 UK8S 集群各节点的 CNI 版本、状态及版本同步情况。
|
|
1294
|
+
|
|
1295
|
+
**Request**
|
|
1296
|
+
|
|
1297
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1298
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1299
|
+
- **ClusterId** (str) - (Required) UK8S 集群 ID
|
|
1300
|
+
- **Zone** (str) - 可用区,可选。
|
|
1301
|
+
|
|
1302
|
+
**Response**
|
|
1303
|
+
|
|
1304
|
+
- **AllNodesSynced** (bool) - 是否所有节点实时查询成功且 CNI 版本一致。数据来源为 database 时返回 false。
|
|
1305
|
+
- **DataSource** (str) - 数据来源:database 表示数据库记录,ipamd_http 表示通过 ipamd 实时查询。
|
|
1306
|
+
- **HighestVersion** (str) - 节点中的最高有效 CNI 版本
|
|
1307
|
+
- **NodeInfoSet** (list) - 见 **NodePluginInfo** 模型定义
|
|
1308
|
+
- **Partial** (bool) - 是否存在部分节点实时查询失败
|
|
1309
|
+
|
|
1310
|
+
**Response Model**
|
|
1311
|
+
|
|
1312
|
+
**NodePluginInfo**
|
|
1313
|
+
- **IP** (str) - Node节点IP
|
|
1314
|
+
- **Node** (str) - Node节点名称
|
|
1315
|
+
- **OperationResult** (int) - 上次插件操作结果,0:没有上次操作结果,或当前正在执行升级或查询 1:获取成功 2 获取失败 3 升级成功 4 升级失败
|
|
1316
|
+
- **Status** (int) - 插件工作状态,0:未知,1:正常,2:异常, 3: 升级中
|
|
1317
|
+
- **UpdateTime** (int) - 插件信息更新时间
|
|
1318
|
+
- **Version** (str) - 插件版本
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
"""
|
|
1322
|
+
# build request
|
|
1323
|
+
d = {
|
|
1324
|
+
"ProjectId": self.config.project_id,
|
|
1325
|
+
"Region": self.config.region,
|
|
1326
|
+
}
|
|
1327
|
+
req and d.update(req)
|
|
1328
|
+
d = apis.GetUK8SCNINodeInfoRequestSchema().dumps(d)
|
|
1329
|
+
|
|
1330
|
+
resp = self.invoke("GetUK8SCNINodeInfo", d, **kwargs)
|
|
1331
|
+
return apis.GetUK8SCNINodeInfoResponseSchema().loads(resp)
|
|
1332
|
+
|
|
1333
|
+
def get_uk8s_ipamd_status(
|
|
1334
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1335
|
+
) -> dict:
|
|
1336
|
+
"""GetUK8SIpamdStatus - 查询 ipamd 插件的安装状态、版本、CNI 初始化模式及模式切换能力。
|
|
1337
|
+
|
|
1338
|
+
**Request**
|
|
1339
|
+
|
|
1340
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1341
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1342
|
+
- **ClusterId** (str) - (Required) 集群id
|
|
1343
|
+
- **Zone** (str) - 可用区,可选。
|
|
1344
|
+
|
|
1345
|
+
**Response**
|
|
1346
|
+
|
|
1347
|
+
- **CNIInitMode** (str) - 当前 CNI 初始化模式。
|
|
1348
|
+
- **CNIInitVersionReady** (bool) - 当前已安装的 ipamd 版本是否支持切换 CNI 初始化模式。
|
|
1349
|
+
- **Installed** (bool) - 是否已经安装
|
|
1350
|
+
- **LastVersion** (str) - ipamd可用最新版本
|
|
1351
|
+
- **OpenTime** (int) - 当前 ipamd 插件的创建时间,Unix 时间戳,单位秒。
|
|
1352
|
+
- **ReleaseDate** (int) - 最新版本的发布日期
|
|
1353
|
+
- **Version** (str) - 当前ipamd的版本
|
|
1354
|
+
|
|
1355
|
+
"""
|
|
1356
|
+
# build request
|
|
1357
|
+
d = {
|
|
1358
|
+
"ProjectId": self.config.project_id,
|
|
1359
|
+
"Region": self.config.region,
|
|
1360
|
+
}
|
|
1361
|
+
req and d.update(req)
|
|
1362
|
+
d = apis.GetUK8SIpamdStatusRequestSchema().dumps(d)
|
|
1363
|
+
|
|
1364
|
+
resp = self.invoke("GetUK8SIpamdStatus", d, **kwargs)
|
|
1365
|
+
return apis.GetUK8SIpamdStatusResponseSchema().loads(resp)
|
|
1366
|
+
|
|
1367
|
+
def get_uk8s_load_balancer_controller(
|
|
1368
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1369
|
+
) -> dict:
|
|
1370
|
+
"""GetUK8SLoadBalancerController - 获取 uk8s LoadBalancerController 信息
|
|
1371
|
+
|
|
1372
|
+
**Request**
|
|
1373
|
+
|
|
1374
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1375
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1376
|
+
- **ClusterId** (str) - (Required) 集群 id
|
|
1377
|
+
- **Zone** (str) - 可用区,可选。
|
|
1378
|
+
|
|
1379
|
+
**Response**
|
|
1380
|
+
|
|
1381
|
+
- **CreateTime** (int) - 安装时间,Unix 时间戳,单位秒。
|
|
1382
|
+
- **Installed** (bool) - 是否安装
|
|
1383
|
+
- **LastVersion** (str) - 最新可用版本。
|
|
1384
|
+
- **Status** (str) - 运行状态:unknown、running、notReady。
|
|
1385
|
+
- **Version** (str) - 当前安装版本。
|
|
1386
|
+
|
|
1387
|
+
"""
|
|
1388
|
+
# build request
|
|
1389
|
+
d = {
|
|
1390
|
+
"ProjectId": self.config.project_id,
|
|
1391
|
+
"Region": self.config.region,
|
|
1392
|
+
}
|
|
1393
|
+
req and d.update(req)
|
|
1394
|
+
d = apis.GetUK8SLoadBalancerControllerRequestSchema().dumps(d)
|
|
1395
|
+
|
|
1396
|
+
resp = self.invoke("GetUK8SLoadBalancerController", d, **kwargs)
|
|
1397
|
+
return apis.GetUK8SLoadBalancerControllerResponseSchema().loads(resp)
|
|
1398
|
+
|
|
1399
|
+
def get_uk8s_node_group(
|
|
1400
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
1401
|
+
) -> dict:
|
|
1402
|
+
"""GetUK8SNodeGroup - 列出某个UK8S节点池
|
|
1403
|
+
|
|
1404
|
+
**Request**
|
|
1405
|
+
|
|
1406
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
1407
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1408
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
1409
|
+
- **NodeGroupId** (str) - (Required) 节点池Id
|
|
1410
|
+
|
|
1411
|
+
**Response**
|
|
1412
|
+
|
|
1413
|
+
- **NodeGroup** (dict) - 见 **NodeGroupSet** 模型定义
|
|
1414
|
+
|
|
1415
|
+
**Response Model**
|
|
1416
|
+
|
|
1417
|
+
**EvictionCondition**
|
|
1418
|
+
- **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。
|
|
1419
|
+
- **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。
|
|
1420
|
+
- **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。
|
|
1421
|
+
- **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
**ReservedResource**
|
|
1425
|
+
- **CPU** (str) - CPU
|
|
1426
|
+
- **EphemeralStorage** (str) - 存储
|
|
1427
|
+
- **Memory** (str) - 内存
|
|
1428
|
+
- **Pid** (str) - Pid
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
**EIP**
|
|
1432
|
+
- **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
|
|
1433
|
+
- **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
|
|
1434
|
+
- **OperatorName** (str) - 【若绑定EIP,此参数必填】弹性IP的线路。枚举值: 国际: International,BGP: Bgp。 各地域允许的线路参数如下: cn-sh1: Bgp cn-sh2: Bgp cn-gd: Bgp cn-bj1: Bgp cn-bj2: Bgp hk: International us-ca: International th-bkk: International kr-seoul:International us-ws:International ge-fra:International sg:International tw-kh:International.其他海外线路均为 International
|
|
1435
|
+
- **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth"
|
|
1436
|
+
- **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
**NetworkInterface**
|
|
1440
|
+
- **EIP** (dict) - 见 **EIP** 模型定义
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
**NodeGroupDiskConfig**
|
|
1444
|
+
- **IsBoot** (bool) - 是否为系统盘
|
|
1445
|
+
- **KmsKeyId** (str) - 磁盘加密密钥 ID
|
|
1446
|
+
- **Size** (int) - 磁盘大小,单位 GB
|
|
1447
|
+
- **Type** (str) - 磁盘类型
|
|
1448
|
+
|
|
1449
|
+
|
|
1450
|
+
**KubeletConfiguration**
|
|
1451
|
+
- **ContainerLogMaxFiles** (int) - 最大日志文件数量
|
|
1452
|
+
- **ContainerLogMaxSize** (str) - 最大日志文件大小
|
|
1453
|
+
- **EvictionHard** (dict) - 见 **EvictionCondition** 模型定义
|
|
1454
|
+
- **EvictionSoft** (dict) - 见 **EvictionCondition** 模型定义
|
|
1455
|
+
- **EvictionSoftGracePeriod** (dict) - 见 **EvictionCondition** 模型定义
|
|
1456
|
+
- **ImageGCHighThresholdPercent** (int) - 镜像垃圾收集阈值
|
|
1457
|
+
- **ImageGCLowThresholdPercent** (int) - 停止镜像垃圾收集阈值
|
|
1458
|
+
- **KubeReserved** (dict) - 见 **ReservedResource** 模型定义
|
|
1459
|
+
- **MaxPods** (int) - 最大Pod数量
|
|
1460
|
+
- **SystemReserved** (dict) - 见 **ReservedResource** 模型定义
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
**SecGroupId**
|
|
1464
|
+
- **Id** (str) - 安全组 ID
|
|
1465
|
+
- **Name** (str) - 安全组名称
|
|
1466
|
+
- **Priority** (str) - 安全组优先级
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
**NodeGroupSet**
|
|
1470
|
+
- **BootDiskSize** (int) - 系统盘大小
|
|
1471
|
+
- **BootDiskType** (str) - 系统盘类型
|
|
1472
|
+
- **CPU** (int) - 虚拟CPU核数
|
|
1473
|
+
- **ChargeType** (str) - 付费方式
|
|
1474
|
+
- **CreateTime** (int) - 节点池创建时间
|
|
1475
|
+
- **DataDiskKmsKeyId** (str) - 数据盘加密密钥 ID
|
|
1476
|
+
- **DataDiskSize** (int) - 数据盘大小
|
|
1477
|
+
- **DataDiskType** (str) - 数据盘类型
|
|
1478
|
+
- **Disks** (list) - 见 **NodeGroupDiskConfig** 模型定义
|
|
1479
|
+
- **GPU** (int) - GPU卡核心数
|
|
1480
|
+
- **GpuType** (str) - GPU类型
|
|
1481
|
+
- **ImageId** (str) - 镜像ID
|
|
1482
|
+
- **ImageName** (str) - 镜像名称
|
|
1483
|
+
- **ImageStatus** (str) - 镜像状态:Unknown、Normal、Deleted、NotLatest
|
|
1484
|
+
- **ImageType** (str) - 镜像类型
|
|
1485
|
+
- **InitScript** (str) - 用户自定义Shell脚本。与UserData的区别在于InitScript在节点初始化完毕后才执行,UserData则是云主机初始化时执行。
|
|
1486
|
+
- **IsolationGroupId** (str) - 硬件隔离组id。可通过DescribeIsolationGroup获取。
|
|
1487
|
+
- **KubeletConfiguration** (dict) - 见 **KubeletConfiguration** 模型定义
|
|
1488
|
+
- **Labels** (str) - Node节点标签。key=value形式,多组用”,“隔开,最多5组。 如env=pro,type=game
|
|
1489
|
+
- **MachineType** (str) - 机型
|
|
1490
|
+
- **MaxPods** (int) - int默认110,生产环境建议小于等于110。
|
|
1491
|
+
- **Mem** (int) - 内存大小
|
|
1492
|
+
- **MinimalCpuPlatform** (str) - cpu平台
|
|
1493
|
+
- **NetCapability** (str) - 网络配置
|
|
1494
|
+
- **NetworkInterface** (list) - 见 **NetworkInterface** 模型定义
|
|
1495
|
+
- **NodeGroupId** (str) - 节点池ID
|
|
1496
|
+
- **NodeGroupName** (str) - 节点池名字
|
|
1497
|
+
- **NodeList** (list) - 节点id列表
|
|
1498
|
+
- **NodeNamePrefix** (str) - 自定义Uhost主机名前缀。完整的自定义Uhost主机名为{NodeNamePrefix}-{NodeIP}。
|
|
1499
|
+
- **OsName** (str) - 操作系统名称
|
|
1500
|
+
- **OsType** (str) - 操作系统类型
|
|
1501
|
+
- **RelatedAsg** (list) - 节点池关联的弹性伸缩组ID
|
|
1502
|
+
- **SecGroupId** (list) - 见 **SecGroupId** 模型定义
|
|
1503
|
+
- **SecurityGroupId** (str) - 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 `DescribeFirewall <https://docs.ucloud.cn/api/uk8s-api/api/unet-api/describe_firewall.html>`_ 。
|
|
1504
|
+
- **SecurityMode** (str) - 主机安全模式。Firewall:防火墙;SecGroup:安全组;默认值:Firewall。
|
|
1505
|
+
- **SubnetId** (str) - 子网 ID。默认为集群创建时填写的子网ID,也可以填写集群同VPC内的子网ID。
|
|
1506
|
+
- **Tag** (str) - 业务组
|
|
1507
|
+
- **Taints** (str) - Node节点污点,形式为key=value:effect,多组taints用”,“隔开,最多支持五组。
|
|
1508
|
+
- **UHostFamily** (str) - 主机规格族
|
|
1509
|
+
- **UNIFeature** (bool) - 是否启用 UNI 网络特性
|
|
1510
|
+
- **UpdateTime** (int) - 节点池更新时间
|
|
1511
|
+
- **UserData** (str) - 用户自定义数据。当镜像支持Cloud-init Feature时可填写此字段。注意:1、总数据量大小不超过 16K;2、使用base64编码。
|
|
1512
|
+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
"""
|
|
1516
|
+
# build request
|
|
1517
|
+
d = {
|
|
1518
|
+
"ProjectId": self.config.project_id,
|
|
1519
|
+
"Region": self.config.region,
|
|
1520
|
+
}
|
|
1521
|
+
req and d.update(req)
|
|
1522
|
+
d = apis.GetUK8SNodeGroupRequestSchema().dumps(d)
|
|
832
1523
|
|
|
833
|
-
resp = self.invoke("
|
|
834
|
-
return apis.
|
|
1524
|
+
resp = self.invoke("GetUK8SNodeGroup", d, **kwargs)
|
|
1525
|
+
return apis.GetUK8SNodeGroupResponseSchema().loads(resp)
|
|
835
1526
|
|
|
836
|
-
def
|
|
1527
|
+
def get_uk8s_plugin_info(
|
|
837
1528
|
self, req: typing.Optional[dict] = None, **kwargs
|
|
838
1529
|
) -> dict:
|
|
839
|
-
"""
|
|
1530
|
+
"""GetUK8SPluginInfo - 查询集群插件信息
|
|
840
1531
|
|
|
841
1532
|
**Request**
|
|
842
1533
|
|
|
843
1534
|
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
844
1535
|
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
845
|
-
- **ClusterId** (str) - (Required)
|
|
846
|
-
- **Name** (str) - (Required) K8S 节点IP或者节点ID
|
|
1536
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
847
1537
|
|
|
848
1538
|
**Response**
|
|
849
1539
|
|
|
850
|
-
- **
|
|
851
|
-
- **
|
|
852
|
-
- **
|
|
853
|
-
- **
|
|
854
|
-
- **
|
|
855
|
-
- **
|
|
856
|
-
- **
|
|
857
|
-
- **
|
|
858
|
-
- **
|
|
859
|
-
- **
|
|
860
|
-
- **ContainerRuntimeVersion** (str) - 容器运行时版本,如:"docker://18.9.9"
|
|
861
|
-
- **CreationTimestamp** (int) - 时间戳,单位是 秒
|
|
862
|
-
- **Hostname** (str) - 主机名
|
|
863
|
-
- **InternalIP** (str) - 内部 IP 地址
|
|
864
|
-
- **KernelVersion** (str) - 内核版本,如:"4.19.0-6.el7.ucloud.x86_64"
|
|
865
|
-
- **KubeProxyVersion** (str) - kubeproxy 版本
|
|
866
|
-
- **KubeletVersion** (str) - kubelet 版本
|
|
867
|
-
- **Labels** (list) - 字符串数组,每一项是类似 "kubernetes.io/arch=amd64" 的标签
|
|
868
|
-
- **MemoryCapacity** (str) - 节点内存总量
|
|
869
|
-
- **MemoryLimits** (str) - 节点上已分配 Pod 的内存限制量
|
|
870
|
-
- **MemoryLimitsFraction** (str) - 节点上已分配 Pod 的内存限制量占内存总量的比例,如返回值为 "18",则意味着限制量占总量的 18%
|
|
871
|
-
- **MemoryRequests** (str) - 节点上已分配 Pod 的内存请求量
|
|
872
|
-
- **MemoryRequestsFraction** (str) - 节点上已分配 Pod 的内存请求量占内存总量的比例,如返回值为 "4.5",则意味着请求量占总量的 4.5%
|
|
873
|
-
- **Message** (str) - 操作出错时的提示信息
|
|
874
|
-
- **Name** (str) - 节点名称
|
|
875
|
-
- **OSImage** (str) - 操作系统类型,如:"CentOS Linux 7 (Core)"
|
|
876
|
-
- **PodCapacity** (int) - 节点允许的可分配 Pod 最大数量
|
|
877
|
-
- **ProviderID** (str) - 字符串,如:"UCloud://cn-sh2-02//uk8s-vsc0vgob-n-mpzxc"
|
|
878
|
-
- **RetCode** (int) - 返回码
|
|
879
|
-
- **Taints** (list) - 字符串数组,每一项是类似 "node-role.kubernetes.io/master:NoSchedule" 的污点
|
|
880
|
-
- **Unschedulable** (bool) - 是否禁止调度
|
|
1540
|
+
- **CNIInfoSet** (dict) - 见 **NodePlugin** 模型定义
|
|
1541
|
+
- **CSIInfo** (dict) - 见 **CSIInfo** 模型定义
|
|
1542
|
+
- **CloudProviderInfo** (dict) - 见 **CloudProviderInfo** 模型定义
|
|
1543
|
+
- **ClusterId** (str) - 集群ID
|
|
1544
|
+
- **ClusterStatus** (str) - 集群状态信息
|
|
1545
|
+
- **ClusterUpgradeInfo** (dict) - 见 **ClusterUpgradeInfo** 模型定义
|
|
1546
|
+
- **Message** (str) - 错误描述信息
|
|
1547
|
+
- **MonitorInfo** (dict) - 见 **MonitorInfo** 模型定义
|
|
1548
|
+
- **RuntimeConvertInfo** (dict) - 见 **RuntimeConvertInfo** 模型定义
|
|
1549
|
+
- **VKInfo** (dict) - 见 **VKNode** 模型定义
|
|
881
1550
|
|
|
882
1551
|
**Response Model**
|
|
883
1552
|
|
|
884
|
-
**
|
|
885
|
-
- **
|
|
886
|
-
- **
|
|
887
|
-
- **
|
|
888
|
-
- **
|
|
889
|
-
- **Status** (
|
|
890
|
-
- **
|
|
1553
|
+
**ClusterUpdateNodeInfo**
|
|
1554
|
+
- **IP** (str) - Node节点IP
|
|
1555
|
+
- **Node** (str) - Node节点名称
|
|
1556
|
+
- **OperationResult** (int) - 上次插件操作结果,0:没有上次操作结果,或当前正在执行升级或查询 1:获取成功 2 获取失败 3 升级成功 4 升级失败
|
|
1557
|
+
- **Role** (str) - 节点角色, master 或者 node
|
|
1558
|
+
- **Status** (int) - 插件工作状态,0:未知,1:正常,2:异常, 3: 升级中
|
|
1559
|
+
- **UpdateTime** (int) - 插件信息更新时间
|
|
1560
|
+
- **Version** (str) - 插件版本
|
|
891
1561
|
|
|
892
1562
|
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
d = apis.DescribeUK8SNodeRequestSchema().dumps(d)
|
|
1563
|
+
**ClusterUpgradeInfo**
|
|
1564
|
+
- **AvailableVersions** (list) - string 数组,可用新版本,例如 ["1.15.12","1.16.15","1.17.4","1.18.9"]
|
|
1565
|
+
- **NodeInfoSet** (list) - 见 **ClusterUpdateNodeInfo** 模型定义
|
|
1566
|
+
- **Stage** (str) - string,集群升级所处阶段 Unknown、Precheck、MasterUpdating、NodeUpdating、Failed、Success集群从未进行过升级则返回 Unknown集群开始升级过程几个阶段 Precheck->MasterUpdating->NodeUpdating→Success如果升级失败则为 Failed
|
|
1567
|
+
- **TargetVersion** (str) - string,集群升级目标版本
|
|
1568
|
+
- **UpdateTime** (int) - 集群信息更新时间戳,单位 s
|
|
1569
|
+
- **Version** (str) - string, 集群当前版本
|
|
901
1570
|
|
|
902
|
-
resp = self.invoke("DescribeUK8SNode", d, **kwargs)
|
|
903
|
-
return apis.DescribeUK8SNodeResponseSchema().loads(resp)
|
|
904
1571
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1572
|
+
**VKNodeInfo**
|
|
1573
|
+
- **Node** (str) - 节点 ID。
|
|
1574
|
+
- **OperationResult** (int) - 上次插件操作结果:0 无结果,1 查询成功,2 查询失败,3 升级成功,4 升级失败。
|
|
1575
|
+
- **Status** (int) - 插件状态:0 未知,1 正常,2 异常,3 升级中。
|
|
1576
|
+
- **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。
|
|
1577
|
+
- **Version** (str) - 插件版本。
|
|
909
1578
|
|
|
910
|
-
**Request**
|
|
911
1579
|
|
|
912
|
-
|
|
913
|
-
- **
|
|
914
|
-
- **
|
|
1580
|
+
**VKNode**
|
|
1581
|
+
- **AvailableVersion** (str) - 最新版本
|
|
1582
|
+
- **ManageEnabled** (bool) - 插件管理是否开启
|
|
1583
|
+
- **Name** (str) - 插件名称
|
|
1584
|
+
- **PluginInfoSet** (list) - 见 **VKNodeInfo** 模型定义
|
|
1585
|
+
- **ReleaseTime** (str) - 发布时间
|
|
915
1586
|
|
|
916
|
-
**Response**
|
|
917
1587
|
|
|
918
|
-
|
|
919
|
-
- **
|
|
920
|
-
|
|
1588
|
+
**MonitorInfo**
|
|
1589
|
+
- **AvailableVersion** (str) - 最新可用监控插件版本。
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
**CSIInfo**
|
|
1593
|
+
- **AvailableVersion** (str) - 最新可用插件版本。
|
|
1594
|
+
- **ManageEnabled** (bool) - 是否开启插件托管。
|
|
1595
|
+
- **Name** (str) - 插件名称。
|
|
1596
|
+
- **OperationResult** (int) - 上次插件操作结果。
|
|
1597
|
+
- **ReleaseTime** (str) - 最新可用版本的发布时间。
|
|
1598
|
+
- **Status** (int) - 插件状态。
|
|
1599
|
+
- **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。
|
|
1600
|
+
- **Version** (str) - 当前插件版本。
|
|
1601
|
+
|
|
1602
|
+
|
|
1603
|
+
**CloudProviderInfo**
|
|
1604
|
+
- **AvailableVersion** (str) - 最新可用插件版本。
|
|
1605
|
+
- **ManageEnabled** (bool) - 是否开启插件托管。
|
|
1606
|
+
- **Name** (str) - 插件名称。
|
|
1607
|
+
- **OperationResult** (int) - 上次插件操作结果。
|
|
1608
|
+
- **ReleaseTime** (str) - 最新可用版本的发布时间。
|
|
1609
|
+
- **Status** (int) - 插件状态。
|
|
1610
|
+
- **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。
|
|
1611
|
+
- **Version** (str) - 当前插件版本。
|
|
1612
|
+
|
|
1613
|
+
|
|
1614
|
+
**NodePluginInfo**
|
|
1615
|
+
- **IP** (str) - Node节点IP
|
|
1616
|
+
- **Node** (str) - Node节点名称
|
|
1617
|
+
- **OperationResult** (int) - 上次插件操作结果,0:没有上次操作结果,或当前正在执行升级或查询 1:获取成功 2 获取失败 3 升级成功 4 升级失败
|
|
1618
|
+
- **Status** (int) - 插件工作状态,0:未知,1:正常,2:异常, 3: 升级中
|
|
1619
|
+
- **UpdateTime** (int) - 插件信息更新时间
|
|
1620
|
+
- **Version** (str) - 插件版本
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
**RuntimeConvertInfo**
|
|
1624
|
+
- **NodeInfoSet** (list) - 见 **NodePluginInfo** 模型定义
|
|
1625
|
+
- **RuntimeName** (str) - 容器运行时名称。
|
|
1626
|
+
- **RuntimeVersion** (str) - 容器运行时版本。
|
|
1627
|
+
- **Stage** (str) - 集群从未进行过运行时转换则返回 Unknown集群运行时转换几个阶段 Precheck->Updating→Success如果转换失败则为 Failed
|
|
1628
|
+
- **UpdateTime** (int) - 运行时转换信息更新时间,Unix 时间戳,单位秒。
|
|
1629
|
+
|
|
1630
|
+
|
|
1631
|
+
**NodePlugin**
|
|
1632
|
+
- **AvailableVersion** (str) - 最新插件版本
|
|
1633
|
+
- **ManageEnabled** (bool) - 插件管理是否开启
|
|
1634
|
+
- **Name** (str) - 插件名称, 如 CNI, CSI, Flexv, CloudProvider
|
|
1635
|
+
- **PluginInfoSet** (list) - 见 **NodePluginInfo** 模型定义
|
|
1636
|
+
- **ReleaseTime** (str) - 最新插件发布时间
|
|
1637
|
+
|
|
921
1638
|
|
|
922
1639
|
"""
|
|
923
1640
|
# build request
|
|
@@ -926,10 +1643,10 @@ class UK8SClient(Client):
|
|
|
926
1643
|
"Region": self.config.region,
|
|
927
1644
|
}
|
|
928
1645
|
req and d.update(req)
|
|
929
|
-
d = apis.
|
|
1646
|
+
d = apis.GetUK8SPluginInfoRequestSchema().dumps(d)
|
|
930
1647
|
|
|
931
|
-
resp = self.invoke("
|
|
932
|
-
return apis.
|
|
1648
|
+
resp = self.invoke("GetUK8SPluginInfo", d, **kwargs)
|
|
1649
|
+
return apis.GetUK8SPluginInfoResponseSchema().loads(resp)
|
|
933
1650
|
|
|
934
1651
|
def get_uk8s_versions(
|
|
935
1652
|
self, req: typing.Optional[dict] = None, **kwargs
|
|
@@ -1138,6 +1855,13 @@ class UK8SClient(Client):
|
|
|
1138
1855
|
|
|
1139
1856
|
**Response Model**
|
|
1140
1857
|
|
|
1858
|
+
**ReservedResource**
|
|
1859
|
+
- **CPU** (str) - CPU
|
|
1860
|
+
- **EphemeralStorage** (str) - 存储
|
|
1861
|
+
- **Memory** (str) - 内存
|
|
1862
|
+
- **Pid** (str) - Pid
|
|
1863
|
+
|
|
1864
|
+
|
|
1141
1865
|
**EvictionCondition**
|
|
1142
1866
|
- **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。
|
|
1143
1867
|
- **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。
|
|
@@ -1145,11 +1869,10 @@ class UK8SClient(Client):
|
|
|
1145
1869
|
- **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。
|
|
1146
1870
|
|
|
1147
1871
|
|
|
1148
|
-
**
|
|
1149
|
-
- **
|
|
1150
|
-
- **
|
|
1151
|
-
- **
|
|
1152
|
-
- **Pid** (str) - Pid
|
|
1872
|
+
**SecGroupId**
|
|
1873
|
+
- **Id** (str) - 安全组名称
|
|
1874
|
+
- **Name** (str) - 安全组id
|
|
1875
|
+
- **Priority** (str) - 安全组优先级
|
|
1153
1876
|
|
|
1154
1877
|
|
|
1155
1878
|
**KubeletConfiguration**
|
|
@@ -1165,14 +1888,6 @@ class UK8SClient(Client):
|
|
|
1165
1888
|
- **SystemReserved** (dict) - 见 **ReservedResource** 模型定义
|
|
1166
1889
|
|
|
1167
1890
|
|
|
1168
|
-
**EIP**
|
|
1169
|
-
- **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
|
|
1170
|
-
- **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
|
|
1171
|
-
- **OperatorName** (str) - 【若绑定EIP,此参数必填】弹性IP的线路。枚举值: 国际: International,BGP: Bgp。 各地域允许的线路参数如下: cn-sh1: Bgp cn-sh2: Bgp cn-gd: Bgp cn-bj1: Bgp cn-bj2: Bgp hk: International us-ca: International th-bkk: International kr-seoul:International us-ws:International ge-fra:International sg:International tw-kh:International.其他海外线路均为 International
|
|
1172
|
-
- **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth"
|
|
1173
|
-
- **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
1891
|
**DiskSet**
|
|
1177
1892
|
- **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。
|
|
1178
1893
|
- **DiskId** (str) - 磁盘长ID
|
|
@@ -1186,14 +1901,16 @@ class UK8SClient(Client):
|
|
|
1186
1901
|
- **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk
|
|
1187
1902
|
|
|
1188
1903
|
|
|
1189
|
-
**
|
|
1190
|
-
- **
|
|
1904
|
+
**EIP**
|
|
1905
|
+
- **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
|
|
1906
|
+
- **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
|
|
1907
|
+
- **OperatorName** (str) - 【若绑定EIP,此参数必填】弹性IP的线路。枚举值: 国际: International,BGP: Bgp。 各地域允许的线路参数如下: cn-sh1: Bgp cn-sh2: Bgp cn-gd: Bgp cn-bj1: Bgp cn-bj2: Bgp hk: International us-ca: International th-bkk: International kr-seoul:International us-ws:International ge-fra:International sg:International tw-kh:International.其他海外线路均为 International
|
|
1908
|
+
- **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth"
|
|
1909
|
+
- **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
|
|
1191
1910
|
|
|
1192
1911
|
|
|
1193
|
-
**
|
|
1194
|
-
- **
|
|
1195
|
-
- **Name** (str) - 安全组id
|
|
1196
|
-
- **Priority** (str) - 安全组优先级
|
|
1912
|
+
**NetworkInterface**
|
|
1913
|
+
- **EIP** (dict) - 见 **EIP** 模型定义
|
|
1197
1914
|
|
|
1198
1915
|
|
|
1199
1916
|
**NodeGroupSet**
|
|
@@ -1271,29 +1988,9 @@ class UK8SClient(Client):
|
|
|
1271
1988
|
|
|
1272
1989
|
**Response Model**
|
|
1273
1990
|
|
|
1274
|
-
**
|
|
1275
|
-
- **
|
|
1276
|
-
- **
|
|
1277
|
-
- **ValueOperator** (str) - 标签值的匹配操作符。可选值: in, notin。
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
**ULSPodLabelsMatch**
|
|
1281
|
-
- **Labels** (list) - 见 **ULSLabels** 模型定义
|
|
1282
|
-
- **Namespace** (str) - 要匹配的命名空间。namespaceOperator 存在时必需。
|
|
1283
|
-
- **NamespaceOperator** (str) - 命名空间名称的匹配操作符。可选值: in, notin。
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
**ULSWorkloadMatch**
|
|
1287
|
-
- **Name** (str) - 工作负载的名称。
|
|
1288
|
-
- **Namespace** (str) - 工作负载所在的命名空间。
|
|
1289
|
-
- **Type** (str) - 工作负载的类型,例如 deployment, statefulset, daemonset,cronjob,job。
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
**ULSMatchRule**
|
|
1293
|
-
- **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔
|
|
1294
|
-
- **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含)
|
|
1295
|
-
- **PodLabels** (dict) - 见 **ULSPodLabelsMatch** 模型定义
|
|
1296
|
-
- **Workloads** (list) - 见 **ULSWorkloadMatch** 模型定义
|
|
1991
|
+
**ULSFilePaths**
|
|
1992
|
+
- **File** (str) - 采集文件
|
|
1993
|
+
- **Path** (str) - 定义采集路径
|
|
1297
1994
|
|
|
1298
1995
|
|
|
1299
1996
|
**ULSInputMetadata**
|
|
@@ -1301,6 +1998,13 @@ class UK8SClient(Client):
|
|
|
1301
1998
|
- **Labels** (str) - 定义要采集哪些 Pod 的标签 (Labels)。可选值:*:采集所有标签。app,version:仅采集 app 和 version 这两个标签。""(空字符串):不采集任何标签。
|
|
1302
1999
|
|
|
1303
2000
|
|
|
2001
|
+
**ULSInputDetail**
|
|
2002
|
+
- **FilePaths** (list) - 见 **ULSFilePaths** 模型定义
|
|
2003
|
+
- **InputMetadata** (dict) - 见 **ULSInputMetadata** 模型定义
|
|
2004
|
+
- **Stream** (str) - 容器标准输出流类型。仅适用于 container_stdout,可选值:all、stdout、stderr,默认为 all。
|
|
2005
|
+
- **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。
|
|
2006
|
+
|
|
2007
|
+
|
|
1304
2008
|
**ULSExtractRule**
|
|
1305
2009
|
- **BeginningRegex** (str) - 行首正则表达式。在 multi_line、multi_line_full_regex 或 multi_line_delimiter 模式下,BeginningRegex 和 BeginningRegexBase64 必须至少填写一个。
|
|
1306
2010
|
- **BeginningRegexBase64** (str) - Base64 编码的行首正则表达式。填写时优先于 BeginningRegex。
|
|
@@ -1318,16 +2022,29 @@ class UK8SClient(Client):
|
|
|
1318
2022
|
- **UnMatchUpload** (str) - 是否上传解析失败的日志。字符串 true 表示上传,false 表示丢弃。默认为 false。
|
|
1319
2023
|
|
|
1320
2024
|
|
|
1321
|
-
**
|
|
1322
|
-
- **
|
|
1323
|
-
- **
|
|
2025
|
+
**ULSWorkloadMatch**
|
|
2026
|
+
- **Name** (str) - 工作负载的名称。
|
|
2027
|
+
- **Namespace** (str) - 工作负载所在的命名空间。
|
|
2028
|
+
- **Type** (str) - 工作负载的类型,例如 deployment, statefulset, daemonset,cronjob,job。
|
|
1324
2029
|
|
|
1325
2030
|
|
|
1326
|
-
**
|
|
1327
|
-
- **
|
|
1328
|
-
- **
|
|
1329
|
-
- **
|
|
1330
|
-
|
|
2031
|
+
**ULSLabels**
|
|
2032
|
+
- **Key** (str) - 要匹配的标签的 Key。
|
|
2033
|
+
- **Value** (str) - 要匹配的标签的值。
|
|
2034
|
+
- **ValueOperator** (str) - 标签值的匹配操作符。可选值: in, notin。
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
**ULSPodLabelsMatch**
|
|
2038
|
+
- **Labels** (list) - 见 **ULSLabels** 模型定义
|
|
2039
|
+
- **Namespace** (str) - 要匹配的命名空间。namespaceOperator 存在时必需。
|
|
2040
|
+
- **NamespaceOperator** (str) - 命名空间名称的匹配操作符。可选值: in, notin。
|
|
2041
|
+
|
|
2042
|
+
|
|
2043
|
+
**ULSMatchRule**
|
|
2044
|
+
- **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔
|
|
2045
|
+
- **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含)
|
|
2046
|
+
- **PodLabels** (dict) - 见 **ULSPodLabelsMatch** 模型定义
|
|
2047
|
+
- **Workloads** (list) - 见 **ULSWorkloadMatch** 模型定义
|
|
1331
2048
|
|
|
1332
2049
|
|
|
1333
2050
|
**ULSLogConfig**
|
|
@@ -1406,6 +2123,69 @@ class UK8SClient(Client):
|
|
|
1406
2123
|
resp = self.invoke("RemoveUK8SNodeGroup", d, **kwargs)
|
|
1407
2124
|
return apis.RemoveUK8SNodeGroupResponseSchema().loads(resp)
|
|
1408
2125
|
|
|
2126
|
+
def update_uk8s_auto_scaling_group_v2(
|
|
2127
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2128
|
+
) -> dict:
|
|
2129
|
+
"""UpdateUK8SAutoScalingGroupV2 - 更新伸缩组的名称、节点数上下限和优先级。节点规格等配置请通过关联节点池修改。
|
|
2130
|
+
|
|
2131
|
+
**Request**
|
|
2132
|
+
|
|
2133
|
+
- **ProjectId** (str) - (Config) 项目ID
|
|
2134
|
+
- **Region** (str) - (Config) 地域
|
|
2135
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
2136
|
+
- **Id** (str) - (Required) 伸缩组ID
|
|
2137
|
+
- **Max** (int) - (Required) 最大节点数,范围 1–100。
|
|
2138
|
+
- **Min** (int) - (Required) 最小节点数,范围 0–100。
|
|
2139
|
+
- **Name** (str) - (Required) 伸缩组名称
|
|
2140
|
+
- **Priority** (int) - 伸缩组优先级,范围 1–100,值越大越优先。省略或传 0 时保持原优先级。
|
|
2141
|
+
- **Zone** (str) - 可用区,可选。此接口按集群和伸缩组 ID 更新配置。
|
|
2142
|
+
|
|
2143
|
+
**Response**
|
|
2144
|
+
|
|
2145
|
+
- **Message** (str) -
|
|
2146
|
+
|
|
2147
|
+
"""
|
|
2148
|
+
# build request
|
|
2149
|
+
d = {
|
|
2150
|
+
"ProjectId": self.config.project_id,
|
|
2151
|
+
"Region": self.config.region,
|
|
2152
|
+
}
|
|
2153
|
+
req and d.update(req)
|
|
2154
|
+
d = apis.UpdateUK8SAutoScalingGroupV2RequestSchema().dumps(d)
|
|
2155
|
+
|
|
2156
|
+
resp = self.invoke("UpdateUK8SAutoScalingGroupV2", d, **kwargs)
|
|
2157
|
+
return apis.UpdateUK8SAutoScalingGroupV2ResponseSchema().loads(resp)
|
|
2158
|
+
|
|
2159
|
+
def update_uk8s_autoscaler(
|
|
2160
|
+
self, req: typing.Optional[dict] = None, **kwargs
|
|
2161
|
+
) -> dict:
|
|
2162
|
+
"""UpdateUK8SAutoscaler - 更新集群级缩容阈值和等待时间。调用前必须关闭 cluster-autoscaler;修改后重新开启,使新配置生效。
|
|
2163
|
+
|
|
2164
|
+
**Request**
|
|
2165
|
+
|
|
2166
|
+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
|
|
2167
|
+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
|
|
2168
|
+
- **ClusterId** (str) - (Required) 集群ID
|
|
2169
|
+
- **ScaleDownDelayAfterAdd** (int) - (Required) 添加节点后等待缩容的时间,单位分钟,范围 1–1440。
|
|
2170
|
+
- **ScaleDownUnneededTime** (int) - (Required) 节点持续不需要后触发缩容的等待时间,单位分钟,范围 1–1440。
|
|
2171
|
+
- **ScaleDownUtilizationThreshold** (int) - (Required) 节点缩容利用率阈值,单位百分比,范围 0–100。例如 50 表示 50%。
|
|
2172
|
+
- **ScaleDownGPUUtilizationThreshold** (int) - GPU 缩容利用率阈值,单位百分比,范围 0–100。省略时使用 ScaleDownUtilizationThreshold。
|
|
2173
|
+
|
|
2174
|
+
**Response**
|
|
2175
|
+
|
|
2176
|
+
|
|
2177
|
+
"""
|
|
2178
|
+
# build request
|
|
2179
|
+
d = {
|
|
2180
|
+
"ProjectId": self.config.project_id,
|
|
2181
|
+
"Region": self.config.region,
|
|
2182
|
+
}
|
|
2183
|
+
req and d.update(req)
|
|
2184
|
+
d = apis.UpdateUK8SAutoscalerRequestSchema().dumps(d)
|
|
2185
|
+
|
|
2186
|
+
resp = self.invoke("UpdateUK8SAutoscaler", d, **kwargs)
|
|
2187
|
+
return apis.UpdateUK8SAutoscalerResponseSchema().loads(resp)
|
|
2188
|
+
|
|
1409
2189
|
def update_uk8s_node_group(
|
|
1410
2190
|
self, req: typing.Optional[dict] = None, **kwargs
|
|
1411
2191
|
) -> dict:
|
|
@@ -1457,10 +2237,6 @@ class UK8SClient(Client):
|
|
|
1457
2237
|
|
|
1458
2238
|
**Request Model**
|
|
1459
2239
|
|
|
1460
|
-
**UpdateUK8SNodeGroupParamKubeletConfiguration**
|
|
1461
|
-
- **ContainerLogMaxFiles** (int) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
2240
|
**UpdateUK8SNodeGroupParamNetworkInterfaceEIP**
|
|
1465
2241
|
- **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
|
|
1466
2242
|
- **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
|
|
@@ -1479,6 +2255,10 @@ class UK8SClient(Client):
|
|
|
1479
2255
|
- **Priority** (str) - 安全组优先级。取值范围[1, 5]
|
|
1480
2256
|
|
|
1481
2257
|
|
|
2258
|
+
**UpdateUK8SNodeGroupParamKubeletConfiguration**
|
|
2259
|
+
- **ContainerLogMaxFiles** (int) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup
|
|
2260
|
+
|
|
2261
|
+
|
|
1482
2262
|
"""
|
|
1483
2263
|
# build request
|
|
1484
2264
|
d = {
|
|
@@ -1532,13 +2312,6 @@ class UK8SClient(Client):
|
|
|
1532
2312
|
- **Type** (str) - 工作负载类型。可选值:deployment、statefulset、daemonset、job、cronjob。
|
|
1533
2313
|
|
|
1534
2314
|
|
|
1535
|
-
**UpdateUK8SULSConfigParamMatchRule**
|
|
1536
|
-
- **Container** (str) - 要匹配的容器名称,*表示所有容器,多个名称使用逗号分隔。
|
|
1537
|
-
- **ContainerOperator** (str) - 容器名称匹配操作符。可选值:in、notin。填写该参数时必须同时填写MatchRule.Container。
|
|
1538
|
-
- **PodLabels** (dict) - 见 **UpdateUK8SULSConfigParamMatchRulePodLabels** 模型定义
|
|
1539
|
-
- **Workloads** (list) - 见 **UpdateUK8SULSConfigParamMatchRuleWorkloads** 模型定义
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
2315
|
**UpdateUK8SULSConfigParamInputDetailFilePaths**
|
|
1543
2316
|
- **File** (str) - 要采集的文件名。仅适用于container_file。
|
|
1544
2317
|
- **Path** (str) - 日志采集路径。仅适用于container_file。
|
|
@@ -1549,11 +2322,11 @@ class UK8SClient(Client):
|
|
|
1549
2322
|
- **Labels** (str) - 要采集的Pod标签。*表示采集所有标签,app,version表示仅采集指定标签,空字符串表示不采集标签。
|
|
1550
2323
|
|
|
1551
2324
|
|
|
1552
|
-
**
|
|
1553
|
-
- **
|
|
1554
|
-
- **
|
|
1555
|
-
- **
|
|
1556
|
-
- **
|
|
2325
|
+
**UpdateUK8SULSConfigParamMatchRule**
|
|
2326
|
+
- **Container** (str) - 要匹配的容器名称,*表示所有容器,多个名称使用逗号分隔。
|
|
2327
|
+
- **ContainerOperator** (str) - 容器名称匹配操作符。可选值:in、notin。填写该参数时必须同时填写MatchRule.Container。
|
|
2328
|
+
- **PodLabels** (dict) - 见 **UpdateUK8SULSConfigParamMatchRulePodLabels** 模型定义
|
|
2329
|
+
- **Workloads** (list) - 见 **UpdateUK8SULSConfigParamMatchRuleWorkloads** 模型定义
|
|
1557
2330
|
|
|
1558
2331
|
|
|
1559
2332
|
**UpdateUK8SULSConfigParamExtractRule**
|
|
@@ -1573,6 +2346,13 @@ class UK8SClient(Client):
|
|
|
1573
2346
|
- **UnMatchUpload** (str) - 是否上传解析失败的日志。字符串true表示上传,false表示丢弃。默认为false。
|
|
1574
2347
|
|
|
1575
2348
|
|
|
2349
|
+
**UpdateUK8SULSConfigParamInputDetail**
|
|
2350
|
+
- **FilePaths** (list) - 见 **UpdateUK8SULSConfigParamInputDetailFilePaths** 模型定义
|
|
2351
|
+
- **Metadata** (dict) - 见 **UpdateUK8SULSConfigParamInputDetailMetadata** 模型定义
|
|
2352
|
+
- **Stream** (str) - 容器标准输出流类型。仅适用于container_stdout,可选值:all、stdout、stderr,默认为all。
|
|
2353
|
+
- **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。
|
|
2354
|
+
|
|
2355
|
+
|
|
1576
2356
|
"""
|
|
1577
2357
|
# build request
|
|
1578
2358
|
d = {
|