From 7bd55ac71adaa204fcd2eb7c5fe8ae5664f1c29c Mon Sep 17 00:00:00 2001 From: ucloud-bot Date: Mon, 28 Sep 2026 10:02:54 +0000 Subject: [PATCH] sdk: rolling update for 0.11.142 --- ucloud/services/uk8s/client.py | 286 +++++++++++----------- ucloud/services/uk8s/schemas/apis.py | 323 ++++++++++++++----------- ucloud/services/uk8s/schemas/models.py | 228 ++++++++--------- ucloud/version.py | 2 +- 4 files changed, 447 insertions(+), 392 deletions(-) diff --git a/ucloud/services/uk8s/client.py b/ucloud/services/uk8s/client.py index 362429d..381fe47 100644 --- a/ucloud/services/uk8s/client.py +++ b/ucloud/services/uk8s/client.py @@ -103,6 +103,12 @@ def add_uk8s_node_group( **Request Model** + **AddUK8SNodeGroupParamSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] + + **AddUK8SNodeGroupParamKubeletConfigurationKubeReserved** - **CPU** (str) - kubelet预留CPU资源,以m结尾。控制台展示为kubeReserved - cpu - **EphemeralStorage** (str) - kubelet预留存储空间,以Gi结尾。控制台展示为kubeReserved - ephemeral-storage @@ -110,6 +116,20 @@ def add_uk8s_node_group( - **Pid** (str) - kubelet预留pid数量,必须大于等于500, string方式提供。控制台展示为kubeReserved - pid + **AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod** + - **ImagefsAvailable** (str) - ImagefsAvailable软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - imagefs.available + - **MemoryAvailable** (str) - MemoryAvailable软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - memory.available + - **NodefsAvailable** (str) - NodefsAvailable软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - nodefs.available + - **NodefsInodesFree** (str) - NodefsInodesFree软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - nodefs.inodesFree + + + **AddUK8SNodeGroupParamKubeletConfigurationEvictionSoft** + - **ImagefsAvailable** (str) - 触发Pod驱逐操作的软性门限之容器镜像剩余空间: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.ImagefsAvailable。控制台展示为evictionSoft - imagefs.available + - **MemoryAvailable** (str) - 触发Pod驱逐操作的软性门限之内存用量: 需以Mi或Gi结尾。配置此值时必须同时配置EvictionSoftGracePeriod.MemoryAvailable。控制台展示为evictionSoft - memory.available + - **NodefsAvailable** (str) - 触发Pod驱逐操作的软性门限之节点存储剩余空间: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.NodefsAvailable。控制台展示为evictionSoft - nodefs.available + - **NodefsInodesFree** (str) - 触发Pod驱逐操作的软性门限节点inode剩余量: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.NodefsInodesFree。控制台展示为evictionSoft - nodefs.inodesFree + + **AddUK8SNodeGroupParamNetworkInterfaceEIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -118,6 +138,10 @@ def add_uk8s_node_group( - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 + **AddUK8SNodeGroupParamNetworkInterface** + - **EIP** (dict) - 见 **AddUK8SNodeGroupParamNetworkInterfaceEIP** 模型定义 + + **AddUK8SNodeGroupParamKubeletConfigurationEvictionHard** - **ImagefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之容器镜像剩余空间: 需以%结尾。控制台展示为evictionHard - imagefs.available - **MemoryAvailable** (str) - 触发Pod驱逐操作的硬性门限之内存用量: 需以Mi或Gi结尾。控制台展示为evictionHard - memory.available @@ -125,20 +149,6 @@ def add_uk8s_node_group( - **NodefsInodesFree** (str) - 触发Pod驱逐操作的硬性门限节点inode剩余量: 需以%结尾。控制台展示为evictionHard - nodefs.inodesFree - **AddUK8SNodeGroupParamKubeletConfigurationEvictionSoft** - - **ImagefsAvailable** (str) - 触发Pod驱逐操作的软性门限之容器镜像剩余空间: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.ImagefsAvailable。控制台展示为evictionSoft - imagefs.available - - **MemoryAvailable** (str) - 触发Pod驱逐操作的软性门限之内存用量: 需以Mi或Gi结尾。配置此值时必须同时配置EvictionSoftGracePeriod.MemoryAvailable。控制台展示为evictionSoft - memory.available - - **NodefsAvailable** (str) - 触发Pod驱逐操作的软性门限之节点存储剩余空间: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.NodefsAvailable。控制台展示为evictionSoft - nodefs.available - - **NodefsInodesFree** (str) - 触发Pod驱逐操作的软性门限节点inode剩余量: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.NodefsInodesFree。控制台展示为evictionSoft - nodefs.inodesFree - - - **AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod** - - **ImagefsAvailable** (str) - ImagefsAvailable软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - imagefs.available - - **MemoryAvailable** (str) - MemoryAvailable软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - memory.available - - **NodefsAvailable** (str) - NodefsAvailable软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - nodefs.available - - **NodefsInodesFree** (str) - NodefsInodesFree软性门限的宽限时间,必须以s结尾。控制台展示为evictionSoftGracePeriod - nodefs.inodesFree - - **AddUK8SNodeGroupParamKubeletConfigurationSystemReserved** - **CPU** (str) - 系统预留CPU资源,以m结尾。控制台展示为systemReserved - cpu - **EphemeralStorage** (str) - 系统预留存储空间,以Gi结尾。控制台展示为systemReserved - ephemeral-storage @@ -159,16 +169,6 @@ def add_uk8s_node_group( - **SystemReserved** (dict) - 见 **AddUK8SNodeGroupParamKubeletConfigurationSystemReserved** 模型定义 - **AddUK8SNodeGroupParamSecGroupId** - - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - - **Name** (str) - 安全组名称。 - - **Priority** (str) - 安全组优先级。取值范围[1, 5] - - - **AddUK8SNodeGroupParamNetworkInterface** - - **EIP** (dict) - 见 **AddUK8SNodeGroupParamNetworkInterfaceEIP** 模型定义 - - """ # build request d = { @@ -282,12 +282,6 @@ def add_uk8s_uhost_node( **Request Model** - **AddUK8SUHostNodeParamSecGroupId** - - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - - **Name** (str) - 安全组名称。 - - **Priority** (str) - 安全组优先级。取值范围[1, 5] - - **AddUK8SUHostNodeParamNetworkInterfaceEIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -296,17 +290,23 @@ def add_uk8s_uhost_node( - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 - **AddUK8SUHostNodeParamNetworkInterface** - - **EIP** (dict) - 见 **AddUK8SUHostNodeParamNetworkInterfaceEIP** 模型定义 + **AddUK8SUHostNodeParamUserLabels** + - **Key** (str) - UK8S用户资源标签的键值 + - **Value** (str) - UK8S用户资源标签的值 **AddUK8SUHostNodeParamKubeletConfiguration** - **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup - **AddUK8SUHostNodeParamUserLabels** - - **Key** (str) - UK8S用户资源标签的键值 - - **Value** (str) - UK8S用户资源标签的值 + **AddUK8SUHostNodeParamSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] + + + **AddUK8SUHostNodeParamNetworkInterface** + - **EIP** (dict) - 见 **AddUK8SUHostNodeParamNetworkInterfaceEIP** 模型定义 """ @@ -334,6 +334,8 @@ def create_uk8s_cluster_v2( - **ProjectId** (str) - (Config) 项目ID。 请参考 `GetProjectList接口 `_ - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ - **ClusterName** (str) - (Required) 集群名称 + - **ImageId** (str) - (Required) Master节点和Node节点的镜像 ID,不填则随机选择可用的基础镜像。支持用户自定义镜像。 + - **K8sVersion** (str) - (Required) k8s集群的版本,版本信息请参考UK8S集群创建页。 - **MasterCPU** (int) - (Required) Master节点的虚拟CPU核数。可选参数:2-64(具体机型与CPU的对应关系参照控制台)。 - **MasterMachineType** (str) - (Required) Master节点的云主机机型(V2.0),如["N", "C", "O", "OS"],具体请参照云主机机型。 - **MasterMem** (int) - (Required) Master节点的内存大小。单位:MB。范围 :[4096, 262144],取值为1024的倍数(可选范围参考控制台)。 @@ -345,24 +347,26 @@ def create_uk8s_cluster_v2( - **ClusterDomain** (str) - 创建集群的时候定义clusterdomain - **ExternalApiServer** (str) - 是否允许外网访问apiserver,开启:Yes 不开启:No。默认为No。 - **ForwardSrcIPMethod** (str) - LbClass为nlb的时候支持的源ip转发模式,目前只支持Toa,为空则不开源ip功能 枚举:"",Toa - - **ImageId** (str) - Master节点和Node节点的镜像 ID,不填则随机选择可用的基础镜像。支持用户自定义镜像。 - **InitScript** (str) - 用户自定义脚本,与UserData不同,自定义脚本将在集群安装完毕后执行。注意:1、总数据量大小不超多16K;2、使用base64编码。 - - **K8sVersion** (str) - k8s集群的版本,版本信息请参考UK8S集群创建页,不指定的话默认为当前支持的最高版本。 + - **KmsPluginKeyId** (str) - 开启 kms 插件的 key id + - **KmsPluginResource** (list) - kms 加密的资源 - **KubeProxy** (dict) - 见 **CreateUK8SClusterV2ParamKubeProxy** 模型定义 - **LbClass** (str) - master lb 类型默认ulb,可选ulb nlb - **Master** (list) - 见 **CreateUK8SClusterV2ParamMaster** 模型定义 - **MasterBootDiskSize** (int) - Master节点系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。 - **MasterBootDiskType** (str) - Master节点系统盘类型。请参考 `磁盘类型 `_ 。默认为SSD云盘 + - **MasterDataDiskKmsKeyId** (str) - master 节点数据盘使用的 kms key id - **MasterDataDiskSize** (int) - Master节点的数据盘大小,单位GB,默认为0。范围 :[20, 1000] - **MasterDataDiskType** (str) - Master节点数据盘类型。请参考 `磁盘类型 `_ 。默认为SSD云盘 - **MasterImageId** (str) - Master节点的镜像 ID,不填则使用ImageId参数。支持用户自定义镜像。 - **MasterIsolationGroup** (str) - 【无效,已删除】当前将自动为Master节点创建隔离组,确保Master节点归属于不同物理机。 - **MasterMinimalCpuPlatform** (str) - Master节点的最低cpu平台,不选则随机。枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake"。 + - **MasterUHostFamily** (str) - Master节点规格族,如o1a, o1i - **Nodes** (list) - 见 **CreateUK8SClusterV2ParamNodes** 模型定义 - **Quantity** (int) - 购买时长。默认为1。按小时购买(Dynamic)时无需此参数。 月付时,此参数传0,代表了购买至月末。 - **Tag** (str) - 业务组 - **UserData** (str) - 用户自定义数据。注意:1、总数据量大小不超多16K;2、使用base64编码。 - - **UserLabels** (str) - UK8S用户标签,key=value形式,多组用”,“隔开,最多5组。 如env=pro,type=game + - **UserLabels** (list) - 见 **CreateUK8SClusterV2ParamUserLabels** 模型定义 **Response** @@ -370,7 +374,16 @@ def create_uk8s_cluster_v2( **Request Model** - **CreateUK8SClusterV2ParamNodesSecGroupId** + **CreateUK8SClusterV2ParamUserLabels** + - **Key** (str) - UK8S用户资源标签的键值 + - **Value** (str) - UK8S用户资源标签的值 + + + **CreateUK8SClusterV2ParamKubeProxy** + - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 + + + **CreateUK8SClusterV2ParamMasterSecGroupId** - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - **Name** (str) - 安全组名称。 - **Priority** (str) - 安全组优先级。取值范围[1, 5] @@ -379,15 +392,13 @@ def create_uk8s_cluster_v2( **CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 - - **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 + - **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 - **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth" - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 - **CreateUK8SClusterV2ParamMasterSecGroupId** - - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - - **Name** (str) - 安全组名称。 - - **Priority** (str) - 安全组优先级。取值范围[1, 5] + **CreateUK8SClusterV2ParamNodesNetworkInterface** + - **EIP** (dict) - 见 **CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP** 模型定义 **CreateUK8SClusterV2ParamMaster** @@ -395,25 +406,29 @@ def create_uk8s_cluster_v2( - **Zone** (str) - Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 `_ - **CreateUK8SClusterV2ParamKubeProxy** - - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 + **CreateUK8SClusterV2ParamNodesKubeletConfiguration** + - **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup - **CreateUK8SClusterV2ParamNodesNetworkInterface** - - **EIP** (dict) - 见 **CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP** 模型定义 + **CreateUK8SClusterV2ParamNodesSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] **CreateUK8SClusterV2ParamNodes** - - **BootDiskSIze** (int) - Node节点的系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。 + - **BootDiskSize** (int) - Node节点的系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。 - **BootDiskType** (str) - 一组Node节点的系统盘类型,请参考 `磁盘类型 `_ 。默认为SSD云盘 - **CPU** (int) - 一组Node节点的虚拟CPU核数。单位:核,范围:[2, 64],可选范围参考控制台。 - **Count** (int) - 一组Node节点的数量,范围:[1,10]。 + - **DataDiskKmsKeyId** (str) - 节点数据盘加密使用的 key id - **DataDiskSize** (int) - 数据磁盘大小,单位GB。默认0。范围 :[20, 1000] - **DataDiskType** (str) - 一组Node节点的数据盘类型,请参考 `磁盘类型 `_ 。默认为SSD云盘 - **GPU** (int) - 一组Node节点的GPU卡核心数,仅GPU机型支持此字段。 - **GpuType** (str) - 一组Node节点的GPU类型,枚举值["K80", "P40", "V100"],最新值参考Console。 - **ImageId** (str) - Node节点的镜像 ID,不填则使用ImageId参数。支持用户自定义镜像。 - **IsolationGroup** (str) - 一组Node节点的隔离组Id,归属于同一隔离组的虚拟机节点将落在不同的物理机上,单个隔离组最多只能容纳8个节点。参见DescribeIsolationGroup。 + - **KubeletConfiguration** (dict) - 见 **CreateUK8SClusterV2ParamNodesKubeletConfiguration** 模型定义 - **Labels** (str) - Node节点标签,形式为key=value,多组Labels用”,“隔开,最多支持五组。 - **MachineType** (str) - 一组Nodes节点云主机机型,如["N", "C", "O", "OS"],具体请参照云主机机型。 - **MaxPods** (int) - Node节点上可运行最大节点数,默认为110。 @@ -425,6 +440,7 @@ def create_uk8s_cluster_v2( - **SecurityGroupId** (str) - 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 `DescribeFirewall `_ 。 - **SecurityMode** (str) - 主机安全模式。Firewall:防火墙;SecGroup:安全组;默认值:Firewall。 - **Taints** (str) - Node节点污点,形式为key=value:effect,多组taints用”,“隔开,最多支持五组。 + - **UHostFamily** (str) - Node节点规格族 - **UNIFeature** (str) - 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启。 - **Zone** (str) - 一组Nodes节点所属可用区,可创建多组Nodes节点,如一组是CPU Nodes节点,另一组是GPU Nodes节点。参见 `可用区列表 `_ @@ -466,9 +482,25 @@ def create_uk8s_uls_config( **Request Model** - **CreateUK8SULSConfigParamInputDetailFilePaths** - - **File** (str) - 定义采集路径的文件名 - - **Path** (str) - 定义采集路径 + **CreateUK8SULSConfigParamExtractRuleExtractRule** + - **LogRegexBase64** (str) - Base64 编码的日志提取正则表达式。 + + + **CreateUK8SULSConfigParamExtractRule** + - **BeginningRegex** (str) - 行首正则表达式。当 logType 为多行模式 (如 multi_line 或 multi_line_full_regex) 时,用于标识一条新日志的开始。 + - **BeginningRegexBase64** (str) - Base64 编码的行首正则,优先级高于 BeginningRegex + - **CollectPolicy** (str) - 采集策略。可选值: full (全量采集存量日志), increment (从当前时间点增量采集)。默认为 full。 + - **Delimiter** (str) - 当 LogType 为delimiter 时可选,接收 "space"、"tab"、"|"、";"、","。 + - **DelimiterBase64** (str) - Base64 编码的分隔符,优先级高于 Delimiter + - **Encode** (str) - 日志原文的编码格式。可选值: utf-8, gbk。默认为 utf-8。 + - **ExtractRule** (dict) - 见 **CreateUK8SULSConfigParamExtractRuleExtractRule** 模型定义 + - **Keys** (list) - 当LogType 为分隔符、正则、多行正则时可用 + - **LogRegex** (str) - 日志提取正则表达式。当 logType 为正则模式 (如 full_regex,multi_line_full_regex) 时,用于从日志中提取字段。 + - **LogType** (str) - 日志解析类型,决定了如何结构化日志。可选值: multi_line_delimiter:多行分隔符,delimiter:分隔符,full_regex:完全正则,multi_line_full_regex:多行完全正则,minimal_list:单行全文日志,multi_line:多行全文日志 + - **TimeFormat** (str) - timeKey 对应的时间格式。 + - **TimeKey** (str) - 当日志为 json 或正则提取时,指定包含日志时间的字段名 (Key)。 + - **UnMatchKey** (str) - 没有设置默认值;UnMatchUpload="true" 时强制要求填写 + - **UnMatchUpload** (str) - 是否上传解析失败的日志。true 表示上传,false 表示丢弃。默认为 false。 **CreateUK8SULSConfigParamInputDetailMetadata** @@ -476,6 +508,11 @@ def create_uk8s_uls_config( - **Labels** (str) - 定义要采集哪些 Pod 的标签 (Labels)。可选值: * (采集所有标签), "app,version" (仅采集 app 和 version), "" (不采集任何标签)。 + **CreateUK8SULSConfigParamInputDetailFilePaths** + - **File** (str) - 定义采集路径的文件名 + - **Path** (str) - 定义采集路径 + + **CreateUK8SULSConfigParamInputDetail** - **FilePaths** (list) - 见 **CreateUK8SULSConfigParamInputDetailFilePaths** 模型定义 - **Metadata** (dict) - 见 **CreateUK8SULSConfigParamInputDetailMetadata** 模型定义 @@ -483,10 +520,6 @@ def create_uk8s_uls_config( - **Type** (str) - 日志输入类型。支持 container_file 和 container_stdout - **CreateUK8SULSConfigParamExtractRuleExtractRule** - - **LogRegexBase64** (str) - Base64 编码的日志提取正则表达式。 - - **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** - **Key** (str) - 按 Pod 标签匹配时,要匹配的标签的 Key。 - **Value** (str) - 按 Pod 标签匹配时,要匹配的标签的值。 @@ -499,23 +532,6 @@ def create_uk8s_uls_config( - **NamespaceOperator** (str) - 指定/排除命名空间, 可选值: in/notin - **CreateUK8SULSConfigParamExtractRule** - - **BeginningRegex** (str) - 行首正则表达式。当 logType 为多行模式 (如 multi_line 或 multi_line_full_regex) 时,用于标识一条新日志的开始。 - - **BeginningRegexBase64** (str) - Base64 编码的行首正则,优先级高于 BeginningRegex - - **CollectPolicy** (str) - 采集策略。可选值: full (全量采集存量日志), increment (从当前时间点增量采集)。默认为 full。 - - **Delimiter** (str) - 当 LogType 为delimiter 时可选,接收 "space"、"tab"、"|"、";"、","。 - - **DelimiterBase64** (str) - Base64 编码的分隔符,优先级高于 Delimiter - - **Encode** (str) - 日志原文的编码格式。可选值: utf-8, gbk。默认为 utf-8。 - - **ExtractRule** (dict) - 见 **CreateUK8SULSConfigParamExtractRuleExtractRule** 模型定义 - - **Keys** (list) - 当LogType 为分隔符、正则、多行正则时可用 - - **LogRegex** (str) - 日志提取正则表达式。当 logType 为正则模式 (如 full_regex,multi_line_full_regex) 时,用于从日志中提取字段。 - - **LogType** (str) - 日志解析类型,决定了如何结构化日志。可选值: multi_line_delimiter:多行分隔符,delimiter:分隔符,full_regex:完全正则,multi_line_full_regex:多行完全正则,minimal_list:单行全文日志,multi_line:多行全文日志 - - **TimeFormat** (str) - timeKey 对应的时间格式。 - - **TimeKey** (str) - 当日志为 json 或正则提取时,指定包含日志时间的字段名 (Key)。 - - **UnMatchKey** (str) - 没有设置默认值;UnMatchUpload="true" 时强制要求填写 - - **UnMatchUpload** (str) - 是否上传解析失败的日志。true 表示上传,false 表示丢弃。默认为 false。 - - **CreateUK8SULSConfigParamMatchRuleWorkloads** - **Name** (str) - 按工作负载匹配时,工作负载的名称。 - **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。 @@ -682,12 +698,6 @@ def describe_uk8s_cluster( **Response Model** - **SecGroupId** - - **Id** (str) - 安全组名称 - - **Name** (str) - 安全组id - - **Priority** (str) - 安全组优先级 - - **DiskSet** - **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。 - **DiskId** (str) - 磁盘长ID @@ -701,6 +711,22 @@ def describe_uk8s_cluster( - **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk + **Autoscaler** + - **Enabled** (int) - 打开/关闭 + - **ScaleDownDelayAfterAdd** (str) - 静默时间 + - **ScaleDownGpuUtilizationThreshold** (str) - GPU缩容阈值 + - **ScaleDownUnneededTime** (str) - 缩容触发延时 + - **ScaleDownUtilizationThreshold** (str) - CPU缩容阈值 + - **UpdateTime** (int) - + - **Version** (str) - 伸缩器版本 + + + **SecGroupId** + - **Id** (str) - 安全组名称 + - **Name** (str) - 安全组id + - **Priority** (str) - 安全组优先级 + + **IPSet** - **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息) - **Default** (str) - 是否默认的弹性网卡的信息。true: 是默认弹性网卡;其他值:不是。 @@ -736,25 +762,15 @@ def describe_uk8s_cluster( - **Zone** (str) - 所在机房 + **KubeProxy** + - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] + + **LoopbackClientCert** - **ExpireTime** (int) - 证书到期时间 - **Warn** (bool) - 证书是否进入过期告警状态 - **Autoscaler** - - **Enabled** (int) - 打开/关闭 - - **ScaleDownDelayAfterAdd** (str) - 静默时间 - - **ScaleDownGpuUtilizationThreshold** (str) - GPU缩容阈值 - - **ScaleDownUnneededTime** (str) - 缩容触发延时 - - **ScaleDownUtilizationThreshold** (str) - CPU缩容阈值 - - **UpdateTime** (int) - - - **Version** (str) - 伸缩器版本 - - - **KubeProxy** - - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] - - """ # build request d = { @@ -1122,6 +1138,12 @@ def list_uk8s_node_group( **Response Model** + **SecGroupId** + - **Id** (str) - 安全组名称 + - **Name** (str) - 安全组id + - **Priority** (str) - 安全组优先级 + + **DiskSet** - **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。 - **DiskId** (str) - 磁盘长ID @@ -1174,12 +1196,6 @@ def list_uk8s_node_group( - **EIP** (dict) - 见 **EIP** 模型定义 - **SecGroupId** - - **Id** (str) - 安全组名称 - - **Name** (str) - 安全组id - - **Priority** (str) - 安全组优先级 - - **NodeGroupSet** - **BootDiskSize** (int) - 系统盘大小 - **BootDiskType** (str) - 系统盘类型 @@ -1255,41 +1271,24 @@ def list_uk8s_uls_config( **Response Model** - **ULSFilePaths** - - **File** (str) - 采集文件 - - **Path** (str) - 定义采集路径 - - - **ULSInputMetadata** - - **Container** (str) - 指定具体要采集元数据的容器名。如果留空,则不采集容器的元数据,可选字段:container_name,namespace,pod_name,pod_ip,pod_uid,container_id,image_name。Pod Label 元数据通过指定 InputDetail.Metadata.Labels 字段。 - - **Labels** (str) - 定义要采集哪些 Pod 的标签 (Labels)。可选值:*:采集所有标签。app,version:仅采集 app 和 version 这两个标签。""(空字符串):不采集任何标签。 - - - **ULSInputDetail** - - **FilePaths** (list) - 见 **ULSFilePaths** 模型定义 - - **InputMetadata** (dict) - 见 **ULSInputMetadata** 模型定义 - - **Stream** (str) - 容器标准输出流类型。仅适用于 container_stdout,可选值:all、stdout、stderr,默认为 all。 - - **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。 - - **ULSLabels** - **Key** (str) - 要匹配的标签的 Key。 - **Value** (str) - 要匹配的标签的值。 - **ValueOperator** (str) - 标签值的匹配操作符。可选值: in, notin。 - **ULSPodLabelsMatch** - - **Labels** (list) - 见 **ULSLabels** 模型定义 - - **Namespace** (str) - 要匹配的命名空间。namespaceOperator 存在时必需。 - - **NamespaceOperator** (str) - 命名空间名称的匹配操作符。可选值: in, notin。 - - **ULSWorkloadMatch** - **Name** (str) - 工作负载的名称。 - **Namespace** (str) - 工作负载所在的命名空间。 - **Type** (str) - 工作负载的类型,例如 deployment, statefulset, daemonset,cronjob,job。 + **ULSPodLabelsMatch** + - **Labels** (list) - 见 **ULSLabels** 模型定义 + - **Namespace** (str) - 要匹配的命名空间。namespaceOperator 存在时必需。 + - **NamespaceOperator** (str) - 命名空间名称的匹配操作符。可选值: in, notin。 + + **ULSMatchRule** - **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔 - **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含) @@ -1297,6 +1296,23 @@ def list_uk8s_uls_config( - **Workloads** (list) - 见 **ULSWorkloadMatch** 模型定义 + **ULSFilePaths** + - **File** (str) - 采集文件 + - **Path** (str) - 定义采集路径 + + + **ULSInputMetadata** + - **Container** (str) - 指定具体要采集元数据的容器名。如果留空,则不采集容器的元数据,可选字段:container_name,namespace,pod_name,pod_ip,pod_uid,container_id,image_name。Pod Label 元数据通过指定 InputDetail.Metadata.Labels 字段。 + - **Labels** (str) - 定义要采集哪些 Pod 的标签 (Labels)。可选值:*:采集所有标签。app,version:仅采集 app 和 version 这两个标签。""(空字符串):不采集任何标签。 + + + **ULSInputDetail** + - **FilePaths** (list) - 见 **ULSFilePaths** 模型定义 + - **InputMetadata** (dict) - 见 **ULSInputMetadata** 模型定义 + - **Stream** (str) - 容器标准输出流类型。仅适用于 container_stdout,可选值:all、stdout、stderr,默认为 all。 + - **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。 + + **ULSExtractRule** - **BeginningRegex** (str) - 行首正则表达式。在 multi_line、multi_line_full_regex 或 multi_line_delimiter 模式下,BeginningRegex 和 BeginningRegexBase64 必须至少填写一个。 - **BeginningRegexBase64** (str) - Base64 编码的行首正则表达式。填写时优先于 BeginningRegex。 @@ -1498,9 +1514,9 @@ def update_uk8s_uls_config( **Request Model** - **UpdateUK8SULSConfigParamInputDetailFilePaths** - - **File** (str) - 要采集的文件名。仅适用于container_file。 - - **Path** (str) - 日志采集路径。仅适用于container_file。 + **UpdateUK8SULSConfigParamInputDetailMetadata** + - **Container** (str) - 要附加到日志中的容器元数据字段,多个字段使用逗号分隔。可选字段:container_name、namespace、pod_name、pod_ip、pod_uid、container_id、image_name。留空表示不采集容器元数据。 + - **Labels** (str) - 要采集的Pod标签。*表示采集所有标签,app,version表示仅采集指定标签,空字符串表示不采集标签。 **UpdateUK8SULSConfigParamMatchRulePodLabelsLabels** @@ -1521,13 +1537,6 @@ def update_uk8s_uls_config( - **Type** (str) - 工作负载类型。可选值:deployment、statefulset、daemonset、job、cronjob。 - **UpdateUK8SULSConfigParamMatchRule** - - **Container** (str) - 要匹配的容器名称,*表示所有容器,多个名称使用逗号分隔。 - - **ContainerOperator** (str) - 容器名称匹配操作符。可选值:in、notin。填写该参数时必须同时填写MatchRule.Container。 - - **PodLabels** (dict) - 见 **UpdateUK8SULSConfigParamMatchRulePodLabels** 模型定义 - - **Workloads** (list) - 见 **UpdateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 - - **UpdateUK8SULSConfigParamExtractRule** - **BeginningRegex** (str) - 行首正则表达式。multi_line、multi_line_full_regex或multi_line_delimiter模式下,BeginningRegex和BeginningRegexBase64必须至少填写一个。 - **BeginningRegexBase64** (str) - Base64编码的行首正则表达式。填写时优先于BeginningRegex。 @@ -1545,9 +1554,9 @@ def update_uk8s_uls_config( - **UnMatchUpload** (str) - 是否上传解析失败的日志。字符串true表示上传,false表示丢弃。默认为false。 - **UpdateUK8SULSConfigParamInputDetailMetadata** - - **Container** (str) - 要附加到日志中的容器元数据字段,多个字段使用逗号分隔。可选字段:container_name、namespace、pod_name、pod_ip、pod_uid、container_id、image_name。留空表示不采集容器元数据。 - - **Labels** (str) - 要采集的Pod标签。*表示采集所有标签,app,version表示仅采集指定标签,空字符串表示不采集标签。 + **UpdateUK8SULSConfigParamInputDetailFilePaths** + - **File** (str) - 要采集的文件名。仅适用于container_file。 + - **Path** (str) - 日志采集路径。仅适用于container_file。 **UpdateUK8SULSConfigParamInputDetail** @@ -1557,6 +1566,13 @@ def update_uk8s_uls_config( - **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。 + **UpdateUK8SULSConfigParamMatchRule** + - **Container** (str) - 要匹配的容器名称,*表示所有容器,多个名称使用逗号分隔。 + - **ContainerOperator** (str) - 容器名称匹配操作符。可选值:in、notin。填写该参数时必须同时填写MatchRule.Container。 + - **PodLabels** (dict) - 见 **UpdateUK8SULSConfigParamMatchRulePodLabels** 模型定义 + - **Workloads** (list) - 见 **UpdateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 + + """ # build request d = { diff --git a/ucloud/services/uk8s/schemas/apis.py b/ucloud/services/uk8s/schemas/apis.py index 8805281..a200d95 100644 --- a/ucloud/services/uk8s/schemas/apis.py +++ b/ucloud/services/uk8s/schemas/apis.py @@ -51,6 +51,16 @@ class AddUK8SExistingUHostResponseSchema(schema.ResponseSchema): """ +class AddUK8SNodeGroupParamSecGroupIdSchema(schema.RequestSchema): + """AddUK8SNodeGroupParamSecGroupId -""" + + fields = { + "Id": fields.Str(required=False, dump_to="Id"), + "Name": fields.Str(required=False, dump_to="Name"), + "Priority": fields.Str(required=False, dump_to="Priority"), + } + + class AddUK8SNodeGroupParamKubeletConfigurationKubeReservedSchema( schema.RequestSchema ): @@ -66,24 +76,10 @@ class AddUK8SNodeGroupParamKubeletConfigurationKubeReservedSchema( } -class AddUK8SNodeGroupParamNetworkInterfaceEIPSchema(schema.RequestSchema): - """AddUK8SNodeGroupParamNetworkInterfaceEIP -""" - - fields = { - "Bandwidth": fields.Int(required=False, dump_to="Bandwidth"), - "CouponId": fields.Str(required=False, dump_to="CouponId"), - "OperatorName": fields.Str(required=False, dump_to="OperatorName"), - "PayMode": fields.Str(required=False, dump_to="PayMode"), - "ShareBandwidthId": fields.Str( - required=False, dump_to="ShareBandwidthId" - ), - } - - -class AddUK8SNodeGroupParamKubeletConfigurationEvictionHardSchema( +class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriodSchema( schema.RequestSchema ): - """AddUK8SNodeGroupParamKubeletConfigurationEvictionHard -""" + """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod -""" fields = { "ImagefsAvailable": fields.Str( @@ -122,10 +118,34 @@ class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftSchema( } -class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriodSchema( +class AddUK8SNodeGroupParamNetworkInterfaceEIPSchema(schema.RequestSchema): + """AddUK8SNodeGroupParamNetworkInterfaceEIP -""" + + fields = { + "Bandwidth": fields.Int(required=False, dump_to="Bandwidth"), + "CouponId": fields.Str(required=False, dump_to="CouponId"), + "OperatorName": fields.Str(required=False, dump_to="OperatorName"), + "PayMode": fields.Str(required=False, dump_to="PayMode"), + "ShareBandwidthId": fields.Str( + required=False, dump_to="ShareBandwidthId" + ), + } + + +class AddUK8SNodeGroupParamNetworkInterfaceSchema(schema.RequestSchema): + """AddUK8SNodeGroupParamNetworkInterface -""" + + fields = { + "EIP": AddUK8SNodeGroupParamNetworkInterfaceEIPSchema( + required=False, dump_to="EIP" + ), + } + + +class AddUK8SNodeGroupParamKubeletConfigurationEvictionHardSchema( schema.RequestSchema ): - """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod -""" + """AddUK8SNodeGroupParamKubeletConfigurationEvictionHard -""" fields = { "ImagefsAvailable": fields.Str( @@ -193,26 +213,6 @@ class AddUK8SNodeGroupParamKubeletConfigurationSchema(schema.RequestSchema): } -class AddUK8SNodeGroupParamSecGroupIdSchema(schema.RequestSchema): - """AddUK8SNodeGroupParamSecGroupId -""" - - fields = { - "Id": fields.Str(required=False, dump_to="Id"), - "Name": fields.Str(required=False, dump_to="Name"), - "Priority": fields.Str(required=False, dump_to="Priority"), - } - - -class AddUK8SNodeGroupParamNetworkInterfaceSchema(schema.RequestSchema): - """AddUK8SNodeGroupParamNetworkInterface -""" - - fields = { - "EIP": AddUK8SNodeGroupParamNetworkInterfaceEIPSchema( - required=False, dump_to="EIP" - ), - } - - class AddUK8SNodeGroupRequestSchema(schema.RequestSchema): """AddUK8SNodeGroup - 添加UK8S节点池""" @@ -322,16 +322,6 @@ class AddUK8SPHostNodeResponseSchema(schema.ResponseSchema): """ -class AddUK8SUHostNodeParamSecGroupIdSchema(schema.RequestSchema): - """AddUK8SUHostNodeParamSecGroupId -""" - - fields = { - "Id": fields.Str(required=False, dump_to="Id"), - "Name": fields.Str(required=False, dump_to="Name"), - "Priority": fields.Str(required=False, dump_to="Priority"), - } - - class AddUK8SUHostNodeParamNetworkInterfaceEIPSchema(schema.RequestSchema): """AddUK8SUHostNodeParamNetworkInterfaceEIP -""" @@ -346,13 +336,12 @@ class AddUK8SUHostNodeParamNetworkInterfaceEIPSchema(schema.RequestSchema): } -class AddUK8SUHostNodeParamNetworkInterfaceSchema(schema.RequestSchema): - """AddUK8SUHostNodeParamNetworkInterface -""" +class AddUK8SUHostNodeParamUserLabelsSchema(schema.RequestSchema): + """AddUK8SUHostNodeParamUserLabels -""" fields = { - "EIP": AddUK8SUHostNodeParamNetworkInterfaceEIPSchema( - required=False, dump_to="EIP" - ), + "Key": fields.Str(required=False, dump_to="Key"), + "Value": fields.Str(required=False, dump_to="Value"), } @@ -366,12 +355,23 @@ class AddUK8SUHostNodeParamKubeletConfigurationSchema(schema.RequestSchema): } -class AddUK8SUHostNodeParamUserLabelsSchema(schema.RequestSchema): - """AddUK8SUHostNodeParamUserLabels -""" +class AddUK8SUHostNodeParamSecGroupIdSchema(schema.RequestSchema): + """AddUK8SUHostNodeParamSecGroupId -""" fields = { - "Key": fields.Str(required=False, dump_to="Key"), - "Value": fields.Str(required=False, dump_to="Value"), + "Id": fields.Str(required=False, dump_to="Id"), + "Name": fields.Str(required=False, dump_to="Name"), + "Priority": fields.Str(required=False, dump_to="Priority"), + } + + +class AddUK8SUHostNodeParamNetworkInterfaceSchema(schema.RequestSchema): + """AddUK8SUHostNodeParamNetworkInterface -""" + + fields = { + "EIP": AddUK8SUHostNodeParamNetworkInterfaceEIPSchema( + required=False, dump_to="EIP" + ), } @@ -452,8 +452,25 @@ class AddUK8SUHostNodeResponseSchema(schema.ResponseSchema): """ -class CreateUK8SClusterV2ParamNodesSecGroupIdSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamNodesSecGroupId -""" +class CreateUK8SClusterV2ParamUserLabelsSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamUserLabels -""" + + fields = { + "Key": fields.Str(required=False, dump_to="Key"), + "Value": fields.Str(required=False, dump_to="Value"), + } + + +class CreateUK8SClusterV2ParamKubeProxySchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamKubeProxy -""" + + fields = { + "Mode": fields.Str(required=False, dump_to="Mode"), + } + + +class CreateUK8SClusterV2ParamMasterSecGroupIdSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamMasterSecGroupId -""" fields = { "Id": fields.Str(required=False, dump_to="Id"), @@ -478,13 +495,13 @@ class CreateUK8SClusterV2ParamNodesNetworkInterfaceEIPSchema( } -class CreateUK8SClusterV2ParamMasterSecGroupIdSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamMasterSecGroupId -""" +class CreateUK8SClusterV2ParamNodesNetworkInterfaceSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamNodesNetworkInterface -""" fields = { - "Id": fields.Str(required=False, dump_to="Id"), - "Name": fields.Str(required=False, dump_to="Name"), - "Priority": fields.Str(required=False, dump_to="Priority"), + "EIP": CreateUK8SClusterV2ParamNodesNetworkInterfaceEIPSchema( + required=False, dump_to="EIP" + ), } @@ -499,21 +516,25 @@ class CreateUK8SClusterV2ParamMasterSchema(schema.RequestSchema): } -class CreateUK8SClusterV2ParamKubeProxySchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamKubeProxy -""" +class CreateUK8SClusterV2ParamNodesKubeletConfigurationSchema( + schema.RequestSchema +): + """CreateUK8SClusterV2ParamNodesKubeletConfiguration -""" fields = { - "Mode": fields.Str(required=False, dump_to="Mode"), + "ContainerLogMaxFiles": fields.Str( + required=False, dump_to="ContainerLogMaxFiles" + ), } -class CreateUK8SClusterV2ParamNodesNetworkInterfaceSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamNodesNetworkInterface -""" +class CreateUK8SClusterV2ParamNodesSecGroupIdSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamNodesSecGroupId -""" fields = { - "EIP": CreateUK8SClusterV2ParamNodesNetworkInterfaceEIPSchema( - required=False, dump_to="EIP" - ), + "Id": fields.Str(required=False, dump_to="Id"), + "Name": fields.Str(required=False, dump_to="Name"), + "Priority": fields.Str(required=False, dump_to="Priority"), } @@ -521,16 +542,25 @@ class CreateUK8SClusterV2ParamNodesSchema(schema.RequestSchema): """CreateUK8SClusterV2ParamNodes -""" fields = { - "BootDiskSIze": fields.Int(required=False, dump_to="BootDiskSIze"), + "BootDiskSIze": fields.Int( + required=False, dump_to="BootDiskSIze" + ), # Deprecated, will be removed at 1.0 + "BootDiskSize": fields.Int(required=False, dump_to="BootDiskSize"), "BootDiskType": fields.Str(required=False, dump_to="BootDiskType"), "CPU": fields.Int(required=True, dump_to="CPU"), "Count": fields.Int(required=True, dump_to="Count"), + "DataDiskKmsKeyId": fields.Str( + required=False, dump_to="DataDiskKmsKeyId" + ), "DataDiskSize": fields.Int(required=False, dump_to="DataDiskSize"), "DataDiskType": fields.Str(required=False, dump_to="DataDiskType"), "GPU": fields.Int(required=False, dump_to="GPU"), "GpuType": fields.Str(required=False, dump_to="GpuType"), "ImageId": fields.Str(required=False, dump_to="ImageId"), "IsolationGroup": fields.Str(required=False, dump_to="IsolationGroup"), + "KubeletConfiguration": CreateUK8SClusterV2ParamNodesKubeletConfigurationSchema( + required=False, dump_to="KubeletConfiguration" + ), "Labels": fields.Str(required=False, dump_to="Labels"), "MachineType": fields.Str(required=True, dump_to="MachineType"), "MaxPods": fields.Int(required=False, dump_to="MaxPods"), @@ -553,6 +583,7 @@ class CreateUK8SClusterV2ParamNodesSchema(schema.RequestSchema): ), "SecurityMode": fields.Str(required=False, dump_to="SecurityMode"), "Taints": fields.Str(required=False, dump_to="Taints"), + "UHostFamily": fields.Str(required=False, dump_to="UHostFamily"), "UNIFeature": fields.Str(required=False, dump_to="UNIFeature"), "Zone": fields.Str(required=True, dump_to="Zone"), } @@ -571,9 +602,11 @@ class CreateUK8SClusterV2RequestSchema(schema.RequestSchema): "ForwardSrcIPMethod": fields.Str( required=False, dump_to="ForwardSrcIPMethod" ), - "ImageId": fields.Str(required=False, dump_to="ImageId"), + "ImageId": fields.Str(required=True, dump_to="ImageId"), "InitScript": fields.Str(required=False, dump_to="InitScript"), - "K8sVersion": fields.Str(required=False, dump_to="K8sVersion"), + "K8sVersion": fields.Str(required=True, dump_to="K8sVersion"), + "KmsPluginKeyId": fields.Str(required=False, dump_to="KmsPluginKeyId"), + "KmsPluginResource": fields.List(fields.Str()), "KubeProxy": CreateUK8SClusterV2ParamKubeProxySchema( required=False, dump_to="KubeProxy" ), @@ -586,6 +619,9 @@ class CreateUK8SClusterV2RequestSchema(schema.RequestSchema): required=False, dump_to="MasterBootDiskType" ), "MasterCPU": fields.Int(required=True, dump_to="MasterCPU"), + "MasterDataDiskKmsKeyId": fields.Str( + required=False, dump_to="MasterDataDiskKmsKeyId" + ), "MasterDataDiskSize": fields.Int( required=False, dump_to="MasterDataDiskSize" ), @@ -606,6 +642,9 @@ class CreateUK8SClusterV2RequestSchema(schema.RequestSchema): "MasterMinmalCpuPlatform": fields.Str( required=False, dump_to="MasterMinmalCpuPlatform" ), # Deprecated, will be removed at 1.0 + "MasterUHostFamily": fields.Str( + required=False, dump_to="MasterUHostFamily" + ), "Nodes": fields.List(CreateUK8SClusterV2ParamNodesSchema()), "Password": fields.Str(required=True, dump_to="Password"), "ProjectId": fields.Str(required=True, dump_to="ProjectId"), @@ -615,7 +654,7 @@ class CreateUK8SClusterV2RequestSchema(schema.RequestSchema): "SubnetId": fields.Str(required=True, dump_to="SubnetId"), "Tag": fields.Str(required=False, dump_to="Tag"), "UserData": fields.Str(required=False, dump_to="UserData"), - "UserLabels": fields.Str(required=False, dump_to="UserLabels"), + "UserLabels": fields.List(CreateUK8SClusterV2ParamUserLabelsSchema()), "VPCId": fields.Str(required=True, dump_to="VPCId"), } @@ -635,12 +674,40 @@ class CreateUK8SClusterV2ResponseSchema(schema.ResponseSchema): """ -class CreateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamInputDetailFilePaths -""" +class CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( + schema.RequestSchema +): + """CreateUK8SULSConfigParamExtractRuleExtractRule -""" fields = { - "File": fields.Str(required=False, dump_to="File"), - "Path": fields.Str(required=False, dump_to="Path"), + "LogRegexBase64": fields.Str(required=False, dump_to="LogRegexBase64"), + } + + +class CreateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamExtractRule -""" + + fields = { + "BeginningRegex": fields.Str(required=False, dump_to="BeginningRegex"), + "BeginningRegexBase64": fields.Str( + required=False, dump_to="BeginningRegexBase64" + ), + "CollectPolicy": fields.Str(required=False, dump_to="CollectPolicy"), + "Delimiter": fields.Str(required=False, dump_to="Delimiter"), + "DelimiterBase64": fields.Str( + required=False, dump_to="DelimiterBase64" + ), + "Encode": fields.Str(required=False, dump_to="Encode"), + "ExtractRule": CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( + required=False, dump_to="ExtractRule" + ), + "Keys": fields.List(fields.Str()), + "LogRegex": fields.Str(required=False, dump_to="LogRegex"), + "LogType": fields.Str(required=True, dump_to="LogType"), + "TimeFormat": fields.Str(required=False, dump_to="TimeFormat"), + "TimeKey": fields.Str(required=False, dump_to="TimeKey"), + "UnMatchKey": fields.Str(required=False, dump_to="UnMatchKey"), + "UnMatchUpload": fields.Str(required=False, dump_to="UnMatchUpload"), } @@ -653,6 +720,15 @@ class CreateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): } +class CreateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamInputDetailFilePaths -""" + + fields = { + "File": fields.Str(required=False, dump_to="File"), + "Path": fields.Str(required=False, dump_to="Path"), + } + + class CreateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): """CreateUK8SULSConfigParamInputDetail -""" @@ -668,16 +744,6 @@ class CreateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): } -class CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( - schema.RequestSchema -): - """CreateUK8SULSConfigParamExtractRuleExtractRule -""" - - fields = { - "LogRegexBase64": fields.Str(required=False, dump_to="LogRegexBase64"), - } - - class CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema( schema.RequestSchema ): @@ -704,33 +770,6 @@ class CreateUK8SULSConfigParamMatchRulePodLabelsSchema(schema.RequestSchema): } -class CreateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamExtractRule -""" - - fields = { - "BeginningRegex": fields.Str(required=False, dump_to="BeginningRegex"), - "BeginningRegexBase64": fields.Str( - required=False, dump_to="BeginningRegexBase64" - ), - "CollectPolicy": fields.Str(required=False, dump_to="CollectPolicy"), - "Delimiter": fields.Str(required=False, dump_to="Delimiter"), - "DelimiterBase64": fields.Str( - required=False, dump_to="DelimiterBase64" - ), - "Encode": fields.Str(required=False, dump_to="Encode"), - "ExtractRule": CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( - required=False, dump_to="ExtractRule" - ), - "Keys": fields.List(fields.Str()), - "LogRegex": fields.Str(required=False, dump_to="LogRegex"), - "LogType": fields.Str(required=True, dump_to="LogType"), - "TimeFormat": fields.Str(required=False, dump_to="TimeFormat"), - "TimeKey": fields.Str(required=False, dump_to="TimeKey"), - "UnMatchKey": fields.Str(required=False, dump_to="UnMatchKey"), - "UnMatchUpload": fields.Str(required=False, dump_to="UnMatchUpload"), - } - - class CreateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): """CreateUK8SULSConfigParamMatchRuleWorkloads -""" @@ -1417,12 +1456,12 @@ class UpdateUK8SNodeGroupResponseSchema(schema.ResponseSchema): """ -class UpdateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamInputDetailFilePaths -""" +class UpdateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamInputDetailMetadata -""" fields = { - "File": fields.Str(required=False, dump_to="File"), - "Path": fields.Str(required=False, dump_to="Path"), + "Container": fields.Str(required=False, dump_to="Container"), + "Labels": fields.Str(required=False, dump_to="Labels"), } @@ -1462,23 +1501,6 @@ class UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): } -class UpdateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamMatchRule -""" - - fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "ContainerOperator": fields.Str( - required=False, dump_to="ContainerOperator" - ), - "PodLabels": UpdateUK8SULSConfigParamMatchRulePodLabelsSchema( - required=False, dump_to="PodLabels" - ), - "Workloads": fields.List( - UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema() - ), - } - - class UpdateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): """UpdateUK8SULSConfigParamExtractRule -""" @@ -1504,12 +1526,12 @@ class UpdateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): } -class UpdateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamInputDetailMetadata -""" +class UpdateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamInputDetailFilePaths -""" fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "Labels": fields.Str(required=False, dump_to="Labels"), + "File": fields.Str(required=False, dump_to="File"), + "Path": fields.Str(required=False, dump_to="Path"), } @@ -1528,6 +1550,23 @@ class UpdateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): } +class UpdateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamMatchRule -""" + + fields = { + "Container": fields.Str(required=False, dump_to="Container"), + "ContainerOperator": fields.Str( + required=False, dump_to="ContainerOperator" + ), + "PodLabels": UpdateUK8SULSConfigParamMatchRulePodLabelsSchema( + required=False, dump_to="PodLabels" + ), + "Workloads": fields.List( + UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema() + ), + } + + class UpdateUK8SULSConfigRequestSchema(schema.RequestSchema): """UpdateUK8SULSConfig - 更新指定UK8S集群的日志采集规则。""" diff --git a/ucloud/services/uk8s/schemas/models.py b/ucloud/services/uk8s/schemas/models.py index f5ac78e..2c0a042 100644 --- a/ucloud/services/uk8s/schemas/models.py +++ b/ucloud/services/uk8s/schemas/models.py @@ -3,23 +3,6 @@ from ucloud.core.typesystem import schema, fields -class DiskSetSchema(schema.ResponseSchema): - """DiskSet - 节点磁盘信息""" - - fields = { - "BackupType": fields.Str(required=False, load_from="BackupType"), - "DiskId": fields.Str(required=False, load_from="DiskId"), - "DiskType": fields.Str(required=False, load_from="DiskType"), - "Drive": fields.Str(required=False, load_from="Drive"), - "Encrypted": fields.Str(required=False, load_from="Encrypted"), - "IOPS": fields.Int(required=False, load_from="IOPS"), - "IsBoot": fields.Str(required=False, load_from="IsBoot"), - "Name": fields.Str(required=False, load_from="Name"), - "Size": fields.Int(required=False, load_from="Size"), - "Type": fields.Str(required=False, load_from="Type"), - } - - class IPSetSchema(schema.ResponseSchema): """IPSet - 节点的IP信息""" @@ -39,35 +22,30 @@ class IPSetSchema(schema.ResponseSchema): } -class AutoscalerSchema(schema.ResponseSchema): - """Autoscaler -""" +class SecGroupIdSchema(schema.ResponseSchema): + """SecGroupId - 安全组""" fields = { - "Enabled": fields.Int(required=True, load_from="Enabled"), - "ScaleDownDelayAfterAdd": fields.Str( - required=True, load_from="ScaleDownDelayAfterAdd" - ), - "ScaleDownGpuUtilizationThreshold": fields.Str( - required=True, load_from="ScaleDownGpuUtilizationThreshold" - ), - "ScaleDownUnneededTime": fields.Str( - required=True, load_from="ScaleDownUnneededTime" - ), - "ScaleDownUtilizationThreshold": fields.Str( - required=True, load_from="ScaleDownUtilizationThreshold" - ), - "UpdateTime": fields.Int(required=True, load_from="UpdateTime"), - "Version": fields.Str(required=True, load_from="Version"), + "Id": fields.Str(required=False, load_from="Id"), + "Name": fields.Str(required=False, load_from="Name"), + "Priority": fields.Str(required=False, load_from="Priority"), } -class SecGroupIdSchema(schema.ResponseSchema): - """SecGroupId - 安全组""" +class DiskSetSchema(schema.ResponseSchema): + """DiskSet - 节点磁盘信息""" fields = { - "Id": fields.Str(required=False, load_from="Id"), + "BackupType": fields.Str(required=False, load_from="BackupType"), + "DiskId": fields.Str(required=False, load_from="DiskId"), + "DiskType": fields.Str(required=False, load_from="DiskType"), + "Drive": fields.Str(required=False, load_from="Drive"), + "Encrypted": fields.Str(required=False, load_from="Encrypted"), + "IOPS": fields.Int(required=False, load_from="IOPS"), + "IsBoot": fields.Str(required=False, load_from="IsBoot"), "Name": fields.Str(required=False, load_from="Name"), - "Priority": fields.Str(required=False, load_from="Priority"), + "Size": fields.Int(required=False, load_from="Size"), + "Type": fields.Str(required=False, load_from="Type"), } @@ -97,20 +75,42 @@ class UhostInfoSchema(schema.ResponseSchema): } -class KubeProxySchema(schema.ResponseSchema): - """KubeProxy - KubeProxy信息""" +class LoopbackClientCertSchema(schema.ResponseSchema): + """LoopbackClientCert - API Server 回环客户端证书""" fields = { - "Mode": fields.Str(required=False, load_from="Mode"), + "ExpireTime": fields.Int(required=False, load_from="ExpireTime"), + "Warn": fields.Bool(required=False, load_from="Warn"), } -class LoopbackClientCertSchema(schema.ResponseSchema): - """LoopbackClientCert - API Server 回环客户端证书""" +class AutoscalerSchema(schema.ResponseSchema): + """Autoscaler -""" fields = { - "ExpireTime": fields.Int(required=False, load_from="ExpireTime"), - "Warn": fields.Bool(required=False, load_from="Warn"), + "Enabled": fields.Int(required=True, load_from="Enabled"), + "ScaleDownDelayAfterAdd": fields.Str( + required=True, load_from="ScaleDownDelayAfterAdd" + ), + "ScaleDownGpuUtilizationThreshold": fields.Str( + required=True, load_from="ScaleDownGpuUtilizationThreshold" + ), + "ScaleDownUnneededTime": fields.Str( + required=True, load_from="ScaleDownUnneededTime" + ), + "ScaleDownUtilizationThreshold": fields.Str( + required=True, load_from="ScaleDownUtilizationThreshold" + ), + "UpdateTime": fields.Int(required=True, load_from="UpdateTime"), + "Version": fields.Str(required=True, load_from="Version"), + } + + +class KubeProxySchema(schema.ResponseSchema): + """KubeProxy - KubeProxy信息""" + + fields = { + "Mode": fields.Str(required=False, load_from="Mode"), } @@ -281,6 +281,27 @@ class EIPSchema(schema.ResponseSchema): } +class NetworkInterfaceSchema(schema.ResponseSchema): + """NetworkInterface - 网络接口""" + + fields = { + "EIP": EIPSchema(), + } + + +class ReservedResourceSchema(schema.ResponseSchema): + """ReservedResource - 预留资源""" + + fields = { + "CPU": fields.Str(required=False, load_from="CPU"), + "EphemeralStorage": fields.Str( + required=False, load_from="EphemeralStorage" + ), + "Memory": fields.Str(required=False, load_from="Memory"), + "Pid": fields.Str(required=False, load_from="Pid"), + } + + class EvictionConditionSchema(schema.ResponseSchema): """EvictionCondition - 驱逐条件或宽限时间""" @@ -300,19 +321,6 @@ class EvictionConditionSchema(schema.ResponseSchema): } -class ReservedResourceSchema(schema.ResponseSchema): - """ReservedResource - 预留资源""" - - fields = { - "CPU": fields.Str(required=False, load_from="CPU"), - "EphemeralStorage": fields.Str( - required=False, load_from="EphemeralStorage" - ), - "Memory": fields.Str(required=False, load_from="Memory"), - "Pid": fields.Str(required=False, load_from="Pid"), - } - - class KubeletConfigurationSchema(schema.ResponseSchema): """KubeletConfiguration - kubelet自定义配置""" @@ -338,14 +346,6 @@ class KubeletConfigurationSchema(schema.ResponseSchema): } -class NetworkInterfaceSchema(schema.ResponseSchema): - """NetworkInterface - 网络接口""" - - fields = { - "EIP": EIPSchema(), - } - - class NodeGroupSetSchema(schema.ResponseSchema): """NodeGroupSet - 节点池配置""" @@ -402,32 +402,32 @@ class NodeGroupSetSchema(schema.ResponseSchema): } -class ULSFilePathsSchema(schema.ResponseSchema): - """ULSFilePaths - ULS采集文件路径""" - - fields = { - "File": fields.Str(required=False, load_from="File"), - "Path": fields.Str(required=False, load_from="Path"), - } - - -class ULSInputMetadataSchema(schema.ResponseSchema): - """ULSInputMetadata - ULSInputMetadata""" - - fields = { - "Container": fields.Str(required=False, load_from="Container"), - "Labels": fields.Str(required=False, load_from="Labels"), - } - - -class ULSInputDetailSchema(schema.ResponseSchema): - """ULSInputDetail - 定义日志的输入来源,例如容器文件或容器标准输出。""" +class ULSExtractRuleSchema(schema.ResponseSchema): + """ULSExtractRule - 定义日志的提取、解析和格式化规则。""" fields = { - "FilePaths": fields.List(ULSFilePathsSchema()), - "InputMetadata": ULSInputMetadataSchema(), - "Stream": fields.Str(required=False, load_from="Stream"), - "Type": fields.Str(required=False, load_from="Type"), + "BeginningRegex": fields.Str( + required=False, load_from="BeginningRegex" + ), + "BeginningRegexBase64": fields.Str( + required=False, load_from="BeginningRegexBase64" + ), + "CollectPolicy": fields.Str(required=False, load_from="CollectPolicy"), + "Delimiter": fields.Str(required=False, load_from="Delimiter"), + "DelimiterBase64": fields.Str( + required=False, load_from="DelimiterBase64" + ), + "Encode": fields.Str(required=False, load_from="Encode"), + "Keys": fields.List(fields.Str()), + "LogRegex": fields.Str(required=False, load_from="LogRegex"), + "LogRegexBase64": fields.Str( + required=False, load_from="LogRegexBase64" + ), + "LogType": fields.Str(required=False, load_from="LogType"), + "TimeFormat": fields.Str(required=False, load_from="TimeFormat"), + "TimeKey": fields.Str(required=False, load_from="TimeKey"), + "UnMatchKey": fields.Str(required=False, load_from="UnMatchKey"), + "UnMatchUpload": fields.Str(required=False, load_from="UnMatchUpload"), } @@ -476,32 +476,32 @@ class ULSMatchRuleSchema(schema.ResponseSchema): } -class ULSExtractRuleSchema(schema.ResponseSchema): - """ULSExtractRule - 定义日志的提取、解析和格式化规则。""" +class ULSFilePathsSchema(schema.ResponseSchema): + """ULSFilePaths - ULS采集文件路径""" fields = { - "BeginningRegex": fields.Str( - required=False, load_from="BeginningRegex" - ), - "BeginningRegexBase64": fields.Str( - required=False, load_from="BeginningRegexBase64" - ), - "CollectPolicy": fields.Str(required=False, load_from="CollectPolicy"), - "Delimiter": fields.Str(required=False, load_from="Delimiter"), - "DelimiterBase64": fields.Str( - required=False, load_from="DelimiterBase64" - ), - "Encode": fields.Str(required=False, load_from="Encode"), - "Keys": fields.List(fields.Str()), - "LogRegex": fields.Str(required=False, load_from="LogRegex"), - "LogRegexBase64": fields.Str( - required=False, load_from="LogRegexBase64" - ), - "LogType": fields.Str(required=False, load_from="LogType"), - "TimeFormat": fields.Str(required=False, load_from="TimeFormat"), - "TimeKey": fields.Str(required=False, load_from="TimeKey"), - "UnMatchKey": fields.Str(required=False, load_from="UnMatchKey"), - "UnMatchUpload": fields.Str(required=False, load_from="UnMatchUpload"), + "File": fields.Str(required=False, load_from="File"), + "Path": fields.Str(required=False, load_from="Path"), + } + + +class ULSInputMetadataSchema(schema.ResponseSchema): + """ULSInputMetadata - ULSInputMetadata""" + + fields = { + "Container": fields.Str(required=False, load_from="Container"), + "Labels": fields.Str(required=False, load_from="Labels"), + } + + +class ULSInputDetailSchema(schema.ResponseSchema): + """ULSInputDetail - 定义日志的输入来源,例如容器文件或容器标准输出。""" + + fields = { + "FilePaths": fields.List(ULSFilePathsSchema()), + "InputMetadata": ULSInputMetadataSchema(), + "Stream": fields.Str(required=False, load_from="Stream"), + "Type": fields.Str(required=False, load_from="Type"), } diff --git a/ucloud/version.py b/ucloud/version.py index 11f9409..a1859f3 100644 --- a/ucloud/version.py +++ b/ucloud/version.py @@ -1 +1 @@ -version = "0.11.141" +version = "0.11.142"