Supported sync create eni and assign private ip.

This commit is contained in:
sdk-team
2020-06-17 18:04:12 +08:00
parent 2df6079b2d
commit 57416bd581
29 changed files with 566 additions and 1 deletions

View File

@@ -3687,6 +3687,42 @@ EcsClient::DescribeDemandsOutcomeCallable EcsClient::describeDemandsCallable(con
return task->get_future();
}
EcsClient::DescribeDeploymentSetSupportedInstanceTypeFamilyOutcome EcsClient::describeDeploymentSetSupportedInstanceTypeFamily(const DescribeDeploymentSetSupportedInstanceTypeFamilyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeDeploymentSetSupportedInstanceTypeFamilyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeDeploymentSetSupportedInstanceTypeFamilyOutcome(DescribeDeploymentSetSupportedInstanceTypeFamilyResult(outcome.result()));
else
return DescribeDeploymentSetSupportedInstanceTypeFamilyOutcome(outcome.error());
}
void EcsClient::describeDeploymentSetSupportedInstanceTypeFamilyAsync(const DescribeDeploymentSetSupportedInstanceTypeFamilyRequest& request, const DescribeDeploymentSetSupportedInstanceTypeFamilyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeDeploymentSetSupportedInstanceTypeFamily(request), context);
};
asyncExecute(new Runnable(fn));
}
EcsClient::DescribeDeploymentSetSupportedInstanceTypeFamilyOutcomeCallable EcsClient::describeDeploymentSetSupportedInstanceTypeFamilyCallable(const DescribeDeploymentSetSupportedInstanceTypeFamilyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeDeploymentSetSupportedInstanceTypeFamilyOutcome()>>(
[this, request]()
{
return this->describeDeploymentSetSupportedInstanceTypeFamily(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EcsClient::DescribeDeploymentSetsOutcome EcsClient::describeDeploymentSets(const DescribeDeploymentSetsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -38,6 +38,17 @@ void AssignPrivateIpAddressesRequest::setResourceOwnerId(long resourceOwnerId)
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string AssignPrivateIpAddressesRequest::getClientToken()const
{
return clientToken_;
}
void AssignPrivateIpAddressesRequest::setClientToken(const std::string& clientToken)
{
clientToken_ = clientToken;
setParameter("ClientToken", clientToken);
}
int AssignPrivateIpAddressesRequest::getSecondaryPrivateIpAddressCount()const
{
return secondaryPrivateIpAddressCount_;

View File

@@ -39,6 +39,17 @@ void AssignPrivateIpAddressesResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto assignedPrivateIpAddressesSetNode = value["AssignedPrivateIpAddressesSet"];
if(!assignedPrivateIpAddressesSetNode["NetworkInterfaceId"].isNull())
assignedPrivateIpAddressesSet_.networkInterfaceId = assignedPrivateIpAddressesSetNode["NetworkInterfaceId"].asString();
auto allPrivateIpSet = assignedPrivateIpAddressesSetNode["PrivateIpSet"]["PrivateIpAddress"];
for (auto value : allPrivateIpSet)
assignedPrivateIpAddressesSet_.privateIpSet.push_back(value.asString());
}
AssignPrivateIpAddressesResult::AssignedPrivateIpAddressesSet AssignPrivateIpAddressesResult::getAssignedPrivateIpAddressesSet()const
{
return assignedPrivateIpAddressesSet_;
}

View File

@@ -71,6 +71,17 @@ void CreateDeploymentSetRequest::setRegionId(const std::string& regionId)
setParameter("RegionId", regionId);
}
long CreateDeploymentSetRequest::getGroupCount()const
{
return groupCount_;
}
void CreateDeploymentSetRequest::setGroupCount(long groupCount)
{
groupCount_ = groupCount;
setParameter("GroupCount", std::to_string(groupCount));
}
std::string CreateDeploymentSetRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;

View File

@@ -137,6 +137,17 @@ void CreateInstanceRequest::setPassword(const std::string& password)
setParameter("Password", password);
}
int CreateInstanceRequest::getDeploymentSetGroupNo()const
{
return deploymentSetGroupNo_;
}
void CreateInstanceRequest::setDeploymentSetGroupNo(int deploymentSetGroupNo)
{
deploymentSetGroupNo_ = deploymentSetGroupNo;
setParameter("DeploymentSetGroupNo", std::to_string(deploymentSetGroupNo));
}
int CreateInstanceRequest::getStorageSetPartitionNumber()const
{
return storageSetPartitionNumber_;

View File

@@ -39,13 +39,142 @@ void CreateNetworkInterfaceResult::parse(const std::string &payload)
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allPrivateIpSetsNode = value["PrivateIpSets"]["PrivateIpSet"];
for (auto valuePrivateIpSetsPrivateIpSet : allPrivateIpSetsNode)
{
PrivateIpSet privateIpSetsObject;
if(!valuePrivateIpSetsPrivateIpSet["PrivateIpAddress"].isNull())
privateIpSetsObject.privateIpAddress = valuePrivateIpSetsPrivateIpSet["PrivateIpAddress"].asString();
if(!valuePrivateIpSetsPrivateIpSet["Primary"].isNull())
privateIpSetsObject.primary = valuePrivateIpSetsPrivateIpSet["Primary"].asString() == "true";
privateIpSets_.push_back(privateIpSetsObject);
}
auto allTagsNode = value["Tags"]["Tag"];
for (auto valueTagsTag : allTagsNode)
{
Tag tagsObject;
if(!valueTagsTag["TagKey"].isNull())
tagsObject.tagKey = valueTagsTag["TagKey"].asString();
if(!valueTagsTag["TagValue"].isNull())
tagsObject.tagValue = valueTagsTag["TagValue"].asString();
tags_.push_back(tagsObject);
}
auto allSecurityGroupIds = value["SecurityGroupIds"]["SecurityGroupId"];
for (const auto &item : allSecurityGroupIds)
securityGroupIds_.push_back(item.asString());
if(!value["NetworkInterfaceId"].isNull())
networkInterfaceId_ = value["NetworkInterfaceId"].asString();
if(!value["Status"].isNull())
status_ = value["Status"].asString();
if(!value["Type"].isNull())
type_ = value["Type"].asString();
if(!value["VpcId"].isNull())
vpcId_ = value["VpcId"].asString();
if(!value["VSwitchId"].isNull())
vSwitchId_ = value["VSwitchId"].asString();
if(!value["ZoneId"].isNull())
zoneId_ = value["ZoneId"].asString();
if(!value["PrivateIpAddress"].isNull())
privateIpAddress_ = value["PrivateIpAddress"].asString();
if(!value["MacAddress"].isNull())
macAddress_ = value["MacAddress"].asString();
if(!value["NetworkInterfaceName"].isNull())
networkInterfaceName_ = value["NetworkInterfaceName"].asString();
if(!value["Description"].isNull())
description_ = value["Description"].asString();
if(!value["ResourceGroupId"].isNull())
resourceGroupId_ = value["ResourceGroupId"].asString();
if(!value["ServiceID"].isNull())
serviceID_ = std::stol(value["ServiceID"].asString());
if(!value["ServiceManaged"].isNull())
serviceManaged_ = value["ServiceManaged"].asString() == "true";
if(!value["OwnerId"].isNull())
ownerId_ = value["OwnerId"].asString();
}
std::string CreateNetworkInterfaceResult::getStatus()const
{
return status_;
}
std::string CreateNetworkInterfaceResult::getPrivateIpAddress()const
{
return privateIpAddress_;
}
std::string CreateNetworkInterfaceResult::getDescription()const
{
return description_;
}
std::string CreateNetworkInterfaceResult::getZoneId()const
{
return zoneId_;
}
std::string CreateNetworkInterfaceResult::getResourceGroupId()const
{
return resourceGroupId_;
}
bool CreateNetworkInterfaceResult::getServiceManaged()const
{
return serviceManaged_;
}
std::string CreateNetworkInterfaceResult::getVSwitchId()const
{
return vSwitchId_;
}
std::string CreateNetworkInterfaceResult::getNetworkInterfaceName()const
{
return networkInterfaceName_;
}
std::string CreateNetworkInterfaceResult::getNetworkInterfaceId()const
{
return networkInterfaceId_;
}
std::string CreateNetworkInterfaceResult::getMacAddress()const
{
return macAddress_;
}
std::vector<std::string> CreateNetworkInterfaceResult::getSecurityGroupIds()const
{
return securityGroupIds_;
}
long CreateNetworkInterfaceResult::getServiceID()const
{
return serviceID_;
}
std::string CreateNetworkInterfaceResult::getType()const
{
return type_;
}
std::string CreateNetworkInterfaceResult::getVpcId()const
{
return vpcId_;
}
std::string CreateNetworkInterfaceResult::getOwnerId()const
{
return ownerId_;
}
std::vector<CreateNetworkInterfaceResult::Tag> CreateNetworkInterfaceResult::getTags()const
{
return tags_;
}
std::vector<CreateNetworkInterfaceResult::PrivateIpSet> CreateNetworkInterfaceResult::getPrivateIpSets()const
{
return privateIpSets_;
}

View File

@@ -0,0 +1,84 @@
/*
* 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/ecs/model/DescribeDeploymentSetSupportedInstanceTypeFamilyRequest.h>
using AlibabaCloud::Ecs::Model::DescribeDeploymentSetSupportedInstanceTypeFamilyRequest;
DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::DescribeDeploymentSetSupportedInstanceTypeFamilyRequest() :
RpcServiceRequest("ecs", "2014-05-26", "DescribeDeploymentSetSupportedInstanceTypeFamily")
{
setMethod(HttpRequest::Method::Post);
}
DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::~DescribeDeploymentSetSupportedInstanceTypeFamilyRequest()
{}
long DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::getRegionId()const
{
return regionId_;
}
void DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::getOwnerId()const
{
return ownerId_;
}
void DescribeDeploymentSetSupportedInstanceTypeFamilyRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}

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/ecs/model/DescribeDeploymentSetSupportedInstanceTypeFamilyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ecs;
using namespace AlibabaCloud::Ecs::Model;
DescribeDeploymentSetSupportedInstanceTypeFamilyResult::DescribeDeploymentSetSupportedInstanceTypeFamilyResult() :
ServiceResult()
{}
DescribeDeploymentSetSupportedInstanceTypeFamilyResult::DescribeDeploymentSetSupportedInstanceTypeFamilyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeDeploymentSetSupportedInstanceTypeFamilyResult::~DescribeDeploymentSetSupportedInstanceTypeFamilyResult()
{}
void DescribeDeploymentSetSupportedInstanceTypeFamilyResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["InstanceTypeFamilies"].isNull())
instanceTypeFamilies_ = value["InstanceTypeFamilies"].asString();
}
std::string DescribeDeploymentSetSupportedInstanceTypeFamilyResult::getInstanceTypeFamilies()const
{
return instanceTypeFamilies_;
}

View File

@@ -57,6 +57,8 @@ void DescribeDeploymentSetsResult::parse(const std::string &payload)
deploymentSetsObject.domain = valueDeploymentSetsDeploymentSet["Domain"].asString();
if(!valueDeploymentSetsDeploymentSet["Granularity"].isNull())
deploymentSetsObject.granularity = valueDeploymentSetsDeploymentSet["Granularity"].asString();
if(!valueDeploymentSetsDeploymentSet["GroupCount"].isNull())
deploymentSetsObject.groupCount = std::stoi(valueDeploymentSetsDeploymentSet["GroupCount"].asString());
if(!valueDeploymentSetsDeploymentSet["InstanceAmount"].isNull())
deploymentSetsObject.instanceAmount = std::stoi(valueDeploymentSetsDeploymentSet["InstanceAmount"].asString());
if(!valueDeploymentSetsDeploymentSet["CreationTime"].isNull())

View File

@@ -115,6 +115,8 @@ void DescribeDisksResult::parse(const std::string &payload)
disksObject.performanceLevel = valueDisksDisk["PerformanceLevel"].asString();
if(!valueDisksDisk["BdfId"].isNull())
disksObject.bdfId = valueDisksDisk["BdfId"].asString();
if(!valueDisksDisk["SerialNumber"].isNull())
disksObject.serialNumber = valueDisksDisk["SerialNumber"].asString();
auto allOperationLocksNode = allDisksNode["OperationLocks"]["OperationLock"];
for (auto allDisksNodeOperationLocksOperationLock : allOperationLocksNode)
{

View File

@@ -73,6 +73,8 @@ void DescribeInstancesResult::parse(const std::string &payload)
instancesObject.hostName = valueInstancesInstance["HostName"].asString();
if(!valueInstancesInstance["DeploymentSetId"].isNull())
instancesObject.deploymentSetId = valueInstancesInstance["DeploymentSetId"].asString();
if(!valueInstancesInstance["DeploymentSetGroupNo"].isNull())
instancesObject.deploymentSetGroupNo = std::stoi(valueInstancesInstance["DeploymentSetGroupNo"].asString());
if(!valueInstancesInstance["Status"].isNull())
instancesObject.status = valueInstancesInstance["Status"].asString();
if(!valueInstancesInstance["SerialNumber"].isNull())

View File

@@ -49,6 +49,17 @@ void ModifyInstanceDeploymentRequest::setRegionId(const std::string& regionId)
setParameter("RegionId", regionId);
}
int ModifyInstanceDeploymentRequest::getDeploymentSetGroupNo()const
{
return deploymentSetGroupNo_;
}
void ModifyInstanceDeploymentRequest::setDeploymentSetGroupNo(int deploymentSetGroupNo)
{
deploymentSetGroupNo_ = deploymentSetGroupNo;
setParameter("DeploymentSetGroupNo", std::to_string(deploymentSetGroupNo));
}
std::string ModifyInstanceDeploymentRequest::getInstanceType()const
{
return instanceType_;

View File

@@ -170,6 +170,17 @@ void RunInstancesRequest::setPassword(const std::string& password)
setParameter("Password", password);
}
int RunInstancesRequest::getDeploymentSetGroupNo()const
{
return deploymentSetGroupNo_;
}
void RunInstancesRequest::setDeploymentSetGroupNo(int deploymentSetGroupNo)
{
deploymentSetGroupNo_ = deploymentSetGroupNo;
setParameter("DeploymentSetGroupNo", std::to_string(deploymentSetGroupNo));
}
int RunInstancesRequest::getStorageSetPartitionNumber()const
{
return storageSetPartitionNumber_;