|
| 1 | +/** |
| 2 | + * Copyright 2021 UCloud Technology Co., Ltd. |
| 3 | + * |
| 4 | + * <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file |
| 5 | + * except in compliance with the License. You may obtain a copy of the License at |
| 6 | + * |
| 7 | + * <p>http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | + * |
| 9 | + * <p>Unless required by applicable law or agreed to in writing, software distributed under the |
| 10 | + * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 11 | + * express or implied. See the License for the specific language governing permissions and |
| 12 | + * limitations under the License. |
| 13 | + */ |
| 14 | +package cn.ucloud.cloudwatch.client; |
| 15 | + |
| 16 | +import cn.ucloud.cloudwatch.models.BindAlertStrategyRequest; |
| 17 | +import cn.ucloud.cloudwatch.models.BindAlertStrategyResponse; |
| 18 | +import cn.ucloud.cloudwatch.models.GetProductMetricsRequest; |
| 19 | +import cn.ucloud.cloudwatch.models.GetProductMetricsResponse; |
| 20 | +import cn.ucloud.cloudwatch.models.ListAlertRecordRequest; |
| 21 | +import cn.ucloud.cloudwatch.models.ListAlertRecordResponse; |
| 22 | +import cn.ucloud.cloudwatch.models.ListAlertStrategyRequest; |
| 23 | +import cn.ucloud.cloudwatch.models.ListAlertStrategyResponse; |
| 24 | +import cn.ucloud.cloudwatch.models.ListMonitorProductRequest; |
| 25 | +import cn.ucloud.cloudwatch.models.ListMonitorProductResponse; |
| 26 | +import cn.ucloud.cloudwatch.models.QueryMetricDataSetRequest; |
| 27 | +import cn.ucloud.cloudwatch.models.QueryMetricDataSetResponse; |
| 28 | +import cn.ucloud.cloudwatch.models.QueryMetricDataSummaryRequest; |
| 29 | +import cn.ucloud.cloudwatch.models.QueryMetricDataSummaryResponse; |
| 30 | +import cn.ucloud.cloudwatch.models.UnBindAlertStrategyRequest; |
| 31 | +import cn.ucloud.cloudwatch.models.UnBindAlertStrategyResponse; |
| 32 | +import cn.ucloud.common.client.DefaultClient; |
| 33 | +import cn.ucloud.common.config.Config; |
| 34 | +import cn.ucloud.common.credential.Credential; |
| 35 | +import cn.ucloud.common.exception.UCloudException; |
| 36 | + |
| 37 | +/** This client is used to call actions of **CloudWatch** service */ |
| 38 | +public class CloudWatchClient extends DefaultClient implements CloudWatchClientInterface { |
| 39 | + public CloudWatchClient(Config config, Credential credential) { |
| 40 | + super(config, credential); |
| 41 | + } |
| 42 | + |
| 43 | + /** |
| 44 | + * BindAlertStrategy - 绑定告警策略 |
| 45 | + * |
| 46 | + * @param request Request object |
| 47 | + * @throws UCloudException Exception |
| 48 | + */ |
| 49 | + public BindAlertStrategyResponse bindAlertStrategy(BindAlertStrategyRequest request) |
| 50 | + throws UCloudException { |
| 51 | + request.setAction("BindAlertStrategy"); |
| 52 | + return (BindAlertStrategyResponse) this.invoke(request, BindAlertStrategyResponse.class); |
| 53 | + } |
| 54 | + |
| 55 | + /** |
| 56 | + * GetProductMetrics - 获取云产品关联的指标列表 |
| 57 | + * |
| 58 | + * @param request Request object |
| 59 | + * @throws UCloudException Exception |
| 60 | + */ |
| 61 | + public GetProductMetricsResponse getProductMetrics(GetProductMetricsRequest request) |
| 62 | + throws UCloudException { |
| 63 | + request.setAction("GetProductMetrics"); |
| 64 | + return (GetProductMetricsResponse) this.invoke(request, GetProductMetricsResponse.class); |
| 65 | + } |
| 66 | + |
| 67 | + /** |
| 68 | + * ListAlertRecord - 告警记录 |
| 69 | + * |
| 70 | + * @param request Request object |
| 71 | + * @throws UCloudException Exception |
| 72 | + */ |
| 73 | + public ListAlertRecordResponse listAlertRecord(ListAlertRecordRequest request) |
| 74 | + throws UCloudException { |
| 75 | + request.setAction("ListAlertRecord"); |
| 76 | + return (ListAlertRecordResponse) this.invoke(request, ListAlertRecordResponse.class); |
| 77 | + } |
| 78 | + |
| 79 | + /** |
| 80 | + * ListAlertStrategy - 获取告警策略列表 |
| 81 | + * |
| 82 | + * @param request Request object |
| 83 | + * @throws UCloudException Exception |
| 84 | + */ |
| 85 | + public ListAlertStrategyResponse listAlertStrategy(ListAlertStrategyRequest request) |
| 86 | + throws UCloudException { |
| 87 | + request.setAction("ListAlertStrategy"); |
| 88 | + return (ListAlertStrategyResponse) this.invoke(request, ListAlertStrategyResponse.class); |
| 89 | + } |
| 90 | + |
| 91 | + /** |
| 92 | + * ListMonitorProduct - 获取监控对象类型列表 |
| 93 | + * |
| 94 | + * @param request Request object |
| 95 | + * @throws UCloudException Exception |
| 96 | + */ |
| 97 | + public ListMonitorProductResponse listMonitorProduct(ListMonitorProductRequest request) |
| 98 | + throws UCloudException { |
| 99 | + request.setAction("ListMonitorProduct"); |
| 100 | + return (ListMonitorProductResponse) this.invoke(request, ListMonitorProductResponse.class); |
| 101 | + } |
| 102 | + |
| 103 | + /** |
| 104 | + * QueryMetricDataSet - 查询监控指标数据集 |
| 105 | + * |
| 106 | + * @param request Request object |
| 107 | + * @throws UCloudException Exception |
| 108 | + */ |
| 109 | + public QueryMetricDataSetResponse queryMetricDataSet(QueryMetricDataSetRequest request) |
| 110 | + throws UCloudException { |
| 111 | + request.setAction("QueryMetricDataSet"); |
| 112 | + return (QueryMetricDataSetResponse) this.invoke(request, QueryMetricDataSetResponse.class); |
| 113 | + } |
| 114 | + |
| 115 | + /** |
| 116 | + * QueryMetricDataSummary - 获取资源看图属性列表 |
| 117 | + * |
| 118 | + * @param request Request object |
| 119 | + * @throws UCloudException Exception |
| 120 | + */ |
| 121 | + public QueryMetricDataSummaryResponse queryMetricDataSummary( |
| 122 | + QueryMetricDataSummaryRequest request) throws UCloudException { |
| 123 | + request.setAction("QueryMetricDataSummary"); |
| 124 | + return (QueryMetricDataSummaryResponse) |
| 125 | + this.invoke(request, QueryMetricDataSummaryResponse.class); |
| 126 | + } |
| 127 | + |
| 128 | + /** |
| 129 | + * UnBindAlertStrategy - 解绑告警策略 |
| 130 | + * |
| 131 | + * @param request Request object |
| 132 | + * @throws UCloudException Exception |
| 133 | + */ |
| 134 | + public UnBindAlertStrategyResponse unBindAlertStrategy(UnBindAlertStrategyRequest request) |
| 135 | + throws UCloudException { |
| 136 | + request.setAction("UnBindAlertStrategy"); |
| 137 | + return (UnBindAlertStrategyResponse) |
| 138 | + this.invoke(request, UnBindAlertStrategyResponse.class); |
| 139 | + } |
| 140 | +} |
0 commit comments