Add result value spanId for GetTrace api.

This commit is contained in:
sdk-team
2021-01-11 06:43:17 +00:00
parent 5bf58dc5b5
commit 4f16d1bd02
20 changed files with 46 additions and 858 deletions

View File

@@ -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 <alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingRequest.h>
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);
}

View File

@@ -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 <alibabacloud/xtrace/model/CheckServiceLinkedRoleForDeletingResult.h>
#include <json/json.h>
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::RoleUsagesItem> CheckServiceLinkedRoleForDeletingResult::getRoleUsages()const
{
return roleUsages_;
}

View File

@@ -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 <alibabacloud/xtrace/model/GetSamplingRequest.h>
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);
}

View File

@@ -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 <alibabacloud/xtrace/model/GetSamplingResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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");
}

View File

@@ -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);

View File

@@ -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 <alibabacloud/xtrace/model/UpdateSamplingRequest.h>
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);
}

View File

@@ -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 <alibabacloud/xtrace/model/UpdateSamplingResult.h>
#include <json/json.h>
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_;
}