Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a74578464 |
@@ -1,3 +1,6 @@
|
||||
2019-09-23 Version 1.36.142
|
||||
- Add param, DescribePrice supprot ReservedInstance.
|
||||
|
||||
2019-09-19 Version 1.36.141
|
||||
- Supported Video Abstract for IMM.
|
||||
|
||||
|
||||
@@ -541,6 +541,8 @@ set(ecs_public_header_model
|
||||
include/alibabacloud/ecs/model/RevokeSecurityGroupResult.h
|
||||
include/alibabacloud/ecs/model/RevokeSecurityGroupEgressRequest.h
|
||||
include/alibabacloud/ecs/model/RevokeSecurityGroupEgressResult.h
|
||||
include/alibabacloud/ecs/model/RunCommandRequest.h
|
||||
include/alibabacloud/ecs/model/RunCommandResult.h
|
||||
include/alibabacloud/ecs/model/RunInstancesRequest.h
|
||||
include/alibabacloud/ecs/model/RunInstancesResult.h
|
||||
include/alibabacloud/ecs/model/StartInstanceRequest.h
|
||||
@@ -1088,6 +1090,8 @@ set(ecs_src
|
||||
src/model/RevokeSecurityGroupResult.cc
|
||||
src/model/RevokeSecurityGroupEgressRequest.cc
|
||||
src/model/RevokeSecurityGroupEgressResult.cc
|
||||
src/model/RunCommandRequest.cc
|
||||
src/model/RunCommandResult.cc
|
||||
src/model/RunInstancesRequest.cc
|
||||
src/model/RunInstancesResult.cc
|
||||
src/model/StartInstanceRequest.cc
|
||||
|
||||
@@ -542,6 +542,8 @@
|
||||
#include "model/RevokeSecurityGroupResult.h"
|
||||
#include "model/RevokeSecurityGroupEgressRequest.h"
|
||||
#include "model/RevokeSecurityGroupEgressResult.h"
|
||||
#include "model/RunCommandRequest.h"
|
||||
#include "model/RunCommandResult.h"
|
||||
#include "model/RunInstancesRequest.h"
|
||||
#include "model/RunInstancesResult.h"
|
||||
#include "model/StartInstanceRequest.h"
|
||||
@@ -1355,6 +1357,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::RevokeSecurityGroupEgressResult> RevokeSecurityGroupEgressOutcome;
|
||||
typedef std::future<RevokeSecurityGroupEgressOutcome> RevokeSecurityGroupEgressOutcomeCallable;
|
||||
typedef std::function<void(const EcsClient*, const Model::RevokeSecurityGroupEgressRequest&, const RevokeSecurityGroupEgressOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RevokeSecurityGroupEgressAsyncHandler;
|
||||
typedef Outcome<Error, Model::RunCommandResult> RunCommandOutcome;
|
||||
typedef std::future<RunCommandOutcome> RunCommandOutcomeCallable;
|
||||
typedef std::function<void(const EcsClient*, const Model::RunCommandRequest&, const RunCommandOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RunCommandAsyncHandler;
|
||||
typedef Outcome<Error, Model::RunInstancesResult> RunInstancesOutcome;
|
||||
typedef std::future<RunInstancesOutcome> RunInstancesOutcomeCallable;
|
||||
typedef std::function<void(const EcsClient*, const Model::RunInstancesRequest&, const RunInstancesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RunInstancesAsyncHandler;
|
||||
@@ -2176,6 +2181,9 @@ namespace AlibabaCloud
|
||||
RevokeSecurityGroupEgressOutcome revokeSecurityGroupEgress(const Model::RevokeSecurityGroupEgressRequest &request)const;
|
||||
void revokeSecurityGroupEgressAsync(const Model::RevokeSecurityGroupEgressRequest& request, const RevokeSecurityGroupEgressAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RevokeSecurityGroupEgressOutcomeCallable revokeSecurityGroupEgressCallable(const Model::RevokeSecurityGroupEgressRequest& request) const;
|
||||
RunCommandOutcome runCommand(const Model::RunCommandRequest &request)const;
|
||||
void runCommandAsync(const Model::RunCommandRequest& request, const RunCommandAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RunCommandOutcomeCallable runCommandCallable(const Model::RunCommandRequest& request) const;
|
||||
RunInstancesOutcome runInstances(const Model::RunInstancesRequest &request)const;
|
||||
void runInstancesAsync(const Model::RunInstancesRequest& request, const RunInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RunInstancesOutcomeCallable runInstancesCallable(const Model::RunInstancesRequest& request) const;
|
||||
|
||||
@@ -47,6 +47,8 @@ namespace AlibabaCloud
|
||||
void setPageNumber(long pageNumber);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getContentEncoding()const;
|
||||
void setContentEncoding(const std::string& contentEncoding);
|
||||
long getPageSize()const;
|
||||
void setPageSize(long pageSize);
|
||||
std::string getResourceOwnerAccount()const;
|
||||
@@ -65,6 +67,7 @@ namespace AlibabaCloud
|
||||
std::string commandId_;
|
||||
long pageNumber_;
|
||||
std::string regionId_;
|
||||
std::string contentEncoding_;
|
||||
long pageSize_;
|
||||
std::string resourceOwnerAccount_;
|
||||
std::string ownerAccount_;
|
||||
|
||||
@@ -45,6 +45,8 @@ namespace AlibabaCloud
|
||||
void setPageNumber(long pageNumber);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getContentEncoding()const;
|
||||
void setContentEncoding(const std::string& contentEncoding);
|
||||
long getPageSize()const;
|
||||
void setPageSize(long pageSize);
|
||||
std::string getInvokeId()const;
|
||||
@@ -70,6 +72,7 @@ namespace AlibabaCloud
|
||||
std::string commandId_;
|
||||
long pageNumber_;
|
||||
std::string regionId_;
|
||||
std::string contentEncoding_;
|
||||
long pageSize_;
|
||||
std::string invokeId_;
|
||||
bool timed_;
|
||||
|
||||
@@ -55,6 +55,8 @@ namespace AlibabaCloud
|
||||
void setInternetChargeType(const std::string& internetChargeType);
|
||||
std::string getInstanceNetworkType()const;
|
||||
void setInstanceNetworkType(const std::string& instanceNetworkType);
|
||||
int getInstanceAmount()const;
|
||||
void setInstanceAmount(int instanceAmount);
|
||||
std::string getDataDisk3PerformanceLevel()const;
|
||||
void setDataDisk3PerformanceLevel(const std::string& dataDisk3PerformanceLevel);
|
||||
std::string getImageId()const;
|
||||
@@ -65,6 +67,8 @@ namespace AlibabaCloud
|
||||
void setInternetMaxBandwidthOut(int internetMaxBandwidthOut);
|
||||
std::string getSystemDiskCategory()const;
|
||||
void setSystemDiskCategory(const std::string& systemDiskCategory);
|
||||
std::string getPlatform()const;
|
||||
void setPlatform(const std::string& platform);
|
||||
std::string getSystemDiskPerformanceLevel()const;
|
||||
void setSystemDiskPerformanceLevel(const std::string& systemDiskPerformanceLevel);
|
||||
std::string getDataDisk4Category()const;
|
||||
@@ -73,6 +77,8 @@ namespace AlibabaCloud
|
||||
void setDataDisk4PerformanceLevel(const std::string& dataDisk4PerformanceLevel);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getScope()const;
|
||||
void setScope(const std::string& scope);
|
||||
std::string getInstanceType()const;
|
||||
void setInstanceType(const std::string& instanceType);
|
||||
std::string getDataDisk2Category()const;
|
||||
@@ -95,6 +101,8 @@ namespace AlibabaCloud
|
||||
void setDataDisk2PerformanceLevel(const std::string& dataDisk2PerformanceLevel);
|
||||
int getSystemDiskSize()const;
|
||||
void setSystemDiskSize(int systemDiskSize);
|
||||
std::string getOfferingType()const;
|
||||
void setOfferingType(const std::string& offeringType);
|
||||
|
||||
private:
|
||||
int dataDisk3Size_;
|
||||
@@ -107,15 +115,18 @@ namespace AlibabaCloud
|
||||
long ownerId_;
|
||||
std::string internetChargeType_;
|
||||
std::string instanceNetworkType_;
|
||||
int instanceAmount_;
|
||||
std::string dataDisk3PerformanceLevel_;
|
||||
std::string imageId_;
|
||||
std::string ioOptimized_;
|
||||
int internetMaxBandwidthOut_;
|
||||
std::string systemDiskCategory_;
|
||||
std::string platform_;
|
||||
std::string systemDiskPerformanceLevel_;
|
||||
std::string dataDisk4Category_;
|
||||
std::string dataDisk4PerformanceLevel_;
|
||||
std::string regionId_;
|
||||
std::string scope_;
|
||||
std::string instanceType_;
|
||||
std::string dataDisk2Category_;
|
||||
int dataDisk1Size_;
|
||||
@@ -127,6 +138,7 @@ namespace AlibabaCloud
|
||||
std::string dataDisk1Category_;
|
||||
std::string dataDisk2PerformanceLevel_;
|
||||
int systemDiskSize_;
|
||||
std::string offeringType_;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace AlibabaCloud
|
||||
float tradePrice;
|
||||
};
|
||||
float originalPrice;
|
||||
float reservedInstanceHourPrice;
|
||||
float discountPrice;
|
||||
std::string currency;
|
||||
std::vector<ResourcePriceModel> detailInfos;
|
||||
|
||||
99
ecs/include/alibabacloud/ecs/model/RunCommandRequest.h
Normal file
99
ecs/include/alibabacloud/ecs/model/RunCommandRequest.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ECS_MODEL_RUNCOMMANDREQUEST_H_
|
||||
#define ALIBABACLOUD_ECS_MODEL_RUNCOMMANDREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ecs/EcsExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ecs
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ECS_EXPORT RunCommandRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RunCommandRequest();
|
||||
~RunCommandRequest();
|
||||
|
||||
long getResourceOwnerId()const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getWorkingDir()const;
|
||||
void setWorkingDir(const std::string& workingDir);
|
||||
std::string getDescription()const;
|
||||
void setDescription(const std::string& description);
|
||||
std::string getType()const;
|
||||
void setType(const std::string& type);
|
||||
std::string getCommandContent()const;
|
||||
void setCommandContent(const std::string& commandContent);
|
||||
long getTimeout()const;
|
||||
void setTimeout(long timeout);
|
||||
std::string getFrequency()const;
|
||||
void setFrequency(const std::string& frequency);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getContentEncoding()const;
|
||||
void setContentEncoding(const std::string& contentEncoding);
|
||||
bool getKeepCommand()const;
|
||||
void setKeepCommand(bool keepCommand);
|
||||
bool getTimed()const;
|
||||
void setTimed(bool timed);
|
||||
std::string getResourceOwnerAccount()const;
|
||||
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
|
||||
std::string getOwnerAccount()const;
|
||||
void setOwnerAccount(const std::string& ownerAccount);
|
||||
long getOwnerId()const;
|
||||
void setOwnerId(long ownerId);
|
||||
std::vector<std::string> getInstanceId()const;
|
||||
void setInstanceId(const std::vector<std::string>& instanceId);
|
||||
std::string getName()const;
|
||||
void setName(const std::string& name);
|
||||
std::map<std::string, std::string> getParameters()const;
|
||||
void setParameters(const std::map<std::string, std::string>& parameters);
|
||||
bool getEnableParameter()const;
|
||||
void setEnableParameter(bool enableParameter);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string workingDir_;
|
||||
std::string description_;
|
||||
std::string type_;
|
||||
std::string commandContent_;
|
||||
long timeout_;
|
||||
std::string frequency_;
|
||||
std::string regionId_;
|
||||
std::string contentEncoding_;
|
||||
bool keepCommand_;
|
||||
bool timed_;
|
||||
std::string resourceOwnerAccount_;
|
||||
std::string ownerAccount_;
|
||||
long ownerId_;
|
||||
std::vector<std::string> instanceId_;
|
||||
std::string name_;
|
||||
std::map<std::string, std::string> parameters_;
|
||||
bool enableParameter_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ECS_MODEL_RUNCOMMANDREQUEST_H_
|
||||
53
ecs/include/alibabacloud/ecs/model/RunCommandResult.h
Normal file
53
ecs/include/alibabacloud/ecs/model/RunCommandResult.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ECS_MODEL_RUNCOMMANDRESULT_H_
|
||||
#define ALIBABACLOUD_ECS_MODEL_RUNCOMMANDRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ecs/EcsExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ecs
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ECS_EXPORT RunCommandResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
RunCommandResult();
|
||||
explicit RunCommandResult(const std::string &payload);
|
||||
~RunCommandResult();
|
||||
std::string getCommandId()const;
|
||||
std::string getInvokeId()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string commandId_;
|
||||
std::string invokeId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ECS_MODEL_RUNCOMMANDRESULT_H_
|
||||
@@ -9411,6 +9411,42 @@ EcsClient::RevokeSecurityGroupEgressOutcomeCallable EcsClient::revokeSecurityGro
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EcsClient::RunCommandOutcome EcsClient::runCommand(const RunCommandRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RunCommandOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RunCommandOutcome(RunCommandResult(outcome.result()));
|
||||
else
|
||||
return RunCommandOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void EcsClient::runCommandAsync(const RunCommandRequest& request, const RunCommandAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, runCommand(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
EcsClient::RunCommandOutcomeCallable EcsClient::runCommandCallable(const RunCommandRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RunCommandOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->runCommand(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EcsClient::RunInstancesOutcome EcsClient::runInstances(const RunInstancesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -91,6 +91,17 @@ void DescribeCommandsRequest::setRegionId(const std::string& regionId)
|
||||
setCoreParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string DescribeCommandsRequest::getContentEncoding()const
|
||||
{
|
||||
return contentEncoding_;
|
||||
}
|
||||
|
||||
void DescribeCommandsRequest::setContentEncoding(const std::string& contentEncoding)
|
||||
{
|
||||
contentEncoding_ = contentEncoding;
|
||||
setCoreParameter("ContentEncoding", contentEncoding);
|
||||
}
|
||||
|
||||
long DescribeCommandsRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
|
||||
@@ -80,6 +80,17 @@ void DescribeInvocationsRequest::setRegionId(const std::string& regionId)
|
||||
setCoreParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string DescribeInvocationsRequest::getContentEncoding()const
|
||||
{
|
||||
return contentEncoding_;
|
||||
}
|
||||
|
||||
void DescribeInvocationsRequest::setContentEncoding(const std::string& contentEncoding)
|
||||
{
|
||||
contentEncoding_ = contentEncoding;
|
||||
setCoreParameter("ContentEncoding", contentEncoding);
|
||||
}
|
||||
|
||||
long DescribeInvocationsRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
|
||||
@@ -135,6 +135,17 @@ void DescribePriceRequest::setInstanceNetworkType(const std::string& instanceNet
|
||||
setCoreParameter("InstanceNetworkType", instanceNetworkType);
|
||||
}
|
||||
|
||||
int DescribePriceRequest::getInstanceAmount()const
|
||||
{
|
||||
return instanceAmount_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setInstanceAmount(int instanceAmount)
|
||||
{
|
||||
instanceAmount_ = instanceAmount;
|
||||
setCoreParameter("InstanceAmount", std::to_string(instanceAmount));
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getDataDisk3PerformanceLevel()const
|
||||
{
|
||||
return dataDisk3PerformanceLevel_;
|
||||
@@ -190,6 +201,17 @@ void DescribePriceRequest::setSystemDiskCategory(const std::string& systemDiskCa
|
||||
setCoreParameter("SystemDiskCategory", systemDiskCategory);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getPlatform()const
|
||||
{
|
||||
return platform_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setPlatform(const std::string& platform)
|
||||
{
|
||||
platform_ = platform;
|
||||
setCoreParameter("Platform", platform);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getSystemDiskPerformanceLevel()const
|
||||
{
|
||||
return systemDiskPerformanceLevel_;
|
||||
@@ -234,6 +256,17 @@ void DescribePriceRequest::setRegionId(const std::string& regionId)
|
||||
setCoreParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getScope()const
|
||||
{
|
||||
return scope_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setScope(const std::string& scope)
|
||||
{
|
||||
scope_ = scope;
|
||||
setCoreParameter("Scope", scope);
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getInstanceType()const
|
||||
{
|
||||
return instanceType_;
|
||||
@@ -355,3 +388,14 @@ void DescribePriceRequest::setSystemDiskSize(int systemDiskSize)
|
||||
setCoreParameter("SystemDiskSize", std::to_string(systemDiskSize));
|
||||
}
|
||||
|
||||
std::string DescribePriceRequest::getOfferingType()const
|
||||
{
|
||||
return offeringType_;
|
||||
}
|
||||
|
||||
void DescribePriceRequest::setOfferingType(const std::string& offeringType)
|
||||
{
|
||||
offeringType_ = offeringType;
|
||||
setCoreParameter("OfferingType", offeringType);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,8 @@ void DescribePriceResult::parse(const std::string &payload)
|
||||
priceInfo_.price.discountPrice = std::stof(priceNode["DiscountPrice"].asString());
|
||||
if(!priceNode["TradePrice"].isNull())
|
||||
priceInfo_.price.tradePrice = std::stof(priceNode["TradePrice"].asString());
|
||||
if(!priceNode["ReservedInstanceHourPrice"].isNull())
|
||||
priceInfo_.price.reservedInstanceHourPrice = std::stof(priceNode["ReservedInstanceHourPrice"].asString());
|
||||
if(!priceNode["Currency"].isNull())
|
||||
priceInfo_.price.currency = priceNode["Currency"].asString();
|
||||
auto allDetailInfosNode = priceNode["DetailInfos"]["ResourcePriceModel"];
|
||||
|
||||
226
ecs/src/model/RunCommandRequest.cc
Normal file
226
ecs/src/model/RunCommandRequest.cc
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* 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/RunCommandRequest.h>
|
||||
|
||||
using AlibabaCloud::Ecs::Model::RunCommandRequest;
|
||||
|
||||
RunCommandRequest::RunCommandRequest() :
|
||||
RpcServiceRequest("ecs", "2014-05-26", "RunCommand")
|
||||
{}
|
||||
|
||||
RunCommandRequest::~RunCommandRequest()
|
||||
{}
|
||||
|
||||
long RunCommandRequest::getResourceOwnerId()const
|
||||
{
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setResourceOwnerId(long resourceOwnerId)
|
||||
{
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setCoreParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getWorkingDir()const
|
||||
{
|
||||
return workingDir_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setWorkingDir(const std::string& workingDir)
|
||||
{
|
||||
workingDir_ = workingDir;
|
||||
setCoreParameter("WorkingDir", workingDir);
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getDescription()const
|
||||
{
|
||||
return description_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setDescription(const std::string& description)
|
||||
{
|
||||
description_ = description;
|
||||
setCoreParameter("Description", description);
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getType()const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setType(const std::string& type)
|
||||
{
|
||||
type_ = type;
|
||||
setCoreParameter("Type", type);
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getCommandContent()const
|
||||
{
|
||||
return commandContent_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setCommandContent(const std::string& commandContent)
|
||||
{
|
||||
commandContent_ = commandContent;
|
||||
setCoreParameter("CommandContent", commandContent);
|
||||
}
|
||||
|
||||
long RunCommandRequest::getTimeout()const
|
||||
{
|
||||
return timeout_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setTimeout(long timeout)
|
||||
{
|
||||
timeout_ = timeout;
|
||||
setCoreParameter("Timeout", std::to_string(timeout));
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getFrequency()const
|
||||
{
|
||||
return frequency_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setFrequency(const std::string& frequency)
|
||||
{
|
||||
frequency_ = frequency;
|
||||
setCoreParameter("Frequency", frequency);
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setCoreParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getContentEncoding()const
|
||||
{
|
||||
return contentEncoding_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setContentEncoding(const std::string& contentEncoding)
|
||||
{
|
||||
contentEncoding_ = contentEncoding;
|
||||
setCoreParameter("ContentEncoding", contentEncoding);
|
||||
}
|
||||
|
||||
bool RunCommandRequest::getKeepCommand()const
|
||||
{
|
||||
return keepCommand_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setKeepCommand(bool keepCommand)
|
||||
{
|
||||
keepCommand_ = keepCommand;
|
||||
setCoreParameter("KeepCommand", keepCommand ? "true" : "false");
|
||||
}
|
||||
|
||||
bool RunCommandRequest::getTimed()const
|
||||
{
|
||||
return timed_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setTimed(bool timed)
|
||||
{
|
||||
timed_ = timed;
|
||||
setCoreParameter("Timed", timed ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getResourceOwnerAccount()const
|
||||
{
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
|
||||
{
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setCoreParameter("ResourceOwnerAccount", resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getOwnerAccount()const
|
||||
{
|
||||
return ownerAccount_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setOwnerAccount(const std::string& ownerAccount)
|
||||
{
|
||||
ownerAccount_ = ownerAccount;
|
||||
setCoreParameter("OwnerAccount", ownerAccount);
|
||||
}
|
||||
|
||||
long RunCommandRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setOwnerId(long ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setCoreParameter("OwnerId", std::to_string(ownerId));
|
||||
}
|
||||
|
||||
std::vector<std::string> RunCommandRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setInstanceId(const std::vector<std::string>& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
for(int i = 0; i!= instanceId.size(); i++)
|
||||
setCoreParameter("InstanceId."+ std::to_string(i), instanceId.at(i));
|
||||
}
|
||||
|
||||
std::string RunCommandRequest::getName()const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setName(const std::string& name)
|
||||
{
|
||||
name_ = name;
|
||||
setCoreParameter("Name", name);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> RunCommandRequest::getParameters()const
|
||||
{
|
||||
return parameters_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setParameters(const std::map<std::string, std::string>& parameters)
|
||||
{
|
||||
parameters_ = parameters;
|
||||
setJsonParameters("Parameters", parameters);
|
||||
}
|
||||
|
||||
bool RunCommandRequest::getEnableParameter()const
|
||||
{
|
||||
return enableParameter_;
|
||||
}
|
||||
|
||||
void RunCommandRequest::setEnableParameter(bool enableParameter)
|
||||
{
|
||||
enableParameter_ = enableParameter;
|
||||
setCoreParameter("EnableParameter", enableParameter ? "true" : "false");
|
||||
}
|
||||
|
||||
58
ecs/src/model/RunCommandResult.cc
Normal file
58
ecs/src/model/RunCommandResult.cc
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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/RunCommandResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ecs;
|
||||
using namespace AlibabaCloud::Ecs::Model;
|
||||
|
||||
RunCommandResult::RunCommandResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RunCommandResult::RunCommandResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RunCommandResult::~RunCommandResult()
|
||||
{}
|
||||
|
||||
void RunCommandResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["CommandId"].isNull())
|
||||
commandId_ = value["CommandId"].asString();
|
||||
if(!value["InvokeId"].isNull())
|
||||
invokeId_ = value["InvokeId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string RunCommandResult::getCommandId()const
|
||||
{
|
||||
return commandId_;
|
||||
}
|
||||
|
||||
std::string RunCommandResult::getInvokeId()const
|
||||
{
|
||||
return invokeId_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user