Support ExecutorId for CreateJob and ListJobExecutors.
This commit is contained in:
@@ -49,10 +49,10 @@ public:
|
|||||||
void setImageType(const std::string &imageType);
|
void setImageType(const std::string &imageType);
|
||||||
std::string getDescription() const;
|
std::string getDescription() const;
|
||||||
void setDescription(const std::string &description);
|
void setDescription(const std::string &description);
|
||||||
std::string getVersion() const;
|
|
||||||
void setVersion(const std::string &version);
|
|
||||||
std::string getName() const;
|
std::string getName() const;
|
||||||
void setName(const std::string &name);
|
void setName(const std::string &name);
|
||||||
|
std::string getImageVersion() const;
|
||||||
|
void setImageVersion(const std::string &imageVersion);
|
||||||
ContainerImageSpec getContainerImageSpec() const;
|
ContainerImageSpec getContainerImageSpec() const;
|
||||||
void setContainerImageSpec(const ContainerImageSpec &containerImageSpec);
|
void setContainerImageSpec(const ContainerImageSpec &containerImageSpec);
|
||||||
VMImageSpec getVMImageSpec() const;
|
VMImageSpec getVMImageSpec() const;
|
||||||
@@ -61,8 +61,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::string imageType_;
|
std::string imageType_;
|
||||||
std::string description_;
|
std::string description_;
|
||||||
std::string version_;
|
|
||||||
std::string name_;
|
std::string name_;
|
||||||
|
std::string imageVersion_;
|
||||||
ContainerImageSpec containerImageSpec_;
|
ContainerImageSpec containerImageSpec_;
|
||||||
VMImageSpec vMImageSpec_;
|
VMImageSpec vMImageSpec_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,16 +32,23 @@ namespace AlibabaCloud
|
|||||||
class ALIBABACLOUD_EHPC_EXPORT CreateJobResult : public ServiceResult
|
class ALIBABACLOUD_EHPC_EXPORT CreateJobResult : public ServiceResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
struct TasksItem
|
||||||
|
{
|
||||||
|
std::vector<std::string> executorIds;
|
||||||
|
std::string taskName;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
CreateJobResult();
|
CreateJobResult();
|
||||||
explicit CreateJobResult(const std::string &payload);
|
explicit CreateJobResult(const std::string &payload);
|
||||||
~CreateJobResult();
|
~CreateJobResult();
|
||||||
|
std::vector<TasksItem> getTasks()const;
|
||||||
std::string getJobId()const;
|
std::string getJobId()const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void parse(const std::string &payload);
|
void parse(const std::string &payload);
|
||||||
private:
|
private:
|
||||||
|
std::vector<TasksItem> tasks_;
|
||||||
std::string jobId_;
|
std::string jobId_;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ namespace AlibabaCloud
|
|||||||
struct Executor
|
struct Executor
|
||||||
{
|
{
|
||||||
std::string status;
|
std::string status;
|
||||||
|
std::string executorId;
|
||||||
std::string endTime;
|
std::string endTime;
|
||||||
std::string statusReason;
|
std::string statusReason;
|
||||||
std::string createTime;
|
std::string createTime;
|
||||||
|
|||||||
@@ -43,15 +43,6 @@ void AddImageRequest::setDescription(const std::string &description) {
|
|||||||
setParameter(std::string("Description"), description);
|
setParameter(std::string("Description"), description);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string AddImageRequest::getVersion() const {
|
|
||||||
return version_;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AddImageRequest::setVersion(const std::string &version) {
|
|
||||||
version_ = version;
|
|
||||||
setParameter(std::string("Version"), version);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string AddImageRequest::getName() const {
|
std::string AddImageRequest::getName() const {
|
||||||
return name_;
|
return name_;
|
||||||
}
|
}
|
||||||
@@ -61,6 +52,15 @@ void AddImageRequest::setName(const std::string &name) {
|
|||||||
setParameter(std::string("Name"), name);
|
setParameter(std::string("Name"), name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string AddImageRequest::getImageVersion() const {
|
||||||
|
return imageVersion_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddImageRequest::setImageVersion(const std::string &imageVersion) {
|
||||||
|
imageVersion_ = imageVersion;
|
||||||
|
setParameter(std::string("ImageVersion"), imageVersion);
|
||||||
|
}
|
||||||
|
|
||||||
AddImageRequest::ContainerImageSpec AddImageRequest::getContainerImageSpec() const {
|
AddImageRequest::ContainerImageSpec AddImageRequest::getContainerImageSpec() const {
|
||||||
return containerImageSpec_;
|
return containerImageSpec_;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,11 +39,27 @@ void CreateJobResult::parse(const std::string &payload)
|
|||||||
Json::Value value;
|
Json::Value value;
|
||||||
reader.parse(payload, value);
|
reader.parse(payload, value);
|
||||||
setRequestId(value["RequestId"].asString());
|
setRequestId(value["RequestId"].asString());
|
||||||
|
auto allTasksNode = value["Tasks"]["TasksItem"];
|
||||||
|
for (auto valueTasksTasksItem : allTasksNode)
|
||||||
|
{
|
||||||
|
TasksItem tasksObject;
|
||||||
|
if(!valueTasksTasksItem["TaskName"].isNull())
|
||||||
|
tasksObject.taskName = valueTasksTasksItem["TaskName"].asString();
|
||||||
|
auto allExecutorIds = value["ExecutorIds"]["ExecutorIds"];
|
||||||
|
for (auto value : allExecutorIds)
|
||||||
|
tasksObject.executorIds.push_back(value.asString());
|
||||||
|
tasks_.push_back(tasksObject);
|
||||||
|
}
|
||||||
if(!value["JobId"].isNull())
|
if(!value["JobId"].isNull())
|
||||||
jobId_ = value["JobId"].asString();
|
jobId_ = value["JobId"].asString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<CreateJobResult::TasksItem> CreateJobResult::getTasks()const
|
||||||
|
{
|
||||||
|
return tasks_;
|
||||||
|
}
|
||||||
|
|
||||||
std::string CreateJobResult::getJobId()const
|
std::string CreateJobResult::getJobId()const
|
||||||
{
|
{
|
||||||
return jobId_;
|
return jobId_;
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ void ListJobExecutorsResult::parse(const std::string &payload)
|
|||||||
for (auto valueExecutorsExecutor : allExecutorsNode)
|
for (auto valueExecutorsExecutor : allExecutorsNode)
|
||||||
{
|
{
|
||||||
Executor executorsObject;
|
Executor executorsObject;
|
||||||
|
if(!valueExecutorsExecutor["ExecutorId"].isNull())
|
||||||
|
executorsObject.executorId = valueExecutorsExecutor["ExecutorId"].asString();
|
||||||
if(!valueExecutorsExecutor["ArrayIndex"].isNull())
|
if(!valueExecutorsExecutor["ArrayIndex"].isNull())
|
||||||
executorsObject.arrayIndex = std::stoi(valueExecutorsExecutor["ArrayIndex"].asString());
|
executorsObject.arrayIndex = std::stoi(valueExecutorsExecutor["ArrayIndex"].asString());
|
||||||
if(!valueExecutorsExecutor["CreateTime"].isNull())
|
if(!valueExecutorsExecutor["CreateTime"].isNull())
|
||||||
|
|||||||
Reference in New Issue
Block a user