E-HPC Instant Computing Service Release, supporting mirroring and job management.

This commit is contained in:
sdk-team
2024-04-25 02:03:07 +00:00
parent c70caca128
commit 7a6b431ace
53 changed files with 4376 additions and 1 deletions

View File

@@ -1 +1 @@
1.36.1895 1.36.1896

130
ehpcinstant/CMakeLists.txt Normal file
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.
#
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
set(ehpcinstant_public_header
include/alibabacloud/ehpcinstant/EhpcInstantClient.h
include/alibabacloud/ehpcinstant/EhpcInstantExport.h )
set(ehpcinstant_public_header_model
include/alibabacloud/ehpcinstant/model/AddImageRequest.h
include/alibabacloud/ehpcinstant/model/AddImageResult.h
include/alibabacloud/ehpcinstant/model/CreateJobRequest.h
include/alibabacloud/ehpcinstant/model/CreateJobResult.h
include/alibabacloud/ehpcinstant/model/DeleteJobsRequest.h
include/alibabacloud/ehpcinstant/model/DeleteJobsResult.h
include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataRequest.h
include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataResult.h
include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastRequest.h
include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastResult.h
include/alibabacloud/ehpcinstant/model/GetImageRequest.h
include/alibabacloud/ehpcinstant/model/GetImageResult.h
include/alibabacloud/ehpcinstant/model/GetJobRequest.h
include/alibabacloud/ehpcinstant/model/GetJobResult.h
include/alibabacloud/ehpcinstant/model/ListExecutorsRequest.h
include/alibabacloud/ehpcinstant/model/ListExecutorsResult.h
include/alibabacloud/ehpcinstant/model/ListImagesRequest.h
include/alibabacloud/ehpcinstant/model/ListImagesResult.h
include/alibabacloud/ehpcinstant/model/ListJobExecutorsRequest.h
include/alibabacloud/ehpcinstant/model/ListJobExecutorsResult.h
include/alibabacloud/ehpcinstant/model/ListJobsRequest.h
include/alibabacloud/ehpcinstant/model/ListJobsResult.h
include/alibabacloud/ehpcinstant/model/RemoveImageRequest.h
include/alibabacloud/ehpcinstant/model/RemoveImageResult.h )
set(ehpcinstant_src
src/EhpcInstantClient.cc
src/model/AddImageRequest.cc
src/model/AddImageResult.cc
src/model/CreateJobRequest.cc
src/model/CreateJobResult.cc
src/model/DeleteJobsRequest.cc
src/model/DeleteJobsResult.cc
src/model/DescribeJobMetricDataRequest.cc
src/model/DescribeJobMetricDataResult.cc
src/model/DescribeJobMetricLastRequest.cc
src/model/DescribeJobMetricLastResult.cc
src/model/GetImageRequest.cc
src/model/GetImageResult.cc
src/model/GetJobRequest.cc
src/model/GetJobResult.cc
src/model/ListExecutorsRequest.cc
src/model/ListExecutorsResult.cc
src/model/ListImagesRequest.cc
src/model/ListImagesResult.cc
src/model/ListJobExecutorsRequest.cc
src/model/ListJobExecutorsResult.cc
src/model/ListJobsRequest.cc
src/model/ListJobsResult.cc
src/model/RemoveImageRequest.cc
src/model/RemoveImageResult.cc )
add_library(ehpcinstant ${LIB_TYPE}
${ehpcinstant_public_header}
${ehpcinstant_public_header_model}
${ehpcinstant_src})
set_target_properties(ehpcinstant
PROPERTIES
LINKER_LANGUAGE CXX
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}ehpcinstant
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(ehpcinstant
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_EHPCINSTANT_LIBRARY)
endif()
target_include_directories(ehpcinstant
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(ehpcinstant
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(ehpcinstant
jsoncpp)
target_include_directories(ehpcinstant
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(ehpcinstant
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(ehpcinstant
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(ehpcinstant
PRIVATE /usr/include/jsoncpp)
target_link_libraries(ehpcinstant
jsoncpp)
endif()
install(FILES ${ehpcinstant_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ehpcinstant)
install(FILES ${ehpcinstant_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/ehpcinstant/model)
install(TARGETS ehpcinstant
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -0,0 +1,142 @@
/*
* 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_EHPCINSTANT_EHPCINSTANTCLIENT_H_
#define ALIBABACLOUD_EHPCINSTANT_EHPCINSTANTCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "EhpcInstantExport.h"
#include "model/AddImageRequest.h"
#include "model/AddImageResult.h"
#include "model/CreateJobRequest.h"
#include "model/CreateJobResult.h"
#include "model/DeleteJobsRequest.h"
#include "model/DeleteJobsResult.h"
#include "model/DescribeJobMetricDataRequest.h"
#include "model/DescribeJobMetricDataResult.h"
#include "model/DescribeJobMetricLastRequest.h"
#include "model/DescribeJobMetricLastResult.h"
#include "model/GetImageRequest.h"
#include "model/GetImageResult.h"
#include "model/GetJobRequest.h"
#include "model/GetJobResult.h"
#include "model/ListExecutorsRequest.h"
#include "model/ListExecutorsResult.h"
#include "model/ListImagesRequest.h"
#include "model/ListImagesResult.h"
#include "model/ListJobExecutorsRequest.h"
#include "model/ListJobExecutorsResult.h"
#include "model/ListJobsRequest.h"
#include "model/ListJobsResult.h"
#include "model/RemoveImageRequest.h"
#include "model/RemoveImageResult.h"
namespace AlibabaCloud
{
namespace EhpcInstant
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT EhpcInstantClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::AddImageResult> AddImageOutcome;
typedef std::future<AddImageOutcome> AddImageOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::AddImageRequest&, const AddImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AddImageAsyncHandler;
typedef Outcome<Error, Model::CreateJobResult> CreateJobOutcome;
typedef std::future<CreateJobOutcome> CreateJobOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::CreateJobRequest&, const CreateJobOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateJobAsyncHandler;
typedef Outcome<Error, Model::DeleteJobsResult> DeleteJobsOutcome;
typedef std::future<DeleteJobsOutcome> DeleteJobsOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::DeleteJobsRequest&, const DeleteJobsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteJobsAsyncHandler;
typedef Outcome<Error, Model::DescribeJobMetricDataResult> DescribeJobMetricDataOutcome;
typedef std::future<DescribeJobMetricDataOutcome> DescribeJobMetricDataOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::DescribeJobMetricDataRequest&, const DescribeJobMetricDataOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeJobMetricDataAsyncHandler;
typedef Outcome<Error, Model::DescribeJobMetricLastResult> DescribeJobMetricLastOutcome;
typedef std::future<DescribeJobMetricLastOutcome> DescribeJobMetricLastOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::DescribeJobMetricLastRequest&, const DescribeJobMetricLastOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeJobMetricLastAsyncHandler;
typedef Outcome<Error, Model::GetImageResult> GetImageOutcome;
typedef std::future<GetImageOutcome> GetImageOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::GetImageRequest&, const GetImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetImageAsyncHandler;
typedef Outcome<Error, Model::GetJobResult> GetJobOutcome;
typedef std::future<GetJobOutcome> GetJobOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::GetJobRequest&, const GetJobOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetJobAsyncHandler;
typedef Outcome<Error, Model::ListExecutorsResult> ListExecutorsOutcome;
typedef std::future<ListExecutorsOutcome> ListExecutorsOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::ListExecutorsRequest&, const ListExecutorsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListExecutorsAsyncHandler;
typedef Outcome<Error, Model::ListImagesResult> ListImagesOutcome;
typedef std::future<ListImagesOutcome> ListImagesOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::ListImagesRequest&, const ListImagesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListImagesAsyncHandler;
typedef Outcome<Error, Model::ListJobExecutorsResult> ListJobExecutorsOutcome;
typedef std::future<ListJobExecutorsOutcome> ListJobExecutorsOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::ListJobExecutorsRequest&, const ListJobExecutorsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListJobExecutorsAsyncHandler;
typedef Outcome<Error, Model::ListJobsResult> ListJobsOutcome;
typedef std::future<ListJobsOutcome> ListJobsOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::ListJobsRequest&, const ListJobsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListJobsAsyncHandler;
typedef Outcome<Error, Model::RemoveImageResult> RemoveImageOutcome;
typedef std::future<RemoveImageOutcome> RemoveImageOutcomeCallable;
typedef std::function<void(const EhpcInstantClient*, const Model::RemoveImageRequest&, const RemoveImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RemoveImageAsyncHandler;
EhpcInstantClient(const Credentials &credentials, const ClientConfiguration &configuration);
EhpcInstantClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
EhpcInstantClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~EhpcInstantClient();
AddImageOutcome addImage(const Model::AddImageRequest &request)const;
void addImageAsync(const Model::AddImageRequest& request, const AddImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
AddImageOutcomeCallable addImageCallable(const Model::AddImageRequest& request) const;
CreateJobOutcome createJob(const Model::CreateJobRequest &request)const;
void createJobAsync(const Model::CreateJobRequest& request, const CreateJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateJobOutcomeCallable createJobCallable(const Model::CreateJobRequest& request) const;
DeleteJobsOutcome deleteJobs(const Model::DeleteJobsRequest &request)const;
void deleteJobsAsync(const Model::DeleteJobsRequest& request, const DeleteJobsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DeleteJobsOutcomeCallable deleteJobsCallable(const Model::DeleteJobsRequest& request) const;
DescribeJobMetricDataOutcome describeJobMetricData(const Model::DescribeJobMetricDataRequest &request)const;
void describeJobMetricDataAsync(const Model::DescribeJobMetricDataRequest& request, const DescribeJobMetricDataAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeJobMetricDataOutcomeCallable describeJobMetricDataCallable(const Model::DescribeJobMetricDataRequest& request) const;
DescribeJobMetricLastOutcome describeJobMetricLast(const Model::DescribeJobMetricLastRequest &request)const;
void describeJobMetricLastAsync(const Model::DescribeJobMetricLastRequest& request, const DescribeJobMetricLastAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeJobMetricLastOutcomeCallable describeJobMetricLastCallable(const Model::DescribeJobMetricLastRequest& request) const;
GetImageOutcome getImage(const Model::GetImageRequest &request)const;
void getImageAsync(const Model::GetImageRequest& request, const GetImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetImageOutcomeCallable getImageCallable(const Model::GetImageRequest& request) const;
GetJobOutcome getJob(const Model::GetJobRequest &request)const;
void getJobAsync(const Model::GetJobRequest& request, const GetJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetJobOutcomeCallable getJobCallable(const Model::GetJobRequest& request) const;
ListExecutorsOutcome listExecutors(const Model::ListExecutorsRequest &request)const;
void listExecutorsAsync(const Model::ListExecutorsRequest& request, const ListExecutorsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListExecutorsOutcomeCallable listExecutorsCallable(const Model::ListExecutorsRequest& request) const;
ListImagesOutcome listImages(const Model::ListImagesRequest &request)const;
void listImagesAsync(const Model::ListImagesRequest& request, const ListImagesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListImagesOutcomeCallable listImagesCallable(const Model::ListImagesRequest& request) const;
ListJobExecutorsOutcome listJobExecutors(const Model::ListJobExecutorsRequest &request)const;
void listJobExecutorsAsync(const Model::ListJobExecutorsRequest& request, const ListJobExecutorsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListJobExecutorsOutcomeCallable listJobExecutorsCallable(const Model::ListJobExecutorsRequest& request) const;
ListJobsOutcome listJobs(const Model::ListJobsRequest &request)const;
void listJobsAsync(const Model::ListJobsRequest& request, const ListJobsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListJobsOutcomeCallable listJobsCallable(const Model::ListJobsRequest& request) const;
RemoveImageOutcome removeImage(const Model::RemoveImageRequest &request)const;
void removeImageAsync(const Model::RemoveImageRequest& request, const RemoveImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RemoveImageOutcomeCallable removeImageCallable(const Model::RemoveImageRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_EHPCINSTANTCLIENT_H_

View File

@@ -0,0 +1,32 @@
/*
* 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_EHPCINSTANT_EHPCINSTANTEXPORT_H_
#define ALIBABACLOUD_EHPCINSTANT_EHPCINSTANTEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_EHPCINSTANT_LIBRARY)
# define ALIBABACLOUD_EHPCINSTANT_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_EHPCINSTANT_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_EHPCINSTANT_EXPORT
#endif
#endif // !ALIBABACLOUD_EHPCINSTANT_EHPCINSTANTEXPORT_H_

View File

@@ -0,0 +1,72 @@
/*
* 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_EHPCINSTANT_MODEL_ADDIMAGEREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_ADDIMAGEREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT AddImageRequest : public RpcServiceRequest {
public:
struct ContainerImageSpec {
bool isACREnterprise;
std::string registryUrl;
struct RegistryCredential {
std::string server;
std::string password;
std::string userName;
};
RegistryCredential registryCredential;
std::string registryCriId;
bool isACRRegistry;
};
struct VMImageSpec {
std::string imageId;
};
AddImageRequest();
~AddImageRequest();
std::string getImageType() const;
void setImageType(const std::string &imageType);
std::string getDescription() const;
void setDescription(const std::string &description);
std::string getName() const;
void setName(const std::string &name);
std::string getImageVersion() const;
void setImageVersion(const std::string &imageVersion);
ContainerImageSpec getContainerImageSpec() const;
void setContainerImageSpec(const ContainerImageSpec &containerImageSpec);
VMImageSpec getVMImageSpec() const;
void setVMImageSpec(const VMImageSpec &vMImageSpec);
private:
std::string imageType_;
std::string description_;
std::string name_;
std::string imageVersion_;
ContainerImageSpec containerImageSpec_;
VMImageSpec vMImageSpec_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_ADDIMAGEREQUEST_H_

View File

@@ -0,0 +1,55 @@
/*
* 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_EHPCINSTANT_MODEL_ADDIMAGERESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_ADDIMAGERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT AddImageResult : public ServiceResult
{
public:
AddImageResult();
explicit AddImageResult(const std::string &payload);
~AddImageResult();
std::string getAppId()const;
std::string getImageId()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string appId_;
std::string imageId_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_ADDIMAGERESULT_H_

View File

@@ -0,0 +1,152 @@
/*
* 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_EHPCINSTANT_MODEL_CREATEJOBREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_CREATEJOBREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT CreateJobRequest : public RpcServiceRequest {
public:
struct MonitorPolicy {
struct NotificationSpec {
struct MNSTopicItem {
std::string string;
std::vector<std::string> event;
std::string topicLocation;
};
MNSTopicItem mNSTopicItem;
std::vector<MNSTopicItem> mNSTopic;
};
NotificationSpec notificationSpec;
};
struct DeploymentPolicy {
std::string allocationSpec;
struct Network {
bool enableERI;
std::string string;
std::vector<std::string> vswitch;
bool enableENIMapping;
};
Network network;
};
struct Tasks {
bool taskSustainable;
std::string taskName;
struct ExecutorPolicy {
int maxCount;
struct ArraySpec {
int indexStart;
int indexStep;
int indexEnd;
};
ArraySpec arraySpec;
};
ExecutorPolicy executorPolicy;
struct TaskSpec {
struct VolumeMountItem {
std::string mountOptions;
std::string volumeDriver;
std::string mountPath;
};
VolumeMountItem volumeMountItem;
std::vector<VolumeMountItem> volumeMount;
struct RetryPolicy {
int retryCount;
struct ExitCodeActionsItem {
std::string action;
std::string exitCode;
};
ExitCodeActionsItem exitCodeActionsItem;
std::vector<ExitCodeActionsItem> exitCodeActions;
};
RetryPolicy retryPolicy;
struct Resource {
float cores;
float memory;
struct DisksItem {
int size;
std::string type;
};
DisksItem disksItem;
std::vector<DisksItem> disks;
bool enableHT;
};
Resource resource;
std::string taskDuration;
struct TaskExecutorItem {
struct Container {
std::string image;
struct EnvironmentVarsItem {
std::string name;
std::string value;
};
EnvironmentVarsItem environmentVarsItem;
std::vector<EnvironmentVarsItem> environmentVars;
std::string workingDir;
std::string string;
std::vector<std::string> command;
};
Container container;
struct VM {
std::string image;
std::string prologScript;
struct EnvironmentVarsItem {
std::string name;
std::string value;
};
EnvironmentVarsItem environmentVarsItem;
std::vector<EnvironmentVarsItem> environmentVars;
std::string script;
};
VM vM;
};
TaskExecutorItem taskExecutorItem;
std::vector<TaskExecutorItem> taskExecutor;
};
TaskSpec taskSpec;
};
CreateJobRequest();
~CreateJobRequest();
MonitorPolicy getMonitorPolicy() const;
void setMonitorPolicy(const MonitorPolicy &monitorPolicy);
std::string getJobDescription() const;
void setJobDescription(const std::string &jobDescription);
DeploymentPolicy getDeploymentPolicy() const;
void setDeploymentPolicy(const DeploymentPolicy &deploymentPolicy);
std::string getJobName() const;
void setJobName(const std::string &jobName);
std::vector<Tasks> getTasks() const;
void setTasks(const std::vector<Tasks> &tasks);
private:
MonitorPolicy monitorPolicy_;
std::string jobDescription_;
DeploymentPolicy deploymentPolicy_;
std::string jobName_;
std::vector<Tasks> tasks_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_CREATEJOBREQUEST_H_

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_EHPCINSTANT_MODEL_CREATEJOBRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_CREATEJOBRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT CreateJobResult : public ServiceResult
{
public:
CreateJobResult();
explicit CreateJobResult(const std::string &payload);
~CreateJobResult();
std::string getJobId()const;
protected:
void parse(const std::string &payload);
private:
std::string jobId_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_CREATEJOBRESULT_H_

View File

@@ -0,0 +1,55 @@
/*
* 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_EHPCINSTANT_MODEL_DELETEJOBSREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_DELETEJOBSREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT DeleteJobsRequest : public RpcServiceRequest {
public:
struct JobSpec {
std::string jobId;
struct TaskSpecItem {
std::string taskName;
int integer;
std::vector<int> arrayIndex;
};
TaskSpecItem taskSpecItem;
std::vector<TaskSpecItem> taskSpec;
};
DeleteJobsRequest();
~DeleteJobsRequest();
std::vector<JobSpec> getJobSpec() const;
void setJobSpec(const std::vector<JobSpec> &jobSpec);
std::vector<std::string> getExecutorIds() const;
void setExecutorIds(const std::vector<std::string> &executorIds);
private:
std::vector<JobSpec> jobSpec_;
std::vector<std::string> executorIds_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DELETEJOBSREQUEST_H_

View 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.
*/
#ifndef ALIBABACLOUD_EHPCINSTANT_MODEL_DELETEJOBSRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_DELETEJOBSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT DeleteJobsResult : public ServiceResult
{
public:
DeleteJobsResult();
explicit DeleteJobsResult(const std::string &payload);
~DeleteJobsResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DELETEJOBSRESULT_H_

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICDATAREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICDATAREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT DescribeJobMetricDataRequest : public RpcServiceRequest {
public:
DescribeJobMetricDataRequest();
~DescribeJobMetricDataRequest();
std::string getTaskName() const;
void setTaskName(const std::string &taskName);
std::string getJobId() const;
void setJobId(const std::string &jobId);
std::string getMetricName() const;
void setMetricName(const std::string &metricName);
std::vector<int> getArrayIndex() const;
void setArrayIndex(const std::vector<int> &arrayIndex);
private:
std::string taskName_;
std::string jobId_;
std::string metricName_;
std::vector<int> arrayIndex_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICDATAREQUEST_H_

View 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_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICDATARESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICDATARESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT DescribeJobMetricDataResult : public ServiceResult
{
public:
DescribeJobMetricDataResult();
explicit DescribeJobMetricDataResult(const std::string &payload);
~DescribeJobMetricDataResult();
int getPeriod()const;
std::string getDataPoints()const;
protected:
void parse(const std::string &payload);
private:
int period_;
std::string dataPoints_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICDATARESULT_H_

View File

@@ -0,0 +1,48 @@
/*
* 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_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT DescribeJobMetricLastRequest : public RpcServiceRequest {
public:
DescribeJobMetricLastRequest();
~DescribeJobMetricLastRequest();
std::string getTaskName() const;
void setTaskName(const std::string &taskName);
std::string getJobId() const;
void setJobId(const std::string &jobId);
std::vector<int> getArrayIndex() const;
void setArrayIndex(const std::vector<int> &arrayIndex);
private:
std::string taskName_;
std::string jobId_;
std::vector<int> arrayIndex_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTREQUEST_H_

View 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_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT DescribeJobMetricLastResult : public ServiceResult
{
public:
struct MetricInfo
{
std::string metric;
int arrayIndex;
};
DescribeJobMetricLastResult();
explicit DescribeJobMetricLastResult(const std::string &payload);
~DescribeJobMetricLastResult();
std::vector<MetricInfo> getMetrics()const;
protected:
void parse(const std::string &payload);
private:
std::vector<MetricInfo> metrics_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTRESULT_H_

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_EHPCINSTANT_MODEL_GETIMAGEREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_GETIMAGEREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT GetImageRequest : public RpcServiceRequest {
public:
GetImageRequest();
~GetImageRequest();
std::string getImageType() const;
void setImageType(const std::string &imageType);
std::string getImageId() const;
void setImageId(const std::string &imageId);
std::string getImageCategory() const;
void setImageCategory(const std::string &imageCategory);
std::string getAppId() const;
void setAppId(const std::string &appId);
private:
std::string imageType_;
std::string imageId_;
std::string imageCategory_;
std::string appId_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_GETIMAGEREQUEST_H_

View File

@@ -0,0 +1,91 @@
/*
* 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_EHPCINSTANT_MODEL_GETIMAGERESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_GETIMAGERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT GetImageResult : public ServiceResult
{
public:
struct Image
{
struct ContainerImageSpec
{
struct RegistryCredential
{
std::string userName;
std::string server;
std::string password;
};
bool isACRRegistry;
std::string registryCriId;
bool isACREnterprise;
RegistryCredential registryCredential;
std::string registryUrl;
};
struct VMImageSpec
{
std::string platform;
std::string architecture;
std::string version;
std::string imageId;
std::string osTag;
};
ContainerImageSpec containerImageSpec;
std::string description;
std::string appId;
std::string version;
std::string size;
std::string createTime;
std::string label;
std::string updateTime;
VMImageSpec vMImageSpec;
std::string imageType;
std::string name;
};
GetImageResult();
explicit GetImageResult(const std::string &payload);
~GetImageResult();
int getTotalCount()const;
Image getImage()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
int totalCount_;
Image image_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_GETIMAGERESULT_H_

View File

@@ -0,0 +1,42 @@
/*
* 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_EHPCINSTANT_MODEL_GETJOBREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_GETJOBREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT GetJobRequest : public RpcServiceRequest {
public:
GetJobRequest();
~GetJobRequest();
std::string getJobId() const;
void setJobId(const std::string &jobId);
private:
std::string jobId_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_GETJOBREQUEST_H_

View File

@@ -0,0 +1,218 @@
/*
* 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_EHPCINSTANT_MODEL_GETJOBRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_GETJOBRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT GetJobResult : public ServiceResult
{
public:
struct JobInfo
{
struct DeploymentPolicy
{
struct Network
{
bool enableERI;
std::vector<std::string> vswitch;
};
struct Tag
{
std::string value;
std::string name;
};
std::string allocationSpec;
Network network;
std::vector<Tag> tags;
};
struct SecurityPolicy
{
struct SecurityGroup
{
std::vector<std::string> securityGroupIds;
};
SecurityGroup securityGroup;
};
struct DependencyPolicy
{
struct JobDependencyItem
{
std::string type;
std::string jobId;
};
std::vector<JobDependencyItem> jobDependency;
};
struct MonitorPolicy
{
struct NotificationSpec
{
struct MNSTopicItem
{
std::string topicLocation;
std::vector<std::string> event;
};
std::vector<MNSTopicItem> mNSTopic;
};
struct LogSpec
{
std::string project;
std::string machineGroup;
std::string logstore;
std::string shard;
std::string expireTime;
};
NotificationSpec notificationSpec;
LogSpec logSpec;
};
struct Task
{
struct TaskSpec
{
struct Resource
{
struct Disk
{
std::string type;
int size;
};
float cores;
bool enableHT;
int memory;
std::vector<Disk> disks;
};
struct RetryPolicy
{
struct ExitCodeAction
{
std::string action;
std::string exitCode;
};
int retryCount;
std::vector<ExitCodeAction> exitCodeActions;
};
struct TaskExecutorItem
{
struct Container
{
struct EnvironmentVar
{
std::string value;
std::string name;
};
std::vector<EnvironmentVar> environmentVars;
std::string workingDir;
std::string appId;
std::string command;
std::string image;
};
struct VM
{
struct EnvironmentVar2
{
std::string value;
std::string name;
};
std::string script;
std::string prologScript;
std::string appId;
std::vector<EnvironmentVar2> environmentVars1;
std::string image;
};
Container container;
VM vM;
};
struct VolumeMountItem
{
std::string mountPath;
std::string volumeDriver;
std::string mountOptions;
};
std::string taskDuration;
std::vector<TaskExecutorItem> taskExecutor;
Resource resource;
std::vector<VolumeMountItem> volumeMount;
RetryPolicy retryPolicy;
};
struct ExecutorPolicy
{
struct ArraySpec
{
int indexStart;
int indexEnd;
int indexStep;
};
ArraySpec arraySpec;
int parallelism;
int maxCount;
};
struct ExecutorStatusItem
{
std::string status;
std::string endTime;
int arrayId;
std::string statusReason;
std::string createTime;
std::string startTime;
};
std::string taskName;
TaskSpec taskSpec;
ExecutorPolicy executorPolicy;
std::vector<Task::ExecutorStatusItem> executorStatus;
bool taskSustainable;
};
std::string jobScheduler;
std::string status;
std::vector<Task> tasks;
std::string endTime;
std::string createTime;
std::string jobName;
std::string startTime;
DependencyPolicy dependencyPolicy;
std::string jobDescription;
SecurityPolicy securityPolicy;
MonitorPolicy monitorPolicy;
DeploymentPolicy deploymentPolicy;
std::string jobId;
};
GetJobResult();
explicit GetJobResult(const std::string &payload);
~GetJobResult();
JobInfo getJobInfo()const;
protected:
void parse(const std::string &payload);
private:
JobInfo jobInfo_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_GETJOBRESULT_H_

View File

@@ -0,0 +1,57 @@
/*
* 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_EHPCINSTANT_MODEL_LISTEXECUTORSREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTEXECUTORSREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListExecutorsRequest : public RpcServiceRequest {
public:
struct Filter {
int timeCreatedAfter;
std::string string;
std::vector<std::string> ipAddresses;
int timeCreatedBefore;
std::string string;
std::vector<std::string> executorIds;
std::string jobName;
};
ListExecutorsRequest();
~ListExecutorsRequest();
std::string getPageNumber() const;
void setPageNumber(const std::string &pageNumber);
Filter getFilter() const;
void setFilter(const Filter &filter);
std::string getPageSize() const;
void setPageSize(const std::string &pageSize);
private:
std::string pageNumber_;
Filter filter_;
std::string pageSize_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTEXECUTORSREQUEST_H_

View File

@@ -0,0 +1,71 @@
/*
* 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_EHPCINSTANT_MODEL_LISTEXECUTORSRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTEXECUTORSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListExecutorsResult : public ServiceResult
{
public:
struct Executor
{
std::string status;
std::string executorId;
std::string endTime;
std::string taskName;
std::string statusReason;
std::string createTime;
std::string jobName;
std::vector<std::string> ipAddress;
int arrayIndex;
std::string jobId;
std::vector<std::string> hostName;
};
ListExecutorsResult();
explicit ListExecutorsResult(const std::string &payload);
~ListExecutorsResult();
std::string getTotalCount()const;
std::string getPageSize()const;
std::string getPageNumber()const;
std::vector<Executor> getExecutors()const;
protected:
void parse(const std::string &payload);
private:
std::string totalCount_;
std::string pageSize_;
std::string pageNumber_;
std::vector<Executor> executors_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTEXECUTORSRESULT_H_

View 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.
*/
#ifndef ALIBABACLOUD_EHPCINSTANT_MODEL_LISTIMAGESREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTIMAGESREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListImagesRequest : public RpcServiceRequest {
public:
ListImagesRequest();
~ListImagesRequest();
std::string getImageType() const;
void setImageType(const std::string &imageType);
std::vector<std::string> getImageNames() const;
void setImageNames(const std::vector<std::string> &imageNames);
long getPageNumber() const;
void setPageNumber(long pageNumber);
std::string getImageCategory() const;
void setImageCategory(const std::string &imageCategory);
std::vector<std::string> getAppIds() const;
void setAppIds(const std::vector<std::string> &appIds);
long getPageSize() const;
void setPageSize(long pageSize);
std::vector<std::string> getImageIds() const;
void setImageIds(const std::vector<std::string> &imageIds);
private:
std::string imageType_;
std::vector<std::string> imageNames_;
long pageNumber_;
std::string imageCategory_;
std::vector<std::string> appIds_;
long pageSize_;
std::vector<std::string> imageIds_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTIMAGESREQUEST_H_

View File

@@ -0,0 +1,72 @@
/*
* 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_EHPCINSTANT_MODEL_LISTIMAGESRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTIMAGESRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListImagesResult : public ServiceResult
{
public:
struct Image
{
std::string status;
std::string description;
std::string appId;
std::string version;
std::string size;
std::string createTime;
std::string imageId;
std::string label;
std::string imageType;
std::string name;
};
ListImagesResult();
explicit ListImagesResult(const std::string &payload);
~ListImagesResult();
int getTotalCount()const;
long getPageSize()const;
long getPageNumber()const;
std::vector<Image> getImages()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
int totalCount_;
long pageSize_;
long pageNumber_;
std::vector<Image> images_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTIMAGESRESULT_H_

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBEXECUTORSREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBEXECUTORSREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListJobExecutorsRequest : public RpcServiceRequest {
public:
ListJobExecutorsRequest();
~ListJobExecutorsRequest();
std::string getTaskName() const;
void setTaskName(const std::string &taskName);
std::string getPageNumber() const;
void setPageNumber(const std::string &pageNumber);
std::string getJobId() const;
void setJobId(const std::string &jobId);
std::string getPageSize() const;
void setPageSize(const std::string &pageSize);
private:
std::string taskName_;
std::string pageNumber_;
std::string jobId_;
std::string pageSize_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBEXECUTORSREQUEST_H_

View File

@@ -0,0 +1,71 @@
/*
* 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_EHPCINSTANT_MODEL_LISTJOBEXECUTORSRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBEXECUTORSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListJobExecutorsResult : public ServiceResult
{
public:
struct Executor
{
std::string status;
std::string endTime;
std::string statusReason;
std::string createTime;
std::vector<std::string> ipAddress;
int arrayIndex;
std::vector<std::string> hostName;
};
ListJobExecutorsResult();
explicit ListJobExecutorsResult(const std::string &payload);
~ListJobExecutorsResult();
std::string getTotalCount()const;
std::string getPageSize()const;
std::string getTaskName()const;
std::string getPageNumber()const;
std::vector<Executor> getExecutors()const;
std::string getJobId()const;
protected:
void parse(const std::string &payload);
private:
std::string totalCount_;
std::string pageSize_;
std::string taskName_;
std::string pageNumber_;
std::vector<Executor> executors_;
std::string jobId_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBEXECUTORSRESULT_H_

View File

@@ -0,0 +1,62 @@
/*
* 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_EHPCINSTANT_MODEL_LISTJOBSREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBSREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListJobsRequest : public RpcServiceRequest {
public:
struct Filter {
std::string jobId;
int timeCreatedAfter;
int timeCreatedBefore;
std::string jobName;
std::string status;
};
struct SortBy {
std::string label;
std::string order;
};
ListJobsRequest();
~ListJobsRequest();
std::string getPageNumber() const;
void setPageNumber(const std::string &pageNumber);
Filter getFilter() const;
void setFilter(const Filter &filter);
std::string getPageSize() const;
void setPageSize(const std::string &pageSize);
SortBy getSortBy() const;
void setSortBy(const SortBy &sortBy);
private:
std::string pageNumber_;
Filter filter_;
std::string pageSize_;
SortBy sortBy_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBSREQUEST_H_

View File

@@ -0,0 +1,71 @@
/*
* 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_EHPCINSTANT_MODEL_LISTJOBSRESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT ListJobsResult : public ServiceResult
{
public:
struct Job
{
std::string status;
std::string jobDescription;
std::string endTime;
std::string ownerUid;
std::string createTime;
int taskCount;
std::string jobName;
std::string startTime;
int executorCount;
std::string jobId;
bool taskSustainable;
};
ListJobsResult();
explicit ListJobsResult(const std::string &payload);
~ListJobsResult();
int getTotalCount()const;
int getPageSize()const;
int getPageNumber()const;
std::vector<Job> getJobList()const;
protected:
void parse(const std::string &payload);
private:
int totalCount_;
int pageSize_;
int pageNumber_;
std::vector<Job> jobList_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBSRESULT_H_

View File

@@ -0,0 +1,48 @@
/*
* 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_EHPCINSTANT_MODEL_REMOVEIMAGEREQUEST_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_REMOVEIMAGEREQUEST_H_
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace EhpcInstant {
namespace Model {
class ALIBABACLOUD_EHPCINSTANT_EXPORT RemoveImageRequest : public RpcServiceRequest {
public:
RemoveImageRequest();
~RemoveImageRequest();
std::string getImageType() const;
void setImageType(const std::string &imageType);
std::string getImageId() const;
void setImageId(const std::string &imageId);
std::string getAppId() const;
void setAppId(const std::string &appId);
private:
std::string imageType_;
std::string imageId_;
std::string appId_;
};
} // namespace Model
} // namespace EhpcInstant
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_REMOVEIMAGEREQUEST_H_

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_EHPCINSTANT_MODEL_REMOVEIMAGERESULT_H_
#define ALIBABACLOUD_EHPCINSTANT_MODEL_REMOVEIMAGERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/ehpcinstant/EhpcInstantExport.h>
namespace AlibabaCloud
{
namespace EhpcInstant
{
namespace Model
{
class ALIBABACLOUD_EHPCINSTANT_EXPORT RemoveImageResult : public ServiceResult
{
public:
RemoveImageResult();
explicit RemoveImageResult(const std::string &payload);
~RemoveImageResult();
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_REMOVEIMAGERESULT_H_

View File

@@ -0,0 +1,485 @@
/*
* 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/ehpcinstant/EhpcInstantClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
namespace
{
const std::string SERVICE_NAME = "EhpcInstant";
}
EhpcInstantClient::EhpcInstantClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
EhpcInstantClient::EhpcInstantClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
EhpcInstantClient::EhpcInstantClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
}
EhpcInstantClient::~EhpcInstantClient()
{}
EhpcInstantClient::AddImageOutcome EhpcInstantClient::addImage(const AddImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return AddImageOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return AddImageOutcome(AddImageResult(outcome.result()));
else
return AddImageOutcome(outcome.error());
}
void EhpcInstantClient::addImageAsync(const AddImageRequest& request, const AddImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, addImage(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::AddImageOutcomeCallable EhpcInstantClient::addImageCallable(const AddImageRequest &request) const
{
auto task = std::make_shared<std::packaged_task<AddImageOutcome()>>(
[this, request]()
{
return this->addImage(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::CreateJobOutcome EhpcInstantClient::createJob(const CreateJobRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateJobOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateJobOutcome(CreateJobResult(outcome.result()));
else
return CreateJobOutcome(outcome.error());
}
void EhpcInstantClient::createJobAsync(const CreateJobRequest& request, const CreateJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createJob(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::CreateJobOutcomeCallable EhpcInstantClient::createJobCallable(const CreateJobRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateJobOutcome()>>(
[this, request]()
{
return this->createJob(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::DeleteJobsOutcome EhpcInstantClient::deleteJobs(const DeleteJobsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteJobsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteJobsOutcome(DeleteJobsResult(outcome.result()));
else
return DeleteJobsOutcome(outcome.error());
}
void EhpcInstantClient::deleteJobsAsync(const DeleteJobsRequest& request, const DeleteJobsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteJobs(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::DeleteJobsOutcomeCallable EhpcInstantClient::deleteJobsCallable(const DeleteJobsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteJobsOutcome()>>(
[this, request]()
{
return this->deleteJobs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::DescribeJobMetricDataOutcome EhpcInstantClient::describeJobMetricData(const DescribeJobMetricDataRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeJobMetricDataOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeJobMetricDataOutcome(DescribeJobMetricDataResult(outcome.result()));
else
return DescribeJobMetricDataOutcome(outcome.error());
}
void EhpcInstantClient::describeJobMetricDataAsync(const DescribeJobMetricDataRequest& request, const DescribeJobMetricDataAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeJobMetricData(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::DescribeJobMetricDataOutcomeCallable EhpcInstantClient::describeJobMetricDataCallable(const DescribeJobMetricDataRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeJobMetricDataOutcome()>>(
[this, request]()
{
return this->describeJobMetricData(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::DescribeJobMetricLastOutcome EhpcInstantClient::describeJobMetricLast(const DescribeJobMetricLastRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeJobMetricLastOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeJobMetricLastOutcome(DescribeJobMetricLastResult(outcome.result()));
else
return DescribeJobMetricLastOutcome(outcome.error());
}
void EhpcInstantClient::describeJobMetricLastAsync(const DescribeJobMetricLastRequest& request, const DescribeJobMetricLastAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeJobMetricLast(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::DescribeJobMetricLastOutcomeCallable EhpcInstantClient::describeJobMetricLastCallable(const DescribeJobMetricLastRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeJobMetricLastOutcome()>>(
[this, request]()
{
return this->describeJobMetricLast(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::GetImageOutcome EhpcInstantClient::getImage(const GetImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetImageOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetImageOutcome(GetImageResult(outcome.result()));
else
return GetImageOutcome(outcome.error());
}
void EhpcInstantClient::getImageAsync(const GetImageRequest& request, const GetImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getImage(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::GetImageOutcomeCallable EhpcInstantClient::getImageCallable(const GetImageRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetImageOutcome()>>(
[this, request]()
{
return this->getImage(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::GetJobOutcome EhpcInstantClient::getJob(const GetJobRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetJobOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetJobOutcome(GetJobResult(outcome.result()));
else
return GetJobOutcome(outcome.error());
}
void EhpcInstantClient::getJobAsync(const GetJobRequest& request, const GetJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getJob(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::GetJobOutcomeCallable EhpcInstantClient::getJobCallable(const GetJobRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetJobOutcome()>>(
[this, request]()
{
return this->getJob(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::ListExecutorsOutcome EhpcInstantClient::listExecutors(const ListExecutorsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListExecutorsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListExecutorsOutcome(ListExecutorsResult(outcome.result()));
else
return ListExecutorsOutcome(outcome.error());
}
void EhpcInstantClient::listExecutorsAsync(const ListExecutorsRequest& request, const ListExecutorsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listExecutors(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::ListExecutorsOutcomeCallable EhpcInstantClient::listExecutorsCallable(const ListExecutorsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListExecutorsOutcome()>>(
[this, request]()
{
return this->listExecutors(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::ListImagesOutcome EhpcInstantClient::listImages(const ListImagesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListImagesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListImagesOutcome(ListImagesResult(outcome.result()));
else
return ListImagesOutcome(outcome.error());
}
void EhpcInstantClient::listImagesAsync(const ListImagesRequest& request, const ListImagesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listImages(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::ListImagesOutcomeCallable EhpcInstantClient::listImagesCallable(const ListImagesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListImagesOutcome()>>(
[this, request]()
{
return this->listImages(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::ListJobExecutorsOutcome EhpcInstantClient::listJobExecutors(const ListJobExecutorsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListJobExecutorsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListJobExecutorsOutcome(ListJobExecutorsResult(outcome.result()));
else
return ListJobExecutorsOutcome(outcome.error());
}
void EhpcInstantClient::listJobExecutorsAsync(const ListJobExecutorsRequest& request, const ListJobExecutorsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listJobExecutors(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::ListJobExecutorsOutcomeCallable EhpcInstantClient::listJobExecutorsCallable(const ListJobExecutorsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListJobExecutorsOutcome()>>(
[this, request]()
{
return this->listJobExecutors(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::ListJobsOutcome EhpcInstantClient::listJobs(const ListJobsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListJobsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListJobsOutcome(ListJobsResult(outcome.result()));
else
return ListJobsOutcome(outcome.error());
}
void EhpcInstantClient::listJobsAsync(const ListJobsRequest& request, const ListJobsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listJobs(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::ListJobsOutcomeCallable EhpcInstantClient::listJobsCallable(const ListJobsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListJobsOutcome()>>(
[this, request]()
{
return this->listJobs(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EhpcInstantClient::RemoveImageOutcome EhpcInstantClient::removeImage(const RemoveImageRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RemoveImageOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RemoveImageOutcome(RemoveImageResult(outcome.result()));
else
return RemoveImageOutcome(outcome.error());
}
void EhpcInstantClient::removeImageAsync(const RemoveImageRequest& request, const RemoveImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, removeImage(request), context);
};
asyncExecute(new Runnable(fn));
}
EhpcInstantClient::RemoveImageOutcomeCallable EhpcInstantClient::removeImageCallable(const RemoveImageRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RemoveImageOutcome()>>(
[this, request]()
{
return this->removeImage(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -0,0 +1,87 @@
/*
* 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/ehpcinstant/model/AddImageRequest.h>
using AlibabaCloud::EhpcInstant::Model::AddImageRequest;
AddImageRequest::AddImageRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "AddImage") {
setMethod(HttpRequest::Method::Post);
}
AddImageRequest::~AddImageRequest() {}
std::string AddImageRequest::getImageType() const {
return imageType_;
}
void AddImageRequest::setImageType(const std::string &imageType) {
imageType_ = imageType;
setParameter(std::string("ImageType"), imageType);
}
std::string AddImageRequest::getDescription() const {
return description_;
}
void AddImageRequest::setDescription(const std::string &description) {
description_ = description;
setParameter(std::string("Description"), description);
}
std::string AddImageRequest::getName() const {
return name_;
}
void AddImageRequest::setName(const std::string &name) {
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 {
return containerImageSpec_;
}
void AddImageRequest::setContainerImageSpec(const AddImageRequest::ContainerImageSpec &containerImageSpec) {
containerImageSpec_ = containerImageSpec;
setParameter(std::string("ContainerImageSpec") + ".IsACREnterprise", containerImageSpec.isACREnterprise ? "true" : "false");
setParameter(std::string("ContainerImageSpec") + ".RegistryUrl", containerImageSpec.registryUrl);
setParameter(std::string("ContainerImageSpec") + ".RegistryCredential.Server", containerImageSpec.registryCredential.server);
setParameter(std::string("ContainerImageSpec") + ".RegistryCredential.Password", containerImageSpec.registryCredential.password);
setParameter(std::string("ContainerImageSpec") + ".RegistryCredential.UserName", containerImageSpec.registryCredential.userName);
setParameter(std::string("ContainerImageSpec") + ".RegistryCriId", containerImageSpec.registryCriId);
setParameter(std::string("ContainerImageSpec") + ".IsACRRegistry", containerImageSpec.isACRRegistry ? "true" : "false");
}
AddImageRequest::VMImageSpec AddImageRequest::getVMImageSpec() const {
return vMImageSpec_;
}
void AddImageRequest::setVMImageSpec(const AddImageRequest::VMImageSpec &vMImageSpec) {
vMImageSpec_ = vMImageSpec;
setParameter(std::string("VMImageSpec") + ".ImageId", vMImageSpec.imageId);
}

View File

@@ -0,0 +1,65 @@
/*
* 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/ehpcinstant/model/AddImageResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
AddImageResult::AddImageResult() :
ServiceResult()
{}
AddImageResult::AddImageResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
AddImageResult::~AddImageResult()
{}
void AddImageResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["ImageId"].isNull())
imageId_ = value["ImageId"].asString();
if(!value["AppId"].isNull())
appId_ = value["AppId"].asString();
}
std::string AddImageResult::getAppId()const
{
return appId_;
}
std::string AddImageResult::getImageId()const
{
return imageId_;
}
bool AddImageResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,125 @@
/*
* 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/ehpcinstant/model/CreateJobRequest.h>
using AlibabaCloud::EhpcInstant::Model::CreateJobRequest;
CreateJobRequest::CreateJobRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "CreateJob") {
setMethod(HttpRequest::Method::Post);
}
CreateJobRequest::~CreateJobRequest() {}
CreateJobRequest::MonitorPolicy CreateJobRequest::getMonitorPolicy() const {
return monitorPolicy_;
}
void CreateJobRequest::setMonitorPolicy(const CreateJobRequest::MonitorPolicy &monitorPolicy) {
monitorPolicy_ = monitorPolicy;
for(int dep1 = 0; dep1 != monitorPolicy.notificationSpec.mNSTopic.size(); dep1++) {
for(int dep2 = 0; dep2 != monitorPolicy.notificationSpec.mNSTopic[dep1].event.size(); dep2++) {
setParameter(std::string("MonitorPolicy") + ".NotificationSpec.MNSTopic." + std::to_string(dep1 + 1) + ".Event." + std::to_string(dep2 + 1), monitorPolicy.notificationSpec.mNSTopic[dep1].event[dep2]);
}
setParameter(std::string("MonitorPolicy") + ".NotificationSpec.MNSTopic." + std::to_string(dep1 + 1) + ".TopicLocation", monitorPolicy.notificationSpec.mNSTopic[dep1].topicLocation);
}
}
std::string CreateJobRequest::getJobDescription() const {
return jobDescription_;
}
void CreateJobRequest::setJobDescription(const std::string &jobDescription) {
jobDescription_ = jobDescription;
setParameter(std::string("JobDescription"), jobDescription);
}
CreateJobRequest::DeploymentPolicy CreateJobRequest::getDeploymentPolicy() const {
return deploymentPolicy_;
}
void CreateJobRequest::setDeploymentPolicy(const CreateJobRequest::DeploymentPolicy &deploymentPolicy) {
deploymentPolicy_ = deploymentPolicy;
setParameter(std::string("DeploymentPolicy") + ".AllocationSpec", deploymentPolicy.allocationSpec);
setParameter(std::string("DeploymentPolicy") + ".Network.EnableERI", deploymentPolicy.network.enableERI ? "true" : "false");
for(int dep1 = 0; dep1 != deploymentPolicy.network.vswitch.size(); dep1++) {
setParameter(std::string("DeploymentPolicy") + ".Network.Vswitch." + std::to_string(dep1 + 1), deploymentPolicy.network.vswitch[dep1]);
}
setParameter(std::string("DeploymentPolicy") + ".Network.EnableENIMapping", deploymentPolicy.network.enableENIMapping ? "true" : "false");
}
std::string CreateJobRequest::getJobName() const {
return jobName_;
}
void CreateJobRequest::setJobName(const std::string &jobName) {
jobName_ = jobName;
setParameter(std::string("JobName"), jobName);
}
std::vector<CreateJobRequest::Tasks> CreateJobRequest::getTasks() const {
return tasks_;
}
void CreateJobRequest::setTasks(const std::vector<CreateJobRequest::Tasks> &tasks) {
tasks_ = tasks;
for(int dep1 = 0; dep1 != tasks.size(); dep1++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSustainable", tasks[dep1].taskSustainable ? "true" : "false");
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskName", tasks[dep1].taskName);
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".ExecutorPolicy.MaxCount", std::to_string(tasks[dep1].executorPolicy.maxCount));
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".ExecutorPolicy.ArraySpec.IndexStart", std::to_string(tasks[dep1].executorPolicy.arraySpec.indexStart));
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".ExecutorPolicy.ArraySpec.IndexStep", std::to_string(tasks[dep1].executorPolicy.arraySpec.indexStep));
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".ExecutorPolicy.ArraySpec.IndexEnd", std::to_string(tasks[dep1].executorPolicy.arraySpec.indexEnd));
for(int dep2 = 0; dep2 != tasks[dep1].taskSpec.volumeMount.size(); dep2++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.VolumeMount." + std::to_string(dep2 + 1) + ".MountOptions", tasks[dep1].taskSpec.volumeMount[dep2].mountOptions);
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.VolumeMount." + std::to_string(dep2 + 1) + ".VolumeDriver", tasks[dep1].taskSpec.volumeMount[dep2].volumeDriver);
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.VolumeMount." + std::to_string(dep2 + 1) + ".MountPath", tasks[dep1].taskSpec.volumeMount[dep2].mountPath);
}
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.RetryPolicy.RetryCount", std::to_string(tasks[dep1].taskSpec.retryPolicy.retryCount));
for(int dep2 = 0; dep2 != tasks[dep1].taskSpec.retryPolicy.exitCodeActions.size(); dep2++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.RetryPolicy.ExitCodeActions." + std::to_string(dep2 + 1) + ".Action", tasks[dep1].taskSpec.retryPolicy.exitCodeActions[dep2].action);
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.RetryPolicy.ExitCodeActions." + std::to_string(dep2 + 1) + ".ExitCode", tasks[dep1].taskSpec.retryPolicy.exitCodeActions[dep2].exitCode);
}
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.Resource.Cores", std::to_string(tasks[dep1].taskSpec.resource.cores));
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.Resource.Memory", std::to_string(tasks[dep1].taskSpec.resource.memory));
for(int dep2 = 0; dep2 != tasks[dep1].taskSpec.resource.disks.size(); dep2++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.Resource.Disks." + std::to_string(dep2 + 1) + ".Size", std::to_string(tasks[dep1].taskSpec.resource.disks[dep2].size));
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.Resource.Disks." + std::to_string(dep2 + 1) + ".Type", tasks[dep1].taskSpec.resource.disks[dep2].type);
}
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.Resource.EnableHT", tasks[dep1].taskSpec.resource.enableHT ? "true" : "false");
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskDuration", tasks[dep1].taskSpec.taskDuration);
for(int dep2 = 0; dep2 != tasks[dep1].taskSpec.taskExecutor.size(); dep2++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".Container.Image", tasks[dep1].taskSpec.taskExecutor[dep2].container.image);
for(int dep3 = 0; dep3 != tasks[dep1].taskSpec.taskExecutor[dep2].container.environmentVars.size(); dep3++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".Container.EnvironmentVars." + std::to_string(dep3 + 1) + ".Name", tasks[dep1].taskSpec.taskExecutor[dep2].container.environmentVars[dep3].name);
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".Container.EnvironmentVars." + std::to_string(dep3 + 1) + ".Value", tasks[dep1].taskSpec.taskExecutor[dep2].container.environmentVars[dep3].value);
}
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".Container.WorkingDir", tasks[dep1].taskSpec.taskExecutor[dep2].container.workingDir);
for(int dep3 = 0; dep3 != tasks[dep1].taskSpec.taskExecutor[dep2].container.command.size(); dep3++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".Container.Command." + std::to_string(dep3 + 1), tasks[dep1].taskSpec.taskExecutor[dep2].container.command[dep3]);
}
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".VM.Image", tasks[dep1].taskSpec.taskExecutor[dep2].vM.image);
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".VM.PrologScript", tasks[dep1].taskSpec.taskExecutor[dep2].vM.prologScript);
for(int dep3 = 0; dep3 != tasks[dep1].taskSpec.taskExecutor[dep2].vM.environmentVars.size(); dep3++) {
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".VM.EnvironmentVars." + std::to_string(dep3 + 1) + ".Name", tasks[dep1].taskSpec.taskExecutor[dep2].vM.environmentVars[dep3].name);
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".VM.EnvironmentVars." + std::to_string(dep3 + 1) + ".Value", tasks[dep1].taskSpec.taskExecutor[dep2].vM.environmentVars[dep3].value);
}
setParameter(std::string("Tasks") + "." + std::to_string(dep1 + 1) + ".TaskSpec.TaskExecutor." + std::to_string(dep2 + 1) + ".VM.Script", tasks[dep1].taskSpec.taskExecutor[dep2].vM.script);
}
}
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/ehpcinstant/model/CreateJobResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
CreateJobResult::CreateJobResult() :
ServiceResult()
{}
CreateJobResult::CreateJobResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateJobResult::~CreateJobResult()
{}
void CreateJobResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["JobId"].isNull())
jobId_ = value["JobId"].asString();
}
std::string CreateJobResult::getJobId()const
{
return jobId_;
}

View File

@@ -0,0 +1,55 @@
/*
* 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/ehpcinstant/model/DeleteJobsRequest.h>
using AlibabaCloud::EhpcInstant::Model::DeleteJobsRequest;
DeleteJobsRequest::DeleteJobsRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "DeleteJobs") {
setMethod(HttpRequest::Method::Post);
}
DeleteJobsRequest::~DeleteJobsRequest() {}
std::vector<DeleteJobsRequest::JobSpec> DeleteJobsRequest::getJobSpec() const {
return jobSpec_;
}
void DeleteJobsRequest::setJobSpec(const std::vector<DeleteJobsRequest::JobSpec> &jobSpec) {
jobSpec_ = jobSpec;
for(int dep1 = 0; dep1 != jobSpec.size(); dep1++) {
setParameter(std::string("JobSpec") + "." + std::to_string(dep1 + 1) + ".JobId", jobSpec[dep1].jobId);
for(int dep2 = 0; dep2 != jobSpec[dep1].taskSpec.size(); dep2++) {
setParameter(std::string("JobSpec") + "." + std::to_string(dep1 + 1) + ".TaskSpec." + std::to_string(dep2 + 1) + ".TaskName", jobSpec[dep1].taskSpec[dep2].taskName);
for(int dep3 = 0; dep3 != jobSpec[dep1].taskSpec[dep2].arrayIndex.size(); dep3++) {
setParameter(std::string("JobSpec") + "." + std::to_string(dep1 + 1) + ".TaskSpec." + std::to_string(dep2 + 1) + ".ArrayIndex." + std::to_string(dep3 + 1), std::to_string(jobSpec[dep1].taskSpec[dep2].arrayIndex[dep3]));
}
}
}
}
std::vector<DeleteJobsRequest::std::string> DeleteJobsRequest::getExecutorIds() const {
return executorIds_;
}
void DeleteJobsRequest::setExecutorIds(const std::vector<DeleteJobsRequest::std::string> &executorIds) {
executorIds_ = executorIds;
for(int dep1 = 0; dep1 != executorIds.size(); dep1++) {
setParameter(std::string("ExecutorIds") + "." + std::to_string(dep1 + 1), executorIds[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/ehpcinstant/model/DeleteJobsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
DeleteJobsResult::DeleteJobsResult() :
ServiceResult()
{}
DeleteJobsResult::DeleteJobsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteJobsResult::~DeleteJobsResult()
{}
void DeleteJobsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,65 @@
/*
* 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/ehpcinstant/model/DescribeJobMetricDataRequest.h>
using AlibabaCloud::EhpcInstant::Model::DescribeJobMetricDataRequest;
DescribeJobMetricDataRequest::DescribeJobMetricDataRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "DescribeJobMetricData") {
setMethod(HttpRequest::Method::Post);
}
DescribeJobMetricDataRequest::~DescribeJobMetricDataRequest() {}
std::string DescribeJobMetricDataRequest::getTaskName() const {
return taskName_;
}
void DescribeJobMetricDataRequest::setTaskName(const std::string &taskName) {
taskName_ = taskName;
setParameter(std::string("TaskName"), taskName);
}
std::string DescribeJobMetricDataRequest::getJobId() const {
return jobId_;
}
void DescribeJobMetricDataRequest::setJobId(const std::string &jobId) {
jobId_ = jobId;
setParameter(std::string("JobId"), jobId);
}
std::string DescribeJobMetricDataRequest::getMetricName() const {
return metricName_;
}
void DescribeJobMetricDataRequest::setMetricName(const std::string &metricName) {
metricName_ = metricName;
setParameter(std::string("MetricName"), metricName);
}
std::vector<DescribeJobMetricDataRequest::int> DescribeJobMetricDataRequest::getArrayIndex() const {
return arrayIndex_;
}
void DescribeJobMetricDataRequest::setArrayIndex(const std::vector<DescribeJobMetricDataRequest::int> &arrayIndex) {
arrayIndex_ = arrayIndex;
for(int dep1 = 0; dep1 != arrayIndex.size(); dep1++) {
setParameter(std::string("ArrayIndex") + "." + std::to_string(dep1 + 1), std::to_string(arrayIndex[dep1]));
}
}

View 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/ehpcinstant/model/DescribeJobMetricDataResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
DescribeJobMetricDataResult::DescribeJobMetricDataResult() :
ServiceResult()
{}
DescribeJobMetricDataResult::DescribeJobMetricDataResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeJobMetricDataResult::~DescribeJobMetricDataResult()
{}
void DescribeJobMetricDataResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Period"].isNull())
period_ = std::stoi(value["Period"].asString());
if(!value["DataPoints"].isNull())
dataPoints_ = value["DataPoints"].asString();
}
int DescribeJobMetricDataResult::getPeriod()const
{
return period_;
}
std::string DescribeJobMetricDataResult::getDataPoints()const
{
return dataPoints_;
}

View 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.
*/
#include <alibabacloud/ehpcinstant/model/DescribeJobMetricLastRequest.h>
using AlibabaCloud::EhpcInstant::Model::DescribeJobMetricLastRequest;
DescribeJobMetricLastRequest::DescribeJobMetricLastRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "DescribeJobMetricLast") {
setMethod(HttpRequest::Method::Post);
}
DescribeJobMetricLastRequest::~DescribeJobMetricLastRequest() {}
std::string DescribeJobMetricLastRequest::getTaskName() const {
return taskName_;
}
void DescribeJobMetricLastRequest::setTaskName(const std::string &taskName) {
taskName_ = taskName;
setParameter(std::string("TaskName"), taskName);
}
std::string DescribeJobMetricLastRequest::getJobId() const {
return jobId_;
}
void DescribeJobMetricLastRequest::setJobId(const std::string &jobId) {
jobId_ = jobId;
setParameter(std::string("JobId"), jobId);
}
std::vector<DescribeJobMetricLastRequest::int> DescribeJobMetricLastRequest::getArrayIndex() const {
return arrayIndex_;
}
void DescribeJobMetricLastRequest::setArrayIndex(const std::vector<DescribeJobMetricLastRequest::int> &arrayIndex) {
arrayIndex_ = arrayIndex;
for(int dep1 = 0; dep1 != arrayIndex.size(); dep1++) {
setParameter(std::string("ArrayIndex") + "." + std::to_string(dep1 + 1), std::to_string(arrayIndex[dep1]));
}
}

View File

@@ -0,0 +1,59 @@
/*
* 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/ehpcinstant/model/DescribeJobMetricLastResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
DescribeJobMetricLastResult::DescribeJobMetricLastResult() :
ServiceResult()
{}
DescribeJobMetricLastResult::DescribeJobMetricLastResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeJobMetricLastResult::~DescribeJobMetricLastResult()
{}
void DescribeJobMetricLastResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allMetricsNode = value["Metrics"]["MetricInfo"];
for (auto valueMetricsMetricInfo : allMetricsNode)
{
MetricInfo metricsObject;
if(!valueMetricsMetricInfo["ArrayIndex"].isNull())
metricsObject.arrayIndex = std::stoi(valueMetricsMetricInfo["ArrayIndex"].asString());
if(!valueMetricsMetricInfo["Metric"].isNull())
metricsObject.metric = valueMetricsMetricInfo["Metric"].asString();
metrics_.push_back(metricsObject);
}
}
std::vector<DescribeJobMetricLastResult::MetricInfo> DescribeJobMetricLastResult::getMetrics()const
{
return metrics_;
}

View File

@@ -0,0 +1,63 @@
/*
* 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/ehpcinstant/model/GetImageRequest.h>
using AlibabaCloud::EhpcInstant::Model::GetImageRequest;
GetImageRequest::GetImageRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "GetImage") {
setMethod(HttpRequest::Method::Post);
}
GetImageRequest::~GetImageRequest() {}
std::string GetImageRequest::getImageType() const {
return imageType_;
}
void GetImageRequest::setImageType(const std::string &imageType) {
imageType_ = imageType;
setParameter(std::string("ImageType"), imageType);
}
std::string GetImageRequest::getImageId() const {
return imageId_;
}
void GetImageRequest::setImageId(const std::string &imageId) {
imageId_ = imageId;
setParameter(std::string("ImageId"), imageId);
}
std::string GetImageRequest::getImageCategory() const {
return imageCategory_;
}
void GetImageRequest::setImageCategory(const std::string &imageCategory) {
imageCategory_ = imageCategory;
setParameter(std::string("ImageCategory"), imageCategory);
}
std::string GetImageRequest::getAppId() const {
return appId_;
}
void GetImageRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}

View File

@@ -0,0 +1,109 @@
/*
* 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/ehpcinstant/model/GetImageResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
GetImageResult::GetImageResult() :
ServiceResult()
{}
GetImageResult::GetImageResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetImageResult::~GetImageResult()
{}
void GetImageResult::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["ImageType"].isNull())
image_.imageType = imageNode["ImageType"].asString();
if(!imageNode["AppId"].isNull())
image_.appId = imageNode["AppId"].asString();
if(!imageNode["Name"].isNull())
image_.name = imageNode["Name"].asString();
if(!imageNode["Version"].isNull())
image_.version = imageNode["Version"].asString();
if(!imageNode["Label"].isNull())
image_.label = imageNode["Label"].asString();
if(!imageNode["Description"].isNull())
image_.description = imageNode["Description"].asString();
if(!imageNode["Size"].isNull())
image_.size = imageNode["Size"].asString();
if(!imageNode["CreateTime"].isNull())
image_.createTime = imageNode["CreateTime"].asString();
if(!imageNode["UpdateTime"].isNull())
image_.updateTime = imageNode["UpdateTime"].asString();
auto containerImageSpecNode = imageNode["ContainerImageSpec"];
if(!containerImageSpecNode["RegistryUrl"].isNull())
image_.containerImageSpec.registryUrl = containerImageSpecNode["RegistryUrl"].asString();
if(!containerImageSpecNode["IsACRRegistry"].isNull())
image_.containerImageSpec.isACRRegistry = containerImageSpecNode["IsACRRegistry"].asString() == "true";
if(!containerImageSpecNode["IsACREnterprise"].isNull())
image_.containerImageSpec.isACREnterprise = containerImageSpecNode["IsACREnterprise"].asString() == "true";
if(!containerImageSpecNode["RegistryCriId"].isNull())
image_.containerImageSpec.registryCriId = containerImageSpecNode["RegistryCriId"].asString();
auto registryCredentialNode = containerImageSpecNode["RegistryCredential"];
if(!registryCredentialNode["Server"].isNull())
image_.containerImageSpec.registryCredential.server = registryCredentialNode["Server"].asString();
if(!registryCredentialNode["UserName"].isNull())
image_.containerImageSpec.registryCredential.userName = registryCredentialNode["UserName"].asString();
if(!registryCredentialNode["Password"].isNull())
image_.containerImageSpec.registryCredential.password = registryCredentialNode["Password"].asString();
auto vMImageSpecNode = imageNode["VMImageSpec"];
if(!vMImageSpecNode["ImageId"].isNull())
image_.vMImageSpec.imageId = vMImageSpecNode["ImageId"].asString();
if(!vMImageSpecNode["OsTag"].isNull())
image_.vMImageSpec.osTag = vMImageSpecNode["OsTag"].asString();
if(!vMImageSpecNode["Platform"].isNull())
image_.vMImageSpec.platform = vMImageSpecNode["Platform"].asString();
if(!vMImageSpecNode["Version"].isNull())
image_.vMImageSpec.version = vMImageSpecNode["Version"].asString();
if(!vMImageSpecNode["Architecture"].isNull())
image_.vMImageSpec.architecture = vMImageSpecNode["Architecture"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
}
int GetImageResult::getTotalCount()const
{
return totalCount_;
}
GetImageResult::Image GetImageResult::getImage()const
{
return image_;
}
bool GetImageResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,36 @@
/*
* 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/ehpcinstant/model/GetJobRequest.h>
using AlibabaCloud::EhpcInstant::Model::GetJobRequest;
GetJobRequest::GetJobRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "GetJob") {
setMethod(HttpRequest::Method::Post);
}
GetJobRequest::~GetJobRequest() {}
std::string GetJobRequest::getJobId() const {
return jobId_;
}
void GetJobRequest::setJobId(const std::string &jobId) {
jobId_ = jobId;
setParameter(std::string("JobId"), jobId);
}

View File

@@ -0,0 +1,254 @@
/*
* 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/ehpcinstant/model/GetJobResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
GetJobResult::GetJobResult() :
ServiceResult()
{}
GetJobResult::GetJobResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetJobResult::~GetJobResult()
{}
void GetJobResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto jobInfoNode = value["JobInfo"];
if(!jobInfoNode["JobId"].isNull())
jobInfo_.jobId = jobInfoNode["JobId"].asString();
if(!jobInfoNode["JobName"].isNull())
jobInfo_.jobName = jobInfoNode["JobName"].asString();
if(!jobInfoNode["JobDescription"].isNull())
jobInfo_.jobDescription = jobInfoNode["JobDescription"].asString();
if(!jobInfoNode["JobScheduler"].isNull())
jobInfo_.jobScheduler = jobInfoNode["JobScheduler"].asString();
if(!jobInfoNode["CreateTime"].isNull())
jobInfo_.createTime = jobInfoNode["CreateTime"].asString();
if(!jobInfoNode["StartTime"].isNull())
jobInfo_.startTime = jobInfoNode["StartTime"].asString();
if(!jobInfoNode["EndTime"].isNull())
jobInfo_.endTime = jobInfoNode["EndTime"].asString();
if(!jobInfoNode["Status"].isNull())
jobInfo_.status = jobInfoNode["Status"].asString();
auto allTasksNode = jobInfoNode["Tasks"]["Task"];
for (auto jobInfoNodeTasksTask : allTasksNode)
{
JobInfo::Task taskObject;
if(!jobInfoNodeTasksTask["TaskName"].isNull())
taskObject.taskName = jobInfoNodeTasksTask["TaskName"].asString();
if(!jobInfoNodeTasksTask["TaskSustainable"].isNull())
taskObject.taskSustainable = jobInfoNodeTasksTask["TaskSustainable"].asString() == "true";
auto allExecutorStatusNode = jobInfoNodeTasksTask["ExecutorStatus"]["ExecutorStatusItem"];
for (auto jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem : allExecutorStatusNode)
{
JobInfo::Task::ExecutorStatusItem executorStatusObject;
if(!jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["ArrayId"].isNull())
executorStatusObject.arrayId = std::stoi(jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["ArrayId"].asString());
if(!jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["Status"].isNull())
executorStatusObject.status = jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["Status"].asString();
if(!jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["StatusReason"].isNull())
executorStatusObject.statusReason = jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["StatusReason"].asString();
if(!jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["CreateTime"].isNull())
executorStatusObject.createTime = jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["CreateTime"].asString();
if(!jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["StartTime"].isNull())
executorStatusObject.startTime = jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["StartTime"].asString();
if(!jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["EndTime"].isNull())
executorStatusObject.endTime = jobInfoNodeTasksTaskExecutorStatusExecutorStatusItem["EndTime"].asString();
taskObject.executorStatus.push_back(executorStatusObject);
}
auto taskSpecNode = value["TaskSpec"];
if(!taskSpecNode["TaskDuration"].isNull())
taskObject.taskSpec.taskDuration = taskSpecNode["TaskDuration"].asString();
auto allTaskExecutorNode = taskSpecNode["TaskExecutor"]["TaskExecutorItem"];
for (auto taskSpecNodeTaskExecutorTaskExecutorItem : allTaskExecutorNode)
{
JobInfo::Task::TaskSpec::TaskExecutorItem taskExecutorItemObject;
auto containerNode = value["Container"];
if(!containerNode["Image"].isNull())
taskExecutorItemObject.container.image = containerNode["Image"].asString();
if(!containerNode["WorkingDir"].isNull())
taskExecutorItemObject.container.workingDir = containerNode["WorkingDir"].asString();
if(!containerNode["Command"].isNull())
taskExecutorItemObject.container.command = containerNode["Command"].asString();
if(!containerNode["AppId"].isNull())
taskExecutorItemObject.container.appId = containerNode["AppId"].asString();
auto allEnvironmentVarsNode = containerNode["EnvironmentVars"]["EnvironmentVar"];
for (auto containerNodeEnvironmentVarsEnvironmentVar : allEnvironmentVarsNode)
{
JobInfo::Task::TaskSpec::TaskExecutorItem::Container::EnvironmentVar environmentVarObject;
if(!containerNodeEnvironmentVarsEnvironmentVar["Name"].isNull())
environmentVarObject.name = containerNodeEnvironmentVarsEnvironmentVar["Name"].asString();
if(!containerNodeEnvironmentVarsEnvironmentVar["Value"].isNull())
environmentVarObject.value = containerNodeEnvironmentVarsEnvironmentVar["Value"].asString();
taskExecutorItemObject.container.environmentVars.push_back(environmentVarObject);
}
auto vMNode = value["VM"];
if(!vMNode["Image"].isNull())
taskExecutorItemObject.vM.image = vMNode["Image"].asString();
if(!vMNode["PrologScript"].isNull())
taskExecutorItemObject.vM.prologScript = vMNode["PrologScript"].asString();
if(!vMNode["Script"].isNull())
taskExecutorItemObject.vM.script = vMNode["Script"].asString();
if(!vMNode["AppId"].isNull())
taskExecutorItemObject.vM.appId = vMNode["AppId"].asString();
auto allEnvironmentVars1Node = vMNode["EnvironmentVars"]["EnvironmentVar"];
for (auto vMNodeEnvironmentVarsEnvironmentVar : allEnvironmentVars1Node)
{
JobInfo::Task::TaskSpec::TaskExecutorItem::VM::EnvironmentVar2 environmentVar2Object;
if(!vMNodeEnvironmentVarsEnvironmentVar["Name"].isNull())
environmentVar2Object.name = vMNodeEnvironmentVarsEnvironmentVar["Name"].asString();
if(!vMNodeEnvironmentVarsEnvironmentVar["Value"].isNull())
environmentVar2Object.value = vMNodeEnvironmentVarsEnvironmentVar["Value"].asString();
taskExecutorItemObject.vM.environmentVars1.push_back(environmentVar2Object);
}
taskObject.taskSpec.taskExecutor.push_back(taskExecutorItemObject);
}
auto allVolumeMountNode = taskSpecNode["VolumeMount"]["VolumeMountItem"];
for (auto taskSpecNodeVolumeMountVolumeMountItem : allVolumeMountNode)
{
JobInfo::Task::TaskSpec::VolumeMountItem volumeMountItemObject;
if(!taskSpecNodeVolumeMountVolumeMountItem["MountPath"].isNull())
volumeMountItemObject.mountPath = taskSpecNodeVolumeMountVolumeMountItem["MountPath"].asString();
if(!taskSpecNodeVolumeMountVolumeMountItem["VolumeDriver"].isNull())
volumeMountItemObject.volumeDriver = taskSpecNodeVolumeMountVolumeMountItem["VolumeDriver"].asString();
if(!taskSpecNodeVolumeMountVolumeMountItem["MountOptions"].isNull())
volumeMountItemObject.mountOptions = taskSpecNodeVolumeMountVolumeMountItem["MountOptions"].asString();
taskObject.taskSpec.volumeMount.push_back(volumeMountItemObject);
}
auto resourceNode = taskSpecNode["Resource"];
if(!resourceNode["Cores"].isNull())
taskObject.taskSpec.resource.cores = std::stof(resourceNode["Cores"].asString());
if(!resourceNode["EnableHT"].isNull())
taskObject.taskSpec.resource.enableHT = resourceNode["EnableHT"].asString() == "true";
if(!resourceNode["Memory"].isNull())
taskObject.taskSpec.resource.memory = std::stoi(resourceNode["Memory"].asString());
auto allDisksNode = resourceNode["Disks"]["Disk"];
for (auto resourceNodeDisksDisk : allDisksNode)
{
JobInfo::Task::TaskSpec::Resource::Disk diskObject;
if(!resourceNodeDisksDisk["Type"].isNull())
diskObject.type = resourceNodeDisksDisk["Type"].asString();
if(!resourceNodeDisksDisk["Size"].isNull())
diskObject.size = std::stoi(resourceNodeDisksDisk["Size"].asString());
taskObject.taskSpec.resource.disks.push_back(diskObject);
}
auto retryPolicyNode = taskSpecNode["RetryPolicy"];
if(!retryPolicyNode["RetryCount"].isNull())
taskObject.taskSpec.retryPolicy.retryCount = std::stoi(retryPolicyNode["RetryCount"].asString());
auto allExitCodeActionsNode = retryPolicyNode["ExitCodeActions"]["ExitCodeAction"];
for (auto retryPolicyNodeExitCodeActionsExitCodeAction : allExitCodeActionsNode)
{
JobInfo::Task::TaskSpec::RetryPolicy::ExitCodeAction exitCodeActionObject;
if(!retryPolicyNodeExitCodeActionsExitCodeAction["ExitCode"].isNull())
exitCodeActionObject.exitCode = retryPolicyNodeExitCodeActionsExitCodeAction["ExitCode"].asString();
if(!retryPolicyNodeExitCodeActionsExitCodeAction["Action"].isNull())
exitCodeActionObject.action = retryPolicyNodeExitCodeActionsExitCodeAction["Action"].asString();
taskObject.taskSpec.retryPolicy.exitCodeActions.push_back(exitCodeActionObject);
}
auto executorPolicyNode = value["ExecutorPolicy"];
if(!executorPolicyNode["MaxCount"].isNull())
taskObject.executorPolicy.maxCount = std::stoi(executorPolicyNode["MaxCount"].asString());
if(!executorPolicyNode["Parallelism"].isNull())
taskObject.executorPolicy.parallelism = std::stoi(executorPolicyNode["Parallelism"].asString());
auto arraySpecNode = executorPolicyNode["ArraySpec"];
if(!arraySpecNode["IndexStart"].isNull())
taskObject.executorPolicy.arraySpec.indexStart = std::stoi(arraySpecNode["IndexStart"].asString());
if(!arraySpecNode["IndexEnd"].isNull())
taskObject.executorPolicy.arraySpec.indexEnd = std::stoi(arraySpecNode["IndexEnd"].asString());
if(!arraySpecNode["IndexStep"].isNull())
taskObject.executorPolicy.arraySpec.indexStep = std::stoi(arraySpecNode["IndexStep"].asString());
jobInfo_.tasks.push_back(taskObject);
}
auto deploymentPolicyNode = jobInfoNode["DeploymentPolicy"];
if(!deploymentPolicyNode["AllocationSpec"].isNull())
jobInfo_.deploymentPolicy.allocationSpec = deploymentPolicyNode["AllocationSpec"].asString();
auto allTagsNode = deploymentPolicyNode["Tags"]["Tag"];
for (auto deploymentPolicyNodeTagsTag : allTagsNode)
{
JobInfo::DeploymentPolicy::Tag tagObject;
if(!deploymentPolicyNodeTagsTag["Name"].isNull())
tagObject.name = deploymentPolicyNodeTagsTag["Name"].asString();
if(!deploymentPolicyNodeTagsTag["Value"].isNull())
tagObject.value = deploymentPolicyNodeTagsTag["Value"].asString();
jobInfo_.deploymentPolicy.tags.push_back(tagObject);
}
auto networkNode = deploymentPolicyNode["Network"];
if(!networkNode["EnableERI"].isNull())
jobInfo_.deploymentPolicy.network.enableERI = networkNode["EnableERI"].asString() == "true";
auto allVswitch = networkNode["Vswitch"]["Vswitch"];
for (auto value : allVswitch)
jobInfo_.deploymentPolicy.network.vswitch.push_back(value.asString());
auto securityPolicyNode = jobInfoNode["SecurityPolicy"];
auto securityGroupNode = securityPolicyNode["SecurityGroup"];
auto allSecurityGroupIds = securityGroupNode["SecurityGroupIds"]["SecurityGroupId"];
for (auto value : allSecurityGroupIds)
jobInfo_.securityPolicy.securityGroup.securityGroupIds.push_back(value.asString());
auto dependencyPolicyNode = jobInfoNode["DependencyPolicy"];
auto allJobDependencyNode = dependencyPolicyNode["JobDependency"]["JobDependencyItem"];
for (auto dependencyPolicyNodeJobDependencyJobDependencyItem : allJobDependencyNode)
{
JobInfo::DependencyPolicy::JobDependencyItem jobDependencyItemObject;
if(!dependencyPolicyNodeJobDependencyJobDependencyItem["JobId"].isNull())
jobDependencyItemObject.jobId = dependencyPolicyNodeJobDependencyJobDependencyItem["JobId"].asString();
if(!dependencyPolicyNodeJobDependencyJobDependencyItem["Type"].isNull())
jobDependencyItemObject.type = dependencyPolicyNodeJobDependencyJobDependencyItem["Type"].asString();
jobInfo_.dependencyPolicy.jobDependency.push_back(jobDependencyItemObject);
}
auto monitorPolicyNode = jobInfoNode["MonitorPolicy"];
auto notificationSpecNode = monitorPolicyNode["NotificationSpec"];
auto allMNSTopicNode = notificationSpecNode["MNSTopic"]["MNSTopicItem"];
for (auto notificationSpecNodeMNSTopicMNSTopicItem : allMNSTopicNode)
{
JobInfo::MonitorPolicy::NotificationSpec::MNSTopicItem mNSTopicItemObject;
if(!notificationSpecNodeMNSTopicMNSTopicItem["TopicLocation"].isNull())
mNSTopicItemObject.topicLocation = notificationSpecNodeMNSTopicMNSTopicItem["TopicLocation"].asString();
auto allEvent = value["Event"]["Event"];
for (auto value : allEvent)
mNSTopicItemObject.event.push_back(value.asString());
jobInfo_.monitorPolicy.notificationSpec.mNSTopic.push_back(mNSTopicItemObject);
}
auto logSpecNode = monitorPolicyNode["LogSpec"];
if(!logSpecNode["Project"].isNull())
jobInfo_.monitorPolicy.logSpec.project = logSpecNode["Project"].asString();
if(!logSpecNode["Logstore"].isNull())
jobInfo_.monitorPolicy.logSpec.logstore = logSpecNode["Logstore"].asString();
if(!logSpecNode["MachineGroup"].isNull())
jobInfo_.monitorPolicy.logSpec.machineGroup = logSpecNode["MachineGroup"].asString();
if(!logSpecNode["Shard"].isNull())
jobInfo_.monitorPolicy.logSpec.shard = logSpecNode["Shard"].asString();
if(!logSpecNode["ExpireTime"].isNull())
jobInfo_.monitorPolicy.logSpec.expireTime = logSpecNode["ExpireTime"].asString();
}
GetJobResult::JobInfo GetJobResult::getJobInfo()const
{
return jobInfo_;
}

View File

@@ -0,0 +1,62 @@
/*
* 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/ehpcinstant/model/ListExecutorsRequest.h>
using AlibabaCloud::EhpcInstant::Model::ListExecutorsRequest;
ListExecutorsRequest::ListExecutorsRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "ListExecutors") {
setMethod(HttpRequest::Method::Post);
}
ListExecutorsRequest::~ListExecutorsRequest() {}
std::string ListExecutorsRequest::getPageNumber() const {
return pageNumber_;
}
void ListExecutorsRequest::setPageNumber(const std::string &pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), pageNumber);
}
ListExecutorsRequest::Filter ListExecutorsRequest::getFilter() const {
return filter_;
}
void ListExecutorsRequest::setFilter(const ListExecutorsRequest::Filter &filter) {
filter_ = filter;
setParameter(std::string("Filter") + ".TimeCreatedAfter", std::to_string(filter.timeCreatedAfter));
for(int dep1 = 0; dep1 != filter.ipAddresses.size(); dep1++) {
setParameter(std::string("Filter") + ".IpAddresses." + std::to_string(dep1 + 1), filter.ipAddresses[dep1]);
}
setParameter(std::string("Filter") + ".TimeCreatedBefore", std::to_string(filter.timeCreatedBefore));
for(int dep1 = 0; dep1 != filter.executorIds.size(); dep1++) {
setParameter(std::string("Filter") + ".ExecutorIds." + std::to_string(dep1 + 1), filter.executorIds[dep1]);
}
setParameter(std::string("Filter") + ".JobName", filter.jobName);
}
std::string ListExecutorsRequest::getPageSize() const {
return pageSize_;
}
void ListExecutorsRequest::setPageSize(const std::string &pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), pageSize);
}

View File

@@ -0,0 +1,100 @@
/*
* 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/ehpcinstant/model/ListExecutorsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
ListExecutorsResult::ListExecutorsResult() :
ServiceResult()
{}
ListExecutorsResult::ListExecutorsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListExecutorsResult::~ListExecutorsResult()
{}
void ListExecutorsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allExecutorsNode = value["Executors"]["Executor"];
for (auto valueExecutorsExecutor : allExecutorsNode)
{
Executor executorsObject;
if(!valueExecutorsExecutor["ExecutorId"].isNull())
executorsObject.executorId = valueExecutorsExecutor["ExecutorId"].asString();
if(!valueExecutorsExecutor["JobId"].isNull())
executorsObject.jobId = valueExecutorsExecutor["JobId"].asString();
if(!valueExecutorsExecutor["JobName"].isNull())
executorsObject.jobName = valueExecutorsExecutor["JobName"].asString();
if(!valueExecutorsExecutor["TaskName"].isNull())
executorsObject.taskName = valueExecutorsExecutor["TaskName"].asString();
if(!valueExecutorsExecutor["ArrayIndex"].isNull())
executorsObject.arrayIndex = std::stoi(valueExecutorsExecutor["ArrayIndex"].asString());
if(!valueExecutorsExecutor["CreateTime"].isNull())
executorsObject.createTime = valueExecutorsExecutor["CreateTime"].asString();
if(!valueExecutorsExecutor["EndTime"].isNull())
executorsObject.endTime = valueExecutorsExecutor["EndTime"].asString();
if(!valueExecutorsExecutor["Status"].isNull())
executorsObject.status = valueExecutorsExecutor["Status"].asString();
if(!valueExecutorsExecutor["StatusReason"].isNull())
executorsObject.statusReason = valueExecutorsExecutor["StatusReason"].asString();
auto allIpAddress = value["IpAddress"]["IpAddress"];
for (auto value : allIpAddress)
executorsObject.ipAddress.push_back(value.asString());
auto allHostName = value["HostName"]["HostName"];
for (auto value : allHostName)
executorsObject.hostName.push_back(value.asString());
executors_.push_back(executorsObject);
}
if(!value["PageSize"].isNull())
pageSize_ = value["PageSize"].asString();
if(!value["PageNumber"].isNull())
pageNumber_ = value["PageNumber"].asString();
if(!value["TotalCount"].isNull())
totalCount_ = value["TotalCount"].asString();
}
std::string ListExecutorsResult::getTotalCount()const
{
return totalCount_;
}
std::string ListExecutorsResult::getPageSize()const
{
return pageSize_;
}
std::string ListExecutorsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<ListExecutorsResult::Executor> ListExecutorsResult::getExecutors()const
{
return executors_;
}

View File

@@ -0,0 +1,96 @@
/*
* 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/ehpcinstant/model/ListImagesRequest.h>
using AlibabaCloud::EhpcInstant::Model::ListImagesRequest;
ListImagesRequest::ListImagesRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "ListImages") {
setMethod(HttpRequest::Method::Post);
}
ListImagesRequest::~ListImagesRequest() {}
std::string ListImagesRequest::getImageType() const {
return imageType_;
}
void ListImagesRequest::setImageType(const std::string &imageType) {
imageType_ = imageType;
setParameter(std::string("ImageType"), imageType);
}
std::vector<ListImagesRequest::std::string> ListImagesRequest::getImageNames() const {
return imageNames_;
}
void ListImagesRequest::setImageNames(const std::vector<ListImagesRequest::std::string> &imageNames) {
imageNames_ = imageNames;
for(int dep1 = 0; dep1 != imageNames.size(); dep1++) {
setParameter(std::string("ImageNames") + "." + std::to_string(dep1 + 1), imageNames[dep1]);
}
}
long ListImagesRequest::getPageNumber() const {
return pageNumber_;
}
void ListImagesRequest::setPageNumber(long pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), std::to_string(pageNumber));
}
std::string ListImagesRequest::getImageCategory() const {
return imageCategory_;
}
void ListImagesRequest::setImageCategory(const std::string &imageCategory) {
imageCategory_ = imageCategory;
setParameter(std::string("ImageCategory"), imageCategory);
}
std::vector<ListImagesRequest::std::string> ListImagesRequest::getAppIds() const {
return appIds_;
}
void ListImagesRequest::setAppIds(const std::vector<ListImagesRequest::std::string> &appIds) {
appIds_ = appIds;
for(int dep1 = 0; dep1 != appIds.size(); dep1++) {
setParameter(std::string("AppIds") + "." + std::to_string(dep1 + 1), appIds[dep1]);
}
}
long ListImagesRequest::getPageSize() const {
return pageSize_;
}
void ListImagesRequest::setPageSize(long pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), std::to_string(pageSize));
}
std::vector<ListImagesRequest::std::string> ListImagesRequest::getImageIds() const {
return imageIds_;
}
void ListImagesRequest::setImageIds(const std::vector<ListImagesRequest::std::string> &imageIds) {
imageIds_ = imageIds;
for(int dep1 = 0; dep1 != imageIds.size(); dep1++) {
setParameter(std::string("ImageIds") + "." + std::to_string(dep1 + 1), imageIds[dep1]);
}
}

View File

@@ -0,0 +1,103 @@
/*
* 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/ehpcinstant/model/ListImagesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
ListImagesResult::ListImagesResult() :
ServiceResult()
{}
ListImagesResult::ListImagesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListImagesResult::~ListImagesResult()
{}
void ListImagesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allImagesNode = value["Images"]["Image"];
for (auto valueImagesImage : allImagesNode)
{
Image imagesObject;
if(!valueImagesImage["ImageType"].isNull())
imagesObject.imageType = valueImagesImage["ImageType"].asString();
if(!valueImagesImage["ImageId"].isNull())
imagesObject.imageId = valueImagesImage["ImageId"].asString();
if(!valueImagesImage["AppId"].isNull())
imagesObject.appId = valueImagesImage["AppId"].asString();
if(!valueImagesImage["Name"].isNull())
imagesObject.name = valueImagesImage["Name"].asString();
if(!valueImagesImage["Version"].isNull())
imagesObject.version = valueImagesImage["Version"].asString();
if(!valueImagesImage["Label"].isNull())
imagesObject.label = valueImagesImage["Label"].asString();
if(!valueImagesImage["Description"].isNull())
imagesObject.description = valueImagesImage["Description"].asString();
if(!valueImagesImage["Size"].isNull())
imagesObject.size = valueImagesImage["Size"].asString();
if(!valueImagesImage["CreateTime"].isNull())
imagesObject.createTime = valueImagesImage["CreateTime"].asString();
if(!valueImagesImage["Status"].isNull())
imagesObject.status = valueImagesImage["Status"].asString();
images_.push_back(imagesObject);
}
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stol(value["PageSize"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stol(value["PageNumber"].asString());
}
int ListImagesResult::getTotalCount()const
{
return totalCount_;
}
long ListImagesResult::getPageSize()const
{
return pageSize_;
}
long ListImagesResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<ListImagesResult::Image> ListImagesResult::getImages()const
{
return images_;
}
bool ListImagesResult::getSuccess()const
{
return success_;
}

View File

@@ -0,0 +1,63 @@
/*
* 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/ehpcinstant/model/ListJobExecutorsRequest.h>
using AlibabaCloud::EhpcInstant::Model::ListJobExecutorsRequest;
ListJobExecutorsRequest::ListJobExecutorsRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "ListJobExecutors") {
setMethod(HttpRequest::Method::Post);
}
ListJobExecutorsRequest::~ListJobExecutorsRequest() {}
std::string ListJobExecutorsRequest::getTaskName() const {
return taskName_;
}
void ListJobExecutorsRequest::setTaskName(const std::string &taskName) {
taskName_ = taskName;
setParameter(std::string("TaskName"), taskName);
}
std::string ListJobExecutorsRequest::getPageNumber() const {
return pageNumber_;
}
void ListJobExecutorsRequest::setPageNumber(const std::string &pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), pageNumber);
}
std::string ListJobExecutorsRequest::getJobId() const {
return jobId_;
}
void ListJobExecutorsRequest::setJobId(const std::string &jobId) {
jobId_ = jobId;
setParameter(std::string("JobId"), jobId);
}
std::string ListJobExecutorsRequest::getPageSize() const {
return pageSize_;
}
void ListJobExecutorsRequest::setPageSize(const std::string &pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), pageSize);
}

View File

@@ -0,0 +1,106 @@
/*
* 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/ehpcinstant/model/ListJobExecutorsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
ListJobExecutorsResult::ListJobExecutorsResult() :
ServiceResult()
{}
ListJobExecutorsResult::ListJobExecutorsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListJobExecutorsResult::~ListJobExecutorsResult()
{}
void ListJobExecutorsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allExecutorsNode = value["Executors"]["Executor"];
for (auto valueExecutorsExecutor : allExecutorsNode)
{
Executor executorsObject;
if(!valueExecutorsExecutor["ArrayIndex"].isNull())
executorsObject.arrayIndex = std::stoi(valueExecutorsExecutor["ArrayIndex"].asString());
if(!valueExecutorsExecutor["CreateTime"].isNull())
executorsObject.createTime = valueExecutorsExecutor["CreateTime"].asString();
if(!valueExecutorsExecutor["EndTime"].isNull())
executorsObject.endTime = valueExecutorsExecutor["EndTime"].asString();
if(!valueExecutorsExecutor["Status"].isNull())
executorsObject.status = valueExecutorsExecutor["Status"].asString();
if(!valueExecutorsExecutor["StatusReason"].isNull())
executorsObject.statusReason = valueExecutorsExecutor["StatusReason"].asString();
auto allIpAddress = value["IpAddress"]["IpAddress"];
for (auto value : allIpAddress)
executorsObject.ipAddress.push_back(value.asString());
auto allHostName = value["HostName"]["HostName"];
for (auto value : allHostName)
executorsObject.hostName.push_back(value.asString());
executors_.push_back(executorsObject);
}
if(!value["JobId"].isNull())
jobId_ = value["JobId"].asString();
if(!value["TaskName"].isNull())
taskName_ = value["TaskName"].asString();
if(!value["PageSize"].isNull())
pageSize_ = value["PageSize"].asString();
if(!value["PageNumber"].isNull())
pageNumber_ = value["PageNumber"].asString();
if(!value["TotalCount"].isNull())
totalCount_ = value["TotalCount"].asString();
}
std::string ListJobExecutorsResult::getTotalCount()const
{
return totalCount_;
}
std::string ListJobExecutorsResult::getPageSize()const
{
return pageSize_;
}
std::string ListJobExecutorsResult::getTaskName()const
{
return taskName_;
}
std::string ListJobExecutorsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<ListJobExecutorsResult::Executor> ListJobExecutorsResult::getExecutors()const
{
return executors_;
}
std::string ListJobExecutorsResult::getJobId()const
{
return jobId_;
}

View File

@@ -0,0 +1,68 @@
/*
* 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/ehpcinstant/model/ListJobsRequest.h>
using AlibabaCloud::EhpcInstant::Model::ListJobsRequest;
ListJobsRequest::ListJobsRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "ListJobs") {
setMethod(HttpRequest::Method::Post);
}
ListJobsRequest::~ListJobsRequest() {}
std::string ListJobsRequest::getPageNumber() const {
return pageNumber_;
}
void ListJobsRequest::setPageNumber(const std::string &pageNumber) {
pageNumber_ = pageNumber;
setParameter(std::string("PageNumber"), pageNumber);
}
ListJobsRequest::Filter ListJobsRequest::getFilter() const {
return filter_;
}
void ListJobsRequest::setFilter(const ListJobsRequest::Filter &filter) {
filter_ = filter;
setParameter(std::string("Filter") + ".JobId", filter.jobId);
setParameter(std::string("Filter") + ".TimeCreatedAfter", std::to_string(filter.timeCreatedAfter));
setParameter(std::string("Filter") + ".TimeCreatedBefore", std::to_string(filter.timeCreatedBefore));
setParameter(std::string("Filter") + ".JobName", filter.jobName);
setParameter(std::string("Filter") + ".Status", filter.status);
}
std::string ListJobsRequest::getPageSize() const {
return pageSize_;
}
void ListJobsRequest::setPageSize(const std::string &pageSize) {
pageSize_ = pageSize;
setParameter(std::string("PageSize"), pageSize);
}
ListJobsRequest::SortBy ListJobsRequest::getSortBy() const {
return sortBy_;
}
void ListJobsRequest::setSortBy(const ListJobsRequest::SortBy &sortBy) {
sortBy_ = sortBy;
setParameter(std::string("SortBy") + ".Label", sortBy.label);
setParameter(std::string("SortBy") + ".Order", sortBy.order);
}

View File

@@ -0,0 +1,98 @@
/*
* 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/ehpcinstant/model/ListJobsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
ListJobsResult::ListJobsResult() :
ServiceResult()
{}
ListJobsResult::ListJobsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListJobsResult::~ListJobsResult()
{}
void ListJobsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allJobListNode = value["JobList"]["Job"];
for (auto valueJobListJob : allJobListNode)
{
Job jobListObject;
if(!valueJobListJob["JobName"].isNull())
jobListObject.jobName = valueJobListJob["JobName"].asString();
if(!valueJobListJob["JobId"].isNull())
jobListObject.jobId = valueJobListJob["JobId"].asString();
if(!valueJobListJob["JobDescription"].isNull())
jobListObject.jobDescription = valueJobListJob["JobDescription"].asString();
if(!valueJobListJob["CreateTime"].isNull())
jobListObject.createTime = valueJobListJob["CreateTime"].asString();
if(!valueJobListJob["OwnerUid"].isNull())
jobListObject.ownerUid = valueJobListJob["OwnerUid"].asString();
if(!valueJobListJob["Status"].isNull())
jobListObject.status = valueJobListJob["Status"].asString();
if(!valueJobListJob["TaskCount"].isNull())
jobListObject.taskCount = std::stoi(valueJobListJob["TaskCount"].asString());
if(!valueJobListJob["ExecutorCount"].isNull())
jobListObject.executorCount = std::stoi(valueJobListJob["ExecutorCount"].asString());
if(!valueJobListJob["StartTime"].isNull())
jobListObject.startTime = valueJobListJob["StartTime"].asString();
if(!valueJobListJob["EndTime"].isNull())
jobListObject.endTime = valueJobListJob["EndTime"].asString();
if(!valueJobListJob["TaskSustainable"].isNull())
jobListObject.taskSustainable = valueJobListJob["TaskSustainable"].asString() == "true";
jobList_.push_back(jobListObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stoi(value["PageSize"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
}
int ListJobsResult::getTotalCount()const
{
return totalCount_;
}
int ListJobsResult::getPageSize()const
{
return pageSize_;
}
int ListJobsResult::getPageNumber()const
{
return pageNumber_;
}
std::vector<ListJobsResult::Job> ListJobsResult::getJobList()const
{
return jobList_;
}

View File

@@ -0,0 +1,54 @@
/*
* 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/ehpcinstant/model/RemoveImageRequest.h>
using AlibabaCloud::EhpcInstant::Model::RemoveImageRequest;
RemoveImageRequest::RemoveImageRequest()
: RpcServiceRequest("ehpcinstant", "2023-07-01", "RemoveImage") {
setMethod(HttpRequest::Method::Post);
}
RemoveImageRequest::~RemoveImageRequest() {}
std::string RemoveImageRequest::getImageType() const {
return imageType_;
}
void RemoveImageRequest::setImageType(const std::string &imageType) {
imageType_ = imageType;
setParameter(std::string("ImageType"), imageType);
}
std::string RemoveImageRequest::getImageId() const {
return imageId_;
}
void RemoveImageRequest::setImageId(const std::string &imageId) {
imageId_ = imageId;
setParameter(std::string("ImageId"), imageId);
}
std::string RemoveImageRequest::getAppId() const {
return appId_;
}
void RemoveImageRequest::setAppId(const std::string &appId) {
appId_ = appId;
setParameter(std::string("AppId"), appId);
}

View File

@@ -0,0 +1,51 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/ehpcinstant/model/RemoveImageResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EhpcInstant;
using namespace AlibabaCloud::EhpcInstant::Model;
RemoveImageResult::RemoveImageResult() :
ServiceResult()
{}
RemoveImageResult::RemoveImageResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RemoveImageResult::~RemoveImageResult()
{}
void RemoveImageResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
bool RemoveImageResult::getSuccess()const
{
return success_;
}