ESS SDK Auto Released By kangning.tkn,Version:1.19.3
Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
BIN
ess/src/.DS_Store
vendored
BIN
ess/src/.DS_Store
vendored
Binary file not shown.
@@ -31,21 +31,21 @@ EssClient::EssClient(const Credentials &credentials, const ClientConfiguration &
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ESS");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ess");
|
||||
}
|
||||
|
||||
EssClient::EssClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ESS");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ess");
|
||||
}
|
||||
|
||||
EssClient::EssClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ESS");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "ess");
|
||||
}
|
||||
|
||||
EssClient::~EssClient()
|
||||
@@ -1383,6 +1383,42 @@ EssClient::DescribeRegionsOutcomeCallable EssClient::describeRegionsCallable(con
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EssClient::DetachDBInstancesOutcome EssClient::detachDBInstances(const DetachDBInstancesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetachDBInstancesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetachDBInstancesOutcome(DetachDBInstancesResult(outcome.result()));
|
||||
else
|
||||
return DetachDBInstancesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void EssClient::detachDBInstancesAsync(const DetachDBInstancesRequest& request, const DetachDBInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detachDBInstances(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
EssClient::DetachDBInstancesOutcomeCallable EssClient::detachDBInstancesCallable(const DetachDBInstancesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetachDBInstancesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detachDBInstances(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EssClient::SetInstancesProtectionOutcome EssClient::setInstancesProtection(const SetInstancesProtectionRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -1815,6 +1851,42 @@ EssClient::DeleteScalingRuleOutcomeCallable EssClient::deleteScalingRuleCallable
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EssClient::AttachDBInstancesOutcome EssClient::attachDBInstances(const AttachDBInstancesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return AttachDBInstancesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return AttachDBInstancesOutcome(AttachDBInstancesResult(outcome.result()));
|
||||
else
|
||||
return AttachDBInstancesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void EssClient::attachDBInstancesAsync(const AttachDBInstancesRequest& request, const AttachDBInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, attachDBInstances(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
EssClient::AttachDBInstancesOutcomeCallable EssClient::attachDBInstancesCallable(const AttachDBInstancesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<AttachDBInstancesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->attachDBInstances(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EssClient::CreateLifecycleHookOutcome EssClient::createLifecycleHook(const CreateLifecycleHookRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
94
ess/src/model/AttachDBInstancesRequest.cc
Executable file
94
ess/src/model/AttachDBInstancesRequest.cc
Executable file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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/ess/model/AttachDBInstancesRequest.h>
|
||||
|
||||
using AlibabaCloud::Ess::Model::AttachDBInstancesRequest;
|
||||
|
||||
AttachDBInstancesRequest::AttachDBInstancesRequest() :
|
||||
RpcServiceRequest("ess", "2014-08-28", "AttachDBInstances")
|
||||
{}
|
||||
|
||||
AttachDBInstancesRequest::~AttachDBInstancesRequest()
|
||||
{}
|
||||
|
||||
std::string AttachDBInstancesRequest::getResourceOwnerAccount()const
|
||||
{
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void AttachDBInstancesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
|
||||
{
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string AttachDBInstancesRequest::getScalingGroupId()const
|
||||
{
|
||||
return scalingGroupId_;
|
||||
}
|
||||
|
||||
void AttachDBInstancesRequest::setScalingGroupId(const std::string& scalingGroupId)
|
||||
{
|
||||
scalingGroupId_ = scalingGroupId;
|
||||
setParameter("ScalingGroupId", scalingGroupId);
|
||||
}
|
||||
|
||||
bool AttachDBInstancesRequest::getForceAttach()const
|
||||
{
|
||||
return forceAttach_;
|
||||
}
|
||||
|
||||
void AttachDBInstancesRequest::setForceAttach(bool forceAttach)
|
||||
{
|
||||
forceAttach_ = forceAttach;
|
||||
setParameter("ForceAttach", std::to_string(forceAttach));
|
||||
}
|
||||
|
||||
std::vector<std::string> AttachDBInstancesRequest::getDBInstance()const
|
||||
{
|
||||
return dBInstance_;
|
||||
}
|
||||
|
||||
void AttachDBInstancesRequest::setDBInstance(const std::vector<std::string>& dBInstance)
|
||||
{
|
||||
dBInstance_ = dBInstance;
|
||||
for(int i = 0; i!= dBInstance.size(); i++)
|
||||
setParameter("DBInstance."+ std::to_string(i), dBInstance.at(i));
|
||||
}
|
||||
|
||||
long AttachDBInstancesRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void AttachDBInstancesRequest::setOwnerId(long ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setParameter("OwnerId", std::to_string(ownerId));
|
||||
}
|
||||
|
||||
std::string AttachDBInstancesRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void AttachDBInstancesRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
45
ess/src/model/AttachDBInstancesResult.cc
Executable file
45
ess/src/model/AttachDBInstancesResult.cc
Executable file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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/ess/model/AttachDBInstancesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ess;
|
||||
using namespace AlibabaCloud::Ess::Model;
|
||||
|
||||
AttachDBInstancesResult::AttachDBInstancesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
AttachDBInstancesResult::AttachDBInstancesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
AttachDBInstancesResult::~AttachDBInstancesResult()
|
||||
{}
|
||||
|
||||
void AttachDBInstancesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
}
|
||||
|
||||
94
ess/src/model/DetachDBInstancesRequest.cc
Executable file
94
ess/src/model/DetachDBInstancesRequest.cc
Executable file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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/ess/model/DetachDBInstancesRequest.h>
|
||||
|
||||
using AlibabaCloud::Ess::Model::DetachDBInstancesRequest;
|
||||
|
||||
DetachDBInstancesRequest::DetachDBInstancesRequest() :
|
||||
RpcServiceRequest("ess", "2014-08-28", "DetachDBInstances")
|
||||
{}
|
||||
|
||||
DetachDBInstancesRequest::~DetachDBInstancesRequest()
|
||||
{}
|
||||
|
||||
std::string DetachDBInstancesRequest::getResourceOwnerAccount()const
|
||||
{
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void DetachDBInstancesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
|
||||
{
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string DetachDBInstancesRequest::getScalingGroupId()const
|
||||
{
|
||||
return scalingGroupId_;
|
||||
}
|
||||
|
||||
void DetachDBInstancesRequest::setScalingGroupId(const std::string& scalingGroupId)
|
||||
{
|
||||
scalingGroupId_ = scalingGroupId;
|
||||
setParameter("ScalingGroupId", scalingGroupId);
|
||||
}
|
||||
|
||||
std::vector<std::string> DetachDBInstancesRequest::getDBInstance()const
|
||||
{
|
||||
return dBInstance_;
|
||||
}
|
||||
|
||||
void DetachDBInstancesRequest::setDBInstance(const std::vector<std::string>& dBInstance)
|
||||
{
|
||||
dBInstance_ = dBInstance;
|
||||
for(int i = 0; i!= dBInstance.size(); i++)
|
||||
setParameter("DBInstance."+ std::to_string(i), dBInstance.at(i));
|
||||
}
|
||||
|
||||
bool DetachDBInstancesRequest::getForceDetach()const
|
||||
{
|
||||
return forceDetach_;
|
||||
}
|
||||
|
||||
void DetachDBInstancesRequest::setForceDetach(bool forceDetach)
|
||||
{
|
||||
forceDetach_ = forceDetach;
|
||||
setParameter("ForceDetach", std::to_string(forceDetach));
|
||||
}
|
||||
|
||||
long DetachDBInstancesRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void DetachDBInstancesRequest::setOwnerId(long ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setParameter("OwnerId", std::to_string(ownerId));
|
||||
}
|
||||
|
||||
std::string DetachDBInstancesRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void DetachDBInstancesRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
45
ess/src/model/DetachDBInstancesResult.cc
Executable file
45
ess/src/model/DetachDBInstancesResult.cc
Executable file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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/ess/model/DetachDBInstancesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ess;
|
||||
using namespace AlibabaCloud::Ess::Model;
|
||||
|
||||
DetachDBInstancesResult::DetachDBInstancesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetachDBInstancesResult::DetachDBInstancesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetachDBInstancesResult::~DetachDBInstancesResult()
|
||||
{}
|
||||
|
||||
void DetachDBInstancesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user