EHPC SDK Auto Released By qianzheng.llc,Version:1.27.0
Signed-off-by: yixiong.jxy <yixiong.jxy@alibaba-inc.com>
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2018-09-27 Version: 1.27.0
|
||||
1, Add new API ListQueues, modify API SetAutoScaleConfig to support queue related features.
|
||||
|
||||
2018-09-27 Version: 1.26.4
|
||||
1, modify getFaces Api
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ set(ehpc_public_header_model
|
||||
include/alibabacloud/ehpc/model/ModifyImageGatewayConfigResult.h
|
||||
include/alibabacloud/ehpc/model/ListContainerAppsRequest.h
|
||||
include/alibabacloud/ehpc/model/ListContainerAppsResult.h
|
||||
include/alibabacloud/ehpc/model/ListQueuesRequest.h
|
||||
include/alibabacloud/ehpc/model/ListQueuesResult.h
|
||||
include/alibabacloud/ehpc/model/ListCloudMetricProfilingsRequest.h
|
||||
include/alibabacloud/ehpc/model/ListCloudMetricProfilingsResult.h
|
||||
include/alibabacloud/ehpc/model/SetJobUserRequest.h
|
||||
@@ -258,6 +260,8 @@ set(ehpc_src
|
||||
src/model/ModifyImageGatewayConfigResult.cc
|
||||
src/model/ListContainerAppsRequest.cc
|
||||
src/model/ListContainerAppsResult.cc
|
||||
src/model/ListQueuesRequest.cc
|
||||
src/model/ListQueuesResult.cc
|
||||
src/model/ListCloudMetricProfilingsRequest.cc
|
||||
src/model/ListCloudMetricProfilingsResult.cc
|
||||
src/model/SetJobUserRequest.cc
|
||||
|
||||
@@ -124,6 +124,8 @@
|
||||
#include "model/ModifyImageGatewayConfigResult.h"
|
||||
#include "model/ListContainerAppsRequest.h"
|
||||
#include "model/ListContainerAppsResult.h"
|
||||
#include "model/ListQueuesRequest.h"
|
||||
#include "model/ListQueuesResult.h"
|
||||
#include "model/ListCloudMetricProfilingsRequest.h"
|
||||
#include "model/ListCloudMetricProfilingsResult.h"
|
||||
#include "model/SetJobUserRequest.h"
|
||||
@@ -316,6 +318,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::ListContainerAppsResult> ListContainerAppsOutcome;
|
||||
typedef std::future<ListContainerAppsOutcome> ListContainerAppsOutcomeCallable;
|
||||
typedef std::function<void(const EHPCClient*, const Model::ListContainerAppsRequest&, const ListContainerAppsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListContainerAppsAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListQueuesResult> ListQueuesOutcome;
|
||||
typedef std::future<ListQueuesOutcome> ListQueuesOutcomeCallable;
|
||||
typedef std::function<void(const EHPCClient*, const Model::ListQueuesRequest&, const ListQueuesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListQueuesAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListCloudMetricProfilingsResult> ListCloudMetricProfilingsOutcome;
|
||||
typedef std::future<ListCloudMetricProfilingsOutcome> ListCloudMetricProfilingsOutcomeCallable;
|
||||
typedef std::function<void(const EHPCClient*, const Model::ListCloudMetricProfilingsRequest&, const ListCloudMetricProfilingsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListCloudMetricProfilingsAsyncHandler;
|
||||
@@ -519,6 +524,9 @@ namespace AlibabaCloud
|
||||
ListContainerAppsOutcome listContainerApps(const Model::ListContainerAppsRequest &request)const;
|
||||
void listContainerAppsAsync(const Model::ListContainerAppsRequest& request, const ListContainerAppsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListContainerAppsOutcomeCallable listContainerAppsCallable(const Model::ListContainerAppsRequest& request) const;
|
||||
ListQueuesOutcome listQueues(const Model::ListQueuesRequest &request)const;
|
||||
void listQueuesAsync(const Model::ListQueuesRequest& request, const ListQueuesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListQueuesOutcomeCallable listQueuesCallable(const Model::ListQueuesRequest& request) const;
|
||||
ListCloudMetricProfilingsOutcome listCloudMetricProfilings(const Model::ListCloudMetricProfilingsRequest &request)const;
|
||||
void listCloudMetricProfilingsAsync(const Model::ListCloudMetricProfilingsRequest& request, const ListCloudMetricProfilingsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListCloudMetricProfilingsOutcomeCallable listCloudMetricProfilingsCallable(const Model::ListCloudMetricProfilingsRequest& request) const;
|
||||
|
||||
@@ -47,6 +47,8 @@ namespace AlibabaCloud
|
||||
void setClusterId(const std::string& clusterId);
|
||||
std::string getComputeSpotStrategy()const;
|
||||
void setComputeSpotStrategy(const std::string& computeSpotStrategy);
|
||||
std::string getJobQueue()const;
|
||||
void setJobQueue(const std::string& jobQueue);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
std::string getImageOwnerAlias()const;
|
||||
@@ -69,6 +71,7 @@ namespace AlibabaCloud
|
||||
int count_;
|
||||
std::string clusterId_;
|
||||
std::string computeSpotStrategy_;
|
||||
std::string jobQueue_;
|
||||
std::string accessKeyId_;
|
||||
std::string imageOwnerAlias_;
|
||||
std::string periodUnit_;
|
||||
|
||||
@@ -64,6 +64,8 @@ namespace AlibabaCloud
|
||||
void setSecurityGroupName(const std::string& securityGroupName);
|
||||
std::string getEcsOrderComputeInstanceType()const;
|
||||
void setEcsOrderComputeInstanceType(const std::string& ecsOrderComputeInstanceType);
|
||||
std::string getJobQueue()const;
|
||||
void setJobQueue(const std::string& jobQueue);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
std::string getImageOwnerAlias()const;
|
||||
@@ -138,6 +140,7 @@ namespace AlibabaCloud
|
||||
std::string keyPairName_;
|
||||
std::string securityGroupName_;
|
||||
std::string ecsOrderComputeInstanceType_;
|
||||
std::string jobQueue_;
|
||||
std::string accessKeyId_;
|
||||
std::string imageOwnerAlias_;
|
||||
std::string volumeType_;
|
||||
|
||||
@@ -32,6 +32,13 @@ namespace AlibabaCloud
|
||||
class ALIBABACLOUD_EHPC_EXPORT GetAutoScaleConfigResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct QueueInfo
|
||||
{
|
||||
float spotPriceLimit;
|
||||
std::string instanceType;
|
||||
std::string queueName;
|
||||
std::string spotStrategy;
|
||||
};
|
||||
|
||||
|
||||
GetAutoScaleConfigResult();
|
||||
@@ -49,7 +56,8 @@ namespace AlibabaCloud
|
||||
std::string getUid()const;
|
||||
int getGrowTimeoutInMinutes()const;
|
||||
int getShrinkIntervalInMinutes()const;
|
||||
std::string getSpotPriceLimit()const;
|
||||
float getSpotPriceLimit()const;
|
||||
std::vector<QueueInfo> getQueues()const;
|
||||
std::string getExcludeNodes()const;
|
||||
std::string getSpotStrategy()const;
|
||||
|
||||
@@ -68,7 +76,8 @@ namespace AlibabaCloud
|
||||
std::string uid_;
|
||||
int growTimeoutInMinutes_;
|
||||
int shrinkIntervalInMinutes_;
|
||||
std::string spotPriceLimit_;
|
||||
float spotPriceLimit_;
|
||||
std::vector<QueueInfo> queues_;
|
||||
std::string excludeNodes_;
|
||||
std::string spotStrategy_;
|
||||
|
||||
|
||||
51
ehpc/include/alibabacloud/ehpc/model/ListQueuesRequest.h
Normal file
51
ehpc/include/alibabacloud/ehpc/model/ListQueuesRequest.h
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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_EHPC_MODEL_LISTQUEUESREQUEST_H_
|
||||
#define ALIBABACLOUD_EHPC_MODEL_LISTQUEUESREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ehpc/EHPCExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace EHPC
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_EHPC_EXPORT ListQueuesRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ListQueuesRequest();
|
||||
~ListQueuesRequest();
|
||||
|
||||
std::string getClusterId()const;
|
||||
void setClusterId(const std::string& clusterId);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
|
||||
private:
|
||||
std::string clusterId_;
|
||||
std::string accessKeyId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_EHPC_MODEL_LISTQUEUESREQUEST_H_
|
||||
56
ehpc/include/alibabacloud/ehpc/model/ListQueuesResult.h
Normal file
56
ehpc/include/alibabacloud/ehpc/model/ListQueuesResult.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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_EHPC_MODEL_LISTQUEUESRESULT_H_
|
||||
#define ALIBABACLOUD_EHPC_MODEL_LISTQUEUESRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ehpc/EHPCExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace EHPC
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_EHPC_EXPORT ListQueuesResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct QueueInfo
|
||||
{
|
||||
std::string type;
|
||||
std::string queueName;
|
||||
};
|
||||
|
||||
|
||||
ListQueuesResult();
|
||||
explicit ListQueuesResult(const std::string &payload);
|
||||
~ListQueuesResult();
|
||||
std::vector<QueueInfo> getQueues()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<QueueInfo> queues_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_EHPC_MODEL_LISTQUEUESRESULT_H_
|
||||
@@ -30,6 +30,13 @@ namespace AlibabaCloud
|
||||
{
|
||||
class ALIBABACLOUD_EHPC_EXPORT SetAutoScaleConfigRequest : public RpcServiceRequest
|
||||
{
|
||||
struct Queues
|
||||
{
|
||||
std::string spotStrategy;
|
||||
std::string queueName;
|
||||
std::string instanceType;
|
||||
float spotPriceLimit;
|
||||
};
|
||||
|
||||
public:
|
||||
SetAutoScaleConfigRequest();
|
||||
@@ -43,8 +50,8 @@ namespace AlibabaCloud
|
||||
void setClusterId(const std::string& clusterId);
|
||||
bool getEnableAutoGrow()const;
|
||||
void setEnableAutoGrow(bool enableAutoGrow);
|
||||
std::string getSpotPriceLimit()const;
|
||||
void setSpotPriceLimit(const std::string& spotPriceLimit);
|
||||
float getSpotPriceLimit()const;
|
||||
void setSpotPriceLimit(float spotPriceLimit);
|
||||
bool getEnableAutoShrink()const;
|
||||
void setEnableAutoShrink(bool enableAutoShrink);
|
||||
std::string getAccessKeyId()const;
|
||||
@@ -57,6 +64,8 @@ namespace AlibabaCloud
|
||||
void setExcludeNodes(const std::string& excludeNodes);
|
||||
int getShrinkIntervalInMinutes()const;
|
||||
void setShrinkIntervalInMinutes(int shrinkIntervalInMinutes);
|
||||
std::vector<Queues> getQueues()const;
|
||||
void setQueues(const std::vector<Queues>& queues);
|
||||
int getExtraNodesGrowRatio()const;
|
||||
void setExtraNodesGrowRatio(int extraNodesGrowRatio);
|
||||
int getGrowIntervalInMinutes()const;
|
||||
@@ -69,13 +78,14 @@ namespace AlibabaCloud
|
||||
int growTimeoutInMinutes_;
|
||||
std::string clusterId_;
|
||||
bool enableAutoGrow_;
|
||||
std::string spotPriceLimit_;
|
||||
float spotPriceLimit_;
|
||||
bool enableAutoShrink_;
|
||||
std::string accessKeyId_;
|
||||
std::string spotStrategy_;
|
||||
int maxNodesInCluster_;
|
||||
std::string excludeNodes_;
|
||||
int shrinkIntervalInMinutes_;
|
||||
std::vector<Queues> queues_;
|
||||
int extraNodesGrowRatio_;
|
||||
int growIntervalInMinutes_;
|
||||
int growRatio_;
|
||||
|
||||
@@ -53,6 +53,8 @@ namespace AlibabaCloud
|
||||
void setPriority(int priority);
|
||||
std::string getCommandLine()const;
|
||||
void setCommandLine(const std::string& commandLine);
|
||||
std::string getJobQueue()const;
|
||||
void setJobQueue(const std::string& jobQueue);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
std::string getArrayRequest()const;
|
||||
@@ -80,6 +82,7 @@ namespace AlibabaCloud
|
||||
bool reRunable_;
|
||||
int priority_;
|
||||
std::string commandLine_;
|
||||
std::string jobQueue_;
|
||||
std::string accessKeyId_;
|
||||
std::string arrayRequest_;
|
||||
std::string unzipCmd_;
|
||||
|
||||
@@ -1887,6 +1887,42 @@ EHPCClient::ListContainerAppsOutcomeCallable EHPCClient::listContainerAppsCallab
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EHPCClient::ListQueuesOutcome EHPCClient::listQueues(const ListQueuesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListQueuesOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListQueuesOutcome(ListQueuesResult(outcome.result()));
|
||||
else
|
||||
return ListQueuesOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void EHPCClient::listQueuesAsync(const ListQueuesRequest& request, const ListQueuesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listQueues(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
EHPCClient::ListQueuesOutcomeCallable EHPCClient::listQueuesCallable(const ListQueuesRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListQueuesOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listQueues(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
EHPCClient::ListCloudMetricProfilingsOutcome EHPCClient::listCloudMetricProfilings(const ListCloudMetricProfilingsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
@@ -91,6 +91,17 @@ void AddNodesRequest::setComputeSpotStrategy(const std::string& computeSpotStrat
|
||||
setParameter("ComputeSpotStrategy", computeSpotStrategy);
|
||||
}
|
||||
|
||||
std::string AddNodesRequest::getJobQueue()const
|
||||
{
|
||||
return jobQueue_;
|
||||
}
|
||||
|
||||
void AddNodesRequest::setJobQueue(const std::string& jobQueue)
|
||||
{
|
||||
jobQueue_ = jobQueue;
|
||||
setParameter("JobQueue", jobQueue);
|
||||
}
|
||||
|
||||
std::string AddNodesRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
|
||||
@@ -135,6 +135,17 @@ void CreateClusterRequest::setEcsOrderComputeInstanceType(const std::string& ecs
|
||||
setParameter("EcsOrderComputeInstanceType", ecsOrderComputeInstanceType);
|
||||
}
|
||||
|
||||
std::string CreateClusterRequest::getJobQueue()const
|
||||
{
|
||||
return jobQueue_;
|
||||
}
|
||||
|
||||
void CreateClusterRequest::setJobQueue(const std::string& jobQueue)
|
||||
{
|
||||
jobQueue_ = jobQueue;
|
||||
setParameter("JobQueue", jobQueue);
|
||||
}
|
||||
|
||||
std::string CreateClusterRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
|
||||
@@ -40,6 +40,20 @@ void GetAutoScaleConfigResult::parse(const std::string &payload)
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allQueues = value["Queues"]["QueueInfo"];
|
||||
for (auto value : allQueues)
|
||||
{
|
||||
QueueInfo queuesObject;
|
||||
if(!value["QueueName"].isNull())
|
||||
queuesObject.queueName = value["QueueName"].asString();
|
||||
if(!value["InstanceType"].isNull())
|
||||
queuesObject.instanceType = value["InstanceType"].asString();
|
||||
if(!value["SpotStrategy"].isNull())
|
||||
queuesObject.spotStrategy = value["SpotStrategy"].asString();
|
||||
if(!value["SpotPriceLimit"].isNull())
|
||||
queuesObject.spotPriceLimit = std::stof(value["SpotPriceLimit"].asString());
|
||||
queues_.push_back(queuesObject);
|
||||
}
|
||||
if(!value["Uid"].isNull())
|
||||
uid_ = value["Uid"].asString();
|
||||
if(!value["ClusterId"].isNull())
|
||||
@@ -69,7 +83,7 @@ void GetAutoScaleConfigResult::parse(const std::string &payload)
|
||||
if(!value["SpotStrategy"].isNull())
|
||||
spotStrategy_ = value["SpotStrategy"].asString();
|
||||
if(!value["SpotPriceLimit"].isNull())
|
||||
spotPriceLimit_ = value["SpotPriceLimit"].asString();
|
||||
spotPriceLimit_ = std::stof(value["SpotPriceLimit"].asString());
|
||||
|
||||
}
|
||||
|
||||
@@ -133,11 +147,16 @@ int GetAutoScaleConfigResult::getShrinkIntervalInMinutes()const
|
||||
return shrinkIntervalInMinutes_;
|
||||
}
|
||||
|
||||
std::string GetAutoScaleConfigResult::getSpotPriceLimit()const
|
||||
float GetAutoScaleConfigResult::getSpotPriceLimit()const
|
||||
{
|
||||
return spotPriceLimit_;
|
||||
}
|
||||
|
||||
std::vector<GetAutoScaleConfigResult::QueueInfo> GetAutoScaleConfigResult::getQueues()const
|
||||
{
|
||||
return queues_;
|
||||
}
|
||||
|
||||
std::string GetAutoScaleConfigResult::getExcludeNodes()const
|
||||
{
|
||||
return excludeNodes_;
|
||||
|
||||
49
ehpc/src/model/ListQueuesRequest.cc
Normal file
49
ehpc/src/model/ListQueuesRequest.cc
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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/ehpc/model/ListQueuesRequest.h>
|
||||
|
||||
using AlibabaCloud::EHPC::Model::ListQueuesRequest;
|
||||
|
||||
ListQueuesRequest::ListQueuesRequest() :
|
||||
RpcServiceRequest("ehpc", "2018-04-12", "ListQueues")
|
||||
{}
|
||||
|
||||
ListQueuesRequest::~ListQueuesRequest()
|
||||
{}
|
||||
|
||||
std::string ListQueuesRequest::getClusterId()const
|
||||
{
|
||||
return clusterId_;
|
||||
}
|
||||
|
||||
void ListQueuesRequest::setClusterId(const std::string& clusterId)
|
||||
{
|
||||
clusterId_ = clusterId;
|
||||
setParameter("ClusterId", clusterId);
|
||||
}
|
||||
|
||||
std::string ListQueuesRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void ListQueuesRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
60
ehpc/src/model/ListQueuesResult.cc
Normal file
60
ehpc/src/model/ListQueuesResult.cc
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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/ehpc/model/ListQueuesResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::EHPC;
|
||||
using namespace AlibabaCloud::EHPC::Model;
|
||||
|
||||
ListQueuesResult::ListQueuesResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListQueuesResult::ListQueuesResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListQueuesResult::~ListQueuesResult()
|
||||
{}
|
||||
|
||||
void ListQueuesResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allQueues = value["Queues"]["QueueInfo"];
|
||||
for (auto value : allQueues)
|
||||
{
|
||||
QueueInfo queuesObject;
|
||||
if(!value["QueueName"].isNull())
|
||||
queuesObject.queueName = value["QueueName"].asString();
|
||||
if(!value["Type"].isNull())
|
||||
queuesObject.type = value["Type"].asString();
|
||||
queues_.push_back(queuesObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListQueuesResult::QueueInfo> ListQueuesResult::getQueues()const
|
||||
{
|
||||
return queues_;
|
||||
}
|
||||
|
||||
@@ -69,15 +69,15 @@ void SetAutoScaleConfigRequest::setEnableAutoGrow(bool enableAutoGrow)
|
||||
setParameter("EnableAutoGrow", std::to_string(enableAutoGrow));
|
||||
}
|
||||
|
||||
std::string SetAutoScaleConfigRequest::getSpotPriceLimit()const
|
||||
float SetAutoScaleConfigRequest::getSpotPriceLimit()const
|
||||
{
|
||||
return spotPriceLimit_;
|
||||
}
|
||||
|
||||
void SetAutoScaleConfigRequest::setSpotPriceLimit(const std::string& spotPriceLimit)
|
||||
void SetAutoScaleConfigRequest::setSpotPriceLimit(float spotPriceLimit)
|
||||
{
|
||||
spotPriceLimit_ = spotPriceLimit;
|
||||
setParameter("SpotPriceLimit", spotPriceLimit);
|
||||
setParameter("SpotPriceLimit", std::to_string(spotPriceLimit));
|
||||
}
|
||||
|
||||
bool SetAutoScaleConfigRequest::getEnableAutoShrink()const
|
||||
@@ -146,6 +146,25 @@ void SetAutoScaleConfigRequest::setShrinkIntervalInMinutes(int shrinkIntervalInM
|
||||
setParameter("ShrinkIntervalInMinutes", std::to_string(shrinkIntervalInMinutes));
|
||||
}
|
||||
|
||||
std::vector<SetAutoScaleConfigRequest::Queues> SetAutoScaleConfigRequest::getQueues()const
|
||||
{
|
||||
return queues_;
|
||||
}
|
||||
|
||||
void SetAutoScaleConfigRequest::setQueues(const std::vector<Queues>& queues)
|
||||
{
|
||||
queues_ = queues;
|
||||
int i = 0;
|
||||
for(int i = 0; i!= queues.size(); i++) {
|
||||
auto obj = queues.at(i);
|
||||
std::string str ="Queues."+ std::to_string(i);
|
||||
setParameter(str + ".SpotStrategy", obj.spotStrategy);
|
||||
setParameter(str + ".QueueName", obj.queueName);
|
||||
setParameter(str + ".InstanceType", obj.instanceType);
|
||||
setParameter(str + ".SpotPriceLimit", std::to_string(obj.spotPriceLimit));
|
||||
}
|
||||
}
|
||||
|
||||
int SetAutoScaleConfigRequest::getExtraNodesGrowRatio()const
|
||||
{
|
||||
return extraNodesGrowRatio_;
|
||||
|
||||
@@ -124,6 +124,17 @@ void SubmitJobRequest::setCommandLine(const std::string& commandLine)
|
||||
setParameter("CommandLine", commandLine);
|
||||
}
|
||||
|
||||
std::string SubmitJobRequest::getJobQueue()const
|
||||
{
|
||||
return jobQueue_;
|
||||
}
|
||||
|
||||
void SubmitJobRequest::setJobQueue(const std::string& jobQueue)
|
||||
{
|
||||
jobQueue_ = jobQueue;
|
||||
setParameter("JobQueue", jobQueue);
|
||||
}
|
||||
|
||||
std::string SubmitJobRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
|
||||
Reference in New Issue
Block a user