Bugfix QueryMoniter.

This commit is contained in:
sdk-team
2022-02-21 10:07:17 +00:00
parent bd57cca01a
commit d42d229efb
4 changed files with 26 additions and 6 deletions

View File

@@ -1,3 +1,6 @@
2022-02-21 Version: 1.36.1061
- Bugfix QueryMoniter.
2022-02-21 Version: 1.36.1060
- Add DleteNacosInstance.
- Change CreateCluster parameter.

View File

@@ -1 +1 @@
1.36.1060
1.36.1061

View File

@@ -32,13 +32,19 @@ namespace AlibabaCloud
class ALIBABACLOUD_MSE_EXPORT QueryMonitorResult : public ServiceResult
{
public:
struct DataItem
{
std::string podName;
std::string clusterNamePrefix;
std::vector<std::string> values;
};
QueryMonitorResult();
explicit QueryMonitorResult(const std::string &payload);
~QueryMonitorResult();
std::string getMessage()const;
std::string getData()const;
std::vector<DataItem> getData()const;
std::string getErrorCode()const;
bool getSuccess()const;
@@ -46,7 +52,7 @@ namespace AlibabaCloud
void parse(const std::string &payload);
private:
std::string message_;
std::string data_;
std::vector<DataItem> data_;
std::string errorCode_;
bool success_;

View File

@@ -39,10 +39,21 @@ void QueryMonitorResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allDataNode = value["Data"]["dataItem"];
for (auto valueDatadataItem : allDataNode)
{
DataItem dataObject;
if(!valueDatadataItem["podName"].isNull())
dataObject.podName = valueDatadataItem["podName"].asString();
if(!valueDatadataItem["clusterNamePrefix"].isNull())
dataObject.clusterNamePrefix = valueDatadataItem["clusterNamePrefix"].asString();
auto allValues = value["values"]["values"];
for (auto value : allValues)
dataObject.values.push_back(value.asString());
data_.push_back(dataObject);
}
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Data"].isNull())
data_ = value["Data"].asString();
if(!value["ErrorCode"].isNull())
errorCode_ = value["ErrorCode"].asString();
if(!value["Success"].isNull())
@@ -55,7 +66,7 @@ std::string QueryMonitorResult::getMessage()const
return message_;
}
std::string QueryMonitorResult::getData()const
std::vector<QueryMonitorResult::DataItem> QueryMonitorResult::getData()const
{
return data_;
}