Step By Step
- 导入依赖信息
- 调用示例
- 查看结果
一.导入依赖信息
<dependency><groupId>com.aliyun</groupId><artifactId>aliyun-java-sdk-core</artifactId><version>3.2.6</version></dependency><dependency><groupId>com.aliyun</groupId><artifactId>aliyun-java-sdk-cms</artifactId><version>7.0.24</version></dependency>
二.调用示例
// DescribeAlertHistoryList 调用DescribeAlertHistoryList接口查询报警历史详情DefaultProfileprofile=DefaultProfile.getProfile("cn-shanghai", "accessKeyId", "accessSecret"); IAcsClientclient=newDefaultAcsClient(profile); DescribeAlertHistoryListRequestrequest=newDescribeAlertHistoryListRequest(); request.setRegionId("cn-shanghai"); request.setRuleId("ruleId"); request.setNamespace("namespace"); request.setMetricName("metricName"); request.setGroupId("groupId"); request.setAscending(ascending); request.setStartTime("startTime"); request.setEndTime("endTime"); DescribeAlertHistoryListResponseresponse=client.getAcsResponse(request); System.out.println(newGson().toJson(response));
三.查看结果