Add ImageFamily paramters and apis, in Instance creation apis and Image query apis, and add DescribeImageFromFamily.

This commit is contained in:
sdk-team
2020-03-16 11:43:45 +08:00
parent 54883f36c2
commit 24f68932a7
47 changed files with 1592 additions and 11 deletions

View File

@@ -4011,6 +4011,42 @@ EcsClient::DescribeHpcClustersOutcomeCallable EcsClient::describeHpcClustersCall
return task->get_future();
}
EcsClient::DescribeImageFromFamilyOutcome EcsClient::describeImageFromFamily(const DescribeImageFromFamilyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeImageFromFamilyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeImageFromFamilyOutcome(DescribeImageFromFamilyResult(outcome.result()));
else
return DescribeImageFromFamilyOutcome(outcome.error());
}
void EcsClient::describeImageFromFamilyAsync(const DescribeImageFromFamilyRequest& request, const DescribeImageFromFamilyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeImageFromFamily(request), context);
};
asyncExecute(new Runnable(fn));
}
EcsClient::DescribeImageFromFamilyOutcomeCallable EcsClient::describeImageFromFamilyCallable(const DescribeImageFromFamilyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeImageFromFamilyOutcome()>>(
[this, request]()
{
return this->describeImageFromFamily(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EcsClient::DescribeImageSharePermissionOutcome EcsClient::describeImageSharePermission(const DescribeImageSharePermissionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -8835,6 +8871,42 @@ EcsClient::RebootInstanceOutcomeCallable EcsClient::rebootInstanceCallable(const
return task->get_future();
}
EcsClient::RebootInstancesOutcome EcsClient::rebootInstances(const RebootInstancesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RebootInstancesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RebootInstancesOutcome(RebootInstancesResult(outcome.result()));
else
return RebootInstancesOutcome(outcome.error());
}
void EcsClient::rebootInstancesAsync(const RebootInstancesRequest& request, const RebootInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, rebootInstances(request), context);
};
asyncExecute(new Runnable(fn));
}
EcsClient::RebootInstancesOutcomeCallable EcsClient::rebootInstancesCallable(const RebootInstancesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RebootInstancesOutcome()>>(
[this, request]()
{
return this->rebootInstances(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EcsClient::RecoverVirtualBorderRouterOutcome EcsClient::recoverVirtualBorderRouter(const RecoverVirtualBorderRouterRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -9519,6 +9591,42 @@ EcsClient::StartInstanceOutcomeCallable EcsClient::startInstanceCallable(const S
return task->get_future();
}
EcsClient::StartInstancesOutcome EcsClient::startInstances(const StartInstancesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StartInstancesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StartInstancesOutcome(StartInstancesResult(outcome.result()));
else
return StartInstancesOutcome(outcome.error());
}
void EcsClient::startInstancesAsync(const StartInstancesRequest& request, const StartInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, startInstances(request), context);
};
asyncExecute(new Runnable(fn));
}
EcsClient::StartInstancesOutcomeCallable EcsClient::startInstancesCallable(const StartInstancesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StartInstancesOutcome()>>(
[this, request]()
{
return this->startInstances(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EcsClient::StopInstanceOutcome EcsClient::stopInstance(const StopInstanceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -9555,6 +9663,42 @@ EcsClient::StopInstanceOutcomeCallable EcsClient::stopInstanceCallable(const Sto
return task->get_future();
}
EcsClient::StopInstancesOutcome EcsClient::stopInstances(const StopInstancesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StopInstancesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StopInstancesOutcome(StopInstancesResult(outcome.result()));
else
return StopInstancesOutcome(outcome.error());
}
void EcsClient::stopInstancesAsync(const StopInstancesRequest& request, const StopInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, stopInstances(request), context);
};
asyncExecute(new Runnable(fn));
}
EcsClient::StopInstancesOutcomeCallable EcsClient::stopInstancesCallable(const StopInstancesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StopInstancesOutcome()>>(
[this, request]()
{
return this->stopInstances(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EcsClient::StopInvocationOutcome EcsClient::stopInvocation(const StopInvocationRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -49,6 +49,17 @@ void CopyImageRequest::setImageId(const std::string& imageId)
setParameter("ImageId", imageId);
}
std::string CopyImageRequest::getEncryptAlgorithm()const
{
return encryptAlgorithm_;
}
void CopyImageRequest::setEncryptAlgorithm(const std::string& encryptAlgorithm)
{
encryptAlgorithm_ = encryptAlgorithm;
setParameter("EncryptAlgorithm", encryptAlgorithm);
}
std::string CopyImageRequest::getDestinationRegionId()const
{
return destinationRegionId_;

View File

@@ -60,6 +60,17 @@ void CreateDiskRequest::setClientToken(const std::string& clientToken)
setParameter("ClientToken", clientToken);
}
std::string CreateDiskRequest::getEncryptAlgorithm()const
{
return encryptAlgorithm_;
}
void CreateDiskRequest::setEncryptAlgorithm(const std::string& encryptAlgorithm)
{
encryptAlgorithm_ = encryptAlgorithm;
setParameter("EncryptAlgorithm", encryptAlgorithm);
}
std::string CreateDiskRequest::getDescription()const
{
return description_;

View File

@@ -204,6 +204,17 @@ void CreateImageRequest::setInstanceId(const std::string& instanceId)
setParameter("InstanceId", instanceId);
}
std::string CreateImageRequest::getImageFamily()const
{
return imageFamily_;
}
void CreateImageRequest::setImageFamily(const std::string& imageFamily)
{
imageFamily_ = imageFamily;
setParameter("ImageFamily", imageFamily);
}
std::string CreateImageRequest::getImageVersion()const
{
return imageVersion_;

View File

@@ -670,6 +670,7 @@ void CreateInstanceRequest::setDataDisk(const std::vector<DataDisk>& dataDisk)
setParameter(dataDiskObjStr + ".Size", std::to_string(dataDiskObj.size));
setParameter(dataDiskObjStr + ".Encrypted", dataDiskObj.encrypted ? "true" : "false");
setParameter(dataDiskObjStr + ".PerformanceLevel", dataDiskObj.performanceLevel);
setParameter(dataDiskObjStr + ".EncryptAlgorithm", dataDiskObj.encryptAlgorithm);
setParameter(dataDiskObjStr + ".Description", dataDiskObj.description);
setParameter(dataDiskObjStr + ".Category", dataDiskObj.category);
setParameter(dataDiskObjStr + ".KMSKeyId", dataDiskObj.kMSKeyId);
@@ -700,6 +701,17 @@ void CreateInstanceRequest::setSystemDiskSize(int systemDiskSize)
setParameter("SystemDiskSize", std::to_string(systemDiskSize));
}
std::string CreateInstanceRequest::getImageFamily()const
{
return imageFamily_;
}
void CreateInstanceRequest::setImageFamily(const std::string& imageFamily)
{
imageFamily_ = imageFamily;
setParameter("ImageFamily", imageFamily);
}
std::string CreateInstanceRequest::getSystemDiskDescription()const
{
return systemDiskDescription_;

View File

@@ -61,6 +61,8 @@ void DescribeAccountAttributesResult::parse(const std::string &payload)
attributeValuesObject.instanceType = allAccountAttributeItemsNodeAttributeValuesValueItem["InstanceType"].asString();
if(!allAccountAttributeItemsNodeAttributeValuesValueItem["Count"].isNull())
attributeValuesObject.count = std::stoi(allAccountAttributeItemsNodeAttributeValuesValueItem["Count"].asString());
if(!allAccountAttributeItemsNodeAttributeValuesValueItem["DiskCategory"].isNull())
attributeValuesObject.diskCategory = allAccountAttributeItemsNodeAttributeValuesValueItem["DiskCategory"].asString();
accountAttributeItemsObject.attributeValues.push_back(attributeValuesObject);
}
accountAttributeItems_.push_back(accountAttributeItemsObject);

View File

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

View File

@@ -0,0 +1,122 @@
/*
* 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/DescribeImageFromFamilyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ecs;
using namespace AlibabaCloud::Ecs::Model;
DescribeImageFromFamilyResult::DescribeImageFromFamilyResult() :
ServiceResult()
{}
DescribeImageFromFamilyResult::DescribeImageFromFamilyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeImageFromFamilyResult::~DescribeImageFromFamilyResult()
{}
void DescribeImageFromFamilyResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto imageNode = value["Image"];
if(!imageNode["Progress"].isNull())
image_.progress = imageNode["Progress"].asString();
if(!imageNode["ImageId"].isNull())
image_.imageId = imageNode["ImageId"].asString();
if(!imageNode["ImageName"].isNull())
image_.imageName = imageNode["ImageName"].asString();
if(!imageNode["ImageFamily"].isNull())
image_.imageFamily = imageNode["ImageFamily"].asString();
if(!imageNode["ImageVersion"].isNull())
image_.imageVersion = imageNode["ImageVersion"].asString();
if(!imageNode["Description"].isNull())
image_.description = imageNode["Description"].asString();
if(!imageNode["Size"].isNull())
image_.size = std::stoi(imageNode["Size"].asString());
if(!imageNode["ImageOwnerAlias"].isNull())
image_.imageOwnerAlias = imageNode["ImageOwnerAlias"].asString();
if(!imageNode["IsSupportIoOptimized"].isNull())
image_.isSupportIoOptimized = imageNode["IsSupportIoOptimized"].asString() == "true";
if(!imageNode["IsSupportCloudinit"].isNull())
image_.isSupportCloudinit = imageNode["IsSupportCloudinit"].asString() == "true";
if(!imageNode["OSName"].isNull())
image_.oSName = imageNode["OSName"].asString();
if(!imageNode["Architecture"].isNull())
image_.architecture = imageNode["Architecture"].asString();
if(!imageNode["Status"].isNull())
image_.status = imageNode["Status"].asString();
if(!imageNode["ProductCode"].isNull())
image_.productCode = imageNode["ProductCode"].asString();
if(!imageNode["IsSubscribed"].isNull())
image_.isSubscribed = imageNode["IsSubscribed"].asString() == "true";
if(!imageNode["CreationTime"].isNull())
image_.creationTime = imageNode["CreationTime"].asString();
if(!imageNode["IsSelfShared"].isNull())
image_.isSelfShared = imageNode["IsSelfShared"].asString();
if(!imageNode["OSType"].isNull())
image_.oSType = imageNode["OSType"].asString();
if(!imageNode["Platform"].isNull())
image_.platform = imageNode["Platform"].asString();
if(!imageNode["Usage"].isNull())
image_.usage = imageNode["Usage"].asString();
if(!imageNode["IsCopied"].isNull())
image_.isCopied = imageNode["IsCopied"].asString() == "true";
auto allDiskDeviceMappingsNode = imageNode["DiskDeviceMappings"]["DiskDeviceMapping"];
for (auto imageNodeDiskDeviceMappingsDiskDeviceMapping : allDiskDeviceMappingsNode)
{
Image::DiskDeviceMapping diskDeviceMappingObject;
if(!imageNodeDiskDeviceMappingsDiskDeviceMapping["SnapshotId"].isNull())
diskDeviceMappingObject.snapshotId = imageNodeDiskDeviceMappingsDiskDeviceMapping["SnapshotId"].asString();
if(!imageNodeDiskDeviceMappingsDiskDeviceMapping["Size"].isNull())
diskDeviceMappingObject.size = imageNodeDiskDeviceMappingsDiskDeviceMapping["Size"].asString();
if(!imageNodeDiskDeviceMappingsDiskDeviceMapping["Device"].isNull())
diskDeviceMappingObject.device = imageNodeDiskDeviceMappingsDiskDeviceMapping["Device"].asString();
if(!imageNodeDiskDeviceMappingsDiskDeviceMapping["Type"].isNull())
diskDeviceMappingObject.type = imageNodeDiskDeviceMappingsDiskDeviceMapping["Type"].asString();
if(!imageNodeDiskDeviceMappingsDiskDeviceMapping["Format"].isNull())
diskDeviceMappingObject.format = imageNodeDiskDeviceMappingsDiskDeviceMapping["Format"].asString();
if(!imageNodeDiskDeviceMappingsDiskDeviceMapping["ImportOSSBucket"].isNull())
diskDeviceMappingObject.importOSSBucket = imageNodeDiskDeviceMappingsDiskDeviceMapping["ImportOSSBucket"].asString();
if(!imageNodeDiskDeviceMappingsDiskDeviceMapping["ImportOSSObject"].isNull())
diskDeviceMappingObject.importOSSObject = imageNodeDiskDeviceMappingsDiskDeviceMapping["ImportOSSObject"].asString();
image_.diskDeviceMappings.push_back(diskDeviceMappingObject);
}
auto allTagsNode = imageNode["Tags"]["Tag"];
for (auto imageNodeTagsTag : allTagsNode)
{
Image::Tag tagObject;
if(!imageNodeTagsTag["TagKey"].isNull())
tagObject.tagKey = imageNodeTagsTag["TagKey"].asString();
if(!imageNodeTagsTag["TagValue"].isNull())
tagObject.tagValue = imageNodeTagsTag["TagValue"].asString();
image_.tags.push_back(tagObject);
}
}
DescribeImageFromFamilyResult::Image DescribeImageFromFamilyResult::getImage()const
{
return image_;
}

View File

@@ -290,6 +290,17 @@ void DescribeImagesRequest::setFilter(const std::vector<Filter>& filter)
}
}
std::string DescribeImagesRequest::getImageFamily()const
{
return imageFamily_;
}
void DescribeImagesRequest::setImageFamily(const std::string& imageFamily)
{
imageFamily_ = imageFamily;
setParameter("ImageFamily", imageFamily);
}
std::string DescribeImagesRequest::getStatus()const
{
return status_;

View File

@@ -49,6 +49,8 @@ void DescribeImagesResult::parse(const std::string &payload)
imagesObject.imageId = valueImagesImage["ImageId"].asString();
if(!valueImagesImage["ImageName"].isNull())
imagesObject.imageName = valueImagesImage["ImageName"].asString();
if(!valueImagesImage["ImageFamily"].isNull())
imagesObject.imageFamily = valueImagesImage["ImageFamily"].asString();
if(!valueImagesImage["ImageVersion"].isNull())
imagesObject.imageVersion = valueImagesImage["ImageVersion"].asString();
if(!valueImagesImage["Description"].isNull())

View File

@@ -115,6 +115,19 @@ void DescribeInstanceStatusRequest::setOwnerId(long ownerId)
setParameter("OwnerId", std::to_string(ownerId));
}
std::vector<std::string> DescribeInstanceStatusRequest::getInstanceId()const
{
return instanceId_;
}
void DescribeInstanceStatusRequest::setInstanceId(const std::vector<std::string>& instanceId)
{
instanceId_ = instanceId;
for(int dep1 = 0; dep1!= instanceId.size(); dep1++) {
setParameter("InstanceId."+ std::to_string(dep1), instanceId.at(dep1));
}
}
std::string DescribeInstanceStatusRequest::getZoneId()const
{
return zoneId_;

View File

@@ -75,6 +75,8 @@ void DescribeNetworkInterfacesResult::parse(const std::string &payload)
networkInterfaceSetsObject.serviceManaged = valueNetworkInterfaceSetsNetworkInterfaceSet["ServiceManaged"].asString() == "true";
if(!valueNetworkInterfaceSetsNetworkInterfaceSet["QueueNumber"].isNull())
networkInterfaceSetsObject.queueNumber = std::stoi(valueNetworkInterfaceSetsNetworkInterfaceSet["QueueNumber"].asString());
if(!valueNetworkInterfaceSetsNetworkInterfaceSet["OwnerId"].isNull())
networkInterfaceSetsObject.ownerId = valueNetworkInterfaceSetsNetworkInterfaceSet["OwnerId"].asString();
auto allPrivateIpSetsNode = allNetworkInterfaceSetsNode["PrivateIpSets"]["PrivateIpSet"];
for (auto allNetworkInterfaceSetsNodePrivateIpSetsPrivateIpSet : allPrivateIpSetsNode)
{

View File

@@ -83,6 +83,8 @@ void DescribeSnapshotsResult::parse(const std::string &payload)
snapshotsObject.kMSKeyId = valueSnapshotsSnapshot["KMSKeyId"].asString();
if(!valueSnapshotsSnapshot["Category"].isNull())
snapshotsObject.category = valueSnapshotsSnapshot["Category"].asString();
if(!valueSnapshotsSnapshot["SnapshotType"].isNull())
snapshotsObject.snapshotType = valueSnapshotsSnapshot["SnapshotType"].asString();
auto allTagsNode = allSnapshotsNode["Tags"]["Tag"];
for (auto allSnapshotsNodeTagsTag : allTagsNode)
{

View File

@@ -49,6 +49,17 @@ void ImportKeyPairRequest::setKeyPairName(const std::string& keyPairName)
setParameter("KeyPairName", keyPairName);
}
std::string ImportKeyPairRequest::getResourceGroupId()const
{
return resourceGroupId_;
}
void ImportKeyPairRequest::setResourceGroupId(const std::string& resourceGroupId)
{
resourceGroupId_ = resourceGroupId;
setParameter("ResourceGroupId", resourceGroupId);
}
std::string ImportKeyPairRequest::getRegionId()const
{
return regionId_;
@@ -60,6 +71,22 @@ void ImportKeyPairRequest::setRegionId(const std::string& regionId)
setParameter("RegionId", regionId);
}
std::vector<ImportKeyPairRequest::Tag> ImportKeyPairRequest::getTag()const
{
return tag_;
}
void ImportKeyPairRequest::setTag(const std::vector<Tag>& tag)
{
tag_ = tag;
for(int dep1 = 0; dep1!= tag.size(); dep1++) {
auto tagObj = tag.at(dep1);
std::string tagObjStr = "Tag." + std::to_string(dep1 + 1);
setParameter(tagObjStr + ".Value", tagObj.value);
setParameter(tagObjStr + ".Key", tagObj.key);
}
}
std::string ImportKeyPairRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;

View File

@@ -115,3 +115,14 @@ void ModifyImageAttributeRequest::setOwnerId(long ownerId)
setParameter("OwnerId", std::to_string(ownerId));
}
std::string ModifyImageAttributeRequest::getStatus()const
{
return status_;
}
void ModifyImageAttributeRequest::setStatus(const std::string& status)
{
status_ = status;
setParameter("Status", status);
}

View File

@@ -0,0 +1,119 @@
/*
* 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/RebootInstancesRequest.h>
using AlibabaCloud::Ecs::Model::RebootInstancesRequest;
RebootInstancesRequest::RebootInstancesRequest() :
RpcServiceRequest("ecs", "2014-05-26", "RebootInstances")
{
setMethod(HttpRequest::Method::Post);
}
RebootInstancesRequest::~RebootInstancesRequest()
{}
long RebootInstancesRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void RebootInstancesRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string RebootInstancesRequest::getRegionId()const
{
return regionId_;
}
void RebootInstancesRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
bool RebootInstancesRequest::getDryRun()const
{
return dryRun_;
}
void RebootInstancesRequest::setDryRun(bool dryRun)
{
dryRun_ = dryRun;
setParameter("DryRun", dryRun ? "true" : "false");
}
std::string RebootInstancesRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void RebootInstancesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string RebootInstancesRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void RebootInstancesRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long RebootInstancesRequest::getOwnerId()const
{
return ownerId_;
}
void RebootInstancesRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
bool RebootInstancesRequest::getForceReboot()const
{
return forceReboot_;
}
void RebootInstancesRequest::setForceReboot(bool forceReboot)
{
forceReboot_ = forceReboot;
setParameter("ForceReboot", forceReboot ? "true" : "false");
}
std::vector<std::string> RebootInstancesRequest::getInstanceId()const
{
return instanceId_;
}
void RebootInstancesRequest::setInstanceId(const std::vector<std::string>& instanceId)
{
instanceId_ = instanceId;
for(int dep1 = 0; dep1!= instanceId.size(); dep1++) {
setParameter("InstanceId."+ std::to_string(dep1), instanceId.at(dep1));
}
}

View File

@@ -0,0 +1,44 @@
/*
* 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/RebootInstancesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ecs;
using namespace AlibabaCloud::Ecs::Model;
RebootInstancesResult::RebootInstancesResult() :
ServiceResult()
{}
RebootInstancesResult::RebootInstancesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RebootInstancesResult::~RebootInstancesResult()
{}
void RebootInstancesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -784,6 +784,7 @@ void RunInstancesRequest::setDataDisk(const std::vector<DataDisk>& dataDisk)
setParameter(dataDiskObjStr + ".DeleteWithInstance", dataDiskObj.deleteWithInstance ? "true" : "false");
setParameter(dataDiskObjStr + ".PerformanceLevel", dataDiskObj.performanceLevel);
setParameter(dataDiskObjStr + ".AutoSnapshotPolicyId", dataDiskObj.autoSnapshotPolicyId);
setParameter(dataDiskObjStr + ".EncryptAlgorithm", dataDiskObj.encryptAlgorithm);
}
}
@@ -820,6 +821,17 @@ void RunInstancesRequest::setSystemDiskSize(const std::string& systemDiskSize)
setParameter("SystemDiskSize", systemDiskSize);
}
std::string RunInstancesRequest::getImageFamily()const
{
return imageFamily_;
}
void RunInstancesRequest::setImageFamily(const std::string& imageFamily)
{
imageFamily_ = imageFamily;
setParameter("ImageFamily", imageFamily);
}
std::string RunInstancesRequest::getSystemDiskDescription()const
{
return systemDiskDescription_;

View File

@@ -0,0 +1,108 @@
/*
* 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/StartInstancesRequest.h>
using AlibabaCloud::Ecs::Model::StartInstancesRequest;
StartInstancesRequest::StartInstancesRequest() :
RpcServiceRequest("ecs", "2014-05-26", "StartInstances")
{
setMethod(HttpRequest::Method::Post);
}
StartInstancesRequest::~StartInstancesRequest()
{}
long StartInstancesRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void StartInstancesRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string StartInstancesRequest::getRegionId()const
{
return regionId_;
}
void StartInstancesRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
bool StartInstancesRequest::getDryRun()const
{
return dryRun_;
}
void StartInstancesRequest::setDryRun(bool dryRun)
{
dryRun_ = dryRun;
setParameter("DryRun", dryRun ? "true" : "false");
}
std::string StartInstancesRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void StartInstancesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string StartInstancesRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void StartInstancesRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long StartInstancesRequest::getOwnerId()const
{
return ownerId_;
}
void StartInstancesRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::vector<std::string> StartInstancesRequest::getInstanceId()const
{
return instanceId_;
}
void StartInstancesRequest::setInstanceId(const std::vector<std::string>& instanceId)
{
instanceId_ = instanceId;
for(int dep1 = 0; dep1!= instanceId.size(); dep1++) {
setParameter("InstanceId."+ std::to_string(dep1), instanceId.at(dep1));
}
}

View File

@@ -0,0 +1,44 @@
/*
* 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/StartInstancesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ecs;
using namespace AlibabaCloud::Ecs::Model;
StartInstancesResult::StartInstancesResult() :
ServiceResult()
{}
StartInstancesResult::StartInstancesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
StartInstancesResult::~StartInstancesResult()
{}
void StartInstancesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,130 @@
/*
* 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/StopInstancesRequest.h>
using AlibabaCloud::Ecs::Model::StopInstancesRequest;
StopInstancesRequest::StopInstancesRequest() :
RpcServiceRequest("ecs", "2014-05-26", "StopInstances")
{
setMethod(HttpRequest::Method::Post);
}
StopInstancesRequest::~StopInstancesRequest()
{}
long StopInstancesRequest::getResourceOwnerId()const
{
return resourceOwnerId_;
}
void StopInstancesRequest::setResourceOwnerId(long resourceOwnerId)
{
resourceOwnerId_ = resourceOwnerId;
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
}
std::string StopInstancesRequest::getStoppedMode()const
{
return stoppedMode_;
}
void StopInstancesRequest::setStoppedMode(const std::string& stoppedMode)
{
stoppedMode_ = stoppedMode;
setParameter("StoppedMode", stoppedMode);
}
bool StopInstancesRequest::getForceStop()const
{
return forceStop_;
}
void StopInstancesRequest::setForceStop(bool forceStop)
{
forceStop_ = forceStop;
setParameter("ForceStop", forceStop ? "true" : "false");
}
std::string StopInstancesRequest::getRegionId()const
{
return regionId_;
}
void StopInstancesRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
bool StopInstancesRequest::getDryRun()const
{
return dryRun_;
}
void StopInstancesRequest::setDryRun(bool dryRun)
{
dryRun_ = dryRun;
setParameter("DryRun", dryRun ? "true" : "false");
}
std::string StopInstancesRequest::getResourceOwnerAccount()const
{
return resourceOwnerAccount_;
}
void StopInstancesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
{
resourceOwnerAccount_ = resourceOwnerAccount;
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
}
std::string StopInstancesRequest::getOwnerAccount()const
{
return ownerAccount_;
}
void StopInstancesRequest::setOwnerAccount(const std::string& ownerAccount)
{
ownerAccount_ = ownerAccount;
setParameter("OwnerAccount", ownerAccount);
}
long StopInstancesRequest::getOwnerId()const
{
return ownerId_;
}
void StopInstancesRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}
std::vector<std::string> StopInstancesRequest::getInstanceId()const
{
return instanceId_;
}
void StopInstancesRequest::setInstanceId(const std::vector<std::string>& instanceId)
{
instanceId_ = instanceId;
for(int dep1 = 0; dep1!= instanceId.size(); dep1++) {
setParameter("InstanceId."+ std::to_string(dep1), instanceId.at(dep1));
}
}

View File

@@ -0,0 +1,44 @@
/*
* 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/StopInstancesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Ecs;
using namespace AlibabaCloud::Ecs::Model;
StopInstancesResult::StopInstancesResult() :
ServiceResult()
{}
StopInstancesResult::StopInstancesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
StopInstancesResult::~StopInstancesResult()
{}
void StopInstancesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}