Add ModifyWhiteIps.
This commit is contained in:
@@ -1563,6 +1563,42 @@ ElasticsearchClient::ListTagResourcesOutcomeCallable ElasticsearchClient::listTa
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ElasticsearchClient::ModifyWhiteIpsOutcome ElasticsearchClient::modifyWhiteIps(const ModifyWhiteIpsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ModifyWhiteIpsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ModifyWhiteIpsOutcome(ModifyWhiteIpsResult(outcome.result()));
|
||||
else
|
||||
return ModifyWhiteIpsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ElasticsearchClient::modifyWhiteIpsAsync(const ModifyWhiteIpsRequest& request, const ModifyWhiteIpsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, modifyWhiteIps(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ElasticsearchClient::ModifyWhiteIpsOutcomeCallable ElasticsearchClient::modifyWhiteIpsCallable(const ModifyWhiteIpsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ModifyWhiteIpsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->modifyWhiteIps(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ElasticsearchClient::MoveResourceGroupOutcome ElasticsearchClient::moveResourceGroup(const MoveResourceGroupRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -90,6 +90,8 @@ void DescribeInstanceResult::parse(const std::string &payload)
|
||||
result_.enableKibanaPublicNetwork = resultNode["enableKibanaPublicNetwork"].asString() == "true";
|
||||
if(!resultNode["haveKibana"].isNull())
|
||||
result_.haveKibana = resultNode["haveKibana"].asString() == "true";
|
||||
if(!resultNode["resourceGroupId"].isNull())
|
||||
result_.resourceGroupId = resultNode["resourceGroupId"].asString();
|
||||
auto alldictListNode = resultNode["dictList"]["DictListItem"];
|
||||
for (auto resultNodedictListDictListItem : alldictListNode)
|
||||
{
|
||||
|
||||
@@ -28,3 +28,14 @@ GetRegionConfigurationRequest::GetRegionConfigurationRequest() :
|
||||
GetRegionConfigurationRequest::~GetRegionConfigurationRequest()
|
||||
{}
|
||||
|
||||
std::string GetRegionConfigurationRequest::getZoneId()const
|
||||
{
|
||||
return zoneId_;
|
||||
}
|
||||
|
||||
void GetRegionConfigurationRequest::setZoneId(const std::string& zoneId)
|
||||
{
|
||||
zoneId_ = zoneId;
|
||||
setParameter("ZoneId", zoneId);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,8 @@ void ListInstanceResult::parse(const std::string &payload)
|
||||
resultObject.advancedDedicateMaster = valueResultInstance["advancedDedicateMaster"].asString() == "true";
|
||||
if(!valueResultInstance["dedicateMaster"].isNull())
|
||||
resultObject.dedicateMaster = valueResultInstance["dedicateMaster"].asString() == "true";
|
||||
if(!valueResultInstance["resourceGroupId"].isNull())
|
||||
resultObject.resourceGroupId = valueResultInstance["resourceGroupId"].asString();
|
||||
auto alltagsNode = allResultNode["tags"]["Tag"];
|
||||
for (auto allResultNodetagsTag : alltagsNode)
|
||||
{
|
||||
|
||||
52
elasticsearch/src/model/ModifyWhiteIpsRequest.cc
Normal file
52
elasticsearch/src/model/ModifyWhiteIpsRequest.cc
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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/elasticsearch/model/ModifyWhiteIpsRequest.h>
|
||||
|
||||
using AlibabaCloud::Elasticsearch::Model::ModifyWhiteIpsRequest;
|
||||
|
||||
ModifyWhiteIpsRequest::ModifyWhiteIpsRequest() :
|
||||
RoaServiceRequest("elasticsearch", "2017-06-13")
|
||||
{
|
||||
setResourcePath("/openapi/instances/[InstanceId]/actions/modify-white-ips");
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ModifyWhiteIpsRequest::~ModifyWhiteIpsRequest()
|
||||
{}
|
||||
|
||||
std::string ModifyWhiteIpsRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void ModifyWhiteIpsRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
std::string ModifyWhiteIpsRequest::getClientToken()const
|
||||
{
|
||||
return clientToken_;
|
||||
}
|
||||
|
||||
void ModifyWhiteIpsRequest::setClientToken(const std::string& clientToken)
|
||||
{
|
||||
clientToken_ = clientToken;
|
||||
setParameter("ClientToken", clientToken);
|
||||
}
|
||||
|
||||
51
elasticsearch/src/model/ModifyWhiteIpsResult.cc
Normal file
51
elasticsearch/src/model/ModifyWhiteIpsResult.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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/elasticsearch/model/ModifyWhiteIpsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Elasticsearch;
|
||||
using namespace AlibabaCloud::Elasticsearch::Model;
|
||||
|
||||
ModifyWhiteIpsResult::ModifyWhiteIpsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ModifyWhiteIpsResult::ModifyWhiteIpsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ModifyWhiteIpsResult::~ModifyWhiteIpsResult()
|
||||
{}
|
||||
|
||||
void ModifyWhiteIpsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Result"].isNull())
|
||||
result_ = value["Result"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool ModifyWhiteIpsResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user