Add renew and modify instance pay type api.

This commit is contained in:
sdk-team
2022-11-15 11:08:13 +00:00
parent b7b1b733c1
commit 57a114d7ef
14 changed files with 715 additions and 1 deletions

View File

@@ -303,6 +303,42 @@ HitsdbClient::ListTagResourcesOutcomeCallable HitsdbClient::listTagResourcesCall
return task->get_future();
}
HitsdbClient::ModifyInstancePayTypeOutcome HitsdbClient::modifyInstancePayType(const ModifyInstancePayTypeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ModifyInstancePayTypeOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ModifyInstancePayTypeOutcome(ModifyInstancePayTypeResult(outcome.result()));
else
return ModifyInstancePayTypeOutcome(outcome.error());
}
void HitsdbClient::modifyInstancePayTypeAsync(const ModifyInstancePayTypeRequest& request, const ModifyInstancePayTypeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, modifyInstancePayType(request), context);
};
asyncExecute(new Runnable(fn));
}
HitsdbClient::ModifyInstancePayTypeOutcomeCallable HitsdbClient::modifyInstancePayTypeCallable(const ModifyInstancePayTypeRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ModifyInstancePayTypeOutcome()>>(
[this, request]()
{
return this->modifyInstancePayType(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
HitsdbClient::ReleaseLindormInstanceOutcome HitsdbClient::releaseLindormInstance(const ReleaseLindormInstanceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -339,6 +375,42 @@ HitsdbClient::ReleaseLindormInstanceOutcomeCallable HitsdbClient::releaseLindorm
return task->get_future();
}
HitsdbClient::RenewLindormInstanceOutcome HitsdbClient::renewLindormInstance(const RenewLindormInstanceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RenewLindormInstanceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RenewLindormInstanceOutcome(RenewLindormInstanceResult(outcome.result()));
else
return RenewLindormInstanceOutcome(outcome.error());
}
void HitsdbClient::renewLindormInstanceAsync(const RenewLindormInstanceRequest& request, const RenewLindormInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, renewLindormInstance(request), context);
};
asyncExecute(new Runnable(fn));
}
HitsdbClient::RenewLindormInstanceOutcomeCallable HitsdbClient::renewLindormInstanceCallable(const RenewLindormInstanceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RenewLindormInstanceOutcome()>>(
[this, request]()
{
return this->renewLindormInstance(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
HitsdbClient::TagResourcesOutcome HitsdbClient::tagResources(const TagResourcesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -79,6 +79,15 @@ void CreateLindormInstanceRequest::setTsdbNum(int tsdbNum) {
setParameter(std::string("TsdbNum"), std::to_string(tsdbNum));
}
std::string CreateLindormInstanceRequest::getPrimaryVSwitchId() const {
return primaryVSwitchId_;
}
void CreateLindormInstanceRequest::setPrimaryVSwitchId(const std::string &primaryVSwitchId) {
primaryVSwitchId_ = primaryVSwitchId;
setParameter(std::string("PrimaryVSwitchId"), primaryVSwitchId);
}
int CreateLindormInstanceRequest::getSolrNum() const {
return solrNum_;
}
@@ -187,6 +196,15 @@ void CreateLindormInstanceRequest::setTsdbSpec(const std::string &tsdbSpec) {
setParameter(std::string("TsdbSpec"), tsdbSpec);
}
std::string CreateLindormInstanceRequest::getPrimaryZoneId() const {
return primaryZoneId_;
}
void CreateLindormInstanceRequest::setPrimaryZoneId(const std::string &primaryZoneId) {
primaryZoneId_ = primaryZoneId;
setParameter(std::string("PrimaryZoneId"), primaryZoneId);
}
std::string CreateLindormInstanceRequest::getFilestoreSpec() const {
return filestoreSpec_;
}

View File

@@ -0,0 +1,117 @@
/*
* 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/hitsdb/model/ModifyInstancePayTypeRequest.h>
using AlibabaCloud::Hitsdb::Model::ModifyInstancePayTypeRequest;
ModifyInstancePayTypeRequest::ModifyInstancePayTypeRequest()
: RpcServiceRequest("hitsdb", "2020-06-15", "ModifyInstancePayType") {
setMethod(HttpRequest::Method::Post);
}
ModifyInstancePayTypeRequest::~ModifyInstancePayTypeRequest() {}
long ModifyInstancePayTypeRequest::getResourceOwnerId() const {
return resourceOwnerId_;
}
void ModifyInstancePayTypeRequest::setResourceOwnerId(long resourceOwnerId) {
resourceOwnerId_ = resourceOwnerId;
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
}
std::string ModifyInstancePayTypeRequest::getAccessKeyId() const {
return accessKeyId_;
}
void ModifyInstancePayTypeRequest::setAccessKeyId(const std::string &accessKeyId) {
accessKeyId_ = accessKeyId;
setParameter(std::string("AccessKeyId"), accessKeyId);
}
int ModifyInstancePayTypeRequest::getDuration() const {
return duration_;
}
void ModifyInstancePayTypeRequest::setDuration(int duration) {
duration_ = duration;
setParameter(std::string("Duration"), std::to_string(duration));
}
std::string ModifyInstancePayTypeRequest::getSecurityToken() const {
return securityToken_;
}
void ModifyInstancePayTypeRequest::setSecurityToken(const std::string &securityToken) {
securityToken_ = securityToken;
setParameter(std::string("SecurityToken"), securityToken);
}
std::string ModifyInstancePayTypeRequest::getResourceOwnerAccount() const {
return resourceOwnerAccount_;
}
void ModifyInstancePayTypeRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
}
std::string ModifyInstancePayTypeRequest::getOwnerAccount() const {
return ownerAccount_;
}
void ModifyInstancePayTypeRequest::setOwnerAccount(const std::string &ownerAccount) {
ownerAccount_ = ownerAccount;
setParameter(std::string("OwnerAccount"), ownerAccount);
}
long ModifyInstancePayTypeRequest::getOwnerId() const {
return ownerId_;
}
void ModifyInstancePayTypeRequest::setOwnerId(long ownerId) {
ownerId_ = ownerId;
setParameter(std::string("OwnerId"), std::to_string(ownerId));
}
std::string ModifyInstancePayTypeRequest::getInstanceId() const {
return instanceId_;
}
void ModifyInstancePayTypeRequest::setInstanceId(const std::string &instanceId) {
instanceId_ = instanceId;
setParameter(std::string("InstanceId"), instanceId);
}
std::string ModifyInstancePayTypeRequest::getPricingCycle() const {
return pricingCycle_;
}
void ModifyInstancePayTypeRequest::setPricingCycle(const std::string &pricingCycle) {
pricingCycle_ = pricingCycle;
setParameter(std::string("PricingCycle"), pricingCycle);
}
std::string ModifyInstancePayTypeRequest::getPayType() const {
return payType_;
}
void ModifyInstancePayTypeRequest::setPayType(const std::string &payType) {
payType_ = payType;
setParameter(std::string("PayType"), payType);
}

View File

@@ -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.
*/
#include <alibabacloud/hitsdb/model/ModifyInstancePayTypeResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Hitsdb;
using namespace AlibabaCloud::Hitsdb::Model;
ModifyInstancePayTypeResult::ModifyInstancePayTypeResult() :
ServiceResult()
{}
ModifyInstancePayTypeResult::ModifyInstancePayTypeResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ModifyInstancePayTypeResult::~ModifyInstancePayTypeResult()
{}
void ModifyInstancePayTypeResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["OrderId"].isNull())
orderId_ = std::stol(value["OrderId"].asString());
if(!value["InstanceId"].isNull())
instanceId_ = value["InstanceId"].asString();
}
std::string ModifyInstancePayTypeResult::getInstanceId()const
{
return instanceId_;
}
long ModifyInstancePayTypeResult::getOrderId()const
{
return orderId_;
}

View File

@@ -0,0 +1,117 @@
/*
* 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/hitsdb/model/RenewLindormInstanceRequest.h>
using AlibabaCloud::Hitsdb::Model::RenewLindormInstanceRequest;
RenewLindormInstanceRequest::RenewLindormInstanceRequest()
: RpcServiceRequest("hitsdb", "2020-06-15", "RenewLindormInstance") {
setMethod(HttpRequest::Method::Post);
}
RenewLindormInstanceRequest::~RenewLindormInstanceRequest() {}
long RenewLindormInstanceRequest::getResourceOwnerId() const {
return resourceOwnerId_;
}
void RenewLindormInstanceRequest::setResourceOwnerId(long resourceOwnerId) {
resourceOwnerId_ = resourceOwnerId;
setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId));
}
std::string RenewLindormInstanceRequest::getAccessKeyId() const {
return accessKeyId_;
}
void RenewLindormInstanceRequest::setAccessKeyId(const std::string &accessKeyId) {
accessKeyId_ = accessKeyId;
setParameter(std::string("AccessKeyId"), accessKeyId);
}
int RenewLindormInstanceRequest::getDuration() const {
return duration_;
}
void RenewLindormInstanceRequest::setDuration(int duration) {
duration_ = duration;
setParameter(std::string("Duration"), std::to_string(duration));
}
std::string RenewLindormInstanceRequest::getSecurityToken() const {
return securityToken_;
}
void RenewLindormInstanceRequest::setSecurityToken(const std::string &securityToken) {
securityToken_ = securityToken;
setParameter(std::string("SecurityToken"), securityToken);
}
std::string RenewLindormInstanceRequest::getRegionId() const {
return regionId_;
}
void RenewLindormInstanceRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string RenewLindormInstanceRequest::getResourceOwnerAccount() const {
return resourceOwnerAccount_;
}
void RenewLindormInstanceRequest::setResourceOwnerAccount(const std::string &resourceOwnerAccount) {
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter(std::string("ResourceOwnerAccount"), resourceOwnerAccount);
}
std::string RenewLindormInstanceRequest::getOwnerAccount() const {
return ownerAccount_;
}
void RenewLindormInstanceRequest::setOwnerAccount(const std::string &ownerAccount) {
ownerAccount_ = ownerAccount;
setParameter(std::string("OwnerAccount"), ownerAccount);
}
long RenewLindormInstanceRequest::getOwnerId() const {
return ownerId_;
}
void RenewLindormInstanceRequest::setOwnerId(long ownerId) {
ownerId_ = ownerId;
setParameter(std::string("OwnerId"), std::to_string(ownerId));
}
std::string RenewLindormInstanceRequest::getInstanceId() const {
return instanceId_;
}
void RenewLindormInstanceRequest::setInstanceId(const std::string &instanceId) {
instanceId_ = instanceId;
setParameter(std::string("InstanceId"), instanceId);
}
std::string RenewLindormInstanceRequest::getPricingCycle() const {
return pricingCycle_;
}
void RenewLindormInstanceRequest::setPricingCycle(const std::string &pricingCycle) {
pricingCycle_ = pricingCycle;
setParameter(std::string("PricingCycle"), pricingCycle);
}

View File

@@ -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.
*/
#include <alibabacloud/hitsdb/model/RenewLindormInstanceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Hitsdb;
using namespace AlibabaCloud::Hitsdb::Model;
RenewLindormInstanceResult::RenewLindormInstanceResult() :
ServiceResult()
{}
RenewLindormInstanceResult::RenewLindormInstanceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RenewLindormInstanceResult::~RenewLindormInstanceResult()
{}
void RenewLindormInstanceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["InstanceId"].isNull())
instanceId_ = value["InstanceId"].asString();
if(!value["OrderId"].isNull())
orderId_ = std::stol(value["OrderId"].asString());
}
std::string RenewLindormInstanceResult::getInstanceId()const
{
return instanceId_;
}
long RenewLindormInstanceResult::getOrderId()const
{
return orderId_;
}