EHPC SDK Auto Released By qianzheng.llc,Version:1.25.0

Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
This commit is contained in:
yixiong.jxy
2018-09-05 10:48:44 +08:00
parent 19a082eb56
commit e96ffc6afe
13 changed files with 703 additions and 1 deletions

View File

@@ -627,6 +627,42 @@ EHPCClient::GetCloudMetricProfilingOutcomeCallable EHPCClient::getCloudMetricPro
return task->get_future();
}
EHPCClient::DescribeImagePriceOutcome EHPCClient::describeImagePrice(const DescribeImagePriceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeImagePriceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeImagePriceOutcome(DescribeImagePriceResult(outcome.result()));
else
return DescribeImagePriceOutcome(outcome.error());
}
void EHPCClient::describeImagePriceAsync(const DescribeImagePriceRequest& request, const DescribeImagePriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeImagePrice(request), context);
};
asyncExecute(new Runnable(fn));
}
EHPCClient::DescribeImagePriceOutcomeCallable EHPCClient::describeImagePriceCallable(const DescribeImagePriceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeImagePriceOutcome()>>(
[this, request]()
{
return this->describeImagePrice(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EHPCClient::GetAutoScaleConfigOutcome EHPCClient::getAutoScaleConfig(const GetAutoScaleConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -2103,6 +2139,42 @@ EHPCClient::RunCloudMetricProfilingOutcomeCallable EHPCClient::runCloudMetricPro
return task->get_future();
}
EHPCClient::DescribePriceOutcome EHPCClient::describePrice(const DescribePriceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribePriceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribePriceOutcome(DescribePriceResult(outcome.result()));
else
return DescribePriceOutcome(outcome.error());
}
void EHPCClient::describePriceAsync(const DescribePriceRequest& request, const DescribePriceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describePrice(request), context);
};
asyncExecute(new Runnable(fn));
}
EHPCClient::DescribePriceOutcomeCallable EHPCClient::describePriceCallable(const DescribePriceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribePriceOutcome()>>(
[this, request]()
{
return this->describePrice(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EHPCClient::RerunJobsOutcome EHPCClient::rerunJobs(const RerunJobsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,104 @@
/*
* 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/ehpc/model/DescribeImagePriceRequest.h>
using AlibabaCloud::EHPC::Model::DescribeImagePriceRequest;
DescribeImagePriceRequest::DescribeImagePriceRequest() :
RpcServiceRequest("ehpc", "2018-04-12", "DescribeImagePrice")
{}
DescribeImagePriceRequest::~DescribeImagePriceRequest()
{}
int DescribeImagePriceRequest::getPeriod()const
{
return period_;
}
void DescribeImagePriceRequest::setPeriod(int period)
{
period_ = period;
setParameter("Period", std::to_string(period));
}
int DescribeImagePriceRequest::getAmount()const
{
return amount_;
}
void DescribeImagePriceRequest::setAmount(int amount)
{
amount_ = amount;
setParameter("Amount", std::to_string(amount));
}
std::string DescribeImagePriceRequest::getImageId()const
{
return imageId_;
}
void DescribeImagePriceRequest::setImageId(const std::string& imageId)
{
imageId_ = imageId;
setParameter("ImageId", imageId);
}
std::string DescribeImagePriceRequest::getPriceUnit()const
{
return priceUnit_;
}
void DescribeImagePriceRequest::setPriceUnit(const std::string& priceUnit)
{
priceUnit_ = priceUnit;
setParameter("PriceUnit", priceUnit);
}
std::string DescribeImagePriceRequest::getSkuCode()const
{
return skuCode_;
}
void DescribeImagePriceRequest::setSkuCode(const std::string& skuCode)
{
skuCode_ = skuCode;
setParameter("SkuCode", skuCode);
}
std::string DescribeImagePriceRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DescribeImagePriceRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string DescribeImagePriceRequest::getOrderType()const
{
return orderType_;
}
void DescribeImagePriceRequest::setOrderType(const std::string& orderType)
{
orderType_ = orderType;
setParameter("OrderType", orderType);
}

View File

@@ -0,0 +1,80 @@
/*
* 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/ehpc/model/DescribeImagePriceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EHPC;
using namespace AlibabaCloud::EHPC::Model;
DescribeImagePriceResult::DescribeImagePriceResult() :
ServiceResult()
{}
DescribeImagePriceResult::DescribeImagePriceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeImagePriceResult::~DescribeImagePriceResult()
{}
void DescribeImagePriceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["ImageId"].isNull())
imageId_ = value["ImageId"].asString();
if(!value["DiscountPrice"].isNull())
discountPrice_ = std::stof(value["DiscountPrice"].asString());
if(!value["OriginalPrice"].isNull())
originalPrice_ = std::stof(value["OriginalPrice"].asString());
if(!value["TradePrice"].isNull())
tradePrice_ = std::stof(value["TradePrice"].asString());
if(!value["Amount"].isNull())
amount_ = std::stoi(value["Amount"].asString());
}
float DescribeImagePriceResult::getOriginalPrice()const
{
return originalPrice_;
}
float DescribeImagePriceResult::getDiscountPrice()const
{
return discountPrice_;
}
int DescribeImagePriceResult::getAmount()const
{
return amount_;
}
std::string DescribeImagePriceResult::getImageId()const
{
return imageId_;
}
float DescribeImagePriceResult::getTradePrice()const
{
return tradePrice_;
}

View File

@@ -0,0 +1,93 @@
/*
* 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/ehpc/model/DescribePriceRequest.h>
using AlibabaCloud::EHPC::Model::DescribePriceRequest;
DescribePriceRequest::DescribePriceRequest() :
RpcServiceRequest("ehpc", "2018-04-12", "DescribePrice")
{}
DescribePriceRequest::~DescribePriceRequest()
{}
std::string DescribePriceRequest::getPriceUnit()const
{
return priceUnit_;
}
void DescribePriceRequest::setPriceUnit(const std::string& priceUnit)
{
priceUnit_ = priceUnit;
setParameter("PriceUnit", priceUnit);
}
std::vector<DescribePriceRequest::Commodities> DescribePriceRequest::getCommodities()const
{
return commodities_;
}
void DescribePriceRequest::setCommodities(const std::vector<Commodities>& commodities)
{
commodities_ = commodities;
int i = 0;
for(int i = 0; i!= commodities.size(); i++) {
auto obj = commodities.at(i);
std::string str ="Commodities."+ std::to_string(i);
setParameter(str + ".Amount", std::to_string(obj.amount));
setParameter(str + ".Period", std::to_string(obj.period));
setParameter(str + ".NodeType", obj.nodeType);
setParameter(str + ".SystemDiskCategory", obj.systemDiskCategory);
setParameter(str + ".SystemDiskSize", std::to_string(obj.systemDiskSize));
setParameter(str + ".InstanceType", obj.instanceType);
setParameter(str + ".NetworkType", obj.networkType);
}
}
std::string DescribePriceRequest::getChargeType()const
{
return chargeType_;
}
void DescribePriceRequest::setChargeType(const std::string& chargeType)
{
chargeType_ = chargeType;
setParameter("ChargeType", chargeType);
}
std::string DescribePriceRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DescribePriceRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
std::string DescribePriceRequest::getOrderType()const
{
return orderType_;
}
void DescribePriceRequest::setOrderType(const std::string& orderType)
{
orderType_ = orderType;
setParameter("OrderType", orderType);
}

View File

@@ -0,0 +1,71 @@
/*
* 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/ehpc/model/DescribePriceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EHPC;
using namespace AlibabaCloud::EHPC::Model;
DescribePriceResult::DescribePriceResult() :
ServiceResult()
{}
DescribePriceResult::DescribePriceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribePriceResult::~DescribePriceResult()
{}
void DescribePriceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allPrices = value["Prices"]["PriceInfo"];
for (auto value : allPrices)
{
PriceInfo pricesObject;
if(!value["NodeType"].isNull())
pricesObject.nodeType = value["NodeType"].asString();
if(!value["OriginalPrice"].isNull())
pricesObject.originalPrice = std::stof(value["OriginalPrice"].asString());
if(!value["TradePrice"].isNull())
pricesObject.tradePrice = std::stof(value["TradePrice"].asString());
if(!value["Currency"].isNull())
pricesObject.currency = value["Currency"].asString();
prices_.push_back(pricesObject);
}
if(!value["TotalTradePrice"].isNull())
totalTradePrice_ = std::stof(value["TotalTradePrice"].asString());
}
std::vector<DescribePriceResult::PriceInfo> DescribePriceResult::getPrices()const
{
return prices_;
}
float DescribePriceResult::getTotalTradePrice()const
{
return totalTradePrice_;
}