From 7ce38ea9496e740c87ce9d1e1ec31a3eccf8384a Mon Sep 17 00:00:00 2001 From: ucloud-bot Date: Thu, 24 Sep 2026 10:04:08 +0000 Subject: [PATCH] sdk: rolling update for 0.3.58 --- VERSION | 2 +- .../GetProductHighPrecisionMetricsRequest.php | 50 ++++++ ...GetProductHighPrecisionMetricsResponse.php | 49 ++++++ .../Apis/QueryMetricDenseDataRequest.php | 166 ++++++++++++++++++ .../Apis/QueryMetricDenseDataResponse.php | 50 ++++++ src/CloudWatch/CloudWatchClient.php | 149 ++++++++++++++++ .../QueryMetricDenseDataParamMetricInfos.php | 84 +++++++++ ...eryMetricDenseDataParamMetricInfosTags.php | 44 +++++ 8 files changed, 593 insertions(+), 1 deletion(-) create mode 100644 src/CloudWatch/Apis/GetProductHighPrecisionMetricsRequest.php create mode 100644 src/CloudWatch/Apis/GetProductHighPrecisionMetricsResponse.php create mode 100644 src/CloudWatch/Apis/QueryMetricDenseDataRequest.php create mode 100644 src/CloudWatch/Apis/QueryMetricDenseDataResponse.php create mode 100644 src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfos.php create mode 100644 src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfosTags.php diff --git a/VERSION b/VERSION index f6f4908c..6d716d90 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.57 +0.3.58 diff --git a/src/CloudWatch/Apis/GetProductHighPrecisionMetricsRequest.php b/src/CloudWatch/Apis/GetProductHighPrecisionMetricsRequest.php new file mode 100644 index 00000000..2ffcfb5e --- /dev/null +++ b/src/CloudWatch/Apis/GetProductHighPrecisionMetricsRequest.php @@ -0,0 +1,50 @@ + "GetProductHighPrecisionMetrics"]); + $this->markRequired("ProductKey"); + } + + + + /** + * ProductKey: 产品唯一标识,参见 [产品概览](https://docs.ucloud.cn/cloudwatch/metric/intro) + * + * @return string|null + */ + public function getProductKey() + { + return $this->get("ProductKey"); + } + + /** + * ProductKey: 产品唯一标识,参见 [产品概览](https://docs.ucloud.cn/cloudwatch/metric/intro) + * + * @param string $productKey + */ + public function setProductKey($productKey) + { + $this->set("ProductKey", $productKey); + } +} diff --git a/src/CloudWatch/Apis/GetProductHighPrecisionMetricsResponse.php b/src/CloudWatch/Apis/GetProductHighPrecisionMetricsResponse.php new file mode 100644 index 00000000..47f8af88 --- /dev/null +++ b/src/CloudWatch/Apis/GetProductHighPrecisionMetricsResponse.php @@ -0,0 +1,49 @@ +get("Data")); + } + + /** + * Data: 返回数据 + * + * @param GetProductMetricsRespData $data + */ + public function setData(array $data) + { + $this->set("Data", $data->getAll()); + } +} diff --git a/src/CloudWatch/Apis/QueryMetricDenseDataRequest.php b/src/CloudWatch/Apis/QueryMetricDenseDataRequest.php new file mode 100644 index 00000000..8824f326 --- /dev/null +++ b/src/CloudWatch/Apis/QueryMetricDenseDataRequest.php @@ -0,0 +1,166 @@ + "QueryMetricDenseData"]); + $this->markRequired("ProductKey"); + $this->markRequired("StartTime"); + $this->markRequired("EndTime"); + } + + + + /** + * Region: 地域。 全局产品可不传,其他类型必传。 + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 全局产品可不传,其他类型必传。 + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * ProductKey: 资源类型 + * + * @return string|null + */ + public function getProductKey() + { + return $this->get("ProductKey"); + } + + /** + * ProductKey: 资源类型 + * + * @param string $productKey + */ + public function setProductKey($productKey) + { + $this->set("ProductKey", $productKey); + } + + /** + * StartTime: 开始时间戳 + * + * @return integer|null + */ + public function getStartTime() + { + return $this->get("StartTime"); + } + + /** + * StartTime: 开始时间戳 + * + * @param int $startTime + */ + public function setStartTime($startTime) + { + $this->set("StartTime", $startTime); + } + + /** + * EndTime: 截止时间戳 + * + * @return integer|null + */ + public function getEndTime() + { + return $this->get("EndTime"); + } + + /** + * EndTime: 截止时间戳 + * + * @param int $endTime + */ + public function setEndTime($endTime) + { + $this->set("EndTime", $endTime); + } + + /** + * MetricInfos: + * + * @return QueryMetricDenseDataParamMetricInfos[]|null + */ + public function getMetricInfos() + { + $items = $this->get("MetricInfos"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new QueryMetricDenseDataParamMetricInfos($item)); + } + return $result; + } + + /** + * MetricInfos: + * + * @param QueryMetricDenseDataParamMetricInfos[] $metricInfos + */ + public function setMetricInfos(array $metricInfos) + { + $result = []; + foreach ($metricInfos as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/CloudWatch/Apis/QueryMetricDenseDataResponse.php b/src/CloudWatch/Apis/QueryMetricDenseDataResponse.php new file mode 100644 index 00000000..9c764b87 --- /dev/null +++ b/src/CloudWatch/Apis/QueryMetricDenseDataResponse.php @@ -0,0 +1,50 @@ +get("Data")); + } + + /** + * Data: 返回高精度指标监控数据 + * + * @param QueryMetricDataResp $data + */ + public function setData(array $data) + { + $this->set("Data", $data->getAll()); + } +} diff --git a/src/CloudWatch/CloudWatchClient.php b/src/CloudWatch/CloudWatchClient.php index bef0d8f5..a634ddbf 100644 --- a/src/CloudWatch/CloudWatchClient.php +++ b/src/CloudWatch/CloudWatchClient.php @@ -30,6 +30,8 @@ use UCloud\CloudWatch\Apis\EnableAlertStrategyResponse; use UCloud\CloudWatch\Apis\GetMetricDataAggregationMethodRequest; use UCloud\CloudWatch\Apis\GetMetricDataAggregationMethodResponse; +use UCloud\CloudWatch\Apis\GetProductHighPrecisionMetricsRequest; +use UCloud\CloudWatch\Apis\GetProductHighPrecisionMetricsResponse; use UCloud\CloudWatch\Apis\GetProductMetricsRequest; use UCloud\CloudWatch\Apis\GetProductMetricsResponse; use UCloud\CloudWatch\Apis\ListAlertRecordRequest; @@ -46,6 +48,8 @@ use UCloud\CloudWatch\Apis\QueryMetricDataSetResponse; use UCloud\CloudWatch\Apis\QueryMetricDataSummaryRequest; use UCloud\CloudWatch\Apis\QueryMetricDataSummaryResponse; +use UCloud\CloudWatch\Apis\QueryMetricDenseDataRequest; +use UCloud\CloudWatch\Apis\QueryMetricDenseDataResponse; use UCloud\CloudWatch\Apis\UnBindAlertStrategyRequest; use UCloud\CloudWatch\Apis\UnBindAlertStrategyResponse; use UCloud\CloudWatch\Apis\UpdateAlertStrategyRequest; @@ -280,6 +284,79 @@ public function getMetricDataAggregationMethod(GetMetricDataAggregationMethodReq return new GetMetricDataAggregationMethodResponse($resp->toArray(), $resp->getRequestId()); } + /** + * GetProductHighPrecisionMetrics - 获取云产品关联的高精度指标列表 + * + * See also: https://docs.ucloud.cn/api/cloudwatch-api/get_product_high_precision_metrics + * + * Arguments: + * + * $args = [ + * "ProductKey" => (string) 产品唯一标识,参见 [产品概览](https://docs.ucloud.cn/cloudwatch/metric/intro) + * ] + * + * Outputs: + * + * $outputs = [ + * "Data" => (object) 返回数据[ + * "Total" => (integer) 查询结果总数 + * "List" => (array) 指标列表[ + * [ + * "ProductType" => (integer) 云产品ID + * "UnitID" => (integer) 单位ID + * "MetricID" => (integer) 指标ID + * "Metric" => (string) 指标唯一标识 (uhost_cpu_usage) + * "MetricEnName" => (string) 指标英文名称 + * "MetricChName" => (string) 指标中文名称 + * "MetricEnDesc" => (string) 指标英文描述 + * "MetricChDesc" => (string) 指标中文描述 + * "MetricGroup" => (string) 指标分类/指标组 + * "FrequencyMs" => (integer) 上报频率毫秒 + * "Unit" => (object) 单位[ + * "UnitID" => (integer) 单位id + * "GroupId" => (integer) GroupId + * "UnitEnName" => (string) 单位英文名称 + * "UnitChName" => (string) 单位中文名称 + * "UnitDesc" => (string) 单位描述 + * "ConversionFactor" => (integer) 转换因子 + * "CreatedBy" => (string) 创建人 + * "UpdatedBy" => (string) 修改人 + * "CreatedAt" => (string) 创建时间 + * "UpdatedAt" => (string) 修改时间 + * "DeletedAt" => (integer) 删除时间 + * ] + * "CreatedBy" => (string) 创建者 + * "CreatedAt" => (string) 创建时间 + * "UpdatedBy" => (string) 修改者 + * "UpdatedAt" => (string) 修改时间 + * ] + * ] + * "UnitConfigs" => (array) 单位转换信息[ + * [ + * "UnitCnNames" => (array) 指标中文名列表 + * "UnitEnNames" => (array) 指标英文名列表 + * "ConversionFactor" => (integer) 转换因子 + * "ConversionRules" => (array) 转换规则[ + * [ + * "From" => (string) 来源 + * "To" => (string) 目标 + * "ConversionFactor" => (integer) 转换因子 + * ] + * ] + * ] + * ] + * ] + * ] + * + * @return GetProductHighPrecisionMetricsResponse + * @throws UCloudException + */ + public function getProductHighPrecisionMetrics(GetProductHighPrecisionMetricsRequest $request = null) + { + $resp = $this->invoke($request); + return new GetProductHighPrecisionMetricsResponse($resp->toArray(), $resp->getRequestId()); + } + /** * GetProductMetrics - 获取云产品关联的指标列表 * @@ -786,6 +863,78 @@ public function queryMetricDataSummary(QueryMetricDataSummaryRequest $request = return new QueryMetricDataSummaryResponse($resp->toArray(), $resp->getRequestId()); } + /** + * QueryMetricDenseData - 获取高精度指标样本数据 + * + * See also: https://docs.ucloud.cn/api/cloudwatch-api/query_metric_dense_data + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 全局产品可不传,其他类型必传。 + * "ProjectId" => (string) 项目ID + * "ProductKey" => (string) 资源类型 + * "StartTime" => (integer) 开始时间戳 + * "EndTime" => (integer) 截止时间戳 + * "MetricInfos" => (array) [ + * [ + * "Metric" => (string) 指标名 + * "ResourceId" => (string) 资源id + * "Tags" => (object) [ + * "AnyKey" => (string) AnyKey:代表任意一个用户自定义的key。Tags是一个用户自定义对象map,是要查询指标的tag的key和value。用户自定义的Tags对象里的key和value,它们分别是要查询的tag的key和value。如:"Tags":{ "tag1":"value1", "tag2":"value2", "tag3":"value3"} + * ] + * ] + * ] + * ] + * + * Outputs: + * + * $outputs = [ + * "Data" => (object) 返回高精度指标监控数据[ + * "InvalidResourceIds" => (array) 无效或无权限资源的 ID 列表 + * "List" => (array) 查询的结果集[ + * [ + * "Metric" => (string) 指标名 + * "ErrCode" => (integer) 该指标查询的处理状态码 + * "ErrMsg" => (string) 该指标查询的状态说明 + * "TagEntries" => (array) 标签列表。每项为 TagEntry:TagName(标签名)和 KeyList(该标签的全部候选值)。[ + * [ + * "TagName" => (string) 标签名称 + * "KeyList" => (array) 标签候选值列表 + * ] + * ] + * "Results" => (array) 查询到的时间序列列表[ + * [ + * "ResourceId" => (string) 资源的短id + * "ResourceName" => (string) 资源名称 + * "TagList" => (array) 资源标签列表。每项为 TagListItem:Tag(标签名)和 TagValue(标签值)。[ + * [ + * "Tag" => (string) 标签名 + * "TagValue" => (string) 标签值 + * ] + * ] + * "Values" => (array) 指标数据点列表,元素为 MetricPoint[ + * [ + * "Timestamp" => (integer) 时间戳 + * "Value" => (number) 样本值 + * ] + * ] + * ] + * ] + * ] + * ] + * ] + * ] + * + * @return QueryMetricDenseDataResponse + * @throws UCloudException + */ + public function queryMetricDenseData(QueryMetricDenseDataRequest $request = null) + { + $resp = $this->invoke($request); + return new QueryMetricDenseDataResponse($resp->toArray(), $resp->getRequestId()); + } + /** * UnBindAlertStrategy - 解绑告警策略 * diff --git a/src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfos.php b/src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfos.php new file mode 100644 index 00000000..ed9f931d --- /dev/null +++ b/src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfos.php @@ -0,0 +1,84 @@ +get("Metric"); + } + + /** + * Metric: 指标名 + * + * @param string $metric + */ + public function setMetric($metric) + { + $this->set("Metric", $metric); + } + + /** + * ResourceId: 资源id + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: 资源id + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * Tags: + * + * @return QueryMetricDenseDataParamMetricInfosTags|null + */ + public function getTags() + { + return new QueryMetricDenseDataParamMetricInfosTags($this->get("Tags")); + } + + /** + * Tags: + * + * @param QueryMetricDenseDataParamMetricInfosTags $tags + */ + public function setTags(array $tags) + { + $this->set("Tags", $tags->getAll()); + } +} diff --git a/src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfosTags.php b/src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfosTags.php new file mode 100644 index 00000000..d2759ddc --- /dev/null +++ b/src/CloudWatch/Params/QueryMetricDenseDataParamMetricInfosTags.php @@ -0,0 +1,44 @@ +get("AnyKey"); + } + + /** + * AnyKey: AnyKey:代表任意一个用户自定义的key。Tags是一个用户自定义对象map,是要查询指标的tag的key和value。用户自定义的Tags对象里的key和value,它们分别是要查询的tag的key和value。如:"Tags":{ "tag1":"value1", "tag2":"value2", "tag3":"value3"} + * + * @param string $anyKey + */ + public function setAnyKey($anyKey) + { + $this->set("AnyKey", $anyKey); + } +}