diff --git a/CHANGELOG b/CHANGELOG index 7589c4db0..7289f6185 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-10-27 Version: patch +- Support Sampling for jaeger. + 2020-10-27 Version: patch - Fix bug. diff --git a/xtrace/CMakeLists.txt b/xtrace/CMakeLists.txt index dfebc1a73..e9ca39d01 100644 --- a/xtrace/CMakeLists.txt +++ b/xtrace/CMakeLists.txt @@ -21,6 +21,10 @@ set(xtrace_public_header include/alibabacloud/xtrace/XtraceExport.h ) set(xtrace_public_header_model + include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingRequest.h + include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingResult.h + include/alibabacloud/xtrace/model/GetSamplingRequest.h + include/alibabacloud/xtrace/model/GetSamplingResult.h include/alibabacloud/xtrace/model/GetTagKeyRequest.h include/alibabacloud/xtrace/model/GetTagKeyResult.h include/alibabacloud/xtrace/model/GetTagValRequest.h @@ -29,6 +33,8 @@ set(xtrace_public_header_model include/alibabacloud/xtrace/model/GetTokenResult.h include/alibabacloud/xtrace/model/GetTraceRequest.h include/alibabacloud/xtrace/model/GetTraceResult.h + include/alibabacloud/xtrace/model/GetTraceAnalysisRequest.h + include/alibabacloud/xtrace/model/GetTraceAnalysisResult.h include/alibabacloud/xtrace/model/ListIpOrHostsRequest.h include/alibabacloud/xtrace/model/ListIpOrHostsResult.h include/alibabacloud/xtrace/model/ListServicesRequest.h @@ -38,10 +44,16 @@ set(xtrace_public_header_model include/alibabacloud/xtrace/model/QueryMetricRequest.h include/alibabacloud/xtrace/model/QueryMetricResult.h include/alibabacloud/xtrace/model/SearchTracesRequest.h - include/alibabacloud/xtrace/model/SearchTracesResult.h ) + include/alibabacloud/xtrace/model/SearchTracesResult.h + include/alibabacloud/xtrace/model/UpdateSamplingRequest.h + include/alibabacloud/xtrace/model/UpdateSamplingResult.h ) set(xtrace_src src/XtraceClient.cc + src/model/CheckServiceLinkedRoleForDeletingRequest.cc + src/model/CheckServiceLinkedRoleForDeletingResult.cc + src/model/GetSamplingRequest.cc + src/model/GetSamplingResult.cc src/model/GetTagKeyRequest.cc src/model/GetTagKeyResult.cc src/model/GetTagValRequest.cc @@ -50,6 +62,8 @@ set(xtrace_src src/model/GetTokenResult.cc src/model/GetTraceRequest.cc src/model/GetTraceResult.cc + src/model/GetTraceAnalysisRequest.cc + src/model/GetTraceAnalysisResult.cc src/model/ListIpOrHostsRequest.cc src/model/ListIpOrHostsResult.cc src/model/ListServicesRequest.cc @@ -59,7 +73,9 @@ set(xtrace_src src/model/QueryMetricRequest.cc src/model/QueryMetricResult.cc src/model/SearchTracesRequest.cc - src/model/SearchTracesResult.cc ) + src/model/SearchTracesResult.cc + src/model/UpdateSamplingRequest.cc + src/model/UpdateSamplingResult.cc ) add_library(xtrace ${LIB_TYPE} ${xtrace_public_header} diff --git a/xtrace/include/alibabacloud/xtrace/XtraceClient.h b/xtrace/include/alibabacloud/xtrace/XtraceClient.h index 9f030d5fb..bba441baa 100644 --- a/xtrace/include/alibabacloud/xtrace/XtraceClient.h +++ b/xtrace/include/alibabacloud/xtrace/XtraceClient.h @@ -22,6 +22,10 @@ #include #include #include "XtraceExport.h" +#include "model/CheckServiceLinkedRoleForDeletingRequest.h" +#include "model/CheckServiceLinkedRoleForDeletingResult.h" +#include "model/GetSamplingRequest.h" +#include "model/GetSamplingResult.h" #include "model/GetTagKeyRequest.h" #include "model/GetTagKeyResult.h" #include "model/GetTagValRequest.h" @@ -30,6 +34,8 @@ #include "model/GetTokenResult.h" #include "model/GetTraceRequest.h" #include "model/GetTraceResult.h" +#include "model/GetTraceAnalysisRequest.h" +#include "model/GetTraceAnalysisResult.h" #include "model/ListIpOrHostsRequest.h" #include "model/ListIpOrHostsResult.h" #include "model/ListServicesRequest.h" @@ -40,6 +46,8 @@ #include "model/QueryMetricResult.h" #include "model/SearchTracesRequest.h" #include "model/SearchTracesResult.h" +#include "model/UpdateSamplingRequest.h" +#include "model/UpdateSamplingResult.h" namespace AlibabaCloud @@ -49,6 +57,12 @@ namespace AlibabaCloud class ALIBABACLOUD_XTRACE_EXPORT XtraceClient : public RpcServiceClient { public: + typedef Outcome CheckServiceLinkedRoleForDeletingOutcome; + typedef std::future CheckServiceLinkedRoleForDeletingOutcomeCallable; + typedef std::function&)> CheckServiceLinkedRoleForDeletingAsyncHandler; + typedef Outcome GetSamplingOutcome; + typedef std::future GetSamplingOutcomeCallable; + typedef std::function&)> GetSamplingAsyncHandler; typedef Outcome GetTagKeyOutcome; typedef std::future GetTagKeyOutcomeCallable; typedef std::function&)> GetTagKeyAsyncHandler; @@ -61,6 +75,9 @@ namespace AlibabaCloud typedef Outcome GetTraceOutcome; typedef std::future GetTraceOutcomeCallable; typedef std::function&)> GetTraceAsyncHandler; + typedef Outcome GetTraceAnalysisOutcome; + typedef std::future GetTraceAnalysisOutcomeCallable; + typedef std::function&)> GetTraceAnalysisAsyncHandler; typedef Outcome ListIpOrHostsOutcome; typedef std::future ListIpOrHostsOutcomeCallable; typedef std::function&)> ListIpOrHostsAsyncHandler; @@ -76,11 +93,20 @@ namespace AlibabaCloud typedef Outcome SearchTracesOutcome; typedef std::future SearchTracesOutcomeCallable; typedef std::function&)> SearchTracesAsyncHandler; + typedef Outcome UpdateSamplingOutcome; + typedef std::future UpdateSamplingOutcomeCallable; + typedef std::function&)> UpdateSamplingAsyncHandler; XtraceClient(const Credentials &credentials, const ClientConfiguration &configuration); XtraceClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); XtraceClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); ~XtraceClient(); + CheckServiceLinkedRoleForDeletingOutcome checkServiceLinkedRoleForDeleting(const Model::CheckServiceLinkedRoleForDeletingRequest &request)const; + void checkServiceLinkedRoleForDeletingAsync(const Model::CheckServiceLinkedRoleForDeletingRequest& request, const CheckServiceLinkedRoleForDeletingAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CheckServiceLinkedRoleForDeletingOutcomeCallable checkServiceLinkedRoleForDeletingCallable(const Model::CheckServiceLinkedRoleForDeletingRequest& request) const; + GetSamplingOutcome getSampling(const Model::GetSamplingRequest &request)const; + void getSamplingAsync(const Model::GetSamplingRequest& request, const GetSamplingAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetSamplingOutcomeCallable getSamplingCallable(const Model::GetSamplingRequest& request) const; GetTagKeyOutcome getTagKey(const Model::GetTagKeyRequest &request)const; void getTagKeyAsync(const Model::GetTagKeyRequest& request, const GetTagKeyAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetTagKeyOutcomeCallable getTagKeyCallable(const Model::GetTagKeyRequest& request) const; @@ -93,6 +119,9 @@ namespace AlibabaCloud GetTraceOutcome getTrace(const Model::GetTraceRequest &request)const; void getTraceAsync(const Model::GetTraceRequest& request, const GetTraceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetTraceOutcomeCallable getTraceCallable(const Model::GetTraceRequest& request) const; + GetTraceAnalysisOutcome getTraceAnalysis(const Model::GetTraceAnalysisRequest &request)const; + void getTraceAnalysisAsync(const Model::GetTraceAnalysisRequest& request, const GetTraceAnalysisAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetTraceAnalysisOutcomeCallable getTraceAnalysisCallable(const Model::GetTraceAnalysisRequest& request) const; ListIpOrHostsOutcome listIpOrHosts(const Model::ListIpOrHostsRequest &request)const; void listIpOrHostsAsync(const Model::ListIpOrHostsRequest& request, const ListIpOrHostsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListIpOrHostsOutcomeCallable listIpOrHostsCallable(const Model::ListIpOrHostsRequest& request) const; @@ -108,6 +137,9 @@ namespace AlibabaCloud SearchTracesOutcome searchTraces(const Model::SearchTracesRequest &request)const; void searchTracesAsync(const Model::SearchTracesRequest& request, const SearchTracesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; SearchTracesOutcomeCallable searchTracesCallable(const Model::SearchTracesRequest& request) const; + UpdateSamplingOutcome updateSampling(const Model::UpdateSamplingRequest &request)const; + void updateSamplingAsync(const Model::UpdateSamplingRequest& request, const UpdateSamplingAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateSamplingOutcomeCallable updateSamplingCallable(const Model::UpdateSamplingRequest& request) const; private: std::shared_ptr endpointProvider_; diff --git a/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingRequest.h b/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingRequest.h new file mode 100644 index 000000000..5f3ae7b52 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingRequest.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_XTRACE_MODEL_CHECKSERVICELINKEDROLEFORDELETINGREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_CHECKSERVICELINKEDROLEFORDELETINGREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT CheckServiceLinkedRoleForDeletingRequest : public RpcServiceRequest + { + + public: + CheckServiceLinkedRoleForDeletingRequest(); + ~CheckServiceLinkedRoleForDeletingRequest(); + + std::string getSPIRegionId()const; + void setSPIRegionId(const std::string& sPIRegionId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getRoleArn()const; + void setRoleArn(const std::string& roleArn); + std::string getDeletionTaskId()const; + void setDeletionTaskId(const std::string& deletionTaskId); + std::string getServiceName()const; + void setServiceName(const std::string& serviceName); + + private: + std::string sPIRegionId_; + std::string regionId_; + std::string roleArn_; + std::string deletionTaskId_; + std::string serviceName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_CHECKSERVICELINKEDROLEFORDELETINGREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingResult.h b/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingResult.h new file mode 100644 index 000000000..ec29d9048 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingResult.h @@ -0,0 +1,58 @@ +/* + * 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_XTRACE_MODEL_CHECKSERVICELINKEDROLEFORDELETINGRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_CHECKSERVICELINKEDROLEFORDELETINGRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT CheckServiceLinkedRoleForDeletingResult : public ServiceResult + { + public: + struct RoleUsagesItem + { + std::string region; + std::vector resources; + }; + + + CheckServiceLinkedRoleForDeletingResult(); + explicit CheckServiceLinkedRoleForDeletingResult(const std::string &payload); + ~CheckServiceLinkedRoleForDeletingResult(); + bool getDeletable()const; + std::vector getRoleUsages()const; + + protected: + void parse(const std::string &payload); + private: + bool deletable_; + std::vector roleUsages_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_CHECKSERVICELINKEDROLEFORDELETINGRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetSamplingRequest.h b/xtrace/include/alibabacloud/xtrace/model/GetSamplingRequest.h new file mode 100644 index 000000000..9b66901da --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetSamplingRequest.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_XTRACE_MODEL_GETSAMPLINGREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETSAMPLINGREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetSamplingRequest : public RpcServiceRequest + { + + public: + GetSamplingRequest(); + ~GetSamplingRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); + + private: + std::string regionId_; + std::string proxyUserId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETSAMPLINGREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetSamplingResult.h b/xtrace/include/alibabacloud/xtrace/model/GetSamplingResult.h new file mode 100644 index 000000000..0e96a6262 --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetSamplingResult.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_XTRACE_MODEL_GETSAMPLINGRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETSAMPLINGRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetSamplingResult : public ServiceResult + { + public: + + + GetSamplingResult(); + explicit GetSamplingResult(const std::string &payload); + ~GetSamplingResult(); + std::string getData()const; + + protected: + void parse(const std::string &payload); + private: + std::string data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETSAMPLINGRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h b/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h index 8c15182e4..0526e2fb2 100644 --- a/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h +++ b/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h @@ -39,10 +39,13 @@ namespace AlibabaCloud void setRegionId(const std::string& regionId); std::string getAppType()const; void setAppType(const std::string& appType); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); private: std::string regionId_; std::string appType_; + std::string proxyUserId_; }; } diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTraceAnalysisRequest.h b/xtrace/include/alibabacloud/xtrace/model/GetTraceAnalysisRequest.h new file mode 100644 index 000000000..f2417ef6f --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTraceAnalysisRequest.h @@ -0,0 +1,57 @@ +/* + * 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_XTRACE_MODEL_GETTRACEANALYSISREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTRACEANALYSISREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTraceAnalysisRequest : public RpcServiceRequest + { + + public: + GetTraceAnalysisRequest(); + ~GetTraceAnalysisRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getQuery()const; + void setQuery(const std::string& query); + std::string getApi()const; + void setApi(const std::string& api); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); + + private: + std::string regionId_; + std::string query_; + std::string api_; + std::string proxyUserId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTRACEANALYSISREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTraceAnalysisResult.h b/xtrace/include/alibabacloud/xtrace/model/GetTraceAnalysisResult.h new file mode 100644 index 000000000..bedfaae1f --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/GetTraceAnalysisResult.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_XTRACE_MODEL_GETTRACEANALYSISRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_GETTRACEANALYSISRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT GetTraceAnalysisResult : public ServiceResult + { + public: + + + GetTraceAnalysisResult(); + explicit GetTraceAnalysisResult(const std::string &payload); + ~GetTraceAnalysisResult(); + std::string getData()const; + + protected: + void parse(const std::string &payload); + private: + std::string data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_GETTRACEANALYSISRESULT_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/QueryMetricRequest.h b/xtrace/include/alibabacloud/xtrace/model/QueryMetricRequest.h index 78af647bd..65ef80dd6 100644 --- a/xtrace/include/alibabacloud/xtrace/model/QueryMetricRequest.h +++ b/xtrace/include/alibabacloud/xtrace/model/QueryMetricRequest.h @@ -49,6 +49,8 @@ namespace AlibabaCloud void setStartTime(long startTime); std::vector getFilters()const; void setFilters(const std::vector& filters); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); std::vector getMeasures()const; void setMeasures(const std::vector& measures); int getIntervalInSec()const; @@ -67,6 +69,7 @@ namespace AlibabaCloud std::string orderBy_; long startTime_; std::vector filters_; + std::string proxyUserId_; std::vector measures_; int intervalInSec_; std::string metric_; diff --git a/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingRequest.h b/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingRequest.h new file mode 100644 index 000000000..a4c8bce0e --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingRequest.h @@ -0,0 +1,54 @@ +/* + * 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_XTRACE_MODEL_UPDATESAMPLINGREQUEST_H_ +#define ALIBABACLOUD_XTRACE_MODEL_UPDATESAMPLINGREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT UpdateSamplingRequest : public RpcServiceRequest + { + + public: + UpdateSamplingRequest(); + ~UpdateSamplingRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getSampling()const; + void setSampling(const std::string& sampling); + std::string getProxyUserId()const; + void setProxyUserId(const std::string& proxyUserId); + + private: + std::string regionId_; + std::string sampling_; + std::string proxyUserId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_UPDATESAMPLINGREQUEST_H_ \ No newline at end of file diff --git a/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingResult.h b/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingResult.h new file mode 100644 index 000000000..119b3376a --- /dev/null +++ b/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingResult.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_XTRACE_MODEL_UPDATESAMPLINGRESULT_H_ +#define ALIBABACLOUD_XTRACE_MODEL_UPDATESAMPLINGRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Xtrace + { + namespace Model + { + class ALIBABACLOUD_XTRACE_EXPORT UpdateSamplingResult : public ServiceResult + { + public: + + + UpdateSamplingResult(); + explicit UpdateSamplingResult(const std::string &payload); + ~UpdateSamplingResult(); + std::string getData()const; + + protected: + void parse(const std::string &payload); + private: + std::string data_; + + }; + } + } +} +#endif // !ALIBABACLOUD_XTRACE_MODEL_UPDATESAMPLINGRESULT_H_ \ No newline at end of file diff --git a/xtrace/src/XtraceClient.cc b/xtrace/src/XtraceClient.cc index e82569a59..661a45e21 100644 --- a/xtrace/src/XtraceClient.cc +++ b/xtrace/src/XtraceClient.cc @@ -31,26 +31,98 @@ XtraceClient::XtraceClient(const Credentials &credentials, const ClientConfigura RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "xtrace"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } XtraceClient::XtraceClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "xtrace"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } XtraceClient::XtraceClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "xtrace"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } XtraceClient::~XtraceClient() {} +XtraceClient::CheckServiceLinkedRoleForDeletingOutcome XtraceClient::checkServiceLinkedRoleForDeleting(const CheckServiceLinkedRoleForDeletingRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CheckServiceLinkedRoleForDeletingOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CheckServiceLinkedRoleForDeletingOutcome(CheckServiceLinkedRoleForDeletingResult(outcome.result())); + else + return CheckServiceLinkedRoleForDeletingOutcome(outcome.error()); +} + +void XtraceClient::checkServiceLinkedRoleForDeletingAsync(const CheckServiceLinkedRoleForDeletingRequest& request, const CheckServiceLinkedRoleForDeletingAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, checkServiceLinkedRoleForDeleting(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +XtraceClient::CheckServiceLinkedRoleForDeletingOutcomeCallable XtraceClient::checkServiceLinkedRoleForDeletingCallable(const CheckServiceLinkedRoleForDeletingRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->checkServiceLinkedRoleForDeleting(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +XtraceClient::GetSamplingOutcome XtraceClient::getSampling(const GetSamplingRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetSamplingOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetSamplingOutcome(GetSamplingResult(outcome.result())); + else + return GetSamplingOutcome(outcome.error()); +} + +void XtraceClient::getSamplingAsync(const GetSamplingRequest& request, const GetSamplingAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getSampling(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +XtraceClient::GetSamplingOutcomeCallable XtraceClient::getSamplingCallable(const GetSamplingRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getSampling(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + XtraceClient::GetTagKeyOutcome XtraceClient::getTagKey(const GetTagKeyRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -195,6 +267,42 @@ XtraceClient::GetTraceOutcomeCallable XtraceClient::getTraceCallable(const GetTr return task->get_future(); } +XtraceClient::GetTraceAnalysisOutcome XtraceClient::getTraceAnalysis(const GetTraceAnalysisRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetTraceAnalysisOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetTraceAnalysisOutcome(GetTraceAnalysisResult(outcome.result())); + else + return GetTraceAnalysisOutcome(outcome.error()); +} + +void XtraceClient::getTraceAnalysisAsync(const GetTraceAnalysisRequest& request, const GetTraceAnalysisAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getTraceAnalysis(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +XtraceClient::GetTraceAnalysisOutcomeCallable XtraceClient::getTraceAnalysisCallable(const GetTraceAnalysisRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getTraceAnalysis(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + XtraceClient::ListIpOrHostsOutcome XtraceClient::listIpOrHosts(const ListIpOrHostsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -375,3 +483,39 @@ XtraceClient::SearchTracesOutcomeCallable XtraceClient::searchTracesCallable(con return task->get_future(); } +XtraceClient::UpdateSamplingOutcome XtraceClient::updateSampling(const UpdateSamplingRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateSamplingOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateSamplingOutcome(UpdateSamplingResult(outcome.result())); + else + return UpdateSamplingOutcome(outcome.error()); +} + +void XtraceClient::updateSamplingAsync(const UpdateSamplingRequest& request, const UpdateSamplingAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateSampling(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +XtraceClient::UpdateSamplingOutcomeCallable XtraceClient::updateSamplingCallable(const UpdateSamplingRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateSampling(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/xtrace/src/model/CheckServiceLinkedRoleForDeletingRequest.cc b/xtrace/src/model/CheckServiceLinkedRoleForDeletingRequest.cc new file mode 100644 index 000000000..3e9b4940a --- /dev/null +++ b/xtrace/src/model/CheckServiceLinkedRoleForDeletingRequest.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::Xtrace::Model::CheckServiceLinkedRoleForDeletingRequest; + +CheckServiceLinkedRoleForDeletingRequest::CheckServiceLinkedRoleForDeletingRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "CheckServiceLinkedRoleForDeleting") +{ + setMethod(HttpRequest::Method::Post); +} + +CheckServiceLinkedRoleForDeletingRequest::~CheckServiceLinkedRoleForDeletingRequest() +{} + +std::string CheckServiceLinkedRoleForDeletingRequest::getSPIRegionId()const +{ + return sPIRegionId_; +} + +void CheckServiceLinkedRoleForDeletingRequest::setSPIRegionId(const std::string& sPIRegionId) +{ + sPIRegionId_ = sPIRegionId; + setParameter("SPIRegionId", sPIRegionId); +} + +std::string CheckServiceLinkedRoleForDeletingRequest::getRegionId()const +{ + return regionId_; +} + +void CheckServiceLinkedRoleForDeletingRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string CheckServiceLinkedRoleForDeletingRequest::getRoleArn()const +{ + return roleArn_; +} + +void CheckServiceLinkedRoleForDeletingRequest::setRoleArn(const std::string& roleArn) +{ + roleArn_ = roleArn; + setParameter("RoleArn", roleArn); +} + +std::string CheckServiceLinkedRoleForDeletingRequest::getDeletionTaskId()const +{ + return deletionTaskId_; +} + +void CheckServiceLinkedRoleForDeletingRequest::setDeletionTaskId(const std::string& deletionTaskId) +{ + deletionTaskId_ = deletionTaskId; + setParameter("DeletionTaskId", deletionTaskId); +} + +std::string CheckServiceLinkedRoleForDeletingRequest::getServiceName()const +{ + return serviceName_; +} + +void CheckServiceLinkedRoleForDeletingRequest::setServiceName(const std::string& serviceName) +{ + serviceName_ = serviceName; + setParameter("ServiceName", serviceName); +} + diff --git a/xtrace/src/model/CheckServiceLinkedRoleForDeletingResult.cc b/xtrace/src/model/CheckServiceLinkedRoleForDeletingResult.cc new file mode 100644 index 000000000..641c1063e --- /dev/null +++ b/xtrace/src/model/CheckServiceLinkedRoleForDeletingResult.cc @@ -0,0 +1,67 @@ +/* + * 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::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +CheckServiceLinkedRoleForDeletingResult::CheckServiceLinkedRoleForDeletingResult() : + ServiceResult() +{} + +CheckServiceLinkedRoleForDeletingResult::CheckServiceLinkedRoleForDeletingResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CheckServiceLinkedRoleForDeletingResult::~CheckServiceLinkedRoleForDeletingResult() +{} + +void CheckServiceLinkedRoleForDeletingResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allRoleUsagesNode = value["RoleUsages"]["RoleUsagesItem"]; + for (auto valueRoleUsagesRoleUsagesItem : allRoleUsagesNode) + { + RoleUsagesItem roleUsagesObject; + if(!valueRoleUsagesRoleUsagesItem["Region"].isNull()) + roleUsagesObject.region = valueRoleUsagesRoleUsagesItem["Region"].asString(); + auto allResources = value["Resources"]["Resources"]; + for (auto value : allResources) + roleUsagesObject.resources.push_back(value.asString()); + roleUsages_.push_back(roleUsagesObject); + } + if(!value["Deletable"].isNull()) + deletable_ = value["Deletable"].asString() == "true"; + +} + +bool CheckServiceLinkedRoleForDeletingResult::getDeletable()const +{ + return deletable_; +} + +std::vector CheckServiceLinkedRoleForDeletingResult::getRoleUsages()const +{ + return roleUsages_; +} + diff --git a/xtrace/src/model/GetSamplingRequest.cc b/xtrace/src/model/GetSamplingRequest.cc new file mode 100644 index 000000000..eb904c36b --- /dev/null +++ b/xtrace/src/model/GetSamplingRequest.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::Xtrace::Model::GetSamplingRequest; + +GetSamplingRequest::GetSamplingRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "GetSampling") +{ + setMethod(HttpRequest::Method::Post); +} + +GetSamplingRequest::~GetSamplingRequest() +{} + +std::string GetSamplingRequest::getRegionId()const +{ + return regionId_; +} + +void GetSamplingRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string GetSamplingRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void GetSamplingRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + diff --git a/xtrace/src/model/GetSamplingResult.cc b/xtrace/src/model/GetSamplingResult.cc new file mode 100644 index 000000000..e26bcd829 --- /dev/null +++ b/xtrace/src/model/GetSamplingResult.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::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +GetSamplingResult::GetSamplingResult() : + ServiceResult() +{} + +GetSamplingResult::GetSamplingResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetSamplingResult::~GetSamplingResult() +{} + +void GetSamplingResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Data"].isNull()) + data_ = value["Data"].asString(); + +} + +std::string GetSamplingResult::getData()const +{ + return data_; +} + diff --git a/xtrace/src/model/GetTokenRequest.cc b/xtrace/src/model/GetTokenRequest.cc index 89bb17d29..7dca97c8c 100644 --- a/xtrace/src/model/GetTokenRequest.cc +++ b/xtrace/src/model/GetTokenRequest.cc @@ -49,3 +49,14 @@ void GetTokenRequest::setAppType(const std::string& appType) setParameter("AppType", appType); } +std::string GetTokenRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void GetTokenRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + diff --git a/xtrace/src/model/GetTraceAnalysisRequest.cc b/xtrace/src/model/GetTraceAnalysisRequest.cc new file mode 100644 index 000000000..9ec6c79a0 --- /dev/null +++ b/xtrace/src/model/GetTraceAnalysisRequest.cc @@ -0,0 +1,73 @@ +/* + * 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::Xtrace::Model::GetTraceAnalysisRequest; + +GetTraceAnalysisRequest::GetTraceAnalysisRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "GetTraceAnalysis") +{ + setMethod(HttpRequest::Method::Post); +} + +GetTraceAnalysisRequest::~GetTraceAnalysisRequest() +{} + +std::string GetTraceAnalysisRequest::getRegionId()const +{ + return regionId_; +} + +void GetTraceAnalysisRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string GetTraceAnalysisRequest::getQuery()const +{ + return query_; +} + +void GetTraceAnalysisRequest::setQuery(const std::string& query) +{ + query_ = query; + setParameter("Query", query); +} + +std::string GetTraceAnalysisRequest::getApi()const +{ + return api_; +} + +void GetTraceAnalysisRequest::setApi(const std::string& api) +{ + api_ = api; + setParameter("Api", api); +} + +std::string GetTraceAnalysisRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void GetTraceAnalysisRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + diff --git a/xtrace/src/model/GetTraceAnalysisResult.cc b/xtrace/src/model/GetTraceAnalysisResult.cc new file mode 100644 index 000000000..3b4235424 --- /dev/null +++ b/xtrace/src/model/GetTraceAnalysisResult.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::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +GetTraceAnalysisResult::GetTraceAnalysisResult() : + ServiceResult() +{} + +GetTraceAnalysisResult::GetTraceAnalysisResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetTraceAnalysisResult::~GetTraceAnalysisResult() +{} + +void GetTraceAnalysisResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Data"].isNull()) + data_ = value["Data"].asString(); + +} + +std::string GetTraceAnalysisResult::getData()const +{ + return data_; +} + diff --git a/xtrace/src/model/QueryMetricRequest.cc b/xtrace/src/model/QueryMetricRequest.cc index c0fd4e0f5..cd4b3114c 100644 --- a/xtrace/src/model/QueryMetricRequest.cc +++ b/xtrace/src/model/QueryMetricRequest.cc @@ -76,6 +76,17 @@ void QueryMetricRequest::setFilters(const std::vector& filters) } } +std::string QueryMetricRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void QueryMetricRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + std::vector QueryMetricRequest::getMeasures()const { return measures_; diff --git a/xtrace/src/model/UpdateSamplingRequest.cc b/xtrace/src/model/UpdateSamplingRequest.cc new file mode 100644 index 000000000..967a8e0d9 --- /dev/null +++ b/xtrace/src/model/UpdateSamplingRequest.cc @@ -0,0 +1,62 @@ +/* + * 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::Xtrace::Model::UpdateSamplingRequest; + +UpdateSamplingRequest::UpdateSamplingRequest() : + RpcServiceRequest("xtrace", "2019-08-08", "UpdateSampling") +{ + setMethod(HttpRequest::Method::Post); +} + +UpdateSamplingRequest::~UpdateSamplingRequest() +{} + +std::string UpdateSamplingRequest::getRegionId()const +{ + return regionId_; +} + +void UpdateSamplingRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string UpdateSamplingRequest::getSampling()const +{ + return sampling_; +} + +void UpdateSamplingRequest::setSampling(const std::string& sampling) +{ + sampling_ = sampling; + setParameter("Sampling", sampling); +} + +std::string UpdateSamplingRequest::getProxyUserId()const +{ + return proxyUserId_; +} + +void UpdateSamplingRequest::setProxyUserId(const std::string& proxyUserId) +{ + proxyUserId_ = proxyUserId; + setParameter("ProxyUserId", proxyUserId); +} + diff --git a/xtrace/src/model/UpdateSamplingResult.cc b/xtrace/src/model/UpdateSamplingResult.cc new file mode 100644 index 000000000..1750f8da8 --- /dev/null +++ b/xtrace/src/model/UpdateSamplingResult.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::Xtrace; +using namespace AlibabaCloud::Xtrace::Model; + +UpdateSamplingResult::UpdateSamplingResult() : + ServiceResult() +{} + +UpdateSamplingResult::UpdateSamplingResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateSamplingResult::~UpdateSamplingResult() +{} + +void UpdateSamplingResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["Data"].isNull()) + data_ = value["Data"].asString(); + +} + +std::string UpdateSamplingResult::getData()const +{ + return data_; +} +