Support Service name.

This commit is contained in:
sdk-team
2022-01-07 08:06:12 +00:00
parent ec6303fa64
commit bc474a30c7
15 changed files with 316 additions and 1 deletions

View File

@@ -2355,6 +2355,42 @@ AlbClient::UpdateListenerLogConfigOutcomeCallable AlbClient::updateListenerLogCo
return task->get_future();
}
AlbClient::UpdateLoadBalancerAddressTypeConfigOutcome AlbClient::updateLoadBalancerAddressTypeConfig(const UpdateLoadBalancerAddressTypeConfigRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UpdateLoadBalancerAddressTypeConfigOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UpdateLoadBalancerAddressTypeConfigOutcome(UpdateLoadBalancerAddressTypeConfigResult(outcome.result()));
else
return UpdateLoadBalancerAddressTypeConfigOutcome(outcome.error());
}
void AlbClient::updateLoadBalancerAddressTypeConfigAsync(const UpdateLoadBalancerAddressTypeConfigRequest& request, const UpdateLoadBalancerAddressTypeConfigAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, updateLoadBalancerAddressTypeConfig(request), context);
};
asyncExecute(new Runnable(fn));
}
AlbClient::UpdateLoadBalancerAddressTypeConfigOutcomeCallable AlbClient::updateLoadBalancerAddressTypeConfigCallable(const UpdateLoadBalancerAddressTypeConfigRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UpdateLoadBalancerAddressTypeConfigOutcome()>>(
[this, request]()
{
return this->updateLoadBalancerAddressTypeConfig(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
AlbClient::UpdateLoadBalancerAttributeOutcome AlbClient::updateLoadBalancerAttribute(const UpdateLoadBalancerAttributeRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -105,6 +105,15 @@ void CreateServerGroupRequest::setUpstreamKeepaliveEnabled(bool upstreamKeepaliv
setParameter(std::string("UpstreamKeepaliveEnabled"), upstreamKeepaliveEnabled ? "true" : "false");
}
std::string CreateServerGroupRequest::getServiceName() const {
return serviceName_;
}
void CreateServerGroupRequest::setServiceName(const std::string &serviceName) {
serviceName_ = serviceName;
setParameter(std::string("ServiceName"), serviceName);
}
CreateServerGroupRequest::StickySessionConfig CreateServerGroupRequest::getStickySessionConfig() const {
return stickySessionConfig_;
}

View File

@@ -71,6 +71,8 @@ void ListServerGroupsResult::parse(const std::string &payload)
serverGroupsObject.ipv6Enabled = valueServerGroupsServerGroup["Ipv6Enabled"].asString() == "true";
if(!valueServerGroupsServerGroup["ServerCount"].isNull())
serverGroupsObject.serverCount = std::stoi(valueServerGroupsServerGroup["ServerCount"].asString());
if(!valueServerGroupsServerGroup["ServiceName"].isNull())
serverGroupsObject.serviceName = valueServerGroupsServerGroup["ServiceName"].asString();
auto allTagsNode = valueServerGroupsServerGroup["Tags"]["Tag"];
for (auto valueServerGroupsServerGroupTagsTag : allTagsNode)
{

View File

@@ -0,0 +1,76 @@
/*
* 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/alb/model/UpdateLoadBalancerAddressTypeConfigRequest.h>
using AlibabaCloud::Alb::Model::UpdateLoadBalancerAddressTypeConfigRequest;
UpdateLoadBalancerAddressTypeConfigRequest::UpdateLoadBalancerAddressTypeConfigRequest()
: RpcServiceRequest("alb", "2020-06-16", "UpdateLoadBalancerAddressTypeConfig") {
setMethod(HttpRequest::Method::Post);
}
UpdateLoadBalancerAddressTypeConfigRequest::~UpdateLoadBalancerAddressTypeConfigRequest() {}
std::string UpdateLoadBalancerAddressTypeConfigRequest::getClientToken() const {
return clientToken_;
}
void UpdateLoadBalancerAddressTypeConfigRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string UpdateLoadBalancerAddressTypeConfigRequest::getAddressType() const {
return addressType_;
}
void UpdateLoadBalancerAddressTypeConfigRequest::setAddressType(const std::string &addressType) {
addressType_ = addressType;
setParameter(std::string("AddressType"), addressType);
}
std::string UpdateLoadBalancerAddressTypeConfigRequest::getDryRun() const {
return dryRun_;
}
void UpdateLoadBalancerAddressTypeConfigRequest::setDryRun(const std::string &dryRun) {
dryRun_ = dryRun;
setParameter(std::string("DryRun"), dryRun);
}
std::vector<UpdateLoadBalancerAddressTypeConfigRequest::ZoneMappings> UpdateLoadBalancerAddressTypeConfigRequest::getZoneMappings() const {
return zoneMappings_;
}
void UpdateLoadBalancerAddressTypeConfigRequest::setZoneMappings(const std::vector<UpdateLoadBalancerAddressTypeConfigRequest::ZoneMappings> &zoneMappings) {
zoneMappings_ = zoneMappings;
for(int dep1 = 0; dep1 != zoneMappings.size(); dep1++) {
setParameter(std::string("ZoneMappings") + "." + std::to_string(dep1 + 1) + ".VSwitchId", zoneMappings[dep1].vSwitchId);
setParameter(std::string("ZoneMappings") + "." + std::to_string(dep1 + 1) + ".ZoneId", zoneMappings[dep1].zoneId);
setParameter(std::string("ZoneMappings") + "." + std::to_string(dep1 + 1) + ".AllocationId", zoneMappings[dep1].allocationId);
}
}
std::string UpdateLoadBalancerAddressTypeConfigRequest::getLoadBalancerId() const {
return loadBalancerId_;
}
void UpdateLoadBalancerAddressTypeConfigRequest::setLoadBalancerId(const std::string &loadBalancerId) {
loadBalancerId_ = loadBalancerId;
setParameter(std::string("LoadBalancerId"), loadBalancerId);
}

View 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/alb/model/UpdateLoadBalancerAddressTypeConfigResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Alb;
using namespace AlibabaCloud::Alb::Model;
UpdateLoadBalancerAddressTypeConfigResult::UpdateLoadBalancerAddressTypeConfigResult() :
ServiceResult()
{}
UpdateLoadBalancerAddressTypeConfigResult::UpdateLoadBalancerAddressTypeConfigResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UpdateLoadBalancerAddressTypeConfigResult::~UpdateLoadBalancerAddressTypeConfigResult()
{}
void UpdateLoadBalancerAddressTypeConfigResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["JobId"].isNull())
jobId_ = value["JobId"].asString();
}
std::string UpdateLoadBalancerAddressTypeConfigResult::getJobId()const
{
return jobId_;
}

View File

@@ -96,6 +96,15 @@ void UpdateServerGroupAttributeRequest::setUpstreamKeepaliveEnabled(bool upstrea
setParameter(std::string("UpstreamKeepaliveEnabled"), upstreamKeepaliveEnabled ? "true" : "false");
}
std::string UpdateServerGroupAttributeRequest::getServiceName() const {
return serviceName_;
}
void UpdateServerGroupAttributeRequest::setServiceName(const std::string &serviceName) {
serviceName_ = serviceName;
setParameter(std::string("ServiceName"), serviceName);
}
UpdateServerGroupAttributeRequest::StickySessionConfig UpdateServerGroupAttributeRequest::getStickySessionConfig() const {
return stickySessionConfig_;
}