diff --git a/ucloud/services/uk8s/client.py b/ucloud/services/uk8s/client.py index 7544e0d..5fd59ce 100644 --- a/ucloud/services/uk8s/client.py +++ b/ucloud/services/uk8s/client.py @@ -198,10 +198,6 @@ def add_uk8s_uhost_node( **Request Model** - **AddUK8SUHostNodeParamKubeletConfiguration** - - **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup - - **AddUK8SUHostNodeParamNetworkInterfaceEIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -214,6 +210,10 @@ def add_uk8s_uhost_node( - **EIP** (dict) - 见 **AddUK8SUHostNodeParamNetworkInterfaceEIP** 模型定义 + **AddUK8SUHostNodeParamKubeletConfiguration** + - **ContainerLogMaxFiles** (str) - 全量KubeletConfiguration.XXX定义参考AddUK8SNodeGroup接口: https://uxiao.ucloudadmin.com/#/api-manager/api/detail/UK8S/AddUK8SNodeGroup + + **AddUK8SUHostNodeParamSecGroupId** - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - **Name** (str) - 安全组名称。 @@ -286,11 +286,7 @@ def create_uk8s_cluster_v2( **Request Model** - **CreateUK8SClusterV2ParamKubeProxy** - - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 - - - **CreateUK8SClusterV2ParamNodesSecGroupId** + **CreateUK8SClusterV2ParamMasterSecGroupId** - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 - **Name** (str) - 安全组名称。 - **Priority** (str) - 安全组优先级。取值范围[1, 5] @@ -304,10 +300,20 @@ def create_uk8s_cluster_v2( - **ShareBandwidthId** (str) - 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效 + **CreateUK8SClusterV2ParamKubeProxy** + - **Mode** (str) - 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。 + + **CreateUK8SClusterV2ParamNodesNetworkInterface** - **EIP** (dict) - 见 **CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP** 模型定义 + **CreateUK8SClusterV2ParamNodesSecGroupId** + - **Id** (str) - 安全组 ID。至多可以同时绑定5个安全组。 + - **Name** (str) - 安全组名称。 + - **Priority** (str) - 安全组优先级。取值范围[1, 5] + + **CreateUK8SClusterV2ParamNodes** - **BootDiskSIze** (int) - Node节点的系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。 - **BootDiskType** (str) - 一组Node节点的系统盘类型,请参考 `磁盘类型 `_ 。默认为SSD云盘 @@ -334,12 +340,6 @@ 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 节点的可用区。 三个节点可部署在不同可用区。参见 `可用区列表 `_ @@ -382,43 +382,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 + **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), "" (不采集任何标签)。 - **CreateUK8SULSConfigParamMatchRuleWorkloads** - - **Name** (str) - 按工作负载匹配时,工作负载的名称。 - - **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。 - - **Type** (str) - 按工作负载匹配时,工作负载的类型,例如 deployment, statefulset, daemonset,job, cronjob。 + **CreateUK8SULSConfigParamInputDetailFilePaths** + - **File** (str) - 定义采集路径的文件名 + - **Path** (str) - 定义采集路径 - **CreateUK8SULSConfigParamMatchRule** - - **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔 - - **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含) - - **PodLabels** (dict) - 见 **CreateUK8SULSConfigParamMatchRulePodLabels** 模型定义 - - **Workloads** (list) - 见 **CreateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 + **CreateUK8SULSConfigParamInputDetail** + - **FilePaths** (list) - 见 **CreateUK8SULSConfigParamInputDetailFilePaths** 模型定义 + - **Metadata** (dict) - 见 **CreateUK8SULSConfigParamInputDetailMetadata** 模型定义 + - **Stream** (str) - all、stdout、stderr,默认 all (用于 InputDetail.Type = container_stdout) + - **Type** (str) - 日志输入类型。支持 container_file 和 container_stdout **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), "" (不采集任何标签)。 - - - **CreateUK8SULSConfigParamInputDetailFilePaths** - - **File** (str) - 定义采集路径的文件名 - - **Path** (str) - 定义采集路径 + **CreateUK8SULSConfigParamMatchRuleWorkloads** + - **Name** (str) - 按工作负载匹配时,工作负载的名称。 + - **Namespace** (str) - 按工作负载匹配时,工作负载所在的命名空间。 + - **Type** (str) - 按工作负载匹配时,工作负载的类型,例如 deployment, statefulset, daemonset,job, cronjob。 **CreateUK8SULSConfigParamExtractRule** @@ -438,11 +426,23 @@ 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 + **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** + - **Key** (str) - 按 Pod 标签匹配时,要匹配的标签的 Key。 + - **Value** (str) - 按 Pod 标签匹配时,要匹配的标签的值。 + - **ValueOperator** (str) - 按 Pod 标签匹配时,标签值的匹配操作符。可选值: in, notin。 + + + **CreateUK8SULSConfigParamMatchRulePodLabels** + - **Labels** (list) - 见 **CreateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义 + - **Namespace** (str) - 命名空间名称 + - **NamespaceOperator** (str) - 指定/排除命名空间, 可选值: in/notin + + + **CreateUK8SULSConfigParamMatchRule** + - **Container** (str) - 要匹配的容器名称,*表示所有容器,用逗号分隔 + - **ContainerOperator** (str) - 容器名称匹配操作符。支持:in(包含),notin(不包含) + - **PodLabels** (dict) - 见 **CreateUK8SULSConfigParamMatchRulePodLabels** 模型定义 + - **Workloads** (list) - 见 **CreateUK8SULSConfigParamMatchRuleWorkloads** 模型定义 """ @@ -598,32 +598,29 @@ def describe_uk8s_cluster( **Response Model** - **LoopbackClientCert** - - **ExpireTime** (int) - 证书到期时间 - - **Warn** (bool) - 证书是否进入过期告警状态 + **SecGroupId** + - **Id** (str) - 安全组名称 + - **Name** (str) - 安全组id + - **Priority** (str) - 安全组优先级 **KubeProxy** - **Mode** (str) - KubeProxy模式,枚举值为[ipvs,iptables] - **SecGroupId** - - **Id** (str) - 安全组名称 - - **Name** (str) - 安全组id - - **Priority** (str) - 安全组优先级 + **LoopbackClientCert** + - **ExpireTime** (int) - 证书到期时间 + - **Warn** (bool) - 证书是否进入过期告警状态 - **IPSet** - - **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息) - - **Default** (str) - 是否默认的弹性网卡的信息。true: 是默认弹性网卡;其他值:不是。 - - **IP** (str) - IP地址 - - **IPId** (str) - IP资源ID (内网IP无对应的资源ID) - - **IPMode** (str) - IP 地址分配模式 - - **Mac** (str) - 网卡的 MAC 地址 - - **NetworkInterfaceId** (str) - 虚拟网卡 Id - - **SubnetId** (str) - IP 所在的 子网 Id - - **Type** (str) - 国际: Internation,BGP: Bgp,内网: Private - - **VPCId** (str) - IP 所属的 VPC Id + **Autoscaler** + - **Enabled** (int) - 打开/关闭 + - **ScaleDownDelayAfterAdd** (str) - 静默时间 + - **ScaleDownGpuUtilizationThreshold** (str) - GPU缩容阈值 + - **ScaleDownUnneededTime** (str) - 缩容触发延时 + - **ScaleDownUtilizationThreshold** (str) - CPU缩容阈值 + - **UpdateTime** (int) - + - **Version** (str) - 伸缩器版本 **DiskSet** @@ -639,6 +636,19 @@ def describe_uk8s_cluster( - **Type** (str) - 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk + **IPSet** + - **Bandwidth** (int) - IP对应的带宽, 单位: Mb (内网IP不显示带宽信息) + - **Default** (str) - 是否默认的弹性网卡的信息。true: 是默认弹性网卡;其他值:不是。 + - **IP** (str) - IP地址 + - **IPId** (str) - IP资源ID (内网IP无对应的资源ID) + - **IPMode** (str) - IP 地址分配模式 + - **Mac** (str) - 网卡的 MAC 地址 + - **NetworkInterfaceId** (str) - 虚拟网卡 Id + - **SubnetId** (str) - IP 所在的 子网 Id + - **Type** (str) - 国际: Internation,BGP: Bgp,内网: Private + - **VPCId** (str) - IP 所属的 VPC Id + + **UhostInfo** - **BasicImageName** (str) - 基础镜像名称 - **CPU** (int) - Cpu数量 @@ -661,16 +671,6 @@ def describe_uk8s_cluster( - **Zone** (str) - 所在机房 - **Autoscaler** - - **Enabled** (int) - 打开/关闭 - - **ScaleDownDelayAfterAdd** (str) - 静默时间 - - **ScaleDownGpuUtilizationThreshold** (str) - GPU缩容阈值 - - **ScaleDownUnneededTime** (str) - 缩容触发延时 - - **ScaleDownUtilizationThreshold** (str) - CPU缩容阈值 - - **UpdateTime** (int) - - - **Version** (str) - 伸缩器版本 - - """ # build request d = { @@ -1038,17 +1038,11 @@ def list_uk8s_node_group( **Response Model** - **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** @@ -1058,13 +1052,6 @@ def list_uk8s_node_group( - **Pid** (str) - Pid - **EvictionCondition** - - **ImagefsAvailable** (str) - 镜像文件系统存储相关驱逐条件或宽限时间。 - - **MemoryAvailable** (str) - 内存相关驱逐条件或宽限时间。 - - **NodefsAvailable** (str) - 节点存储余量相关驱逐条件或宽限时间。 - - **NodefsInodesFree** (str) - 节点剩余inodes驱逐条件或宽限时间。 - - **KubeletConfiguration** - **ContainerLogMaxFiles** (int) - 最大日志文件数量 - **ContainerLogMaxSize** (str) - 最大日志文件大小 @@ -1078,6 +1065,25 @@ def list_uk8s_node_group( - **SystemReserved** (dict) - 见 **ReservedResource** 模型定义 + **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 + + **EIP** - **Bandwidth** (int) - 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式下非必传, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800] - **CouponId** (str) - 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。 @@ -1090,12 +1096,6 @@ def list_uk8s_node_group( - **EIP** (dict) - 见 **EIP** 模型定义 - **SecGroupId** - - **Id** (str) - 安全组名称 - - **Name** (str) - 安全组id - - **Priority** (str) - 安全组优先级 - - **NodeGroupSet** - **BootDiskSize** (int) - 系统盘大小 - **BootDiskType** (str) - 系统盘类型 @@ -1171,22 +1171,11 @@ def list_uk8s_uls_config( **Response Model** - **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 这两个标签。""(空字符串):不采集任何标签。 - - **ULSFilePaths** - **File** (str) - 采集文件 - **Path** (str) - 定义采集路径 - **ULSInputDetail** - - **FilePaths** (list) - 见 **ULSFilePaths** 模型定义 - - **InputMetadata** (dict) - 见 **ULSInputMetadata** 模型定义 - - **Type** (str) - 日志输入类型。当前主要支持 container_file,表示采集容器标准输出或文件。 - - **ULSLabels** - **Key** (str) - 要匹配的标签的 Key。 - **Value** (str) - 要匹配的标签的值。 @@ -1225,6 +1214,17 @@ def list_uk8s_uls_config( - **UnMatchUpload** (str) - 是否上传解析失败的日志。true 表示上传,false 表示丢弃。默认为 false。 + **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** 模型定义 + - **Type** (str) - 日志输入类型。当前主要支持 container_file,表示采集容器标准输出或文件。 + + **ULSLogConfig** - **ClusterId** (str) - uk8s集群id - **ExtractRule** (dict) - 见 **ULSExtractRule** 模型定义 @@ -1297,12 +1297,36 @@ 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) - 要匹配的标签值。 - **ValueOperator** (str) - 标签值匹配操作符。可选值:in、notin。 + **UpdateUK8SULSConfigParamMatchRulePodLabels** + - **Labels** (list) - 见 **UpdateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义 + - **Namespace** (str) - 按Pod标签匹配时要匹配的命名空间。 + - **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** - **BeginningRegex** (str) - 行首正则表达式。multi_line、multi_line_full_regex或multi_line_delimiter模式下,BeginningRegex和BeginningRegexBase64必须至少填写一个。 - **BeginningRegexBase64** (str) - Base64编码的行首正则表达式。填写时优先于BeginningRegex。 @@ -1325,11 +1349,6 @@ def update_uk8s_uls_config( - **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** 模型定义 @@ -1337,25 +1356,6 @@ def update_uk8s_uls_config( - **Type** (str) - 日志输入类型。可选值:container_file、container_stdout。 - **UpdateUK8SULSConfigParamMatchRulePodLabels** - - **Labels** (list) - 见 **UpdateUK8SULSConfigParamMatchRulePodLabelsLabels** 模型定义 - - **Namespace** (str) - 按Pod标签匹配时要匹配的命名空间。 - - **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** 模型定义 - - """ # build request d = { diff --git a/ucloud/services/uk8s/schemas/apis.py b/ucloud/services/uk8s/schemas/apis.py index 8eb8c7e..1411fc3 100644 --- a/ucloud/services/uk8s/schemas/apis.py +++ b/ucloud/services/uk8s/schemas/apis.py @@ -136,16 +136,6 @@ class AddUK8SPHostNodeResponseSchema(schema.ResponseSchema): """ -class AddUK8SUHostNodeParamKubeletConfigurationSchema(schema.RequestSchema): - """AddUK8SUHostNodeParamKubeletConfiguration -""" - - fields = { - "ContainerLogMaxFiles": fields.Str( - required=False, dump_to="ContainerLogMaxFiles" - ), - } - - class AddUK8SUHostNodeParamNetworkInterfaceEIPSchema(schema.RequestSchema): """AddUK8SUHostNodeParamNetworkInterfaceEIP -""" @@ -170,6 +160,16 @@ class AddUK8SUHostNodeParamNetworkInterfaceSchema(schema.RequestSchema): } +class AddUK8SUHostNodeParamKubeletConfigurationSchema(schema.RequestSchema): + """AddUK8SUHostNodeParamKubeletConfiguration -""" + + fields = { + "ContainerLogMaxFiles": fields.Str( + required=False, dump_to="ContainerLogMaxFiles" + ), + } + + class AddUK8SUHostNodeParamSecGroupIdSchema(schema.RequestSchema): """AddUK8SUHostNodeParamSecGroupId -""" @@ -266,16 +266,8 @@ class AddUK8SUHostNodeResponseSchema(schema.ResponseSchema): """ -class CreateUK8SClusterV2ParamKubeProxySchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamKubeProxy -""" - - fields = { - "Mode": fields.Str(required=False, dump_to="Mode"), - } - - -class CreateUK8SClusterV2ParamNodesSecGroupIdSchema(schema.RequestSchema): - """CreateUK8SClusterV2ParamNodesSecGroupId -""" +class CreateUK8SClusterV2ParamMasterSecGroupIdSchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamMasterSecGroupId -""" fields = { "Id": fields.Str(required=False, dump_to="Id"), @@ -300,6 +292,14 @@ class CreateUK8SClusterV2ParamNodesNetworkInterfaceEIPSchema( } +class CreateUK8SClusterV2ParamKubeProxySchema(schema.RequestSchema): + """CreateUK8SClusterV2ParamKubeProxy -""" + + fields = { + "Mode": fields.Str(required=False, dump_to="Mode"), + } + + class CreateUK8SClusterV2ParamNodesNetworkInterfaceSchema(schema.RequestSchema): """CreateUK8SClusterV2ParamNodesNetworkInterface -""" @@ -310,6 +310,16 @@ class CreateUK8SClusterV2ParamNodesNetworkInterfaceSchema(schema.RequestSchema): } +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 CreateUK8SClusterV2ParamNodesSchema(schema.RequestSchema): """CreateUK8SClusterV2ParamNodes -""" @@ -351,16 +361,6 @@ 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 -""" @@ -449,56 +449,36 @@ 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 -""" +class CreateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamInputDetailMetadata -""" fields = { - "Labels": fields.List( - CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema() - ), - "Namespace": fields.Str(required=False, dump_to="Namespace"), - "NamespaceOperator": fields.Str( - required=False, dump_to="NamespaceOperator" - ), + "Container": fields.Str(required=False, dump_to="Container"), + "Labels": fields.Str(required=False, dump_to="Labels"), } -class CreateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamMatchRuleWorkloads -""" +class CreateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamInputDetailFilePaths -""" 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"), + "File": fields.Str(required=False, dump_to="File"), + "Path": fields.Str(required=False, dump_to="Path"), } -class CreateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamMatchRule -""" +class CreateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamInputDetail -""" fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "ContainerOperator": fields.Str( - required=False, dump_to="ContainerOperator" - ), - "PodLabels": CreateUK8SULSConfigParamMatchRulePodLabelsSchema( - required=False, dump_to="PodLabels" + "FilePaths": fields.List( + CreateUK8SULSConfigParamInputDetailFilePathsSchema() ), - "Workloads": fields.List( - CreateUK8SULSConfigParamMatchRuleWorkloadsSchema() + "Metadata": CreateUK8SULSConfigParamInputDetailMetadataSchema( + required=False, dump_to="Metadata" ), + "Stream": fields.Str(required=False, dump_to="Stream"), + "Type": fields.Str(required=True, dump_to="Type"), } @@ -512,21 +492,13 @@ class CreateUK8SULSConfigParamExtractRuleExtractRuleSchema( } -class CreateUK8SULSConfigParamInputDetailMetadataSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamInputDetailMetadata -""" - - fields = { - "Container": fields.Str(required=False, dump_to="Container"), - "Labels": fields.Str(required=False, dump_to="Labels"), - } - - -class CreateUK8SULSConfigParamInputDetailFilePathsSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamInputDetailFilePaths -""" +class CreateUK8SULSConfigParamMatchRuleWorkloadsSchema(schema.RequestSchema): + """CreateUK8SULSConfigParamMatchRuleWorkloads -""" fields = { - "File": fields.Str(required=False, dump_to="File"), - "Path": fields.Str(required=False, dump_to="Path"), + "Name": fields.Str(required=False, dump_to="Name"), + "Namespace": fields.Str(required=False, dump_to="Namespace"), + "Type": fields.Str(required=False, dump_to="Type"), } @@ -557,18 +529,46 @@ class CreateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): } -class CreateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): - """CreateUK8SULSConfigParamInputDetail -""" +class CreateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema( + schema.RequestSchema +): + """CreateUK8SULSConfigParamMatchRulePodLabelsLabels -""" fields = { - "FilePaths": fields.List( - CreateUK8SULSConfigParamInputDetailFilePathsSchema() + "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() ), - "Metadata": CreateUK8SULSConfigParamInputDetailMetadataSchema( - required=False, dump_to="Metadata" + "Namespace": fields.Str(required=False, dump_to="Namespace"), + "NamespaceOperator": fields.Str( + required=False, dump_to="NamespaceOperator" + ), + } + + +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() ), - "Stream": fields.Str(required=False, dump_to="Stream"), - "Type": fields.Str(required=True, dump_to="Type"), } @@ -1094,6 +1094,15 @@ class RemoveUK8SNodeGroupResponseSchema(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 ): @@ -1106,6 +1115,47 @@ class UpdateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema( } +class UpdateUK8SULSConfigParamMatchRulePodLabelsSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamMatchRulePodLabels -""" + + fields = { + "Labels": fields.List( + UpdateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema() + ), + "Namespace": fields.Str(required=False, dump_to="Namespace"), + "NamespaceOperator": fields.Str( + required=False, dump_to="NamespaceOperator" + ), + } + + +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 UpdateUK8SULSConfigParamMatchRuleSchema(schema.RequestSchema): + """UpdateUK8SULSConfigParamMatchRule -""" + + fields = { + "Container": fields.Str(required=False, dump_to="Container"), + "ContainerOperator": fields.Str( + required=False, dump_to="ContainerOperator" + ), + "PodLabels": UpdateUK8SULSConfigParamMatchRulePodLabelsSchema( + required=False, dump_to="PodLabels" + ), + "Workloads": fields.List( + UpdateUK8SULSConfigParamMatchRuleWorkloadsSchema() + ), + } + + class UpdateUK8SULSConfigParamExtractRuleSchema(schema.RequestSchema): """UpdateUK8SULSConfigParamExtractRule -""" @@ -1140,15 +1190,6 @@ 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 -""" @@ -1164,47 +1205,6 @@ class UpdateUK8SULSConfigParamInputDetailSchema(schema.RequestSchema): } -class UpdateUK8SULSConfigParamMatchRulePodLabelsSchema(schema.RequestSchema): - """UpdateUK8SULSConfigParamMatchRulePodLabels -""" - - fields = { - "Labels": fields.List( - UpdateUK8SULSConfigParamMatchRulePodLabelsLabelsSchema() - ), - "Namespace": fields.Str(required=False, dump_to="Namespace"), - "NamespaceOperator": fields.Str( - required=False, dump_to="NamespaceOperator" - ), - } - - -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 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 e1b159d..bb7f4af 100644 --- a/ucloud/services/uk8s/schemas/models.py +++ b/ucloud/services/uk8s/schemas/models.py @@ -13,25 +13,6 @@ class SecGroupIdSchema(schema.ResponseSchema): } -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 DiskSetSchema(schema.ResponseSchema): """DiskSet - 节点磁盘信息""" @@ -49,6 +30,14 @@ class DiskSetSchema(schema.ResponseSchema): } +class KubeProxySchema(schema.ResponseSchema): + """KubeProxy - KubeProxy信息""" + + fields = { + "Mode": fields.Str(required=False, load_from="Mode"), + } + + class LoopbackClientCertSchema(schema.ResponseSchema): """LoopbackClientCert - API Server 回环客户端证书""" @@ -58,25 +47,22 @@ class LoopbackClientCertSchema(schema.ResponseSchema): } -class AutoscalerSchema(schema.ResponseSchema): - """Autoscaler -""" +class IPSetSchema(schema.ResponseSchema): + """IPSet - 节点的IP信息""" fields = { - "Enabled": fields.Int(required=True, load_from="Enabled"), - "ScaleDownDelayAfterAdd": fields.Str( - required=True, load_from="ScaleDownDelayAfterAdd" - ), - "ScaleDownGpuUtilizationThreshold": fields.Str( - required=True, load_from="ScaleDownGpuUtilizationThreshold" - ), - "ScaleDownUnneededTime": fields.Str( - required=True, load_from="ScaleDownUnneededTime" - ), - "ScaleDownUtilizationThreshold": fields.Str( - required=True, load_from="ScaleDownUtilizationThreshold" + "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" ), - "UpdateTime": fields.Int(required=True, load_from="UpdateTime"), - "Version": fields.Str(required=True, load_from="Version"), + "SubnetId": fields.Str(required=False, load_from="SubnetId"), + "Type": fields.Str(required=False, load_from="Type"), + "VPCId": fields.Str(required=False, load_from="VPCId"), } @@ -106,11 +92,25 @@ class UhostInfoSchema(schema.ResponseSchema): } -class KubeProxySchema(schema.ResponseSchema): - """KubeProxy - KubeProxy信息""" +class AutoscalerSchema(schema.ResponseSchema): + """Autoscaler -""" fields = { - "Mode": fields.Str(required=False, load_from="Mode"), + "Enabled": fields.Int(required=True, load_from="Enabled"), + "ScaleDownDelayAfterAdd": fields.Str( + required=True, load_from="ScaleDownDelayAfterAdd" + ), + "ScaleDownGpuUtilizationThreshold": fields.Str( + required=True, load_from="ScaleDownGpuUtilizationThreshold" + ), + "ScaleDownUnneededTime": fields.Str( + required=True, load_from="ScaleDownUnneededTime" + ), + "ScaleDownUtilizationThreshold": fields.Str( + required=True, load_from="ScaleDownUtilizationThreshold" + ), + "UpdateTime": fields.Int(required=True, load_from="UpdateTime"), + "Version": fields.Str(required=True, load_from="Version"), } @@ -267,28 +267,6 @@ class ClusterSetSchema(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 - 网络接口""" - - fields = { - "EIP": EIPSchema(), - } - - class ReservedResourceSchema(schema.ResponseSchema): """ReservedResource - 预留资源""" @@ -346,6 +324,28 @@ 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 - 网络接口""" + + fields = { + "EIP": EIPSchema(), + } + + class NodeGroupSetSchema(schema.ResponseSchema): """NodeGroupSet - 节点池配置""" @@ -402,6 +402,26 @@ class NodeGroupSetSchema(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 ULSLabelsSchema(schema.ResponseSchema): + """ULSLabels - ULSLabels""" + + fields = { + "Key": fields.Str(required=False, load_from="Key"), + "Value": fields.Str(required=False, load_from="Value"), + "ValueOperator": fields.Str(required=False, load_from="ValueOperator"), + } + + class ULSFilePathsSchema(schema.ResponseSchema): """ULSFilePaths - ULS采集文件路径""" @@ -430,35 +450,6 @@ class ULSInputDetailSchema(schema.ResponseSchema): } -class ULSLabelsSchema(schema.ResponseSchema): - """ULSLabels - ULSLabels""" - - fields = { - "Key": fields.Str(required=False, load_from="Key"), - "Value": fields.Str(required=False, load_from="Value"), - "ValueOperator": fields.Str(required=False, load_from="ValueOperator"), - } - - -class ULSExtractRuleSchema(schema.ResponseSchema): - """ULSExtractRule - 定义日志的提取、解析和格式化规则。""" - - fields = { - "BeginningRegex": fields.Str( - required=False, load_from="BeginningRegex" - ), - "CollectPolicy": fields.Str(required=False, load_from="CollectPolicy"), - "Delimiter": fields.Str(required=False, load_from="Delimiter"), - "Encode": fields.Str(required=False, load_from="Encode"), - "LogRegex": fields.Str(required=False, load_from="LogRegex"), - "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 ULSPodLabelsMatchSchema(schema.ResponseSchema): """ULSPodLabelsMatch - ULSPodLabelsMatch""" @@ -471,16 +462,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""" @@ -494,6 +475,25 @@ class ULSMatchRuleSchema(schema.ResponseSchema): } +class ULSExtractRuleSchema(schema.ResponseSchema): + """ULSExtractRule - 定义日志的提取、解析和格式化规则。""" + + fields = { + "BeginningRegex": fields.Str( + required=False, load_from="BeginningRegex" + ), + "CollectPolicy": fields.Str(required=False, load_from="CollectPolicy"), + "Delimiter": fields.Str(required=False, load_from="Delimiter"), + "Encode": fields.Str(required=False, load_from="Encode"), + "LogRegex": fields.Str(required=False, load_from="LogRegex"), + "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/services/ukms/client.py b/ucloud/services/ukms/client.py index 2dc49c9..9b756ea 100644 --- a/ucloud/services/ukms/client.py +++ b/ucloud/services/ukms/client.py @@ -76,7 +76,7 @@ def create_alias(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - **AliasName** (str) - (Required) 密钥别名,格式为 alias/name。 - - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥 ID 或别名。 - **ResourceId** (str) - UKMS 实例资源 ID。 **Response** @@ -267,7 +267,7 @@ def disable_key_rotation( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥 ID或别名。 - **ResourceId** (str) - (Required) UKMS 实例资源 ID。 **Response** @@ -345,7 +345,7 @@ def encrypt(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥资源长 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥资源长 ID 或别名。 - **Plaintext** (str) - (Required) 待加密明文,Base64 编码。 - **EncryptionAlgorithm** (str) - 加密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;对称密钥默认 SYMMETRIC_DEFAULT,RSA 默认 RSAES_OAEP_SHA_256。 - **EncryptionContext** (str) - 加密上下文,JSON Object。该参数内容会记录在日志中,请勿传入密码、密钥、令牌等敏感信息。 @@ -483,7 +483,7 @@ def generate_data_key_without_plaintext( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥资源长 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥资源长 ID或别名。 - **EncryptionContext** (str) - 加密上下文,JSON Object。 - **KeySpec** (str) - 数据密钥规格。可选值:AES_256、AES_128;默认 AES_256。与 NumberOfBytes 二选一,同时填写时 NumberOfBytes 优先。 - **NumberOfBytes** (int) - 生成数据密钥的字节长度,取值范围 1~1024。与 KeySpec 二选一,同时填写时本字段优先。 @@ -579,7 +579,7 @@ def get_key_rotation_status( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥资源长 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥资源长 ID 或别名。 - **ResourceId** (str) - (Required) UKMS 实例资源 ID。 **Response** @@ -612,7 +612,7 @@ def get_public_key( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥 ID 或 别名。 - **ResourceId** (str) - UKMS 实例资源 ID。 **Response** @@ -790,7 +790,7 @@ def rotate_key_on_demand( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥 ID 或别名。 - **ResourceId** (str) - (Required) UKMS 实例资源 ID。 **Response** @@ -844,7 +844,7 @@ def sign(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥资源长 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥资源长 ID 或别名。 - **SigningAlgorithm** (str) - (Required) 签名算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 - **SigningMessage** (str) - (Required) 待签名消息,Base64 编码,最大 4096 字节。 - **MessageType** (str) - 消息类型。可选值:RAW、DIGEST;默认 RAW。 @@ -876,7 +876,7 @@ def update_alias(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - **AliasName** (str) - (Required) 密钥别名,格式为 alias/name。 - - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥 ID 或别名。 - **ResourceId** (str) - UKMS 实例资源 ID。 **Response** @@ -904,7 +904,7 @@ def update_key_description( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - **Description** (str) - (Required) 新的密钥描述,最多 8192 字符;空字符串表示清空描述。 - - **KeyId** (str) - (Required) 密钥资源长 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥资源长 ID或别名。 - **ResourceId** (str) - UKMS 实例资源 ID。 **Response** @@ -931,7 +931,7 @@ def verify(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 + - **KeyId** (str) - (Required) 密钥 ID或别名。 - **SignatureResult** (str) - (Required) 待验证的签名,Base64 编码。 - **SigningAlgorithm** (str) - (Required) 签名时使用的算法。可选值:RSASSA_PSS_SHA_256、RSASSA_PSS_SHA_384、RSASSA_PSS_SHA_512、RSASSA_PKCS1_V1_5_SHA_256、RSASSA_PKCS1_V1_5_SHA_384、RSASSA_PKCS1_V1_5_SHA_512、ECDSA_SHA_256、ECDSA_SHA_384、ECDSA_SHA_512;须与密钥 KeySpec 匹配。 - **SigningMessage** (str) - (Required) 待验签的消息或消息摘要,Base64 编码。 diff --git a/ucloud/services/ulogservice/client.py b/ucloud/services/ulogservice/client.py index c01e3fa..a1b8873 100644 --- a/ucloud/services/ulogservice/client.py +++ b/ucloud/services/ulogservice/client.py @@ -355,6 +355,42 @@ def describe_u_log_service_machine_group( resp = self.invoke("DescribeULogServiceMachineGroup", d, **kwargs) return apis.DescribeULogServiceMachineGroupResponseSchema().loads(resp) + def get_u_log_service_topic_field( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """GetULogServiceTopicField - 获取ULogService主题索引字段 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **TopicId** (str) - (Required) 主题Id + - **Zone** (str) - (Required) 可用区。参见 `可用区列表 `_ + + **Response** + + - **Data** (list) - 见 **TopicField** 模型定义 + + **Response Model** + + **TopicField** + - **FieldName** (str) - 索引名称 + - **FieldType** (str) - 索引类型,可取的值有: long, double, text + - **IsReserved** (bool) - 是否保留字段,true表示保留字段,false表示非保留字段 + + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.GetULogServiceTopicFieldRequestSchema().dumps(d) + + resp = self.invoke("GetULogServiceTopicField", d, **kwargs) + return apis.GetULogServiceTopicFieldResponseSchema().loads(resp) + def list_u_log_service_collect_conf( self, req: typing.Optional[dict] = None, **kwargs ) -> dict: @@ -561,6 +597,11 @@ def query_u_log_service_log( **Response Model** + **AnalysisField** + - **Name** (str) - 字段名 + - **Type** (str) - 字段类型 + + **LogContent** - **FileName** (str) - 日志文件路径 - **HostName** (str) - 日志来源主机 @@ -569,11 +610,6 @@ def query_u_log_service_log( - **Timestamp** (int) - 日志时间 - **AnalysisField** - - **Name** (str) - 字段名 - - **Type** (str) - 字段类型 - - **LogQueryResult** - **AnalysisRecords** (list) - 当使用SQL语句查询时,数据通过该字段返回 - **Columns** (list) - 见 **AnalysisField** 模型定义 @@ -674,3 +710,38 @@ def update_u_log_service_machine_group( resp = self.invoke("UpdateULogServiceMachineGroup", d, **kwargs) return apis.UpdateULogServiceMachineGroupResponseSchema().loads(resp) + + def update_u_log_service_topic_field( + self, req: typing.Optional[dict] = None, **kwargs + ) -> dict: + """UpdateULogServiceTopicField - 更新ULogService主题索引字段 + + **Request** + + - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 `_ + - **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 `_ + - **TopicId** (str) - (Required) 主题Id + - **Zone** (str) - (Required) 可用区。参见 `可用区列表 `_ + - **FieldInfos** (list) - 见 **UpdateULogServiceTopicFieldParamFieldInfos** 模型定义 + + **Response** + + + **Request Model** + + **UpdateULogServiceTopicFieldParamFieldInfos** + - **FieldName** (str) - 字段名称支持字母、横线(-)、斜杠(/)、特殊符号(@)、数字、下划线(_)和点(.),且不能以下划线开头,长度不超过255个字符 + - **FieldType** (str) - 主题字段类型(text、long、double) + + + """ + # build request + d = { + "ProjectId": self.config.project_id, + "Region": self.config.region, + } + req and d.update(req) + d = apis.UpdateULogServiceTopicFieldRequestSchema().dumps(d) + + resp = self.invoke("UpdateULogServiceTopicField", d, **kwargs) + return apis.UpdateULogServiceTopicFieldResponseSchema().loads(resp) diff --git a/ucloud/services/ulogservice/schemas/apis.py b/ucloud/services/ulogservice/schemas/apis.py index 6cd0095..8dce393 100644 --- a/ucloud/services/ulogservice/schemas/apis.py +++ b/ucloud/services/ulogservice/schemas/apis.py @@ -298,6 +298,34 @@ class DescribeULogServiceMachineGroupResponseSchema(schema.ResponseSchema): } +""" +API: GetULogServiceTopicField + +获取ULogService主题索引字段 +""" + + +class GetULogServiceTopicFieldRequestSchema(schema.RequestSchema): + """GetULogServiceTopicField - 获取ULogService主题索引字段""" + + fields = { + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "TopicId": fields.Str(required=True, dump_to="TopicId"), + "Zone": fields.Str(required=True, dump_to="Zone"), + } + + +class GetULogServiceTopicFieldResponseSchema(schema.ResponseSchema): + """GetULogServiceTopicField - 获取ULogService主题索引字段""" + + fields = { + "Data": fields.List( + models.TopicFieldSchema(), required=True, load_from="Data" + ), + } + + """ API: ListULogServiceCollectConf @@ -522,3 +550,39 @@ class UpdateULogServiceMachineGroupResponseSchema(schema.ResponseSchema): fields = { "Message": fields.Str(required=True, load_from="Message"), } + + +""" +API: UpdateULogServiceTopicField + +更新ULogService主题索引字段 +""" + + +class UpdateULogServiceTopicFieldParamFieldInfosSchema(schema.RequestSchema): + """UpdateULogServiceTopicFieldParamFieldInfos -""" + + fields = { + "FieldName": fields.Str(required=False, dump_to="FieldName"), + "FieldType": fields.Str(required=False, dump_to="FieldType"), + } + + +class UpdateULogServiceTopicFieldRequestSchema(schema.RequestSchema): + """UpdateULogServiceTopicField - 更新ULogService主题索引字段""" + + fields = { + "FieldInfos": fields.List( + UpdateULogServiceTopicFieldParamFieldInfosSchema() + ), + "ProjectId": fields.Str(required=False, dump_to="ProjectId"), + "Region": fields.Str(required=True, dump_to="Region"), + "TopicId": fields.Str(required=True, dump_to="TopicId"), + "Zone": fields.Str(required=True, dump_to="Zone"), + } + + +class UpdateULogServiceTopicFieldResponseSchema(schema.ResponseSchema): + """UpdateULogServiceTopicField - 更新ULogService主题索引字段""" + + fields = {} diff --git a/ucloud/services/ulogservice/schemas/models.py b/ucloud/services/ulogservice/schemas/models.py index fd6a24a..c913a83 100644 --- a/ucloud/services/ulogservice/schemas/models.py +++ b/ucloud/services/ulogservice/schemas/models.py @@ -29,15 +29,13 @@ class MachineInfoSchema(schema.ResponseSchema): } -class MachineGroupSchema(schema.ResponseSchema): - """MachineGroup - 机器组""" +class TopicFieldSchema(schema.ResponseSchema): + """TopicField - 索引字段""" fields = { - "CreateTime": fields.Int(required=False, load_from="CreateTime"), - "Id": fields.Str(required=False, load_from="Id"), - "Name": fields.Str(required=False, load_from="Name"), - "Type": fields.Str(required=False, load_from="Type"), - "UpdateTime": fields.Int(required=False, load_from="UpdateTime"), + "FieldName": fields.Str(required=False, load_from="FieldName"), + "FieldType": fields.Str(required=False, load_from="FieldType"), + "IsReserved": fields.Bool(required=False, load_from="IsReserved"), } @@ -50,6 +48,18 @@ class FilePathSchema(schema.ResponseSchema): } +class MachineGroupSchema(schema.ResponseSchema): + """MachineGroup - 机器组""" + + fields = { + "CreateTime": fields.Int(required=False, load_from="CreateTime"), + "Id": fields.Str(required=False, load_from="Id"), + "Name": fields.Str(required=False, load_from="Name"), + "Type": fields.Str(required=False, load_from="Type"), + "UpdateTime": fields.Int(required=False, load_from="UpdateTime"), + } + + class CollectConfSchema(schema.ResponseSchema): """CollectConf - 日志采集配置""" diff --git a/ucloud/version.py b/ucloud/version.py index 401130c..31145cc 100644 --- a/ucloud/version.py +++ b/ucloud/version.py @@ -1 +1 @@ -version = "0.11.127" +version = "0.11.128"