diff --git a/ucloud/services/uk8s/client.py b/ucloud/services/uk8s/client.py index 7beebe3..354a770 100644 --- a/ucloud/services/uk8s/client.py +++ b/ucloud/services/uk8s/client.py @@ -163,22 +163,18 @@ def add_uk8s_node_group( **Request Model** - **AddUK8SNodeGroupParamSecGroupId** - - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - - **Name** (str) - 安全组名称。 - - **Priority** (str) - 安全组优先级。取值范围[1, 5] - - - **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时有效 + **AddUK8SNodeGroupParamKubeletConfigurationSystemReserved** + - **CPU** (str) - 系统预留CPU资源,以m结尾。控制台展示为systemReserved - cpu + - **EphemeralStorage** (str) - 系统预留存储空间,以Gi结尾。控制台展示为systemReserved - ephemeral-storage + - **Memory** (str) - 系统预留内存资源,以Mi结尾。控制台展示为systemReserved - memory + - **Pid** (str) - 系统预留pid数量,必须大于等于500, string方式提供。控制台展示为systemReserved - pid - **AddUK8SNodeGroupParamNetworkInterface** - - **EIP** (dict) - 见 **AddUK8SNodeGroupParamNetworkInterfaceEIP** 模型定义 + **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** @@ -188,13 +184,6 @@ def add_uk8s_node_group( - **NodefsInodesFree** (str) - 触发Pod驱逐操作的硬性门限节点inode剩余量: 需以%结尾。控制台展示为evictionHard - nodefs.inodesFree - **AddUK8SNodeGroupParamKubeletConfigurationSystemReserved** - - **CPU** (str) - 系统预留CPU资源,以m结尾。控制台展示为systemReserved - cpu - - **EphemeralStorage** (str) - 系统预留存储空间,以Gi结尾。控制台展示为systemReserved - ephemeral-storage - - **Memory** (str) - 系统预留内存资源,以Mi结尾。控制台展示为systemReserved - memory - - **Pid** (str) - 系统预留pid数量,必须大于等于500, string方式提供。控制台展示为systemReserved - pid - - **AddUK8SNodeGroupParamKubeletConfigurationEvictionSoft** - **ImagefsAvailable** (str) - 触发Pod驱逐操作的软性门限之容器镜像剩余空间: 需以%结尾。配置此值时必须同时配置EvictionSoftGracePeriod.ImagefsAvailable。控制台展示为evictionSoft - imagefs.available - **MemoryAvailable** (str) - 触发Pod驱逐操作的软性门限之内存用量: 需以Mi或Gi结尾。配置此值时必须同时配置EvictionSoftGracePeriod.MemoryAvailable。控制台展示为evictionSoft - memory.available @@ -202,13 +191,6 @@ def add_uk8s_node_group( - **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 - - **AddUK8SNodeGroupParamKubeletConfigurationKubeReserved** - **CPU** (str) - kubelet预留CPU资源,以m结尾。控制台展示为kubeReserved - cpu - **EphemeralStorage** (str) - kubelet预留存储空间,以Gi结尾。控制台展示为kubeReserved - ephemeral-storage @@ -229,6 +211,24 @@ def add_uk8s_node_group( - **SystemReserved** (dict) - 见 **AddUK8SNodeGroupParamKubeletConfigurationSystemReserved** 模型定义 + **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** 模型定义 + + + **AddUK8SNodeGroupParamSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] + + """ # build request d = { @@ -347,12 +347,6 @@ def add_uk8s_uhost_node( - **Value** (str) - UK8S用户资源标签的值 - **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接口查询,或登录用户中心查看。 @@ -369,6 +363,12 @@ def add_uk8s_uhost_node( - **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup + **AddUK8SUHostNodeParamSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] + + """ # build request d = { @@ -437,6 +437,10 @@ def create_uk8s_cluster_v2( **Request Model** + **CreateUK8SClusterV2ParamKubeProxy** + - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 + + **CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -449,12 +453,7 @@ def create_uk8s_cluster_v2( - **EIP** (dict) - 见 **CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP** 模型定义 - **CreateUK8SClusterV2ParamUserLabels** - - **Key** (str) - UK8S用户资源标签的键值 - - **Value** (str) - UK8S用户资源标签的值 - - - **CreateUK8SClusterV2ParamMasterSecGroupId** + **CreateUK8SClusterV2ParamNodesSecGroupId** - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - **Name** (str) - 安全组名称。 - **Priority** (str) - 安全组优先级。取值范围[1, 5] @@ -464,21 +463,6 @@ def create_uk8s_cluster_v2( - **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] - - - **CreateUK8SClusterV2ParamMaster** - - **SecGroupId** (list) - 见 **CreateUK8SClusterV2ParamMasterSecGroupId** 模型定义 - - **Zone** (str) - Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 `_ - - - **CreateUK8SClusterV2ParamKubeProxy** - - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 - - **CreateUK8SClusterV2ParamNodes** - **BootDiskSize** (int) - Node节点的系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。 - **BootDiskType** (str) - 一组Node节点的系统盘类型,请参考 `磁盘类型 `_ 。默认为SSD云盘 @@ -508,6 +492,22 @@ def create_uk8s_cluster_v2( - **Zone** (str) - 一组Nodes节点所属可用区,可创建多组Nodes节点,如一组是CPU Nodes节点,另一组是GPU Nodes节点。参见 `可用区列表 `_ + **CreateUK8SClusterV2ParamMasterSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] + + + **CreateUK8SClusterV2ParamMaster** + - **SecGroupId** (list) - 见 **CreateUK8SClusterV2ParamMasterSecGroupId** 模型定义 + - **Zone** (str) - Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 `_ + + + **CreateUK8SClusterV2ParamUserLabels** + - **Key** (str) - UK8S用户资源标签的键值 + - **Value** (str) - UK8S用户资源标签的值 + + """ # build request d = { @@ -545,21 +545,10 @@ def create_uk8s_uls_config( **Request Model** - **CreateUK8SULSConfigParamInputDetailFilePaths** - - **File** (str) - 定义采集路径的文件名 - - **Path** (str) - 定义采集路径 - - - **CreateUK8SULSConfigParamInputDetailMetadata** - - **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), "" (不采集任何标签)。 - - - **CreateUK8SULSConfigParamInputDetail** - - **FilePaths** (list) - 见 **CreateUK8SULSConfigParamInputDetailFilePaths** 模型定义 - - **Metadata** (dict) - 见 **CreateUK8SULSConfigParamInputDetailMetadata** 模型定义 - - **Stream** (str) - all、stdout、stderr,默认 all (用于 InputDetail.Type = container_stdout) - - **Type** (str) - 日志输入类型。支持 container_file 和 container_stdout + **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** + - **Key** (str) - 按 Pod 标签匹配时,要匹配的标签的 Key。 + - **Value** (str) - 按 Pod 标签匹配时,要匹配的标签的值。 + - **ValueOperator** (str) - 按 Pod 标签匹配时,标签值的匹配操作符。可选值: in, notin。 **CreateUK8SULSConfigParamMatchRuleWorkloads** @@ -568,16 +557,6 @@ def create_uk8s_uls_config( - **Type** (str) - 按工作负载匹配时,工作负载的类型,例如 deployment, statefulset, daemonset,job, cronjob。 - **CreateUK8SULSConfigParamExtractRuleExtractRule** - - **LogRegexBase64** (str) - Base64 编码的日志提取正则表达式。 - - - **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** - - **Key** (str) - 按 Pod 标签匹配时,要匹配的标签的 Key。 - - **Value** (str) - 按 Pod 标签匹配时,要匹配的标签的值。 - - **ValueOperator** (str) - 按 Pod 标签匹配时,标签值的匹配操作符。可选值: in, notin。 - - **CreateUK8SULSConfigParamMatchRulePodLabels** - **Labels** (list) - 见 **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义 - **Namespace** (str) - 命名空间名称 @@ -591,6 +570,20 @@ def create_uk8s_uls_config( - **Workloads** (list) - 见 **CreateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 + **CreateUK8SULSConfigParamInputDetailFilePaths** + - **File** (str) - 定义采集路径的文件名 + - **Path** (str) - 定义采集路径 + + + **CreateUK8SULSConfigParamExtractRuleExtractRule** + - **LogRegexBase64** (str) - Base64 编码的日志提取正则表达式。 + + + **CreateUK8SULSConfigParamInputDetailMetadata** + - **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), "" (不采集任何标签)。 + + **CreateUK8SULSConfigParamExtractRule** - **BeginningRegex** (str) - 行首正则表达式。当 logType 为多行模式 (如 multi_line 或 multi_line_full_regex) 时,用于标识一条新日志的开始。 - **BeginningRegexBase64** (str) - Base64 编码的行首正则,优先级高于 BeginningRegex @@ -608,6 +601,13 @@ def create_uk8s_uls_config( - **UnMatchUpload** (str) - 是否上传解析失败的日志。true 表示上传,false 表示丢弃。默认为 false。 + **CreateUK8SULSConfigParamInputDetail** + - **FilePaths** (list) - 见 **CreateUK8SULSConfigParamInputDetailFilePaths** 模型定义 + - **Metadata** (dict) - 见 **CreateUK8SULSConfigParamInputDetailMetadata** 模型定义 + - **Stream** (str) - all、stdout、stderr,默认 all (用于 InputDetail.Type = container_stdout) + - **Type** (str) - 日志输入类型。支持 container_file 和 container_stdout + + """ # build request d = { @@ -754,6 +754,13 @@ def describe_uk8s_autoscaler_group( **Response Model** + **ReservedResource** + - **CPU** (str) - CPU + - **EphemeralStorage** (str) - 存储 + - **Memory** (str) - 内存 + - **Pid** (str) - Pid + + **EIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -762,10 +769,6 @@ def describe_uk8s_autoscaler_group( - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 - **NetworkInterface** - - **EIP** (dict) - 见 **EIP** 模型定义 - - **EvictionCondition** - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 @@ -773,13 +776,6 @@ def describe_uk8s_autoscaler_group( - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 - **ReservedResource** - - **CPU** (str) - CPU - - **EphemeralStorage** (str) - 存储 - - **Memory** (str) - 内存 - - **Pid** (str) - Pid - - **KubeletConfiguration** - **ContainerLogMaxFiles** (int) - 最大日志文件数量 - **ContainerLogMaxSize** (str) - 最大日志文件大小 @@ -793,6 +789,10 @@ def describe_uk8s_autoscaler_group( - **SystemReserved** (dict) - 见 **ReservedResource** 模型定义 + **NetworkInterface** + - **EIP** (dict) - 见 **EIP** 模型定义 + + **SecGroupId** - **Id** (str) - 安全组 ID - **Name** (str) - 安全组名称 @@ -925,6 +925,22 @@ def describe_uk8s_cluster( **Response Model** + **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: 是默认弹性网卡;其他值:不是。 @@ -938,12 +954,6 @@ def describe_uk8s_cluster( - **VPCId** (str) - IP 所属的 VPC Id - **SecGroupId** - - **Id** (str) - 安全组名称 - - **Name** (str) - 安全组id - - **Priority** (str) - 安全组优先级 - - **DiskSet** - **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。 - **DiskId** (str) - 磁盘长ID @@ -957,9 +967,8 @@ def describe_uk8s_cluster( - **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk - **LoopbackClientCert** - - **ExpireTime** (int) - 证书到期时间 - - **Warn** (bool) - 证书是否进入过期告警状态 + **KubeProxy** + - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] **UhostInfo** @@ -984,18 +993,9 @@ def describe_uk8s_cluster( - **Zone** (str) - 所在机房 - **KubeProxy** - - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] - - - **Autoscaler** - - **Enabled** (int) - 打开/关闭 - - **ScaleDownDelayAfterAdd** (str) - 静默时间 - - **ScaleDownGpuUtilizationThreshold** (str) - GPU缩容阈值 - - **ScaleDownUnneededTime** (str) - 缩容触发延时 - - **ScaleDownUtilizationThreshold** (str) - CPU缩容阈值 - - **UpdateTime** (int) - - - **Version** (str) - 伸缩器版本 + **LoopbackClientCert** + - **ExpireTime** (int) - 证书到期时间 + - **Warn** (bool) - 证书是否进入过期告警状态 """ @@ -1203,6 +1203,12 @@ def get_uk8s_available_instance_types( **Response Model** + **InstanceTypeFeatureMode** + - **MinimalCpuPlatform** (list) - 最低 CPU 平台列表 + - **Name** (str) - 模式名称 + - **RelatedToImageFeature** (list) - 关联的镜像特性 + + **InstanceTypeMachineSizeCollection** - **Cpu** (int) - CPU 核数 - **Memory** (list) - 可用内存容量列表 @@ -1215,11 +1221,15 @@ def get_uk8s_available_instance_types( - **Name** (str) - CPU 平台名称 - **InstanceTypeDataDisk** - - **Features** (list) - 磁盘特性列表 - - **MaximalSize** (int) - 最大磁盘容量 - - **MinimalSize** (int) - 最小磁盘容量 - - **Name** (str) - 数据盘类型名称 + **InstanceTypeUHostFamily** + - **CpuFrequency** (str) - CPU 频率 + - **CpuPlatforms** (list) - 见 **InstanceTypeCpuPlatform** 模型定义 + - **Name** (str) - 规格族名称 + + + **InstanceTypeValueRate** + - **Rate** (int) - 评分 + - **Value** (float) - 数值 **InstanceTypeBootDisk** @@ -1229,32 +1239,11 @@ def get_uk8s_available_instance_types( - **Name** (str) - 系统盘类型名称 - **InstanceTypeDisk** - - **BootDisk** (list) - 见 **InstanceTypeBootDisk** 模型定义 - - **DataDisk** (list) - 见 **InstanceTypeDataDisk** 模型定义 - - **Name** (str) - 磁盘配置名称 - - - **InstanceTypeFeatureMode** - - **MinimalCpuPlatform** (list) - 最低 CPU 平台列表 - - **Name** (str) - 模式名称 - - **RelatedToImageFeature** (list) - 关联的镜像特性 - - - **InstanceTypeFeature** - - **Modes** (list) - 见 **InstanceTypeFeatureMode** 模型定义 - - **Name** (str) - 特性名称 - - - **InstanceTypeValueRate** - - **Rate** (int) - 评分 - - **Value** (float) - 数值 - - - **InstanceTypeUHostFamily** - - **CpuFrequency** (str) - CPU 频率 - - **CpuPlatforms** (list) - 见 **InstanceTypeCpuPlatform** 模型定义 - - **Name** (str) - 规格族名称 + **InstanceTypeDataDisk** + - **Features** (list) - 磁盘特性列表 + - **MaximalSize** (int) - 最大磁盘容量 + - **MinimalSize** (int) - 最小磁盘容量 + - **Name** (str) - 数据盘类型名称 **InstanceTypeMachineSize** @@ -1262,6 +1251,17 @@ def get_uk8s_available_instance_types( - **Gpu** (int) - GPU 数量 + **InstanceTypeDisk** + - **BootDisk** (list) - 见 **InstanceTypeBootDisk** 模型定义 + - **DataDisk** (list) - 见 **InstanceTypeDataDisk** 模型定义 + - **Name** (str) - 磁盘配置名称 + + + **InstanceTypeFeature** + - **Modes** (list) - 见 **InstanceTypeFeatureMode** 模型定义 + - **Name** (str) - 特性名称 + + **UK8SAvailableInstanceType** - **Description** (str) - 机型描述 - **Disks** (list) - 见 **InstanceTypeDisk** 模型定义 @@ -1417,27 +1417,6 @@ def get_uk8s_node_group( **Response Model** - **EvictionCondition** - - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 - - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 - - **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。 - - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 - - - **ReservedResource** - - **CPU** (str) - CPU - - **EphemeralStorage** (str) - 存储 - - **Memory** (str) - 内存 - - **Pid** (str) - Pid - - - **NodeGroupDiskConfig** - - **IsBoot** (bool) - 是否为系统盘 - - **KmsKeyId** (str) - 磁盘加密密钥 ID - - **Size** (int) - 磁盘大小,单位 GB - - **Type** (str) - 磁盘类型 - - **EIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -1456,6 +1435,27 @@ def get_uk8s_node_group( - **Priority** (str) - 安全组优先级 + **NodeGroupDiskConfig** + - **IsBoot** (bool) - 是否为系统盘 + - **KmsKeyId** (str) - 磁盘加密密钥 ID + - **Size** (int) - 磁盘大小,单位 GB + - **Type** (str) - 磁盘类型 + + + **ReservedResource** + - **CPU** (str) - CPU + - **EphemeralStorage** (str) - 存储 + - **Memory** (str) - 内存 + - **Pid** (str) - Pid + + + **EvictionCondition** + - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 + - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 + - **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。 + - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 + + **KubeletConfiguration** - **ContainerLogMaxFiles** (int) - 最大日志文件数量 - **ContainerLogMaxSize** (str) - 最大日志文件大小 @@ -1553,48 +1553,6 @@ def get_uk8s_plugin_info( **Response Model** - **VKNodeInfo** - - **Node** (str) - 节点 ID。 - - **OperationResult** (int) - 上次插件操作结果:0 无结果,1 查询成功,2 查询失败,3 升级成功,4 升级失败。 - - **Status** (int) - 插件状态:0 未知,1 正常,2 异常,3 升级中。 - - **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。 - - **Version** (str) - 插件版本。 - - - **VKNode** - - **AvailableVersion** (str) - 最新版本 - - **ManageEnabled** (bool) - 插件管理是否开启 - - **Name** (str) - 插件名称 - - **PluginInfoSet** (list) - 见 **VKNodeInfo** 模型定义 - - **ReleaseTime** (str) - 发布时间 - - - **MonitorInfo** - - **AvailableVersion** (str) - 最新可用监控插件版本。 - - - **CSIInfo** - - **AvailableVersion** (str) - 最新可用插件版本。 - - **ManageEnabled** (bool) - 是否开启插件托管。 - - **Name** (str) - 插件名称。 - - **OperationResult** (int) - 上次插件操作结果。 - - **ReleaseTime** (str) - 最新可用版本的发布时间。 - - **Status** (int) - 插件状态。 - - **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。 - - **Version** (str) - 当前插件版本。 - - - **CloudProviderInfo** - - **AvailableVersion** (str) - 最新可用插件版本。 - - **ManageEnabled** (bool) - 是否开启插件托管。 - - **Name** (str) - 插件名称。 - - **OperationResult** (int) - 上次插件操作结果。 - - **ReleaseTime** (str) - 最新可用版本的发布时间。 - - **Status** (int) - 插件状态。 - - **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。 - - **Version** (str) - 当前插件版本。 - - **ClusterUpdateNodeInfo** - **IP** (str) - Node节点IP - **Node** (str) - Node节点名称 @@ -1631,6 +1589,22 @@ def get_uk8s_plugin_info( - **UpdateTime** (int) - 运行时转换信息更新时间,Unix 时间戳,单位秒。 + **VKNodeInfo** + - **Node** (str) - 节点 ID。 + - **OperationResult** (int) - 上次插件操作结果:0 无结果,1 查询成功,2 查询失败,3 升级成功,4 升级失败。 + - **Status** (int) - 插件状态:0 未知,1 正常,2 异常,3 升级中。 + - **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。 + - **Version** (str) - 插件版本。 + + + **VKNode** + - **AvailableVersion** (str) - 最新版本 + - **ManageEnabled** (bool) - 插件管理是否开启 + - **Name** (str) - 插件名称 + - **PluginInfoSet** (list) - 见 **VKNodeInfo** 模型定义 + - **ReleaseTime** (str) - 发布时间 + + **NodePlugin** - **AvailableVersion** (str) - 最新插件版本 - **ManageEnabled** (bool) - 插件管理是否开启 @@ -1639,6 +1613,32 @@ def get_uk8s_plugin_info( - **ReleaseTime** (str) - 最新插件发布时间 + **CSIInfo** + - **AvailableVersion** (str) - 最新可用插件版本。 + - **ManageEnabled** (bool) - 是否开启插件托管。 + - **Name** (str) - 插件名称。 + - **OperationResult** (int) - 上次插件操作结果。 + - **ReleaseTime** (str) - 最新可用版本的发布时间。 + - **Status** (int) - 插件状态。 + - **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。 + - **Version** (str) - 当前插件版本。 + + + **CloudProviderInfo** + - **AvailableVersion** (str) - 最新可用插件版本。 + - **ManageEnabled** (bool) - 是否开启插件托管。 + - **Name** (str) - 插件名称。 + - **OperationResult** (int) - 上次插件操作结果。 + - **ReleaseTime** (str) - 最新可用版本的发布时间。 + - **Status** (int) - 插件状态。 + - **UpdateTime** (int) - 更新时间,Unix 时间戳,单位秒。 + - **Version** (str) - 当前插件版本。 + + + **MonitorInfo** + - **AvailableVersion** (str) - 最新可用监控插件版本。 + + """ # build request d = { @@ -1858,18 +1858,10 @@ def list_uk8s_node_group( **Response Model** - **EvictionCondition** - - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 - - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 - - **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。 - - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 - - - **ReservedResource** - - **CPU** (str) - CPU - - **EphemeralStorage** (str) - 存储 - - **Memory** (str) - 内存 - - **Pid** (str) - Pid + **SecGroupId** + - **Id** (str) - 安全组名称 + - **Name** (str) - 安全组id + - **Priority** (str) - 安全组优先级 **EIP** @@ -1880,16 +1872,24 @@ def list_uk8s_node_group( - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 - **SecGroupId** - - **Id** (str) - 安全组名称 - - **Name** (str) - 安全组id - - **Priority** (str) - 安全组优先级 - - **NetworkInterface** - **EIP** (dict) - 见 **EIP** 模型定义 + **EvictionCondition** + - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 + - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 + - **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。 + - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 + + + **ReservedResource** + - **CPU** (str) - CPU + - **EphemeralStorage** (str) - 存储 + - **Memory** (str) - 内存 + - **Pid** (str) - Pid + + **DiskSet** - **BackupType** (str) - 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。 - **DiskId** (str) - 磁盘长ID @@ -1991,15 +1991,21 @@ 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 这两个标签。""(空字符串):不采集任何标签。 - **ULSWorkloadMatch** - - **Name** (str) - 工作负载的名称。 - - **Namespace** (str) - 工作负载所在的命名空间。 - - **Type** (str) - 工作负载的类型,例如 deployment, statefulset, daemonset,cronjob,job。 + **ULSInputDetail** + - **FilePaths** (list) - 见 **ULSFilePaths** 模型定义 + - **InputMetadata** (dict) - 见 **ULSInputMetadata** 模型定义 + - **Stream** (str) - 容器标准输出流类型。仅适用于 container_stdout,可选值:all、stdout、stderr,默认为 all。 + - **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。 **ULSLabels** @@ -2014,6 +2020,12 @@ def list_uk8s_uls_config( - **NamespaceOperator** (str) - 命名空间名称的匹配操作符。可选值: in, notin。 + **ULSWorkloadMatch** + - **Name** (str) - 工作负载的名称。 + - **Namespace** (str) - 工作负载所在的命名空间。 + - **Type** (str) - 工作负载的类型,例如 deployment, statefulset, daemonset,cronjob,job。 + + **ULSMatchRule** - **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔 - **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含) @@ -2038,18 +2050,6 @@ 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** 模型定义 @@ -2240,16 +2240,16 @@ def update_uk8s_node_group( **Request Model** - **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] + **UpdateUK8SNodeGroupParamKubeletConfiguration** + - **ContainerLogMaxFiles** (int) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup + + **UpdateUK8SNodeGroupParamNetworkInterfaceEIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -2297,6 +2297,22 @@ def update_uk8s_uls_config( **Request Model** + **UpdateUK8SULSConfigParamMatchRuleWorkloads** + - **Name** (str) - 工作负载名称。 + - **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。Workloads和PodLabels不能同时设置。 + - **Type** (str) - 工作负载类型。可选值:deployment、statefulset、daemonset、job、cronjob。 + + + **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** - **Key** (str) - 按Pod标签匹配时,要匹配的标签Key。 - **Value** (str) - 要匹配的标签值。 @@ -2309,10 +2325,11 @@ def update_uk8s_uls_config( - **NamespaceOperator** (str) - 按Pod标签匹配时,命名空间名称的匹配操作符。可选值:in、notin。填写该参数时必须同时填写MatchRule.PodLabels.Namespace。PodLabels和Workloads不能同时设置。 - **UpdateUK8SULSConfigParamMatchRuleWorkloads** - - **Name** (str) - 工作负载名称。 - - **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。Workloads和PodLabels不能同时设置。 - - **Type** (str) - 工作负载类型。可选值:deployment、statefulset、daemonset、job、cronjob。 + **UpdateUK8SULSConfigParamMatchRule** + - **Container** (str) - 要匹配的容器名称,*表示所有容器,多个名称使用逗号分隔。 + - **ContainerOperator** (str) - 容器名称匹配操作符。可选值:in、notin。填写该参数时必须同时填写MatchRule.Container。 + - **PodLabels** (dict) - 见 **UpdateUK8SULSConfigParamMatchRulePodLabels** 模型定义 + - **Workloads** (list) - 见 **UpdateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 **UpdateUK8SULSConfigParamExtractRule** @@ -2332,16 +2349,6 @@ def update_uk8s_uls_config( - **UnMatchUpload** (str) - 是否上传解析失败的日志。字符串true表示上传,false表示丢弃。默认为false。 - **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** 模型定义 @@ -2349,13 +2356,6 @@ 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 fbde70b..dfa9597 100644 --- a/ucloud/services/uk8s/schemas/apis.py +++ b/ucloud/services/uk8s/schemas/apis.py @@ -110,44 +110,25 @@ 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 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 -""" +class AddUK8SNodeGroupParamKubeletConfigurationSystemReservedSchema( + schema.RequestSchema +): + """AddUK8SNodeGroupParamKubeletConfigurationSystemReserved -""" fields = { - "EIP": AddUK8SNodeGroupParamNetworkInterfaceEIPSchema( - required=False, dump_to="EIP" + "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 AddUK8SNodeGroupParamKubeletConfigurationEvictionHardSchema( +class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriodSchema( schema.RequestSchema ): - """AddUK8SNodeGroupParamKubeletConfigurationEvictionHard -""" + """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod -""" fields = { "ImagefsAvailable": fields.Str( @@ -165,25 +146,10 @@ class AddUK8SNodeGroupParamKubeletConfigurationEvictionHardSchema( } -class AddUK8SNodeGroupParamKubeletConfigurationSystemReservedSchema( - schema.RequestSchema -): - """AddUK8SNodeGroupParamKubeletConfigurationSystemReserved -""" - - 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 AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftSchema( +class AddUK8SNodeGroupParamKubeletConfigurationEvictionHardSchema( schema.RequestSchema ): - """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoft -""" + """AddUK8SNodeGroupParamKubeletConfigurationEvictionHard -""" fields = { "ImagefsAvailable": fields.Str( @@ -201,10 +167,10 @@ class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftSchema( } -class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriodSchema( +class AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftSchema( schema.RequestSchema ): - """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoftGracePeriod -""" + """AddUK8SNodeGroupParamKubeletConfigurationEvictionSoft -""" fields = { "ImagefsAvailable": fields.Str( @@ -272,6 +238,40 @@ class AddUK8SNodeGroupParamKubeletConfigurationSchema(schema.RequestSchema): } +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 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节点池""" @@ -390,16 +390,6 @@ class AddUK8SUHostNodeParamUserLabelsSchema(schema.RequestSchema): } -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 -""" @@ -434,6 +424,16 @@ class AddUK8SUHostNodeParamKubeletConfigurationSchema(schema.RequestSchema): } +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 AddUK8SUHostNodeRequestSchema(schema.RequestSchema): """AddUK8SUHostNode - 为UK8S集群添加一台Node节点,机型类型为云主机""" @@ -511,6 +511,14 @@ class AddUK8SUHostNodeResponseSchema(schema.ResponseSchema): """ +class CreateUK8SClusterV2ParamKubeProxySchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamKubeProxy -""" + + fields = { + "Mode": fields.Str(required=False, dump_to="Mode"), + } + + class CreateUK8SClusterV2ParamNodesNetworkInterfaceEIPSchema( schema.RequestSchema ): @@ -537,17 +545,8 @@ class CreateUK8SClusterV2ParamNodesNetworkInterfaceSchema(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 CreateUK8SClusterV2ParamMasterSecGroupIdSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamMasterSecGroupId -""" +class CreateUK8SClusterV2ParamNodesSecGroupIdSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamNodesSecGroupId -""" fields = { "Id": fields.Str(required=False, dump_to="Id"), @@ -568,35 +567,6 @@ class CreateUK8SClusterV2ParamNodesKubeletConfigurationSchema( } -class CreateUK8SClusterV2ParamNodesSecGroupIdSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamNodesSecGroupId -""" - - 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 CreateUK8SClusterV2ParamMasterSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamMaster -""" - - fields = { - "SecGroupId": fields.List( - CreateUK8SClusterV2ParamMasterSecGroupIdSchema() - ), - "Zone": fields.Str(required=True, dump_to="Zone"), - } - - -class CreateUK8SClusterV2ParamKubeProxySchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamKubeProxy -""" - - fields = { - "Mode": fields.Str(required=False, dump_to="Mode"), - } - - class CreateUK8SClusterV2ParamNodesSchema(schema.RequestSchema): """CreateUK8SClusterV2ParamNodes -""" @@ -648,6 +618,36 @@ class CreateUK8SClusterV2ParamNodesSchema(schema.RequestSchema): } +class CreateUK8SClusterV2ParamMasterSecGroupIdSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamMasterSecGroupId -""" + + 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 CreateUK8SClusterV2ParamMasterSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamMaster -""" + + fields = { + "SecGroupId": fields.List( + CreateUK8SClusterV2ParamMasterSecGroupIdSchema() + ), + "Zone": fields.Str(required=True, dump_to="Zone"), + } + + +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集群""" @@ -740,36 +740,15 @@ class CreateUK8SClusterV2ResponseSchema(schema.ResponseSchema): """ -class CreateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamInputDetailFilePaths -""" - - fields = { - "File": fields.Str(required=False, dump_to="File"), - "Path": fields.Str(required=False, dump_to="Path"), - } - - -class CreateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamInputDetailMetadata -""" - - fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "Labels": fields.Str(required=False, dump_to="Labels"), - } - - -class CreateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamInputDetail -""" +class CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema( + schema.RequestSchema +): + """CreateUK8SULSConfigParamMatchRulePodLabelsLabels -""" fields = { - "FilePaths": fields.List( - CreateUK8SULSConfigParamInputDetailFilePathsSchema() - ), - "Metadata": CreateUK8SULSConfigParamInputDetailMetadataSchema( - required=False, dump_to="Metadata" - ), - "Stream": fields.Str(required=False, dump_to="Stream"), - "Type": fields.Str(required=True, dump_to="Type"), + "Key": fields.Str(required=False, dump_to="Key"), + "Value": fields.Str(required=False, dump_to="Value"), + "ValueOperator": fields.Str(required=False, dump_to="ValueOperator"), } @@ -783,28 +762,6 @@ class CreateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): } -class CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( - schema.RequestSchema -): - """CreateUK8SULSConfigParamExtractRuleExtractRule -""" - - fields = { - "LogRegexBase64": fields.Str(required=False, dump_to="LogRegexBase64"), - } - - -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 -""" @@ -836,6 +793,34 @@ class CreateUK8SULSConfigParamMatchRuleSchema(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 CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( + schema.RequestSchema +): + """CreateUK8SULSConfigParamExtractRuleExtractRule -""" + + fields = { + "LogRegexBase64": fields.Str(required=False, dump_to="LogRegexBase64"), + } + + +class CreateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamInputDetailMetadata -""" + + fields = { + "Container": fields.Str(required=False, dump_to="Container"), + "Labels": fields.Str(required=False, dump_to="Labels"), + } + + class CreateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): """CreateUK8SULSConfigParamExtractRule -""" @@ -863,6 +848,21 @@ class CreateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): } +class CreateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamInputDetail -""" + + fields = { + "FilePaths": fields.List( + CreateUK8SULSConfigParamInputDetailFilePathsSchema() + ), + "Metadata": CreateUK8SULSConfigParamInputDetailMetadataSchema( + required=False, dump_to="Metadata" + ), + "Stream": fields.Str(required=False, dump_to="Stream"), + "Type": fields.Str(required=True, dump_to="Type"), + } + + class CreateUK8SULSConfigRequestSchema(schema.RequestSchema): """CreateUK8SULSConfig - 创建 LogConfig 自定义资源,用于声明式地定义日志采集规则""" @@ -1747,16 +1747,6 @@ class UpdateUK8SAutoscalerResponseSchema(schema.ResponseSchema): """ -class UpdateUK8SNodeGroupParamKubeletConfigurationSchema(schema.RequestSchema): - """UpdateUK8SNodeGroupParamKubeletConfiguration -""" - - fields = { - "ContainerLogMaxFiles": fields.Int( - required=False, dump_to="ContainerLogMaxFiles" - ), - } - - class UpdateUK8SNodeGroupParamSecGroupIdSchema(schema.RequestSchema): """UpdateUK8SNodeGroupParamSecGroupId -""" @@ -1767,6 +1757,16 @@ class UpdateUK8SNodeGroupParamSecGroupIdSchema(schema.RequestSchema): } +class UpdateUK8SNodeGroupParamKubeletConfigurationSchema(schema.RequestSchema): + """UpdateUK8SNodeGroupParamKubeletConfiguration -""" + + fields = { + "ContainerLogMaxFiles": fields.Int( + required=False, dump_to="ContainerLogMaxFiles" + ), + } + + class UpdateUK8SNodeGroupParamNetworkInterfaceEIPSchema(schema.RequestSchema): """UpdateUK8SNodeGroupParamNetworkInterfaceEIP -""" @@ -1860,6 +1860,34 @@ class UpdateUK8SNodeGroupResponseSchema(schema.ResponseSchema): """ +class UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamMatchRuleWorkloads -""" + + 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 UpdateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamInputDetailFilePaths -""" + + fields = { + "File": fields.Str(required=False, dump_to="File"), + "Path": fields.Str(required=False, dump_to="Path"), + } + + +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 ): @@ -1886,13 +1914,20 @@ class UpdateUK8SULSConfigParamMatchRulePodLabelsSchema(schema.RequestSchema): } -class UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamMatchRuleWorkloads -""" +class UpdateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamMatchRule -""" 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"), + "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() + ), } @@ -1921,24 +1956,6 @@ class UpdateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): } -class UpdateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamInputDetailFilePaths -""" - - fields = { - "File": fields.Str(required=False, dump_to="File"), - "Path": fields.Str(required=False, dump_to="Path"), - } - - -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 -""" @@ -1954,23 +1971,6 @@ 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 3a449cb..9bbc6ad 100644 --- a/ucloud/services/uk8s/schemas/models.py +++ b/ucloud/services/uk8s/schemas/models.py @@ -3,6 +3,19 @@ from ucloud.core.typesystem import schema, fields +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 - 驱逐条件或宽限时间""" @@ -22,26 +35,27 @@ class EvictionConditionSchema(schema.ResponseSchema): } -class SecGroupIdSchema(schema.ResponseSchema): - """SecGroupId - 安全组""" +class EIPSchema(schema.ResponseSchema): + """EIP - 节点EIP""" 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"), + "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 ReservedResourceSchema(schema.ResponseSchema): - """ReservedResource - 预留资源""" +class SecGroupIdSchema(schema.ResponseSchema): + """SecGroupId - 安全组""" 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"), + "Id": fields.Str(required=False, load_from="Id"), + "Name": fields.Str(required=False, load_from="Name"), + "Priority": fields.Str(required=False, load_from="Priority"), } @@ -70,20 +84,6 @@ class KubeletConfigurationSchema(schema.ResponseSchema): } -class EIPSchema(schema.ResponseSchema): - """EIP - 节点EIP""" - - 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" - ), - } - - class NetworkInterfaceSchema(schema.ResponseSchema): """NetworkInterface - 网络接口""" @@ -180,14 +180,6 @@ class AutoscalerSchema(schema.ResponseSchema): } -class KubeProxySchema(schema.ResponseSchema): - """KubeProxy - KubeProxy信息""" - - fields = { - "Mode": fields.Str(required=False, load_from="Mode"), - } - - class IPSetSchema(schema.ResponseSchema): """IPSet - 节点的IP信息""" @@ -207,6 +199,14 @@ class IPSetSchema(schema.ResponseSchema): } +class KubeProxySchema(schema.ResponseSchema): + """KubeProxy - KubeProxy信息""" + + fields = { + "Mode": fields.Str(required=False, load_from="Mode"), + } + + class DiskSetSchema(schema.ResponseSchema): """DiskSet - 节点磁盘信息""" @@ -224,15 +224,6 @@ class DiskSetSchema(schema.ResponseSchema): } -class LoopbackClientCertSchema(schema.ResponseSchema): - """LoopbackClientCert - API Server 回环客户端证书""" - - fields = { - "ExpireTime": fields.Int(required=False, load_from="ExpireTime"), - "Warn": fields.Bool(required=False, load_from="Warn"), - } - - class UhostInfoSchema(schema.ResponseSchema): """UhostInfo - 机器信息""" @@ -259,6 +250,15 @@ class UhostInfoSchema(schema.ResponseSchema): } +class LoopbackClientCertSchema(schema.ResponseSchema): + """LoopbackClientCert - API Server 回环客户端证书""" + + fields = { + "ExpireTime": fields.Int(required=False, load_from="ExpireTime"), + "Warn": fields.Bool(required=False, load_from="Warn"), + } + + class ImageInfoSchema(schema.ResponseSchema): """ImageInfo - UK8S 可用镜像信息""" @@ -293,25 +293,6 @@ class K8SNodeConditionSchema(schema.ResponseSchema): } -class InstanceTypeMachineSizeCollectionSchema(schema.ResponseSchema): - """InstanceTypeMachineSizeCollection - 机型 CPU 与内存组合""" - - fields = { - "Cpu": fields.Int(required=False, load_from="Cpu"), - "Memory": fields.List(fields.Int()), - "MinimalCpuPlatform": fields.List(fields.Str()), - } - - -class InstanceTypeMachineSizeSchema(schema.ResponseSchema): - """InstanceTypeMachineSize - 机型规格组合""" - - fields = { - "Collection": fields.List(InstanceTypeMachineSizeCollectionSchema()), - "Gpu": fields.Int(required=False, load_from="Gpu"), - } - - class InstanceTypeBootDiskSchema(schema.ResponseSchema): """InstanceTypeBootDisk - 机型系统盘能力""" @@ -353,6 +334,25 @@ class InstanceTypeFeatureSchema(schema.ResponseSchema): } +class InstanceTypeMachineSizeCollectionSchema(schema.ResponseSchema): + """InstanceTypeMachineSizeCollection - 机型 CPU 与内存组合""" + + fields = { + "Cpu": fields.Int(required=False, load_from="Cpu"), + "Memory": fields.List(fields.Int()), + "MinimalCpuPlatform": fields.List(fields.Str()), + } + + +class InstanceTypeMachineSizeSchema(schema.ResponseSchema): + """InstanceTypeMachineSize - 机型规格组合""" + + fields = { + "Collection": fields.List(InstanceTypeMachineSizeCollectionSchema()), + "Gpu": fields.Int(required=False, load_from="Gpu"), + } + + class InstanceTypeValueRateSchema(schema.ResponseSchema): """InstanceTypeValueRate - 机型数值与评分""" @@ -494,35 +494,6 @@ class NodeGroupSetSchema(schema.ResponseSchema): } -class ClusterUpdateNodeInfoSchema(schema.ResponseSchema): - """ClusterUpdateNodeInfo - 集群升级时单个Node节点的状态等信息""" - - fields = { - "IP": fields.Str(required=False, load_from="IP"), - "Node": fields.Str(required=True, load_from="Node"), - "OperationResult": fields.Int( - required=False, load_from="OperationResult" - ), - "Role": fields.Str(required=False, load_from="Role"), - "Status": fields.Int(required=False, load_from="Status"), - "UpdateTime": fields.Int(required=False, load_from="UpdateTime"), - "Version": fields.Str(required=False, load_from="Version"), - } - - -class ClusterUpgradeInfoSchema(schema.ResponseSchema): - """ClusterUpgradeInfo - UK8S 集群升级状态信息""" - - fields = { - "AvailableVersions": fields.List(fields.Str()), - "NodeInfoSet": fields.List(ClusterUpdateNodeInfoSchema()), - "Stage": fields.Str(required=False, load_from="Stage"), - "TargetVersion": fields.Str(required=False, load_from="TargetVersion"), - "UpdateTime": fields.Int(required=False, load_from="UpdateTime"), - "Version": fields.Str(required=False, load_from="Version"), - } - - class VKNodeInfoSchema(schema.ResponseSchema): """VKNodeInfo - 单个虚拟节点插件信息""" @@ -551,17 +522,13 @@ class VKNodeSchema(schema.ResponseSchema): } -class NodePluginSchema(schema.ResponseSchema): - """NodePlugin - 节点类插件信息""" +class MonitorInfoSchema(schema.ResponseSchema): + """MonitorInfo - 监控插件信息""" fields = { "AvailableVersion": fields.Str( required=False, load_from="AvailableVersion" ), - "ManageEnabled": fields.Bool(required=False, load_from="ManageEnabled"), - "Name": fields.Str(required=True, load_from="Name"), - "PluginInfoSet": fields.List(NodePluginInfoSchema()), - "ReleaseTime": fields.Str(required=False, load_from="ReleaseTime"), } @@ -598,13 +565,46 @@ class CSIInfoSchema(schema.ResponseSchema): } -class MonitorInfoSchema(schema.ResponseSchema): - """MonitorInfo - 监控插件信息""" +class ClusterUpdateNodeInfoSchema(schema.ResponseSchema): + """ClusterUpdateNodeInfo - 集群升级时单个Node节点的状态等信息""" + + fields = { + "IP": fields.Str(required=False, load_from="IP"), + "Node": fields.Str(required=True, load_from="Node"), + "OperationResult": fields.Int( + required=False, load_from="OperationResult" + ), + "Role": fields.Str(required=False, load_from="Role"), + "Status": fields.Int(required=False, load_from="Status"), + "UpdateTime": fields.Int(required=False, load_from="UpdateTime"), + "Version": fields.Str(required=False, load_from="Version"), + } + + +class ClusterUpgradeInfoSchema(schema.ResponseSchema): + """ClusterUpgradeInfo - UK8S 集群升级状态信息""" + + fields = { + "AvailableVersions": fields.List(fields.Str()), + "NodeInfoSet": fields.List(ClusterUpdateNodeInfoSchema()), + "Stage": fields.Str(required=False, load_from="Stage"), + "TargetVersion": fields.Str(required=False, load_from="TargetVersion"), + "UpdateTime": fields.Int(required=False, load_from="UpdateTime"), + "Version": fields.Str(required=False, load_from="Version"), + } + + +class NodePluginSchema(schema.ResponseSchema): + """NodePlugin - 节点类插件信息""" fields = { "AvailableVersion": fields.Str( required=False, load_from="AvailableVersion" ), + "ManageEnabled": fields.Bool(required=False, load_from="ManageEnabled"), + "Name": fields.Str(required=True, load_from="Name"), + "PluginInfoSet": fields.List(NodePluginInfoSchema()), + "ReleaseTime": fields.Str(required=False, load_from="ReleaseTime"), } @@ -746,64 +746,6 @@ class ClusterSetSchema(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 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 - 定义日志的输入来源,例如容器文件或容器标准输出。""" - - fields = { - "FilePaths": fields.List(ULSFilePathsSchema()), - "InputMetadata": ULSInputMetadataSchema(), - "Stream": fields.Str(required=False, load_from="Stream"), - "Type": fields.Str(required=False, load_from="Type"), - } - - class ULSLabelsSchema(schema.ResponseSchema): """ULSLabels - ULSLabels""" @@ -849,6 +791,64 @@ class ULSMatchRuleSchema(schema.ResponseSchema): } +class ULSInputMetadataSchema(schema.ResponseSchema): + """ULSInputMetadata - ULSInputMetadata""" + + fields = { + "Container": fields.Str(required=False, load_from="Container"), + "Labels": fields.Str(required=False, load_from="Labels"), + } + + +class ULSFilePathsSchema(schema.ResponseSchema): + """ULSFilePaths - ULS采集文件路径""" + + fields = { + "File": fields.Str(required=False, load_from="File"), + "Path": fields.Str(required=False, load_from="Path"), + } + + +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 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"), + } + + class ULSLogConfigSchema(schema.ResponseSchema): """ULSLogConfig - ULSLogConfig""" diff --git a/ucloud/version.py b/ucloud/version.py index c829b40..2c8c99d 100644 --- a/ucloud/version.py +++ b/ucloud/version.py @@ -1 +1 @@ -version = "0.11.156" +version = "0.11.157"