From b1e2187ca50823bcaa25885ee030564ec90d7883 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 29 Apr 2020 23:13:32 +0800 Subject: [PATCH] Add prometheus ListDashboards api. --- CHANGELOG | 3 + VERSION | 2 +- arms/CMakeLists.txt | 12 ++ arms/include/alibabacloud/arms/ARMSClient.h | 24 ++++ .../arms/model/CheckDataConsistencyRequest.h | 60 ++++++++++ .../arms/model/CheckDataConsistencyResult.h | 51 ++++++++ .../model/GetConsistencySnapshotRequest.h | 60 ++++++++++ .../arms/model/GetConsistencySnapshotResult.h | 89 ++++++++++++++ .../arms/model/ListDashboardsRequest.h | 51 ++++++++ .../arms/model/ListDashboardsResult.h | 63 ++++++++++ .../arms/model/QueryMetricRequest.h | 6 + arms/src/ARMSClient.cc | 108 +++++++++++++++++ arms/src/model/CheckDataConsistencyRequest.cc | 84 +++++++++++++ arms/src/model/CheckDataConsistencyResult.cc | 51 ++++++++ .../model/GetConsistencySnapshotRequest.cc | 84 +++++++++++++ .../src/model/GetConsistencySnapshotResult.cc | 110 ++++++++++++++++++ arms/src/model/ListDashboardsRequest.cc | 51 ++++++++ arms/src/model/ListDashboardsResult.cc | 74 ++++++++++++ arms/src/model/QueryMetricRequest.cc | 22 ++++ 19 files changed, 1004 insertions(+), 1 deletion(-) create mode 100644 arms/include/alibabacloud/arms/model/CheckDataConsistencyRequest.h create mode 100644 arms/include/alibabacloud/arms/model/CheckDataConsistencyResult.h create mode 100644 arms/include/alibabacloud/arms/model/GetConsistencySnapshotRequest.h create mode 100644 arms/include/alibabacloud/arms/model/GetConsistencySnapshotResult.h create mode 100644 arms/include/alibabacloud/arms/model/ListDashboardsRequest.h create mode 100644 arms/include/alibabacloud/arms/model/ListDashboardsResult.h create mode 100644 arms/src/model/CheckDataConsistencyRequest.cc create mode 100644 arms/src/model/CheckDataConsistencyResult.cc create mode 100644 arms/src/model/GetConsistencySnapshotRequest.cc create mode 100644 arms/src/model/GetConsistencySnapshotResult.cc create mode 100644 arms/src/model/ListDashboardsRequest.cc create mode 100644 arms/src/model/ListDashboardsResult.cc diff --git a/CHANGELOG b/CHANGELOG index 414737466..dd61fa25f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-04-29 Version: 1.36.395 +- Add prometheus ListDashboards api. + 2020-04-29 Version: 1.36.394 - Supported VideoProduce. diff --git a/VERSION b/VERSION index 2af613c40..7537487ce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.394 \ No newline at end of file +1.36.395 \ No newline at end of file diff --git a/arms/CMakeLists.txt b/arms/CMakeLists.txt index 131d43a6b..63c12af6e 100644 --- a/arms/CMakeLists.txt +++ b/arms/CMakeLists.txt @@ -25,6 +25,8 @@ set(arms_public_header_model include/alibabacloud/arms/model/AddGrafanaResult.h include/alibabacloud/arms/model/AddIntegrationRequest.h include/alibabacloud/arms/model/AddIntegrationResult.h + include/alibabacloud/arms/model/CheckDataConsistencyRequest.h + include/alibabacloud/arms/model/CheckDataConsistencyResult.h include/alibabacloud/arms/model/CreateAlertContactRequest.h include/alibabacloud/arms/model/CreateAlertContactResult.h include/alibabacloud/arms/model/CreateAlertContactGroupRequest.h @@ -39,6 +41,8 @@ set(arms_public_header_model include/alibabacloud/arms/model/DeleteAlertRulesResult.h include/alibabacloud/arms/model/DeleteRetcodeAppRequest.h include/alibabacloud/arms/model/DeleteRetcodeAppResult.h + include/alibabacloud/arms/model/GetConsistencySnapshotRequest.h + include/alibabacloud/arms/model/GetConsistencySnapshotResult.h include/alibabacloud/arms/model/GetPrometheusApiTokenRequest.h include/alibabacloud/arms/model/GetPrometheusApiTokenResult.h include/alibabacloud/arms/model/GetRetcodeShareUrlRequest.h @@ -51,6 +55,8 @@ set(arms_public_header_model include/alibabacloud/arms/model/ImportCustomAlertRulesResult.h include/alibabacloud/arms/model/ListClusterFromGrafanaRequest.h include/alibabacloud/arms/model/ListClusterFromGrafanaResult.h + include/alibabacloud/arms/model/ListDashboardsRequest.h + include/alibabacloud/arms/model/ListDashboardsResult.h include/alibabacloud/arms/model/ListPromClustersRequest.h include/alibabacloud/arms/model/ListPromClustersResult.h include/alibabacloud/arms/model/ListRetcodeAppsRequest.h @@ -98,6 +104,8 @@ set(arms_src src/model/AddGrafanaResult.cc src/model/AddIntegrationRequest.cc src/model/AddIntegrationResult.cc + src/model/CheckDataConsistencyRequest.cc + src/model/CheckDataConsistencyResult.cc src/model/CreateAlertContactRequest.cc src/model/CreateAlertContactResult.cc src/model/CreateAlertContactGroupRequest.cc @@ -112,6 +120,8 @@ set(arms_src src/model/DeleteAlertRulesResult.cc src/model/DeleteRetcodeAppRequest.cc src/model/DeleteRetcodeAppResult.cc + src/model/GetConsistencySnapshotRequest.cc + src/model/GetConsistencySnapshotResult.cc src/model/GetPrometheusApiTokenRequest.cc src/model/GetPrometheusApiTokenResult.cc src/model/GetRetcodeShareUrlRequest.cc @@ -124,6 +134,8 @@ set(arms_src src/model/ImportCustomAlertRulesResult.cc src/model/ListClusterFromGrafanaRequest.cc src/model/ListClusterFromGrafanaResult.cc + src/model/ListDashboardsRequest.cc + src/model/ListDashboardsResult.cc src/model/ListPromClustersRequest.cc src/model/ListPromClustersResult.cc src/model/ListRetcodeAppsRequest.cc diff --git a/arms/include/alibabacloud/arms/ARMSClient.h b/arms/include/alibabacloud/arms/ARMSClient.h index 5ce929da1..5284ccf18 100644 --- a/arms/include/alibabacloud/arms/ARMSClient.h +++ b/arms/include/alibabacloud/arms/ARMSClient.h @@ -26,6 +26,8 @@ #include "model/AddGrafanaResult.h" #include "model/AddIntegrationRequest.h" #include "model/AddIntegrationResult.h" +#include "model/CheckDataConsistencyRequest.h" +#include "model/CheckDataConsistencyResult.h" #include "model/CreateAlertContactRequest.h" #include "model/CreateAlertContactResult.h" #include "model/CreateAlertContactGroupRequest.h" @@ -40,6 +42,8 @@ #include "model/DeleteAlertRulesResult.h" #include "model/DeleteRetcodeAppRequest.h" #include "model/DeleteRetcodeAppResult.h" +#include "model/GetConsistencySnapshotRequest.h" +#include "model/GetConsistencySnapshotResult.h" #include "model/GetPrometheusApiTokenRequest.h" #include "model/GetPrometheusApiTokenResult.h" #include "model/GetRetcodeShareUrlRequest.h" @@ -52,6 +56,8 @@ #include "model/ImportCustomAlertRulesResult.h" #include "model/ListClusterFromGrafanaRequest.h" #include "model/ListClusterFromGrafanaResult.h" +#include "model/ListDashboardsRequest.h" +#include "model/ListDashboardsResult.h" #include "model/ListPromClustersRequest.h" #include "model/ListPromClustersResult.h" #include "model/ListRetcodeAppsRequest.h" @@ -107,6 +113,9 @@ namespace AlibabaCloud typedef Outcome AddIntegrationOutcome; typedef std::future AddIntegrationOutcomeCallable; typedef std::function&)> AddIntegrationAsyncHandler; + typedef Outcome CheckDataConsistencyOutcome; + typedef std::future CheckDataConsistencyOutcomeCallable; + typedef std::function&)> CheckDataConsistencyAsyncHandler; typedef Outcome CreateAlertContactOutcome; typedef std::future CreateAlertContactOutcomeCallable; typedef std::function&)> CreateAlertContactAsyncHandler; @@ -128,6 +137,9 @@ namespace AlibabaCloud typedef Outcome DeleteRetcodeAppOutcome; typedef std::future DeleteRetcodeAppOutcomeCallable; typedef std::function&)> DeleteRetcodeAppAsyncHandler; + typedef Outcome GetConsistencySnapshotOutcome; + typedef std::future GetConsistencySnapshotOutcomeCallable; + typedef std::function&)> GetConsistencySnapshotAsyncHandler; typedef Outcome GetPrometheusApiTokenOutcome; typedef std::future GetPrometheusApiTokenOutcomeCallable; typedef std::function&)> GetPrometheusApiTokenAsyncHandler; @@ -146,6 +158,9 @@ namespace AlibabaCloud typedef Outcome ListClusterFromGrafanaOutcome; typedef std::future ListClusterFromGrafanaOutcomeCallable; typedef std::function&)> ListClusterFromGrafanaAsyncHandler; + typedef Outcome ListDashboardsOutcome; + typedef std::future ListDashboardsOutcomeCallable; + typedef std::function&)> ListDashboardsAsyncHandler; typedef Outcome ListPromClustersOutcome; typedef std::future ListPromClustersOutcomeCallable; typedef std::function&)> ListPromClustersAsyncHandler; @@ -217,6 +232,9 @@ namespace AlibabaCloud AddIntegrationOutcome addIntegration(const Model::AddIntegrationRequest &request)const; void addIntegrationAsync(const Model::AddIntegrationRequest& request, const AddIntegrationAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AddIntegrationOutcomeCallable addIntegrationCallable(const Model::AddIntegrationRequest& request) const; + CheckDataConsistencyOutcome checkDataConsistency(const Model::CheckDataConsistencyRequest &request)const; + void checkDataConsistencyAsync(const Model::CheckDataConsistencyRequest& request, const CheckDataConsistencyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CheckDataConsistencyOutcomeCallable checkDataConsistencyCallable(const Model::CheckDataConsistencyRequest& request) const; CreateAlertContactOutcome createAlertContact(const Model::CreateAlertContactRequest &request)const; void createAlertContactAsync(const Model::CreateAlertContactRequest& request, const CreateAlertContactAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateAlertContactOutcomeCallable createAlertContactCallable(const Model::CreateAlertContactRequest& request) const; @@ -238,6 +256,9 @@ namespace AlibabaCloud DeleteRetcodeAppOutcome deleteRetcodeApp(const Model::DeleteRetcodeAppRequest &request)const; void deleteRetcodeAppAsync(const Model::DeleteRetcodeAppRequest& request, const DeleteRetcodeAppAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteRetcodeAppOutcomeCallable deleteRetcodeAppCallable(const Model::DeleteRetcodeAppRequest& request) const; + GetConsistencySnapshotOutcome getConsistencySnapshot(const Model::GetConsistencySnapshotRequest &request)const; + void getConsistencySnapshotAsync(const Model::GetConsistencySnapshotRequest& request, const GetConsistencySnapshotAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetConsistencySnapshotOutcomeCallable getConsistencySnapshotCallable(const Model::GetConsistencySnapshotRequest& request) const; GetPrometheusApiTokenOutcome getPrometheusApiToken(const Model::GetPrometheusApiTokenRequest &request)const; void getPrometheusApiTokenAsync(const Model::GetPrometheusApiTokenRequest& request, const GetPrometheusApiTokenAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetPrometheusApiTokenOutcomeCallable getPrometheusApiTokenCallable(const Model::GetPrometheusApiTokenRequest& request) const; @@ -256,6 +277,9 @@ namespace AlibabaCloud ListClusterFromGrafanaOutcome listClusterFromGrafana(const Model::ListClusterFromGrafanaRequest &request)const; void listClusterFromGrafanaAsync(const Model::ListClusterFromGrafanaRequest& request, const ListClusterFromGrafanaAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListClusterFromGrafanaOutcomeCallable listClusterFromGrafanaCallable(const Model::ListClusterFromGrafanaRequest& request) const; + ListDashboardsOutcome listDashboards(const Model::ListDashboardsRequest &request)const; + void listDashboardsAsync(const Model::ListDashboardsRequest& request, const ListDashboardsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListDashboardsOutcomeCallable listDashboardsCallable(const Model::ListDashboardsRequest& request) const; ListPromClustersOutcome listPromClusters(const Model::ListPromClustersRequest &request)const; void listPromClustersAsync(const Model::ListPromClustersRequest& request, const ListPromClustersAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListPromClustersOutcomeCallable listPromClustersCallable(const Model::ListPromClustersRequest& request) const; diff --git a/arms/include/alibabacloud/arms/model/CheckDataConsistencyRequest.h b/arms/include/alibabacloud/arms/model/CheckDataConsistencyRequest.h new file mode 100644 index 000000000..5b7dff391 --- /dev/null +++ b/arms/include/alibabacloud/arms/model/CheckDataConsistencyRequest.h @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ARMS_MODEL_CHECKDATACONSISTENCYREQUEST_H_ +#define ALIBABACLOUD_ARMS_MODEL_CHECKDATACONSISTENCYREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT CheckDataConsistencyRequest : public RpcServiceRequest + { + + public: + CheckDataConsistencyRequest(); + ~CheckDataConsistencyRequest(); + + long getCurrentTimestamp()const; + void setCurrentTimestamp(long currentTimestamp); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getAppType()const; + void setAppType(const std::string& appType); + std::string getPid()const; + void setPid(const std::string& pid); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); + + private: + long currentTimestamp_; + std::string regionId_; + std::string appType_; + std::string pid_; + std::string proxyUserId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_CHECKDATACONSISTENCYREQUEST_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/CheckDataConsistencyResult.h b/arms/include/alibabacloud/arms/model/CheckDataConsistencyResult.h new file mode 100644 index 000000000..7d9716b3c --- /dev/null +++ b/arms/include/alibabacloud/arms/model/CheckDataConsistencyResult.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ARMS_MODEL_CHECKDATACONSISTENCYRESULT_H_ +#define ALIBABACLOUD_ARMS_MODEL_CHECKDATACONSISTENCYRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT CheckDataConsistencyResult : public ServiceResult + { + public: + + + CheckDataConsistencyResult(); + explicit CheckDataConsistencyResult(const std::string &payload); + ~CheckDataConsistencyResult(); + bool getIsDataConsistency()const; + + protected: + void parse(const std::string &payload); + private: + bool isDataConsistency_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_CHECKDATACONSISTENCYRESULT_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/GetConsistencySnapshotRequest.h b/arms/include/alibabacloud/arms/model/GetConsistencySnapshotRequest.h new file mode 100644 index 000000000..efd020b44 --- /dev/null +++ b/arms/include/alibabacloud/arms/model/GetConsistencySnapshotRequest.h @@ -0,0 +1,60 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ARMS_MODEL_GETCONSISTENCYSNAPSHOTREQUEST_H_ +#define ALIBABACLOUD_ARMS_MODEL_GETCONSISTENCYSNAPSHOTREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT GetConsistencySnapshotRequest : public RpcServiceRequest + { + + public: + GetConsistencySnapshotRequest(); + ~GetConsistencySnapshotRequest(); + + long getCurrentTimestamp()const; + void setCurrentTimestamp(long currentTimestamp); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getAppType()const; + void setAppType(const std::string& appType); + std::string getPid()const; + void setPid(const std::string& pid); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); + + private: + long currentTimestamp_; + std::string regionId_; + std::string appType_; + std::string pid_; + std::string proxyUserId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_GETCONSISTENCYSNAPSHOTREQUEST_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/GetConsistencySnapshotResult.h b/arms/include/alibabacloud/arms/model/GetConsistencySnapshotResult.h new file mode 100644 index 000000000..4fe852231 --- /dev/null +++ b/arms/include/alibabacloud/arms/model/GetConsistencySnapshotResult.h @@ -0,0 +1,89 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ARMS_MODEL_GETCONSISTENCYSNAPSHOTRESULT_H_ +#define ALIBABACLOUD_ARMS_MODEL_GETCONSISTENCYSNAPSHOTRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT GetConsistencySnapshotResult : public ServiceResult + { + public: + struct ConsistencyResult + { + struct SlsShardWatermarkBean + { + struct CheckPointResponse + { + std::string consumer; + long updateTime; + int shard; + std::string checkPoint; + }; + std::string userId; + std::vector checkPointResponses; + std::string pid; + std::vector cursorUpdateTimes; + std::string regionId; + std::string appType; + }; + struct AgentHeartbeatInfo + { + long startTimestamp; + std::string agentVersion; + std::string ip; + std::string hostname; + long lastHeartbeatTime; + std::string pid; + std::string regionId; + std::string appType; + std::string procId; + }; + long lastSlsShardWatermarkTimestamp; + long lastAgentInfoTimestamp; + long judgeTimestamp; + SlsShardWatermarkBean slsShardWatermarkBean; + std::string barrierPointsLastTimestampMap; + long lastBarrierTimestamp; + std::vector agentHeartbeatInfos; + }; + + + GetConsistencySnapshotResult(); + explicit GetConsistencySnapshotResult(const std::string &payload); + ~GetConsistencySnapshotResult(); + ConsistencyResult getConsistencyResult()const; + + protected: + void parse(const std::string &payload); + private: + ConsistencyResult consistencyResult_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_GETCONSISTENCYSNAPSHOTRESULT_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/ListDashboardsRequest.h b/arms/include/alibabacloud/arms/model/ListDashboardsRequest.h new file mode 100644 index 000000000..a14c4f873 --- /dev/null +++ b/arms/include/alibabacloud/arms/model/ListDashboardsRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ARMS_MODEL_LISTDASHBOARDSREQUEST_H_ +#define ALIBABACLOUD_ARMS_MODEL_LISTDASHBOARDSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT ListDashboardsRequest : public RpcServiceRequest + { + + public: + ListDashboardsRequest(); + ~ListDashboardsRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getClusterId()const; + void setClusterId(const std::string& clusterId); + + private: + std::string regionId_; + std::string clusterId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_LISTDASHBOARDSREQUEST_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/ListDashboardsResult.h b/arms/include/alibabacloud/arms/model/ListDashboardsResult.h new file mode 100644 index 000000000..c036cd655 --- /dev/null +++ b/arms/include/alibabacloud/arms/model/ListDashboardsResult.h @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ARMS_MODEL_LISTDASHBOARDSRESULT_H_ +#define ALIBABACLOUD_ARMS_MODEL_LISTDASHBOARDSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace ARMS + { + namespace Model + { + class ALIBABACLOUD_ARMS_EXPORT ListDashboardsResult : public ServiceResult + { + public: + struct DashboardVosItem + { + std::string uid; + std::string type; + std::string title; + std::string time; + std::string id; + std::string exporter; + std::string url; + std::vector tags; + bool isArmsExporter; + }; + + + ListDashboardsResult(); + explicit ListDashboardsResult(const std::string &payload); + ~ListDashboardsResult(); + std::vector getDashboardVos()const; + + protected: + void parse(const std::string &payload); + private: + std::vector dashboardVos_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ARMS_MODEL_LISTDASHBOARDSRESULT_H_ \ No newline at end of file diff --git a/arms/include/alibabacloud/arms/model/QueryMetricRequest.h b/arms/include/alibabacloud/arms/model/QueryMetricRequest.h index ef3ec2a87..2a6886b96 100644 --- a/arms/include/alibabacloud/arms/model/QueryMetricRequest.h +++ b/arms/include/alibabacloud/arms/model/QueryMetricRequest.h @@ -41,6 +41,8 @@ namespace AlibabaCloud QueryMetricRequest(); ~QueryMetricRequest(); + std::string getConsistencyQueryStrategy()const; + void setConsistencyQueryStrategy(const std::string& consistencyQueryStrategy); long getEndTime()const; void setEndTime(long endTime); std::string getOrderBy()const; @@ -49,6 +51,8 @@ namespace AlibabaCloud void setStartTime(long startTime); std::vector getFilters()const; void setFilters(const std::vector& filters); + std::string getConsistencyDataKey()const; + void setConsistencyDataKey(const std::string& consistencyDataKey); std::string getProxyUserId()const; void setProxyUserId(const std::string& proxyUserId); std::vector getMeasures()const; @@ -65,10 +69,12 @@ namespace AlibabaCloud void setOrder(const std::string& order); private: + std::string consistencyQueryStrategy_; long endTime_; std::string orderBy_; long startTime_; std::vector filters_; + std::string consistencyDataKey_; std::string proxyUserId_; std::vector measures_; int intervalInSec_; diff --git a/arms/src/ARMSClient.cc b/arms/src/ARMSClient.cc index 26d23d2cf..1a297e317 100644 --- a/arms/src/ARMSClient.cc +++ b/arms/src/ARMSClient.cc @@ -123,6 +123,42 @@ ARMSClient::AddIntegrationOutcomeCallable ARMSClient::addIntegrationCallable(con return task->get_future(); } +ARMSClient::CheckDataConsistencyOutcome ARMSClient::checkDataConsistency(const CheckDataConsistencyRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CheckDataConsistencyOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CheckDataConsistencyOutcome(CheckDataConsistencyResult(outcome.result())); + else + return CheckDataConsistencyOutcome(outcome.error()); +} + +void ARMSClient::checkDataConsistencyAsync(const CheckDataConsistencyRequest& request, const CheckDataConsistencyAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, checkDataConsistency(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ARMSClient::CheckDataConsistencyOutcomeCallable ARMSClient::checkDataConsistencyCallable(const CheckDataConsistencyRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->checkDataConsistency(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ARMSClient::CreateAlertContactOutcome ARMSClient::createAlertContact(const CreateAlertContactRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -375,6 +411,42 @@ ARMSClient::DeleteRetcodeAppOutcomeCallable ARMSClient::deleteRetcodeAppCallable return task->get_future(); } +ARMSClient::GetConsistencySnapshotOutcome ARMSClient::getConsistencySnapshot(const GetConsistencySnapshotRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetConsistencySnapshotOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetConsistencySnapshotOutcome(GetConsistencySnapshotResult(outcome.result())); + else + return GetConsistencySnapshotOutcome(outcome.error()); +} + +void ARMSClient::getConsistencySnapshotAsync(const GetConsistencySnapshotRequest& request, const GetConsistencySnapshotAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getConsistencySnapshot(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ARMSClient::GetConsistencySnapshotOutcomeCallable ARMSClient::getConsistencySnapshotCallable(const GetConsistencySnapshotRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getConsistencySnapshot(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ARMSClient::GetPrometheusApiTokenOutcome ARMSClient::getPrometheusApiToken(const GetPrometheusApiTokenRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -591,6 +663,42 @@ ARMSClient::ListClusterFromGrafanaOutcomeCallable ARMSClient::listClusterFromGra return task->get_future(); } +ARMSClient::ListDashboardsOutcome ARMSClient::listDashboards(const ListDashboardsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListDashboardsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListDashboardsOutcome(ListDashboardsResult(outcome.result())); + else + return ListDashboardsOutcome(outcome.error()); +} + +void ARMSClient::listDashboardsAsync(const ListDashboardsRequest& request, const ListDashboardsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listDashboards(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +ARMSClient::ListDashboardsOutcomeCallable ARMSClient::listDashboardsCallable(const ListDashboardsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listDashboards(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + ARMSClient::ListPromClustersOutcome ARMSClient::listPromClusters(const ListPromClustersRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/arms/src/model/CheckDataConsistencyRequest.cc b/arms/src/model/CheckDataConsistencyRequest.cc new file mode 100644 index 000000000..b253029ad --- /dev/null +++ b/arms/src/model/CheckDataConsistencyRequest.cc @@ -0,0 +1,84 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::ARMS::Model::CheckDataConsistencyRequest; + +CheckDataConsistencyRequest::CheckDataConsistencyRequest() : + RpcServiceRequest("arms", "2019-08-08", "CheckDataConsistency") +{ + setMethod(HttpRequest::Method::Post); +} + +CheckDataConsistencyRequest::~CheckDataConsistencyRequest() +{} + +long CheckDataConsistencyRequest::getCurrentTimestamp()const +{ + return currentTimestamp_; +} + +void CheckDataConsistencyRequest::setCurrentTimestamp(long currentTimestamp) +{ + currentTimestamp_ = currentTimestamp; + setParameter("CurrentTimestamp", std::to_string(currentTimestamp)); +} + +std::string CheckDataConsistencyRequest::getRegionId()const +{ + return regionId_; +} + +void CheckDataConsistencyRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string CheckDataConsistencyRequest::getAppType()const +{ + return appType_; +} + +void CheckDataConsistencyRequest::setAppType(const std::string& appType) +{ + appType_ = appType; + setParameter("AppType", appType); +} + +std::string CheckDataConsistencyRequest::getPid()const +{ + return pid_; +} + +void CheckDataConsistencyRequest::setPid(const std::string& pid) +{ + pid_ = pid; + setParameter("Pid", pid); +} + +std::string CheckDataConsistencyRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void CheckDataConsistencyRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + diff --git a/arms/src/model/CheckDataConsistencyResult.cc b/arms/src/model/CheckDataConsistencyResult.cc new file mode 100644 index 000000000..7762197fc --- /dev/null +++ b/arms/src/model/CheckDataConsistencyResult.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::ARMS; +using namespace AlibabaCloud::ARMS::Model; + +CheckDataConsistencyResult::CheckDataConsistencyResult() : + ServiceResult() +{} + +CheckDataConsistencyResult::CheckDataConsistencyResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CheckDataConsistencyResult::~CheckDataConsistencyResult() +{} + +void CheckDataConsistencyResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["IsDataConsistency"].isNull()) + isDataConsistency_ = value["IsDataConsistency"].asString() == "true"; + +} + +bool CheckDataConsistencyResult::getIsDataConsistency()const +{ + return isDataConsistency_; +} + diff --git a/arms/src/model/GetConsistencySnapshotRequest.cc b/arms/src/model/GetConsistencySnapshotRequest.cc new file mode 100644 index 000000000..52dfefad4 --- /dev/null +++ b/arms/src/model/GetConsistencySnapshotRequest.cc @@ -0,0 +1,84 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::ARMS::Model::GetConsistencySnapshotRequest; + +GetConsistencySnapshotRequest::GetConsistencySnapshotRequest() : + RpcServiceRequest("arms", "2019-08-08", "GetConsistencySnapshot") +{ + setMethod(HttpRequest::Method::Post); +} + +GetConsistencySnapshotRequest::~GetConsistencySnapshotRequest() +{} + +long GetConsistencySnapshotRequest::getCurrentTimestamp()const +{ + return currentTimestamp_; +} + +void GetConsistencySnapshotRequest::setCurrentTimestamp(long currentTimestamp) +{ + currentTimestamp_ = currentTimestamp; + setParameter("CurrentTimestamp", std::to_string(currentTimestamp)); +} + +std::string GetConsistencySnapshotRequest::getRegionId()const +{ + return regionId_; +} + +void GetConsistencySnapshotRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string GetConsistencySnapshotRequest::getAppType()const +{ + return appType_; +} + +void GetConsistencySnapshotRequest::setAppType(const std::string& appType) +{ + appType_ = appType; + setParameter("AppType", appType); +} + +std::string GetConsistencySnapshotRequest::getPid()const +{ + return pid_; +} + +void GetConsistencySnapshotRequest::setPid(const std::string& pid) +{ + pid_ = pid; + setParameter("Pid", pid); +} + +std::string GetConsistencySnapshotRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void GetConsistencySnapshotRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + diff --git a/arms/src/model/GetConsistencySnapshotResult.cc b/arms/src/model/GetConsistencySnapshotResult.cc new file mode 100644 index 000000000..a906b0eb8 --- /dev/null +++ b/arms/src/model/GetConsistencySnapshotResult.cc @@ -0,0 +1,110 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::ARMS; +using namespace AlibabaCloud::ARMS::Model; + +GetConsistencySnapshotResult::GetConsistencySnapshotResult() : + ServiceResult() +{} + +GetConsistencySnapshotResult::GetConsistencySnapshotResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetConsistencySnapshotResult::~GetConsistencySnapshotResult() +{} + +void GetConsistencySnapshotResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto consistencyResultNode = value["ConsistencyResult"]; + if(!consistencyResultNode["JudgeTimestamp"].isNull()) + consistencyResult_.judgeTimestamp = std::stol(consistencyResultNode["JudgeTimestamp"].asString()); + if(!consistencyResultNode["LastSlsShardWatermarkTimestamp"].isNull()) + consistencyResult_.lastSlsShardWatermarkTimestamp = std::stol(consistencyResultNode["LastSlsShardWatermarkTimestamp"].asString()); + if(!consistencyResultNode["LastAgentInfoTimestamp"].isNull()) + consistencyResult_.lastAgentInfoTimestamp = std::stol(consistencyResultNode["LastAgentInfoTimestamp"].asString()); + if(!consistencyResultNode["BarrierPointsLastTimestampMap"].isNull()) + consistencyResult_.barrierPointsLastTimestampMap = consistencyResultNode["BarrierPointsLastTimestampMap"].asString(); + if(!consistencyResultNode["LastBarrierTimestamp"].isNull()) + consistencyResult_.lastBarrierTimestamp = std::stol(consistencyResultNode["LastBarrierTimestamp"].asString()); + auto allAgentHeartbeatInfosNode = consistencyResultNode["AgentHeartbeatInfos"]["AgentHeartbeatInfo"]; + for (auto consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo : allAgentHeartbeatInfosNode) + { + ConsistencyResult::AgentHeartbeatInfo agentHeartbeatInfoObject; + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["RegionId"].isNull()) + agentHeartbeatInfoObject.regionId = consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["RegionId"].asString(); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["AppType"].isNull()) + agentHeartbeatInfoObject.appType = consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["AppType"].asString(); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["Pid"].isNull()) + agentHeartbeatInfoObject.pid = consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["Pid"].asString(); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["Ip"].isNull()) + agentHeartbeatInfoObject.ip = consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["Ip"].asString(); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["StartTimestamp"].isNull()) + agentHeartbeatInfoObject.startTimestamp = std::stol(consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["StartTimestamp"].asString()); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["Hostname"].isNull()) + agentHeartbeatInfoObject.hostname = consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["Hostname"].asString(); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["ProcId"].isNull()) + agentHeartbeatInfoObject.procId = consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["ProcId"].asString(); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["AgentVersion"].isNull()) + agentHeartbeatInfoObject.agentVersion = consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["AgentVersion"].asString(); + if(!consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["LastHeartbeatTime"].isNull()) + agentHeartbeatInfoObject.lastHeartbeatTime = std::stol(consistencyResultNodeAgentHeartbeatInfosAgentHeartbeatInfo["LastHeartbeatTime"].asString()); + consistencyResult_.agentHeartbeatInfos.push_back(agentHeartbeatInfoObject); + } + auto slsShardWatermarkBeanNode = consistencyResultNode["SlsShardWatermarkBean"]; + if(!slsShardWatermarkBeanNode["Pid"].isNull()) + consistencyResult_.slsShardWatermarkBean.pid = slsShardWatermarkBeanNode["Pid"].asString(); + if(!slsShardWatermarkBeanNode["UserId"].isNull()) + consistencyResult_.slsShardWatermarkBean.userId = slsShardWatermarkBeanNode["UserId"].asString(); + if(!slsShardWatermarkBeanNode["RegionId"].isNull()) + consistencyResult_.slsShardWatermarkBean.regionId = slsShardWatermarkBeanNode["RegionId"].asString(); + if(!slsShardWatermarkBeanNode["AppType"].isNull()) + consistencyResult_.slsShardWatermarkBean.appType = slsShardWatermarkBeanNode["AppType"].asString(); + auto allCheckPointResponsesNode = slsShardWatermarkBeanNode["CheckPointResponses"]["CheckPointResponse"]; + for (auto slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse : allCheckPointResponsesNode) + { + ConsistencyResult::SlsShardWatermarkBean::CheckPointResponse checkPointResponseObject; + if(!slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["Shard"].isNull()) + checkPointResponseObject.shard = std::stoi(slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["Shard"].asString()); + if(!slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["CheckPoint"].isNull()) + checkPointResponseObject.checkPoint = slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["CheckPoint"].asString(); + if(!slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["UpdateTime"].isNull()) + checkPointResponseObject.updateTime = std::stol(slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["UpdateTime"].asString()); + if(!slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["Consumer"].isNull()) + checkPointResponseObject.consumer = slsShardWatermarkBeanNodeCheckPointResponsesCheckPointResponse["Consumer"].asString(); + consistencyResult_.slsShardWatermarkBean.checkPointResponses.push_back(checkPointResponseObject); + } + auto allCursorUpdateTimes = slsShardWatermarkBeanNode["CursorUpdateTimes"]["CursorUpdateTime"]; + for (auto value : allCursorUpdateTimes) + consistencyResult_.slsShardWatermarkBean.cursorUpdateTimes.push_back(value.asString()); + +} + +GetConsistencySnapshotResult::ConsistencyResult GetConsistencySnapshotResult::getConsistencyResult()const +{ + return consistencyResult_; +} + diff --git a/arms/src/model/ListDashboardsRequest.cc b/arms/src/model/ListDashboardsRequest.cc new file mode 100644 index 000000000..a7c5bbe43 --- /dev/null +++ b/arms/src/model/ListDashboardsRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::ARMS::Model::ListDashboardsRequest; + +ListDashboardsRequest::ListDashboardsRequest() : + RpcServiceRequest("arms", "2019-08-08", "ListDashboards") +{ + setMethod(HttpRequest::Method::Post); +} + +ListDashboardsRequest::~ListDashboardsRequest() +{} + +std::string ListDashboardsRequest::getRegionId()const +{ + return regionId_; +} + +void ListDashboardsRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string ListDashboardsRequest::getClusterId()const +{ + return clusterId_; +} + +void ListDashboardsRequest::setClusterId(const std::string& clusterId) +{ + clusterId_ = clusterId; + setParameter("ClusterId", clusterId); +} + diff --git a/arms/src/model/ListDashboardsResult.cc b/arms/src/model/ListDashboardsResult.cc new file mode 100644 index 000000000..bcce000a9 --- /dev/null +++ b/arms/src/model/ListDashboardsResult.cc @@ -0,0 +1,74 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::ARMS; +using namespace AlibabaCloud::ARMS::Model; + +ListDashboardsResult::ListDashboardsResult() : + ServiceResult() +{} + +ListDashboardsResult::ListDashboardsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListDashboardsResult::~ListDashboardsResult() +{} + +void ListDashboardsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allDashboardVosNode = value["DashboardVos"]["DashboardVosItem"]; + for (auto valueDashboardVosDashboardVosItem : allDashboardVosNode) + { + DashboardVosItem dashboardVosObject; + if(!valueDashboardVosDashboardVosItem["Id"].isNull()) + dashboardVosObject.id = valueDashboardVosDashboardVosItem["Id"].asString(); + if(!valueDashboardVosDashboardVosItem["Uid"].isNull()) + dashboardVosObject.uid = valueDashboardVosDashboardVosItem["Uid"].asString(); + if(!valueDashboardVosDashboardVosItem["Title"].isNull()) + dashboardVosObject.title = valueDashboardVosDashboardVosItem["Title"].asString(); + if(!valueDashboardVosDashboardVosItem["Time"].isNull()) + dashboardVosObject.time = valueDashboardVosDashboardVosItem["Time"].asString(); + if(!valueDashboardVosDashboardVosItem["Url"].isNull()) + dashboardVosObject.url = valueDashboardVosDashboardVosItem["Url"].asString(); + if(!valueDashboardVosDashboardVosItem["Type"].isNull()) + dashboardVosObject.type = valueDashboardVosDashboardVosItem["Type"].asString(); + if(!valueDashboardVosDashboardVosItem["Exporter"].isNull()) + dashboardVosObject.exporter = valueDashboardVosDashboardVosItem["Exporter"].asString(); + if(!valueDashboardVosDashboardVosItem["IsArmsExporter"].isNull()) + dashboardVosObject.isArmsExporter = valueDashboardVosDashboardVosItem["IsArmsExporter"].asString() == "true"; + auto allTags = value["Tags"]["Tags"]; + for (auto value : allTags) + dashboardVosObject.tags.push_back(value.asString()); + dashboardVos_.push_back(dashboardVosObject); + } + +} + +std::vector ListDashboardsResult::getDashboardVos()const +{ + return dashboardVos_; +} + diff --git a/arms/src/model/QueryMetricRequest.cc b/arms/src/model/QueryMetricRequest.cc index 024e9fc12..1103d6c84 100644 --- a/arms/src/model/QueryMetricRequest.cc +++ b/arms/src/model/QueryMetricRequest.cc @@ -27,6 +27,17 @@ QueryMetricRequest::QueryMetricRequest() : QueryMetricRequest::~QueryMetricRequest() {} +std::string QueryMetricRequest::getConsistencyQueryStrategy()const +{ + return consistencyQueryStrategy_; +} + +void QueryMetricRequest::setConsistencyQueryStrategy(const std::string& consistencyQueryStrategy) +{ + consistencyQueryStrategy_ = consistencyQueryStrategy; + setParameter("ConsistencyQueryStrategy", consistencyQueryStrategy); +} + long QueryMetricRequest::getEndTime()const { return endTime_; @@ -76,6 +87,17 @@ void QueryMetricRequest::setFilters(const std::vector& filters) } } +std::string QueryMetricRequest::getConsistencyDataKey()const +{ + return consistencyDataKey_; +} + +void QueryMetricRequest::setConsistencyDataKey(const std::string& consistencyDataKey) +{ + consistencyDataKey_ = consistencyDataKey; + setParameter("ConsistencyDataKey", consistencyDataKey); +} + std::string QueryMetricRequest::getProxyUserId()const { return proxyUserId_;