From 09fc73e3c9ce93e651fb1e64b6bcc4435589d5ac Mon Sep 17 00:00:00 2001 From: ucloud-bot Date: Tue, 29 Sep 2026 10:03:07 +0000 Subject: [PATCH] sdk: rolling update for 0.11.143 --- ucloud/services/uk8s/client.py | 340 ++++++++++++------------ ucloud/services/uk8s/schemas/apis.py | 350 ++++++++++++------------- ucloud/services/uk8s/schemas/models.py | 232 ++++++++-------- ucloud/version.py | 2 +- 4 files changed, 462 insertions(+), 462 deletions(-) diff --git a/ucloud/services/uk8s/client.py b/ucloud/services/uk8s/client.py index 381fe47..624dad0 100644 --- a/ucloud/services/uk8s/client.py +++ b/ucloud/services/uk8s/client.py @@ -103,24 +103,19 @@ 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 - - **Memory** (str) - kubelet预留内存资源,以Mi结尾。控制台展示为kubeReserved - memory - - **Pid** (str) - kubelet预留pid数量,必须大于等于500, string方式提供。控制台展示为kubeReserved - pid + **AddUK8SNodeGroupParamNetworkInterfaceEIP** + - **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 + - **PayMode** (str) - 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth" + - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 - **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 + **AddUK8SNodeGroupParamKubeletConfigurationEvictionHard** + - **ImagefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之容器镜像剩余空间: 需以%结尾。控制台展示为evictionHard - imagefs.available + - **MemoryAvailable** (str) - 触发Pod驱逐操作的硬性门限之内存用量: 需以Mi或Gi结尾。控制台展示为evictionHard - memory.available + - **NodefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之节点存储剩余空间: 需以%结尾。控制台展示为evictionHard - nodefs.available + - **NodefsInodesFree** (str) - 触发Pod驱逐操作的硬性门限节点inode剩余量: 需以%结尾。控制台展示为evictionHard - nodefs.inodesFree **AddUK8SNodeGroupParamKubeletConfigurationEvictionSoft** @@ -130,23 +125,15 @@ def add_uk8s_node_group( - **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接口查询,或登录用户中心查看。 - - **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时有效 - - **AddUK8SNodeGroupParamNetworkInterface** - **EIP** (dict) - 见 **AddUK8SNodeGroupParamNetworkInterfaceEIP** 模型定义 - **AddUK8SNodeGroupParamKubeletConfigurationEvictionHard** - - **ImagefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之容器镜像剩余空间: 需以%结尾。控制台展示为evictionHard - imagefs.available - - **MemoryAvailable** (str) - 触发Pod驱逐操作的硬性门限之内存用量: 需以Mi或Gi结尾。控制台展示为evictionHard - memory.available - - **NodefsAvailable** (str) - 触发Pod驱逐操作的硬性门限之节点存储剩余空间: 需以%结尾。控制台展示为evictionHard - nodefs.available - - **NodefsInodesFree** (str) - 触发Pod驱逐操作的硬性门限节点inode剩余量: 需以%结尾。控制台展示为evictionHard - 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** @@ -156,6 +143,13 @@ def add_uk8s_node_group( - **Pid** (str) - 系统预留pid数量,必须大于等于500, string方式提供。控制台展示为systemReserved - pid + **AddUK8SNodeGroupParamKubeletConfigurationKubeReserved** + - **CPU** (str) - kubelet预留CPU资源,以m结尾。控制台展示为kubeReserved - cpu + - **EphemeralStorage** (str) - kubelet预留存储空间,以Gi结尾。控制台展示为kubeReserved - ephemeral-storage + - **Memory** (str) - kubelet预留内存资源,以Mi结尾。控制台展示为kubeReserved - memory + - **Pid** (str) - kubelet预留pid数量,必须大于等于500, string方式提供。控制台展示为kubeReserved - pid + + **AddUK8SNodeGroupParamKubeletConfiguration** - **ContainerLogMaxFiles** (int) - 容器的日志文件个数上限,需大于等于2。控制台展示为containerLogMaxFiles - **ContainerLogMaxSize** (str) - 容器日志文件轮换生成新文件的最大阈值,需以Mi结尾。控制台展示为containerLogMaxSize @@ -169,6 +163,12 @@ def add_uk8s_node_group( - **SystemReserved** (dict) - 见 **AddUK8SNodeGroupParamKubeletConfigurationSystemReserved** 模型定义 + **AddUK8SNodeGroupParamSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] + + """ # build request d = { @@ -290,6 +290,10 @@ def add_uk8s_uhost_node( - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 + **AddUK8SUHostNodeParamNetworkInterface** + - **EIP** (dict) - 见 **AddUK8SUHostNodeParamNetworkInterfaceEIP** 模型定义 + + **AddUK8SUHostNodeParamUserLabels** - **Key** (str) - UK8S用户资源标签的键值 - **Value** (str) - UK8S用户资源标签的值 @@ -305,10 +309,6 @@ def add_uk8s_uhost_node( - **Priority** (str) - 安全组优先级。取值范围[1, 5] - **AddUK8SUHostNodeParamNetworkInterface** - - **EIP** (dict) - 见 **AddUK8SUHostNodeParamNetworkInterfaceEIP** 模型定义 - - """ # build request d = { @@ -374,15 +374,6 @@ def create_uk8s_cluster_v2( **Request Model** - **CreateUK8SClusterV2ParamUserLabels** - - **Key** (str) - UK8S用户资源标签的键值 - - **Value** (str) - UK8S用户资源标签的值 - - - **CreateUK8SClusterV2ParamKubeProxy** - - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 - - **CreateUK8SClusterV2ParamMasterSecGroupId** - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - **Name** (str) - 安全组名称。 @@ -401,19 +392,23 @@ def create_uk8s_cluster_v2( - **EIP** (dict) - 见 **CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP** 模型定义 - **CreateUK8SClusterV2ParamMaster** - - **SecGroupId** (list) - 见 **CreateUK8SClusterV2ParamMasterSecGroupId** 模型定义 - - **Zone** (str) - Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 `_ + **CreateUK8SClusterV2ParamNodesSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] **CreateUK8SClusterV2ParamNodesKubeletConfiguration** - **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup - **CreateUK8SClusterV2ParamNodesSecGroupId** - - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - - **Name** (str) - 安全组名称。 - - **Priority** (str) - 安全组优先级。取值范围[1, 5] + **CreateUK8SClusterV2ParamKubeProxy** + - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 + + + **CreateUK8SClusterV2ParamMaster** + - **SecGroupId** (list) - 见 **CreateUK8SClusterV2ParamMasterSecGroupId** 模型定义 + - **Zone** (str) - Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 `_ **CreateUK8SClusterV2ParamNodes** @@ -445,6 +440,11 @@ def create_uk8s_cluster_v2( - **Zone** (str) - 一组Nodes节点所属可用区,可创建多组Nodes节点,如一组是CPU Nodes节点,另一组是GPU Nodes节点。参见 `可用区列表 `_ + **CreateUK8SClusterV2ParamUserLabels** + - **Key** (str) - UK8S用户资源标签的键值 + - **Value** (str) - UK8S用户资源标签的值 + + """ # build request d = { @@ -482,6 +482,31 @@ def create_uk8s_uls_config( **Request Model** + **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** + - **Key** (str) - 按 Pod 标签匹配时,要匹配的标签的 Key。 + - **Value** (str) - 按 Pod 标签匹配时,要匹配的标签的值。 + - **ValueOperator** (str) - 按 Pod 标签匹配时,标签值的匹配操作符。可选值: in, notin。 + + + **CreateUK8SULSConfigParamMatchRulePodLabels** + - **Labels** (list) - 见 **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义 + - **Namespace** (str) - 命名空间名称 + - **NamespaceOperator** (str) - 指定/排除命名空间, 可选值: in/notin + + + **CreateUK8SULSConfigParamMatchRuleWorkloads** + - **Name** (str) - 按工作负载匹配时,工作负载的名称。 + - **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。 + - **Type** (str) - 按工作负载匹配时,工作负载的类型,例如 deployment, statefulset, daemonset,job, cronjob。 + + + **CreateUK8SULSConfigParamMatchRule** + - **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔 + - **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含) + - **PodLabels** (dict) - 见 **CreateUK8SULSConfigParamMatchRulePodLabels** 模型定义 + - **Workloads** (list) - 见 **CreateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 + + **CreateUK8SULSConfigParamExtractRuleExtractRule** - **LogRegexBase64** (str) - Base64 编码的日志提取正则表达式。 @@ -520,31 +545,6 @@ def create_uk8s_uls_config( - **Type** (str) - 日志输入类型。支持 container_file 和 container_stdout - **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** - - **Key** (str) - 按 Pod 标签匹配时,要匹配的标签的 Key。 - - **Value** (str) - 按 Pod 标签匹配时,要匹配的标签的值。 - - **ValueOperator** (str) - 按 Pod 标签匹配时,标签值的匹配操作符。可选值: in, notin。 - - - **CreateUK8SULSConfigParamMatchRulePodLabels** - - **Labels** (list) - 见 **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义 - - **Namespace** (str) - 命名空间名称 - - **NamespaceOperator** (str) - 指定/排除命名空间, 可选值: in/notin - - - **CreateUK8SULSConfigParamMatchRuleWorkloads** - - **Name** (str) - 按工作负载匹配时,工作负载的名称。 - - **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。 - - **Type** (str) - 按工作负载匹配时,工作负载的类型,例如 deployment, statefulset, daemonset,job, cronjob。 - - - **CreateUK8SULSConfigParamMatchRule** - - **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔 - - **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含) - - **PodLabels** (dict) - 见 **CreateUK8SULSConfigParamMatchRulePodLabels** 模型定义 - - **Workloads** (list) - 见 **CreateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 - - """ # build request d = { @@ -698,6 +698,16 @@ def describe_uk8s_cluster( **Response Model** + **SecGroupId** + - **Id** (str) - 安全组名称 + - **Name** (str) - 安全组id + - **Priority** (str) - 安全组优先级 + + + **KubeProxy** + - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] + + **DiskSet** - **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。 - **DiskId** (str) - 磁盘长ID @@ -711,22 +721,6 @@ 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: 是默认弹性网卡;其他值:不是。 @@ -762,15 +756,21 @@ 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) - 伸缩器版本 + + """ # build request d = { @@ -984,6 +984,10 @@ def list_uk8s_cluster_node_v2( **Response Model** + **KubeProxy** + - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] + + **UHostIPSet** - **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息) - **IP** (str) - IP地址 @@ -996,10 +1000,6 @@ def list_uk8s_cluster_node_v2( - **VPCId** (str) - IP地址对应的VPC ID - **KubeProxy** - - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] - - **NodeInfoV2** - **AsgId** (str) - 节点所属伸缩组ID,非伸缩组创建出来的节点,伸缩组ID为Default。 - **BootDiskSize** (int) - 系统盘大小 @@ -1138,23 +1138,11 @@ def list_uk8s_node_group( **Response Model** - **SecGroupId** - - **Id** (str) - 安全组名称 - - **Name** (str) - 安全组id - - **Priority** (str) - 安全组优先级 - - - **DiskSet** - - **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。 - - **DiskId** (str) - 磁盘长ID - - **DiskType** (str) - LOCAL_NOMAL| CLOUD_NORMAL| LOCAL_SSD| CLOUD_SSD|EXCLUSIVE_LOCAL_DISK - - **Drive** (str) - 磁盘盘符 - - **Encrypted** (str) - Yes: 加密 No: 非加密 - - **IOPS** (int) - 当前主机的IOPS值 - - **IsBoot** (str) - True| False - - **Name** (str) - UDisk名字(仅当磁盘是UDisk时返回) - - **Size** (int) - 磁盘大小,单位: GB - - **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk + **EvictionCondition** + - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 + - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 + - **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。 + - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 **ReservedResource** @@ -1164,13 +1152,6 @@ def list_uk8s_node_group( - **Pid** (str) - Pid - **EvictionCondition** - - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 - - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 - - **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。 - - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 - - **KubeletConfiguration** - **ContainerLogMaxFiles** (int) - 最大日志文件数量 - **ContainerLogMaxSize** (str) - 最大日志文件大小 @@ -1192,10 +1173,29 @@ def list_uk8s_node_group( - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 + **DiskSet** + - **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。 + - **DiskId** (str) - 磁盘长ID + - **DiskType** (str) - LOCAL_NOMAL| CLOUD_NORMAL| LOCAL_SSD| CLOUD_SSD|EXCLUSIVE_LOCAL_DISK + - **Drive** (str) - 磁盘盘符 + - **Encrypted** (str) - Yes: 加密 No: 非加密 + - **IOPS** (int) - 当前主机的IOPS值 + - **IsBoot** (str) - True| False + - **Name** (str) - UDisk名字(仅当磁盘是UDisk时返回) + - **Size** (int) - 磁盘大小,单位: GB + - **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk + + **NetworkInterface** - **EIP** (dict) - 见 **EIP** 模型定义 + **SecGroupId** + - **Id** (str) - 安全组名称 + - **Name** (str) - 安全组id + - **Priority** (str) - 安全组优先级 + + **NodeGroupSet** - **BootDiskSize** (int) - 系统盘大小 - **BootDiskType** (str) - 系统盘类型 @@ -1277,18 +1277,18 @@ def list_uk8s_uls_config( - **ValueOperator** (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。 + **ULSWorkloadMatch** + - **Name** (str) - 工作负载的名称。 + - **Namespace** (str) - 工作负载所在的命名空间。 + - **Type** (str) - 工作负载的类型,例如 deployment, statefulset, daemonset,cronjob,job。 + + **ULSMatchRule** - **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔 - **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含) @@ -1296,23 +1296,11 @@ 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。 @@ -1330,6 +1318,18 @@ def list_uk8s_uls_config( - **UnMatchUpload** (str) - 是否上传解析失败的日志。字符串 true 表示上传,false 表示丢弃。默认为 false。 + **ULSFilePaths** + - **File** (str) - 采集文件 + - **Path** (str) - 定义采集路径 + + + **ULSInputDetail** + - **FilePaths** (list) - 见 **ULSFilePaths** 模型定义 + - **InputMetadata** (dict) - 见 **ULSInputMetadata** 模型定义 + - **Stream** (str) - 容器标准输出流类型。仅适用于 container_stdout,可选值:all、stdout、stderr,默认为 all。 + - **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。 + + **ULSLogConfig** - **ClusterId** (str) - uk8s集群id - **ExtractRule** (dict) - 见 **ULSExtractRule** 模型定义 @@ -1457,10 +1457,8 @@ def update_uk8s_node_group( **Request Model** - **UpdateUK8SNodeGroupParamSecGroupId** - - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - - **Name** (str) - 安全组名称。 - - **Priority** (str) - 安全组优先级。取值范围[1, 5] + **UpdateUK8SNodeGroupParamKubeletConfiguration** + - **ContainerLogMaxFiles** (int) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup **UpdateUK8SNodeGroupParamNetworkInterfaceEIP** @@ -1475,8 +1473,10 @@ def update_uk8s_node_group( - **EIP** (dict) - 见 **UpdateUK8SNodeGroupParamNetworkInterfaceEIP** 模型定义 - **UpdateUK8SNodeGroupParamKubeletConfiguration** - - **ContainerLogMaxFiles** (int) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup + **UpdateUK8SNodeGroupParamSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] """ @@ -1514,11 +1514,6 @@ def update_uk8s_uls_config( **Request Model** - **UpdateUK8SULSConfigParamInputDetailMetadata** - - **Container** (str) - 要附加到日志中的容器元数据字段,多个字段使用逗号分隔。可选字段:container_name、namespace、pod_name、pod_ip、pod_uid、container_id、image_name。留空表示不采集容器元数据。 - - **Labels** (str) - 要采集的Pod标签。*表示采集所有标签,app,version表示仅采集指定标签,空字符串表示不采集标签。 - - **UpdateUK8SULSConfigParamMatchRulePodLabelsLabels** - **Key** (str) - 按Pod标签匹配时,要匹配的标签Key。 - **Value** (str) - 要匹配的标签值。 @@ -1537,6 +1532,30 @@ 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** 模型定义 + + + **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表示仅采集指定标签,空字符串表示不采集标签。 + + + **UpdateUK8SULSConfigParamInputDetail** + - **FilePaths** (list) - 见 **UpdateUK8SULSConfigParamInputDetailFilePaths** 模型定义 + - **Metadata** (dict) - 见 **UpdateUK8SULSConfigParamInputDetailMetadata** 模型定义 + - **Stream** (str) - 容器标准输出流类型。仅适用于container_stdout,可选值:all、stdout、stderr,默认为all。 + - **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。 + + **UpdateUK8SULSConfigParamExtractRule** - **BeginningRegex** (str) - 行首正则表达式。multi_line、multi_line_full_regex或multi_line_delimiter模式下,BeginningRegex和BeginningRegexBase64必须至少填写一个。 - **BeginningRegexBase64** (str) - Base64编码的行首正则表达式。填写时优先于BeginningRegex。 @@ -1554,25 +1573,6 @@ def update_uk8s_uls_config( - **UnMatchUpload** (str) - 是否上传解析失败的日志。字符串true表示上传,false表示丢弃。默认为false。 - **UpdateUK8SULSConfigParamInputDetailFilePaths** - - **File** (str) - 要采集的文件名。仅适用于container_file。 - - **Path** (str) - 日志采集路径。仅适用于container_file。 - - - **UpdateUK8SULSConfigParamInputDetail** - - **FilePaths** (list) - 见 **UpdateUK8SULSConfigParamInputDetailFilePaths** 模型定义 - - **Metadata** (dict) - 见 **UpdateUK8SULSConfigParamInputDetailMetadata** 模型定义 - - **Stream** (str) - 容器标准输出流类型。仅适用于container_stdout,可选值:all、stdout、stderr,默认为all。 - - **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 a200d95..dece01e 100644 --- a/ucloud/services/uk8s/schemas/apis.py +++ b/ucloud/services/uk8s/schemas/apis.py @@ -51,35 +51,24 @@ 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 -): - """AddUK8SNodeGroupParamKubeletConfigurationKubeReserved -""" +class AddUK8SNodeGroupParamNetworkInterfaceEIPSchema(schema.RequestSchema): + """AddUK8SNodeGroupParamNetworkInterfaceEIP -""" fields = { - "CPU": fields.Str(required=False, dump_to="CPU"), - "EphemeralStorage": fields.Str( - required=False, dump_to="EphemeralStorage" + "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" ), - "Memory": fields.Str(required=False, dump_to="Memory"), - "Pid": fields.Str(required=False, dump_to="Pid"), } -class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriodSchema( +class AddUK8SNodeGroupParamKubeletConfigurationEvictionHardSchema( schema.RequestSchema ): - """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod -""" + """AddUK8SNodeGroupParamKubeletConfigurationEvictionHard -""" fields = { "ImagefsAvailable": fields.Str( @@ -118,20 +107,6 @@ class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftSchema( } -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 -""" @@ -142,10 +117,10 @@ class AddUK8SNodeGroupParamNetworkInterfaceSchema(schema.RequestSchema): } -class AddUK8SNodeGroupParamKubeletConfigurationEvictionHardSchema( +class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriodSchema( schema.RequestSchema ): - """AddUK8SNodeGroupParamKubeletConfigurationEvictionHard -""" + """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod -""" fields = { "ImagefsAvailable": fields.Str( @@ -178,6 +153,21 @@ class AddUK8SNodeGroupParamKubeletConfigurationSystemReservedSchema( } +class AddUK8SNodeGroupParamKubeletConfigurationKubeReservedSchema( + schema.RequestSchema +): + """AddUK8SNodeGroupParamKubeletConfigurationKubeReserved -""" + + fields = { + "CPU": fields.Str(required=False, dump_to="CPU"), + "EphemeralStorage": fields.Str( + required=False, dump_to="EphemeralStorage" + ), + "Memory": fields.Str(required=False, dump_to="Memory"), + "Pid": fields.Str(required=False, dump_to="Pid"), + } + + class AddUK8SNodeGroupParamKubeletConfigurationSchema(schema.RequestSchema): """AddUK8SNodeGroupParamKubeletConfiguration -""" @@ -213,6 +203,16 @@ 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 AddUK8SNodeGroupRequestSchema(schema.RequestSchema): """AddUK8SNodeGroup - 添加UK8S节点池""" @@ -336,6 +336,16 @@ class AddUK8SUHostNodeParamNetworkInterfaceEIPSchema(schema.RequestSchema): } +class AddUK8SUHostNodeParamNetworkInterfaceSchema(schema.RequestSchema): + """AddUK8SUHostNodeParamNetworkInterface -""" + + fields = { + "EIP": AddUK8SUHostNodeParamNetworkInterfaceEIPSchema( + required=False, dump_to="EIP" + ), + } + + class AddUK8SUHostNodeParamUserLabelsSchema(schema.RequestSchema): """AddUK8SUHostNodeParamUserLabels -""" @@ -365,16 +375,6 @@ class AddUK8SUHostNodeParamSecGroupIdSchema(schema.RequestSchema): } -class AddUK8SUHostNodeParamNetworkInterfaceSchema(schema.RequestSchema): - """AddUK8SUHostNodeParamNetworkInterface -""" - - fields = { - "EIP": AddUK8SUHostNodeParamNetworkInterfaceEIPSchema( - required=False, dump_to="EIP" - ), - } - - class AddUK8SUHostNodeRequestSchema(schema.RequestSchema): """AddUK8SUHostNode - 为UK8S集群添加一台Node节点,机型类型为云主机""" @@ -452,23 +452,6 @@ class AddUK8SUHostNodeResponseSchema(schema.ResponseSchema): """ -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 -""" @@ -505,14 +488,13 @@ class CreateUK8SClusterV2ParamNodesNetworkInterfaceSchema(schema.RequestSchema): } -class CreateUK8SClusterV2ParamMasterSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamMaster -""" +class CreateUK8SClusterV2ParamNodesSecGroupIdSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamNodesSecGroupId -""" fields = { - "SecGroupId": fields.List( - CreateUK8SClusterV2ParamMasterSecGroupIdSchema() - ), - "Zone": fields.Str(required=True, dump_to="Zone"), + "Id": fields.Str(required=False, dump_to="Id"), + "Name": fields.Str(required=False, dump_to="Name"), + "Priority": fields.Str(required=False, dump_to="Priority"), } @@ -528,13 +510,22 @@ class CreateUK8SClusterV2ParamNodesKubeletConfigurationSchema( } -class CreateUK8SClusterV2ParamNodesSecGroupIdSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamNodesSecGroupId -""" +class CreateUK8SClusterV2ParamKubeProxySchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamKubeProxy -""" 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"), + "Mode": fields.Str(required=False, dump_to="Mode"), + } + + +class CreateUK8SClusterV2ParamMasterSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamMaster -""" + + fields = { + "SecGroupId": fields.List( + CreateUK8SClusterV2ParamMasterSecGroupIdSchema() + ), + "Zone": fields.Str(required=True, dump_to="Zone"), } @@ -589,6 +580,15 @@ class CreateUK8SClusterV2ParamNodesSchema(schema.RequestSchema): } +class CreateUK8SClusterV2ParamUserLabelsSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamUserLabels -""" + + fields = { + "Key": fields.Str(required=False, dump_to="Key"), + "Value": fields.Str(required=False, dump_to="Value"), + } + + class CreateUK8SClusterV2RequestSchema(schema.RequestSchema): """CreateUK8SClusterV2 - 创建UK8S集群""" @@ -674,6 +674,59 @@ class CreateUK8SClusterV2ResponseSchema(schema.ResponseSchema): """ +class CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema( + schema.RequestSchema +): + """CreateUK8SULSConfigParamMatchRulePodLabelsLabels -""" + + fields = { + "Key": fields.Str(required=False, dump_to="Key"), + "Value": fields.Str(required=False, dump_to="Value"), + "ValueOperator": fields.Str(required=False, dump_to="ValueOperator"), + } + + +class CreateUK8SULSConfigParamMatchRulePodLabelsSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamMatchRulePodLabels -""" + + fields = { + "Labels": fields.List( + CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema() + ), + "Namespace": fields.Str(required=False, dump_to="Namespace"), + "NamespaceOperator": fields.Str( + required=False, dump_to="NamespaceOperator" + ), + } + + +class CreateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamMatchRuleWorkloads -""" + + fields = { + "Name": fields.Str(required=False, dump_to="Name"), + "Namespace": fields.Str(required=False, dump_to="Namespace"), + "Type": fields.Str(required=False, dump_to="Type"), + } + + +class CreateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamMatchRule -""" + + fields = { + "Container": fields.Str(required=False, dump_to="Container"), + "ContainerOperator": fields.Str( + required=False, dump_to="ContainerOperator" + ), + "PodLabels": CreateUK8SULSConfigParamMatchRulePodLabelsSchema( + required=False, dump_to="PodLabels" + ), + "Workloads": fields.List( + CreateUK8SULSConfigParamMatchRuleWorkloadsSchema() + ), + } + + class CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( schema.RequestSchema ): @@ -744,59 +797,6 @@ class CreateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): } -class CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema( - schema.RequestSchema -): - """CreateUK8SULSConfigParamMatchRulePodLabelsLabels -""" - - fields = { - "Key": fields.Str(required=False, dump_to="Key"), - "Value": fields.Str(required=False, dump_to="Value"), - "ValueOperator": fields.Str(required=False, dump_to="ValueOperator"), - } - - -class CreateUK8SULSConfigParamMatchRulePodLabelsSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamMatchRulePodLabels -""" - - fields = { - "Labels": fields.List( - CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema() - ), - "Namespace": fields.Str(required=False, dump_to="Namespace"), - "NamespaceOperator": fields.Str( - required=False, dump_to="NamespaceOperator" - ), - } - - -class CreateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamMatchRuleWorkloads -""" - - fields = { - "Name": fields.Str(required=False, dump_to="Name"), - "Namespace": fields.Str(required=False, dump_to="Namespace"), - "Type": fields.Str(required=False, dump_to="Type"), - } - - -class CreateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamMatchRule -""" - - fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "ContainerOperator": fields.Str( - required=False, dump_to="ContainerOperator" - ), - "PodLabels": CreateUK8SULSConfigParamMatchRulePodLabelsSchema( - required=False, dump_to="PodLabels" - ), - "Workloads": fields.List( - CreateUK8SULSConfigParamMatchRuleWorkloadsSchema() - ), - } - - class CreateUK8SULSConfigRequestSchema(schema.RequestSchema): """CreateUK8SULSConfig - 创建 LogConfig 自定义资源,用于声明式地定义日志采集规则""" @@ -1343,13 +1343,13 @@ class RemoveUK8SNodeGroupResponseSchema(schema.ResponseSchema): """ -class UpdateUK8SNodeGroupParamSecGroupIdSchema(schema.RequestSchema): - """UpdateUK8SNodeGroupParamSecGroupId -""" +class UpdateUK8SNodeGroupParamKubeletConfigurationSchema(schema.RequestSchema): + """UpdateUK8SNodeGroupParamKubeletConfiguration -""" 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"), + "ContainerLogMaxFiles": fields.Int( + required=False, dump_to="ContainerLogMaxFiles" + ), } @@ -1377,13 +1377,13 @@ class UpdateUK8SNodeGroupParamNetworkInterfaceSchema(schema.RequestSchema): } -class UpdateUK8SNodeGroupParamKubeletConfigurationSchema(schema.RequestSchema): - """UpdateUK8SNodeGroupParamKubeletConfiguration -""" +class UpdateUK8SNodeGroupParamSecGroupIdSchema(schema.RequestSchema): + """UpdateUK8SNodeGroupParamSecGroupId -""" fields = { - "ContainerLogMaxFiles": fields.Int( - required=False, dump_to="ContainerLogMaxFiles" - ), + "Id": fields.Str(required=False, dump_to="Id"), + "Name": fields.Str(required=False, dump_to="Name"), + "Priority": fields.Str(required=False, dump_to="Priority"), } @@ -1456,15 +1456,6 @@ class UpdateUK8SNodeGroupResponseSchema(schema.ResponseSchema): """ -class UpdateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamInputDetailMetadata -""" - - fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "Labels": fields.Str(required=False, dump_to="Labels"), - } - - class UpdateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema( schema.RequestSchema ): @@ -1501,28 +1492,20 @@ class UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): } -class UpdateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamExtractRule -""" +class UpdateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamMatchRule -""" fields = { - "BeginningRegex": fields.Str(required=False, dump_to="BeginningRegex"), - "BeginningRegexBase64": fields.Str( - required=False, dump_to="BeginningRegexBase64" + "Container": fields.Str(required=False, dump_to="Container"), + "ContainerOperator": fields.Str( + required=False, dump_to="ContainerOperator" ), - "CollectPolicy": fields.Str(required=False, dump_to="CollectPolicy"), - "Delimiter": fields.Str(required=False, dump_to="Delimiter"), - "DelimiterBase64": fields.Str( - required=False, dump_to="DelimiterBase64" + "PodLabels": UpdateUK8SULSConfigParamMatchRulePodLabelsSchema( + required=False, dump_to="PodLabels" + ), + "Workloads": fields.List( + UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema() ), - "Encode": fields.Str(required=False, dump_to="Encode"), - "Keys": fields.List(fields.Str()), - "LogRegex": fields.Str(required=False, dump_to="LogRegex"), - "LogRegexBase64": fields.Str(required=False, dump_to="LogRegexBase64"), - "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"), } @@ -1535,6 +1518,15 @@ class UpdateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): } +class UpdateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamInputDetailMetadata -""" + + fields = { + "Container": fields.Str(required=False, dump_to="Container"), + "Labels": fields.Str(required=False, dump_to="Labels"), + } + + class UpdateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): """UpdateUK8SULSConfigParamInputDetail -""" @@ -1550,20 +1542,28 @@ class UpdateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): } -class UpdateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamMatchRule -""" +class UpdateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamExtractRule -""" fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "ContainerOperator": fields.Str( - required=False, dump_to="ContainerOperator" - ), - "PodLabels": UpdateUK8SULSConfigParamMatchRulePodLabelsSchema( - required=False, dump_to="PodLabels" + "BeginningRegex": fields.Str(required=False, dump_to="BeginningRegex"), + "BeginningRegexBase64": fields.Str( + required=False, dump_to="BeginningRegexBase64" ), - "Workloads": fields.List( - UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema() + "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"), + "Keys": fields.List(fields.Str()), + "LogRegex": fields.Str(required=False, dump_to="LogRegex"), + "LogRegexBase64": fields.Str(required=False, dump_to="LogRegexBase64"), + "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"), } diff --git a/ucloud/services/uk8s/schemas/models.py b/ucloud/services/uk8s/schemas/models.py index 2c0a042..b89897f 100644 --- a/ucloud/services/uk8s/schemas/models.py +++ b/ucloud/services/uk8s/schemas/models.py @@ -3,35 +3,6 @@ from ucloud.core.typesystem import schema, fields -class IPSetSchema(schema.ResponseSchema): - """IPSet - 节点的IP信息""" - - fields = { - "Bandwidth": fields.Int(required=False, load_from="Bandwidth"), - "Default": fields.Str(required=False, load_from="Default"), - "IP": fields.Str(required=False, load_from="IP"), - "IPId": fields.Str(required=False, load_from="IPId"), - "IPMode": fields.Str(required=False, load_from="IPMode"), - "Mac": fields.Str(required=False, load_from="Mac"), - "NetworkInterfaceId": fields.Str( - required=False, load_from="NetworkInterfaceId" - ), - "SubnetId": fields.Str(required=False, load_from="SubnetId"), - "Type": fields.Str(required=False, load_from="Type"), - "VPCId": fields.Str(required=False, load_from="VPCId"), - } - - -class SecGroupIdSchema(schema.ResponseSchema): - """SecGroupId - 安全组""" - - fields = { - "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 DiskSetSchema(schema.ResponseSchema): """DiskSet - 节点磁盘信息""" @@ -49,29 +20,11 @@ class DiskSetSchema(schema.ResponseSchema): } -class UhostInfoSchema(schema.ResponseSchema): - """UhostInfo - 机器信息""" +class KubeProxySchema(schema.ResponseSchema): + """KubeProxy - KubeProxy信息""" fields = { - "BasicImageName": fields.Str(required=True, load_from="BasicImageName"), - "CPU": fields.Int(required=True, load_from="CPU"), - "CreateTime": fields.Int(required=True, load_from="CreateTime"), - "DiskSet": fields.List(DiskSetSchema()), - "ExpireTime": fields.Int(required=True, load_from="ExpireTime"), - "GPU": fields.Int(required=True, load_from="GPU"), - "GpuType": fields.Str(required=True, load_from="GpuType"), - "IPSet": fields.List(IPSetSchema()), - "MachineType": fields.Str(required=True, load_from="MachineType"), - "Memory": fields.Int(required=True, load_from="Memory"), - "Name": fields.Str(required=True, load_from="Name"), - "NodeId": fields.Str(required=True, load_from="NodeId"), - "NodeType": fields.Str(required=True, load_from="NodeType"), - "OsName": fields.Str(required=True, load_from="OsName"), - "OsType": fields.Str(required=True, load_from="OsType"), - "SecGroupId": fields.List(SecGroupIdSchema()), - "State": fields.Str(required=True, load_from="State"), - "TotalDiskSpace": fields.Int(required=True, load_from="TotalDiskSpace"), - "Zone": fields.Str(required=True, load_from="Zone"), + "Mode": fields.Str(required=False, load_from="Mode"), } @@ -106,11 +59,58 @@ class AutoscalerSchema(schema.ResponseSchema): } -class KubeProxySchema(schema.ResponseSchema): - """KubeProxy - KubeProxy信息""" +class IPSetSchema(schema.ResponseSchema): + """IPSet - 节点的IP信息""" fields = { - "Mode": fields.Str(required=False, load_from="Mode"), + "Bandwidth": fields.Int(required=False, load_from="Bandwidth"), + "Default": fields.Str(required=False, load_from="Default"), + "IP": fields.Str(required=False, load_from="IP"), + "IPId": fields.Str(required=False, load_from="IPId"), + "IPMode": fields.Str(required=False, load_from="IPMode"), + "Mac": fields.Str(required=False, load_from="Mac"), + "NetworkInterfaceId": fields.Str( + required=False, load_from="NetworkInterfaceId" + ), + "SubnetId": fields.Str(required=False, load_from="SubnetId"), + "Type": fields.Str(required=False, load_from="Type"), + "VPCId": fields.Str(required=False, load_from="VPCId"), + } + + +class SecGroupIdSchema(schema.ResponseSchema): + """SecGroupId - 安全组""" + + fields = { + "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 UhostInfoSchema(schema.ResponseSchema): + """UhostInfo - 机器信息""" + + fields = { + "BasicImageName": fields.Str(required=True, load_from="BasicImageName"), + "CPU": fields.Int(required=True, load_from="CPU"), + "CreateTime": fields.Int(required=True, load_from="CreateTime"), + "DiskSet": fields.List(DiskSetSchema()), + "ExpireTime": fields.Int(required=True, load_from="ExpireTime"), + "GPU": fields.Int(required=True, load_from="GPU"), + "GpuType": fields.Str(required=True, load_from="GpuType"), + "IPSet": fields.List(IPSetSchema()), + "MachineType": fields.Str(required=True, load_from="MachineType"), + "Memory": fields.Int(required=True, load_from="Memory"), + "Name": fields.Str(required=True, load_from="Name"), + "NodeId": fields.Str(required=True, load_from="NodeId"), + "NodeType": fields.Str(required=True, load_from="NodeType"), + "OsName": fields.Str(required=True, load_from="OsName"), + "OsType": fields.Str(required=True, load_from="OsType"), + "SecGroupId": fields.List(SecGroupIdSchema()), + "State": fields.Str(required=True, load_from="State"), + "TotalDiskSpace": fields.Int(required=True, load_from="TotalDiskSpace"), + "Zone": fields.Str(required=True, load_from="Zone"), } @@ -267,25 +267,22 @@ class ClusterSetSchema(schema.ResponseSchema): } -class EIPSchema(schema.ResponseSchema): - """EIP - 节点EIP""" +class EvictionConditionSchema(schema.ResponseSchema): + """EvictionCondition - 驱逐条件或宽限时间""" fields = { - "Bandwidth": fields.Int(required=False, load_from="Bandwidth"), - "CouponId": fields.Str(required=False, load_from="CouponId"), - "OperatorName": fields.Str(required=False, load_from="OperatorName"), - "PayMode": fields.Str(required=False, load_from="PayMode"), - "ShareBandwidthId": fields.Str( - required=False, load_from="ShareBandwidthId" + "ImagefsAvailable": fields.Str( + required=False, load_from="ImagefsAvailable" + ), + "MemoryAvailable": fields.Str( + required=False, load_from="MemoryAvailable" + ), + "NodefsAvailable": fields.Str( + required=False, load_from="NodefsAvailable" + ), + "NodefsInodesFree": fields.Str( + required=False, load_from="NodefsInodesFree" ), - } - - -class NetworkInterfaceSchema(schema.ResponseSchema): - """NetworkInterface - 网络接口""" - - fields = { - "EIP": EIPSchema(), } @@ -302,25 +299,28 @@ class ReservedResourceSchema(schema.ResponseSchema): } -class EvictionConditionSchema(schema.ResponseSchema): - """EvictionCondition - 驱逐条件或宽限时间""" +class EIPSchema(schema.ResponseSchema): + """EIP - 节点EIP""" fields = { - "ImagefsAvailable": fields.Str( - required=False, load_from="ImagefsAvailable" - ), - "MemoryAvailable": fields.Str( - required=False, load_from="MemoryAvailable" - ), - "NodefsAvailable": fields.Str( - required=False, load_from="NodefsAvailable" - ), - "NodefsInodesFree": fields.Str( - required=False, load_from="NodefsInodesFree" + "Bandwidth": fields.Int(required=False, load_from="Bandwidth"), + "CouponId": fields.Str(required=False, load_from="CouponId"), + "OperatorName": fields.Str(required=False, load_from="OperatorName"), + "PayMode": fields.Str(required=False, load_from="PayMode"), + "ShareBandwidthId": fields.Str( + required=False, load_from="ShareBandwidthId" ), } +class NetworkInterfaceSchema(schema.ResponseSchema): + """NetworkInterface - 网络接口""" + + fields = { + "EIP": EIPSchema(), + } + + class KubeletConfigurationSchema(schema.ResponseSchema): """KubeletConfiguration - kubelet自定义配置""" @@ -402,32 +402,13 @@ class NodeGroupSetSchema(schema.ResponseSchema): } -class ULSExtractRuleSchema(schema.ResponseSchema): - """ULSExtractRule - 定义日志的提取、解析和格式化规则。""" +class ULSWorkloadMatchSchema(schema.ResponseSchema): + """ULSWorkloadMatch - ULSWorkloadMatch""" 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"), + "Name": fields.Str(required=False, load_from="Name"), + "Namespace": fields.Str(required=False, load_from="Namespace"), + "Type": fields.Str(required=False, load_from="Type"), } @@ -453,16 +434,6 @@ class ULSPodLabelsMatchSchema(schema.ResponseSchema): } -class ULSWorkloadMatchSchema(schema.ResponseSchema): - """ULSWorkloadMatch - ULSWorkloadMatch""" - - fields = { - "Name": fields.Str(required=False, load_from="Name"), - "Namespace": fields.Str(required=False, load_from="Namespace"), - "Type": fields.Str(required=False, load_from="Type"), - } - - class ULSMatchRuleSchema(schema.ResponseSchema): """ULSMatchRule - ULSMatchRule""" @@ -505,6 +476,35 @@ class ULSInputDetailSchema(schema.ResponseSchema): } +class ULSExtractRuleSchema(schema.ResponseSchema): + """ULSExtractRule - 定义日志的提取、解析和格式化规则。""" + + 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"), + } + + class ULSLogConfigSchema(schema.ResponseSchema): """ULSLogConfig - ULSLogConfig""" diff --git a/ucloud/version.py b/ucloud/version.py index a1859f3..b6d5d0a 100644 --- a/ucloud/version.py +++ b/ucloud/version.py @@ -1 +1 @@ -version = "0.11.142" +version = "0.11.143"