diff --git a/CHANGELOG b/CHANGELOG index a14d3364f..8c420fcb3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-01-11 Version: patch +- Add result value spanId for GetTrace api. + 2021-01-11 Version: patch - Support DescribeScheduleTasks. - Support CancelScheduleTasks. diff --git a/xtrace/CMakeLists.txt b/xtrace/CMakeLists.txt index e9ca39d01..75228d565 100644 --- a/xtrace/CMakeLists.txt +++ b/xtrace/CMakeLists.txt @@ -21,10 +21,6 @@ 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 @@ -44,16 +40,10 @@ 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/UpdateSamplingRequest.h - include/alibabacloud/xtrace/model/UpdateSamplingResult.h ) + include/alibabacloud/xtrace/model/SearchTracesResult.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 @@ -73,9 +63,7 @@ set(xtrace_src src/model/QueryMetricRequest.cc src/model/QueryMetricResult.cc src/model/SearchTracesRequest.cc - src/model/SearchTracesResult.cc - src/model/UpdateSamplingRequest.cc - src/model/UpdateSamplingResult.cc ) + src/model/SearchTracesResult.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 bba441baa..93d669194 100644 --- a/xtrace/include/alibabacloud/xtrace/XtraceClient.h +++ b/xtrace/include/alibabacloud/xtrace/XtraceClient.h @@ -22,10 +22,6 @@ #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" @@ -46,8 +42,6 @@ #include "model/QueryMetricResult.h" #include "model/SearchTracesRequest.h" #include "model/SearchTracesResult.h" -#include "model/UpdateSamplingRequest.h" -#include "model/UpdateSamplingResult.h" namespace AlibabaCloud @@ -57,12 +51,6 @@ 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; @@ -93,20 +81,11 @@ 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; @@ -137,9 +116,6 @@ 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 deleted file mode 100644 index 5f3ae7b52..000000000 --- a/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingRequest.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 deleted file mode 100644 index ec29d9048..000000000 --- a/xtrace/include/alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingResult.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 deleted file mode 100644 index 9b66901da..000000000 --- a/xtrace/include/alibabacloud/xtrace/model/GetSamplingRequest.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 deleted file mode 100644 index 0e96a6262..000000000 --- a/xtrace/include/alibabacloud/xtrace/model/GetSamplingResult.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 0526e2fb2..223de166f 100644 --- a/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h +++ b/xtrace/include/alibabacloud/xtrace/model/GetTokenRequest.h @@ -41,11 +41,14 @@ namespace AlibabaCloud void setAppType(const std::string& appType); std::string getProxyUserId()const; void setProxyUserId(const std::string& proxyUserId); + bool getIsForce()const; + void setIsForce(bool isForce); private: std::string regionId_; std::string appType_; std::string proxyUserId_; + bool isForce_; }; } diff --git a/xtrace/include/alibabacloud/xtrace/model/GetTraceResult.h b/xtrace/include/alibabacloud/xtrace/model/GetTraceResult.h index 8cdb24bc6..123b97fce 100644 --- a/xtrace/include/alibabacloud/xtrace/model/GetTraceResult.h +++ b/xtrace/include/alibabacloud/xtrace/model/GetTraceResult.h @@ -49,17 +49,19 @@ namespace AlibabaCloud std::vector tagEntryList1; long timestamp; }; - bool haveStack; + std::string parentSpanId; std::string serviceIp; - std::vector logEventList; std::string operationName; - std::string serviceName; - std::string rpcId; - std::string traceID; long duration; std::vector tagEntryList; long timestamp; + bool haveStack; + std::vector logEventList; + std::string serviceName; + std::string rpcId; + std::string traceID; std::string resultCode; + std::string spanId; }; diff --git a/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingRequest.h b/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingRequest.h deleted file mode 100644 index a4c8bce0e..000000000 --- a/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingRequest.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 deleted file mode 100644 index 119b3376a..000000000 --- a/xtrace/include/alibabacloud/xtrace/model/UpdateSamplingResult.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 661a45e21..108700a83 100644 --- a/xtrace/src/XtraceClient.cc +++ b/xtrace/src/XtraceClient.cc @@ -51,78 +51,6 @@ XtraceClient::XtraceClient(const std::string & accessKeyId, const std::string & 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(); @@ -483,39 +411,3 @@ 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 deleted file mode 100644 index 3e9b4940a..000000000 --- a/xtrace/src/model/CheckServiceLinkedRoleForDeletingRequest.cc +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 deleted file mode 100644 index 641c1063e..000000000 --- a/xtrace/src/model/CheckServiceLinkedRoleForDeletingResult.cc +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 deleted file mode 100644 index eb904c36b..000000000 --- a/xtrace/src/model/GetSamplingRequest.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 deleted file mode 100644 index e26bcd829..000000000 --- a/xtrace/src/model/GetSamplingResult.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 7dca97c8c..4d480d968 100644 --- a/xtrace/src/model/GetTokenRequest.cc +++ b/xtrace/src/model/GetTokenRequest.cc @@ -60,3 +60,14 @@ void GetTokenRequest::setProxyUserId(const std::string& proxyUserId) setParameter("ProxyUserId", proxyUserId); } +bool GetTokenRequest::getIsForce()const +{ + return isForce_; +} + +void GetTokenRequest::setIsForce(bool isForce) +{ + isForce_ = isForce; + setParameter("IsForce", isForce ? "true" : "false"); +} + diff --git a/xtrace/src/model/GetTraceResult.cc b/xtrace/src/model/GetTraceResult.cc index 4e4ebb714..75acf63d5 100644 --- a/xtrace/src/model/GetTraceResult.cc +++ b/xtrace/src/model/GetTraceResult.cc @@ -61,30 +61,34 @@ void GetTraceResult::parse(const std::string &payload) spansObject.resultCode = valueSpansSpan["ResultCode"].asString(); if(!valueSpansSpan["HaveStack"].isNull()) spansObject.haveStack = valueSpansSpan["HaveStack"].asString() == "true"; - auto allTagEntryListNode = allSpansNode["TagEntryList"]["TagEntry"]; - for (auto allSpansNodeTagEntryListTagEntry : allTagEntryListNode) + if(!valueSpansSpan["SpanId"].isNull()) + spansObject.spanId = valueSpansSpan["SpanId"].asString(); + if(!valueSpansSpan["ParentSpanId"].isNull()) + spansObject.parentSpanId = valueSpansSpan["ParentSpanId"].asString(); + auto allTagEntryListNode = valueSpansSpan["TagEntryList"]["TagEntry"]; + for (auto valueSpansSpanTagEntryListTagEntry : allTagEntryListNode) { Span::TagEntry tagEntryListObject; - if(!allSpansNodeTagEntryListTagEntry["Key"].isNull()) - tagEntryListObject.key = allSpansNodeTagEntryListTagEntry["Key"].asString(); - if(!allSpansNodeTagEntryListTagEntry["Value"].isNull()) - tagEntryListObject.value = allSpansNodeTagEntryListTagEntry["Value"].asString(); + if(!valueSpansSpanTagEntryListTagEntry["Key"].isNull()) + tagEntryListObject.key = valueSpansSpanTagEntryListTagEntry["Key"].asString(); + if(!valueSpansSpanTagEntryListTagEntry["Value"].isNull()) + tagEntryListObject.value = valueSpansSpanTagEntryListTagEntry["Value"].asString(); spansObject.tagEntryList.push_back(tagEntryListObject); } - auto allLogEventListNode = allSpansNode["LogEventList"]["LogEvent"]; - for (auto allSpansNodeLogEventListLogEvent : allLogEventListNode) + auto allLogEventListNode = valueSpansSpan["LogEventList"]["LogEvent"]; + for (auto valueSpansSpanLogEventListLogEvent : allLogEventListNode) { Span::LogEvent logEventListObject; - if(!allSpansNodeLogEventListLogEvent["Timestamp"].isNull()) - logEventListObject.timestamp = std::stol(allSpansNodeLogEventListLogEvent["Timestamp"].asString()); - auto allTagEntryList1Node = allLogEventListNode["TagEntryList"]["TagEntry"]; - for (auto allLogEventListNodeTagEntryListTagEntry : allTagEntryList1Node) + if(!valueSpansSpanLogEventListLogEvent["Timestamp"].isNull()) + logEventListObject.timestamp = std::stol(valueSpansSpanLogEventListLogEvent["Timestamp"].asString()); + auto allTagEntryList1Node = valueSpansSpanLogEventListLogEvent["TagEntryList"]["TagEntry"]; + for (auto valueSpansSpanLogEventListLogEventTagEntryListTagEntry : allTagEntryList1Node) { Span::LogEvent::TagEntry2 tagEntryList1Object; - if(!allLogEventListNodeTagEntryListTagEntry["Key"].isNull()) - tagEntryList1Object.key = allLogEventListNodeTagEntryListTagEntry["Key"].asString(); - if(!allLogEventListNodeTagEntryListTagEntry["Value"].isNull()) - tagEntryList1Object.value = allLogEventListNodeTagEntryListTagEntry["Value"].asString(); + if(!valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Key"].isNull()) + tagEntryList1Object.key = valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Key"].asString(); + if(!valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Value"].isNull()) + tagEntryList1Object.value = valueSpansSpanLogEventListLogEventTagEntryListTagEntry["Value"].asString(); logEventListObject.tagEntryList1.push_back(tagEntryList1Object); } spansObject.logEventList.push_back(logEventListObject); diff --git a/xtrace/src/model/UpdateSamplingRequest.cc b/xtrace/src/model/UpdateSamplingRequest.cc deleted file mode 100644 index 967a8e0d9..000000000 --- a/xtrace/src/model/UpdateSamplingRequest.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 deleted file mode 100644 index 1750f8da8..000000000 --- a/xtrace/src/model/UpdateSamplingResult.cc +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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_; -} -