From 7a6b431ace73f3664f6de8b7e25b28440e7a6d06 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 25 Apr 2024 02:03:07 +0000 Subject: [PATCH] E-HPC Instant Computing Service Release, supporting mirroring and job management. --- VERSION | 2 +- ehpcinstant/CMakeLists.txt | 130 +++++ .../ehpcinstant/EhpcInstantClient.h | 142 +++++ .../ehpcinstant/EhpcInstantExport.h | 32 ++ .../ehpcinstant/model/AddImageRequest.h | 72 +++ .../ehpcinstant/model/AddImageResult.h | 55 ++ .../ehpcinstant/model/CreateJobRequest.h | 152 ++++++ .../ehpcinstant/model/CreateJobResult.h | 51 ++ .../ehpcinstant/model/DeleteJobsRequest.h | 55 ++ .../ehpcinstant/model/DeleteJobsResult.h | 49 ++ .../model/DescribeJobMetricDataRequest.h | 51 ++ .../model/DescribeJobMetricDataResult.h | 53 ++ .../model/DescribeJobMetricLastRequest.h | 48 ++ .../model/DescribeJobMetricLastResult.h | 56 ++ .../ehpcinstant/model/GetImageRequest.h | 51 ++ .../ehpcinstant/model/GetImageResult.h | 91 ++++ .../ehpcinstant/model/GetJobRequest.h | 42 ++ .../ehpcinstant/model/GetJobResult.h | 218 ++++++++ .../ehpcinstant/model/ListExecutorsRequest.h | 57 ++ .../ehpcinstant/model/ListExecutorsResult.h | 71 +++ .../ehpcinstant/model/ListImagesRequest.h | 60 +++ .../ehpcinstant/model/ListImagesResult.h | 72 +++ .../model/ListJobExecutorsRequest.h | 51 ++ .../model/ListJobExecutorsResult.h | 71 +++ .../ehpcinstant/model/ListJobsRequest.h | 62 +++ .../ehpcinstant/model/ListJobsResult.h | 71 +++ .../ehpcinstant/model/RemoveImageRequest.h | 48 ++ .../ehpcinstant/model/RemoveImageResult.h | 51 ++ ehpcinstant/src/EhpcInstantClient.cc | 485 ++++++++++++++++++ ehpcinstant/src/model/AddImageRequest.cc | 87 ++++ ehpcinstant/src/model/AddImageResult.cc | 65 +++ ehpcinstant/src/model/CreateJobRequest.cc | 125 +++++ ehpcinstant/src/model/CreateJobResult.cc | 51 ++ ehpcinstant/src/model/DeleteJobsRequest.cc | 55 ++ ehpcinstant/src/model/DeleteJobsResult.cc | 44 ++ .../src/model/DescribeJobMetricDataRequest.cc | 65 +++ .../src/model/DescribeJobMetricDataResult.cc | 58 +++ .../src/model/DescribeJobMetricLastRequest.cc | 56 ++ .../src/model/DescribeJobMetricLastResult.cc | 59 +++ ehpcinstant/src/model/GetImageRequest.cc | 63 +++ ehpcinstant/src/model/GetImageResult.cc | 109 ++++ ehpcinstant/src/model/GetJobRequest.cc | 36 ++ ehpcinstant/src/model/GetJobResult.cc | 254 +++++++++ ehpcinstant/src/model/ListExecutorsRequest.cc | 62 +++ ehpcinstant/src/model/ListExecutorsResult.cc | 100 ++++ ehpcinstant/src/model/ListImagesRequest.cc | 96 ++++ ehpcinstant/src/model/ListImagesResult.cc | 103 ++++ .../src/model/ListJobExecutorsRequest.cc | 63 +++ .../src/model/ListJobExecutorsResult.cc | 106 ++++ ehpcinstant/src/model/ListJobsRequest.cc | 68 +++ ehpcinstant/src/model/ListJobsResult.cc | 98 ++++ ehpcinstant/src/model/RemoveImageRequest.cc | 54 ++ ehpcinstant/src/model/RemoveImageResult.cc | 51 ++ 53 files changed, 4376 insertions(+), 1 deletion(-) create mode 100644 ehpcinstant/CMakeLists.txt create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantClient.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantExport.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsResult.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageRequest.h create mode 100644 ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageResult.h create mode 100644 ehpcinstant/src/EhpcInstantClient.cc create mode 100644 ehpcinstant/src/model/AddImageRequest.cc create mode 100644 ehpcinstant/src/model/AddImageResult.cc create mode 100644 ehpcinstant/src/model/CreateJobRequest.cc create mode 100644 ehpcinstant/src/model/CreateJobResult.cc create mode 100644 ehpcinstant/src/model/DeleteJobsRequest.cc create mode 100644 ehpcinstant/src/model/DeleteJobsResult.cc create mode 100644 ehpcinstant/src/model/DescribeJobMetricDataRequest.cc create mode 100644 ehpcinstant/src/model/DescribeJobMetricDataResult.cc create mode 100644 ehpcinstant/src/model/DescribeJobMetricLastRequest.cc create mode 100644 ehpcinstant/src/model/DescribeJobMetricLastResult.cc create mode 100644 ehpcinstant/src/model/GetImageRequest.cc create mode 100644 ehpcinstant/src/model/GetImageResult.cc create mode 100644 ehpcinstant/src/model/GetJobRequest.cc create mode 100644 ehpcinstant/src/model/GetJobResult.cc create mode 100644 ehpcinstant/src/model/ListExecutorsRequest.cc create mode 100644 ehpcinstant/src/model/ListExecutorsResult.cc create mode 100644 ehpcinstant/src/model/ListImagesRequest.cc create mode 100644 ehpcinstant/src/model/ListImagesResult.cc create mode 100644 ehpcinstant/src/model/ListJobExecutorsRequest.cc create mode 100644 ehpcinstant/src/model/ListJobExecutorsResult.cc create mode 100644 ehpcinstant/src/model/ListJobsRequest.cc create mode 100644 ehpcinstant/src/model/ListJobsResult.cc create mode 100644 ehpcinstant/src/model/RemoveImageRequest.cc create mode 100644 ehpcinstant/src/model/RemoveImageResult.cc diff --git a/VERSION b/VERSION index 8772a1669..e7dfe59b9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1895 \ No newline at end of file +1.36.1896 \ No newline at end of file diff --git a/ehpcinstant/CMakeLists.txt b/ehpcinstant/CMakeLists.txt new file mode 100644 index 000000000..245176aac --- /dev/null +++ b/ehpcinstant/CMakeLists.txt @@ -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} + ) \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantClient.h b/ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantClient.h new file mode 100644 index 000000000..7da5ed972 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantClient.h @@ -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 +#include +#include +#include +#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 AddImageOutcome; + typedef std::future AddImageOutcomeCallable; + typedef std::function&)> AddImageAsyncHandler; + typedef Outcome CreateJobOutcome; + typedef std::future CreateJobOutcomeCallable; + typedef std::function&)> CreateJobAsyncHandler; + typedef Outcome DeleteJobsOutcome; + typedef std::future DeleteJobsOutcomeCallable; + typedef std::function&)> DeleteJobsAsyncHandler; + typedef Outcome DescribeJobMetricDataOutcome; + typedef std::future DescribeJobMetricDataOutcomeCallable; + typedef std::function&)> DescribeJobMetricDataAsyncHandler; + typedef Outcome DescribeJobMetricLastOutcome; + typedef std::future DescribeJobMetricLastOutcomeCallable; + typedef std::function&)> DescribeJobMetricLastAsyncHandler; + typedef Outcome GetImageOutcome; + typedef std::future GetImageOutcomeCallable; + typedef std::function&)> GetImageAsyncHandler; + typedef Outcome GetJobOutcome; + typedef std::future GetJobOutcomeCallable; + typedef std::function&)> GetJobAsyncHandler; + typedef Outcome ListExecutorsOutcome; + typedef std::future ListExecutorsOutcomeCallable; + typedef std::function&)> ListExecutorsAsyncHandler; + typedef Outcome ListImagesOutcome; + typedef std::future ListImagesOutcomeCallable; + typedef std::function&)> ListImagesAsyncHandler; + typedef Outcome ListJobExecutorsOutcome; + typedef std::future ListJobExecutorsOutcomeCallable; + typedef std::function&)> ListJobExecutorsAsyncHandler; + typedef Outcome ListJobsOutcome; + typedef std::future ListJobsOutcomeCallable; + typedef std::function&)> ListJobsAsyncHandler; + typedef Outcome RemoveImageOutcome; + typedef std::future RemoveImageOutcomeCallable; + typedef std::function&)> RemoveImageAsyncHandler; + + EhpcInstantClient(const Credentials &credentials, const ClientConfiguration &configuration); + EhpcInstantClient(const std::shared_ptr &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& 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& 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& 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& 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& 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& 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& 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& 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& 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& 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& 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& context = nullptr) const; + RemoveImageOutcomeCallable removeImageCallable(const Model::RemoveImageRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_EHPCINSTANT_EHPCINSTANTCLIENT_H_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantExport.h b/ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantExport.h new file mode 100644 index 000000000..cb787dcc4 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/EhpcInstantExport.h @@ -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 + +#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_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageRequest.h new file mode 100644 index 000000000..8b3522a93 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageRequest.h @@ -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 +#include +#include +#include +#include + +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_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageResult.h new file mode 100644 index 000000000..025475d46 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/AddImageResult.h @@ -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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobRequest.h new file mode 100644 index 000000000..7b49ac8f1 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobRequest.h @@ -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 +#include +#include +#include +#include + +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 event; + std::string topicLocation; + }; + MNSTopicItem mNSTopicItem; + std::vector mNSTopic; + }; + NotificationSpec notificationSpec; + }; + struct DeploymentPolicy { + std::string allocationSpec; + struct Network { + bool enableERI; + std::string string; + std::vector 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 volumeMount; + struct RetryPolicy { + int retryCount; + struct ExitCodeActionsItem { + std::string action; + std::string exitCode; + }; + ExitCodeActionsItem exitCodeActionsItem; + std::vector exitCodeActions; + }; + RetryPolicy retryPolicy; + struct Resource { + float cores; + float memory; + struct DisksItem { + int size; + std::string type; + }; + DisksItem disksItem; + std::vector 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 environmentVars; + std::string workingDir; + std::string string; + std::vector command; + }; + Container container; + struct VM { + std::string image; + std::string prologScript; + struct EnvironmentVarsItem { + std::string name; + std::string value; + }; + EnvironmentVarsItem environmentVarsItem; + std::vector environmentVars; + std::string script; + }; + VM vM; + }; + TaskExecutorItem taskExecutorItem; + std::vector 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 getTasks() const; + void setTasks(const std::vector &tasks); + +private: + MonitorPolicy monitorPolicy_; + std::string jobDescription_; + DeploymentPolicy deploymentPolicy_; + std::string jobName_; + std::vector tasks_; +}; +} // namespace Model +} // namespace EhpcInstant +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_CREATEJOBREQUEST_H_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobResult.h new file mode 100644 index 000000000..f3740accf --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/CreateJobResult.h @@ -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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsRequest.h new file mode 100644 index 000000000..a2caeecc4 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsRequest.h @@ -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 +#include +#include +#include +#include + +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 arrayIndex; + }; + TaskSpecItem taskSpecItem; + std::vector taskSpec; + }; + DeleteJobsRequest(); + ~DeleteJobsRequest(); + std::vector getJobSpec() const; + void setJobSpec(const std::vector &jobSpec); + std::vector getExecutorIds() const; + void setExecutorIds(const std::vector &executorIds); + +private: + std::vector jobSpec_; + std::vector executorIds_; +}; +} // namespace Model +} // namespace EhpcInstant +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DELETEJOBSREQUEST_H_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsResult.h new file mode 100644 index 000000000..c06f04726 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DeleteJobsResult.h @@ -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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataRequest.h new file mode 100644 index 000000000..cefeb4126 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataRequest.h @@ -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 +#include +#include +#include +#include + +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 getArrayIndex() const; + void setArrayIndex(const std::vector &arrayIndex); + +private: + std::string taskName_; + std::string jobId_; + std::string metricName_; + std::vector arrayIndex_; +}; +} // namespace Model +} // namespace EhpcInstant +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICDATAREQUEST_H_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataResult.h new file mode 100644 index 000000000..0373cf2fd --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricDataResult.h @@ -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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastRequest.h new file mode 100644 index 000000000..eecd1ed36 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastRequest.h @@ -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 +#include +#include +#include +#include + +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 getArrayIndex() const; + void setArrayIndex(const std::vector &arrayIndex); + +private: + std::string taskName_; + std::string jobId_; + std::vector arrayIndex_; +}; +} // namespace Model +} // namespace EhpcInstant +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTREQUEST_H_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastResult.h new file mode 100644 index 000000000..a9fbee62b --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/DescribeJobMetricLastResult.h @@ -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 +#include +#include +#include +#include + +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 getMetrics()const; + + protected: + void parse(const std::string &payload); + private: + std::vector metrics_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_DESCRIBEJOBMETRICLASTRESULT_H_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageRequest.h new file mode 100644 index 000000000..2a774d506 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageRequest.h @@ -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 +#include +#include +#include +#include + +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_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageResult.h new file mode 100644 index 000000000..fce4e8500 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetImageResult.h @@ -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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobRequest.h new file mode 100644 index 000000000..8d659d9f6 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobRequest.h @@ -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 +#include +#include +#include +#include + +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_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobResult.h new file mode 100644 index 000000000..cba84a85c --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/GetJobResult.h @@ -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 +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace EhpcInstant + { + namespace Model + { + class ALIBABACLOUD_EHPCINSTANT_EXPORT GetJobResult : public ServiceResult + { + public: + struct JobInfo + { + struct DeploymentPolicy + { + struct Network + { + bool enableERI; + std::vector vswitch; + }; + struct Tag + { + std::string value; + std::string name; + }; + std::string allocationSpec; + Network network; + std::vector tags; + }; + struct SecurityPolicy + { + struct SecurityGroup + { + std::vector securityGroupIds; + }; + SecurityGroup securityGroup; + }; + struct DependencyPolicy + { + struct JobDependencyItem + { + std::string type; + std::string jobId; + }; + std::vector jobDependency; + }; + struct MonitorPolicy + { + struct NotificationSpec + { + struct MNSTopicItem + { + std::string topicLocation; + std::vector event; + }; + std::vector 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 disks; + }; + struct RetryPolicy + { + struct ExitCodeAction + { + std::string action; + std::string exitCode; + }; + int retryCount; + std::vector exitCodeActions; + }; + struct TaskExecutorItem + { + struct Container + { + struct EnvironmentVar + { + std::string value; + std::string name; + }; + std::vector 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 environmentVars1; + std::string image; + }; + Container container; + VM vM; + }; + struct VolumeMountItem + { + std::string mountPath; + std::string volumeDriver; + std::string mountOptions; + }; + std::string taskDuration; + std::vector taskExecutor; + Resource resource; + std::vector 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 executorStatus; + bool taskSustainable; + }; + std::string jobScheduler; + std::string status; + std::vector 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_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsRequest.h new file mode 100644 index 000000000..b34cff710 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsRequest.h @@ -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 +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace EhpcInstant { +namespace Model { +class ALIBABACLOUD_EHPCINSTANT_EXPORT ListExecutorsRequest : public RpcServiceRequest { +public: + struct Filter { + int timeCreatedAfter; + std::string string; + std::vector ipAddresses; + int timeCreatedBefore; + std::string string; + std::vector 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_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsResult.h new file mode 100644 index 000000000..da685d3b5 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListExecutorsResult.h @@ -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 +#include +#include +#include +#include + +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 ipAddress; + int arrayIndex; + std::string jobId; + std::vector hostName; + }; + + + ListExecutorsResult(); + explicit ListExecutorsResult(const std::string &payload); + ~ListExecutorsResult(); + std::string getTotalCount()const; + std::string getPageSize()const; + std::string getPageNumber()const; + std::vector getExecutors()const; + + protected: + void parse(const std::string &payload); + private: + std::string totalCount_; + std::string pageSize_; + std::string pageNumber_; + std::vector executors_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTEXECUTORSRESULT_H_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesRequest.h new file mode 100644 index 000000000..96a188a66 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesRequest.h @@ -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 +#include +#include +#include +#include + +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 getImageNames() const; + void setImageNames(const std::vector &imageNames); + long getPageNumber() const; + void setPageNumber(long pageNumber); + std::string getImageCategory() const; + void setImageCategory(const std::string &imageCategory); + std::vector getAppIds() const; + void setAppIds(const std::vector &appIds); + long getPageSize() const; + void setPageSize(long pageSize); + std::vector getImageIds() const; + void setImageIds(const std::vector &imageIds); + +private: + std::string imageType_; + std::vector imageNames_; + long pageNumber_; + std::string imageCategory_; + std::vector appIds_; + long pageSize_; + std::vector imageIds_; +}; +} // namespace Model +} // namespace EhpcInstant +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTIMAGESREQUEST_H_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesResult.h new file mode 100644 index 000000000..131004226 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListImagesResult.h @@ -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 +#include +#include +#include +#include + +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 getImages()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + long pageSize_; + long pageNumber_; + std::vector images_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTIMAGESRESULT_H_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsRequest.h new file mode 100644 index 000000000..7e3536e04 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsRequest.h @@ -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 +#include +#include +#include +#include + +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_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsResult.h new file mode 100644 index 000000000..0bca0d882 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobExecutorsResult.h @@ -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 +#include +#include +#include +#include + +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 ipAddress; + int arrayIndex; + std::vector 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 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 executors_; + std::string jobId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBEXECUTORSRESULT_H_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsRequest.h new file mode 100644 index 000000000..433f8c634 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsRequest.h @@ -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 +#include +#include +#include +#include + +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_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsResult.h new file mode 100644 index 000000000..d6fa28b76 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/ListJobsResult.h @@ -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 +#include +#include +#include +#include + +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 getJobList()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + int pageSize_; + int pageNumber_; + std::vector jobList_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EHPCINSTANT_MODEL_LISTJOBSRESULT_H_ \ No newline at end of file diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageRequest.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageRequest.h new file mode 100644 index 000000000..a6283ae36 --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageRequest.h @@ -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 +#include +#include +#include +#include + +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_ diff --git a/ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageResult.h b/ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageResult.h new file mode 100644 index 000000000..b91d02a7f --- /dev/null +++ b/ehpcinstant/include/alibabacloud/ehpcinstant/model/RemoveImageResult.h @@ -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 +#include +#include +#include +#include + +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_ \ No newline at end of file diff --git a/ehpcinstant/src/EhpcInstantClient.cc b/ehpcinstant/src/EhpcInstantClient.cc new file mode 100644 index 000000000..95aac1cd7 --- /dev/null +++ b/ehpcinstant/src/EhpcInstantClient.cc @@ -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 +#include + +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(credentials), configuration) +{ + auto locationClient = std::make_shared(credentials, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +EhpcInstantClient::EhpcInstantClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) +{ + auto locationClient = std::make_shared(credentialsProvider, configuration); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); +} + +EhpcInstantClient::EhpcInstantClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : + RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) +{ + auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); + endpointProvider_ = std::make_shared(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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [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& 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>( + [this, request]() + { + return this->removeImage(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/ehpcinstant/src/model/AddImageRequest.cc b/ehpcinstant/src/model/AddImageRequest.cc new file mode 100644 index 000000000..d5c7b0b01 --- /dev/null +++ b/ehpcinstant/src/model/AddImageRequest.cc @@ -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 + +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); +} + diff --git a/ehpcinstant/src/model/AddImageResult.cc b/ehpcinstant/src/model/AddImageResult.cc new file mode 100644 index 000000000..36f8c208f --- /dev/null +++ b/ehpcinstant/src/model/AddImageResult.cc @@ -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 +#include + +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_; +} + diff --git a/ehpcinstant/src/model/CreateJobRequest.cc b/ehpcinstant/src/model/CreateJobRequest.cc new file mode 100644 index 000000000..60d36d200 --- /dev/null +++ b/ehpcinstant/src/model/CreateJobRequest.cc @@ -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 + +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::getTasks() const { + return tasks_; +} + +void CreateJobRequest::setTasks(const std::vector &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); + } + } +} + diff --git a/ehpcinstant/src/model/CreateJobResult.cc b/ehpcinstant/src/model/CreateJobResult.cc new file mode 100644 index 000000000..2c550f39d --- /dev/null +++ b/ehpcinstant/src/model/CreateJobResult.cc @@ -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 +#include + +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_; +} + diff --git a/ehpcinstant/src/model/DeleteJobsRequest.cc b/ehpcinstant/src/model/DeleteJobsRequest.cc new file mode 100644 index 000000000..59a6807a4 --- /dev/null +++ b/ehpcinstant/src/model/DeleteJobsRequest.cc @@ -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 + +using AlibabaCloud::EhpcInstant::Model::DeleteJobsRequest; + +DeleteJobsRequest::DeleteJobsRequest() + : RpcServiceRequest("ehpcinstant", "2023-07-01", "DeleteJobs") { + setMethod(HttpRequest::Method::Post); +} + +DeleteJobsRequest::~DeleteJobsRequest() {} + +std::vector DeleteJobsRequest::getJobSpec() const { + return jobSpec_; +} + +void DeleteJobsRequest::setJobSpec(const std::vector &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::getExecutorIds() const { + return executorIds_; +} + +void DeleteJobsRequest::setExecutorIds(const std::vector &executorIds) { + executorIds_ = executorIds; + for(int dep1 = 0; dep1 != executorIds.size(); dep1++) { + setParameter(std::string("ExecutorIds") + "." + std::to_string(dep1 + 1), executorIds[dep1]); + } +} + diff --git a/ehpcinstant/src/model/DeleteJobsResult.cc b/ehpcinstant/src/model/DeleteJobsResult.cc new file mode 100644 index 000000000..f12d128bc --- /dev/null +++ b/ehpcinstant/src/model/DeleteJobsResult.cc @@ -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 +#include + +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()); + +} + diff --git a/ehpcinstant/src/model/DescribeJobMetricDataRequest.cc b/ehpcinstant/src/model/DescribeJobMetricDataRequest.cc new file mode 100644 index 000000000..c4bb96da4 --- /dev/null +++ b/ehpcinstant/src/model/DescribeJobMetricDataRequest.cc @@ -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 + +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::getArrayIndex() const { + return arrayIndex_; +} + +void DescribeJobMetricDataRequest::setArrayIndex(const std::vector &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])); + } +} + diff --git a/ehpcinstant/src/model/DescribeJobMetricDataResult.cc b/ehpcinstant/src/model/DescribeJobMetricDataResult.cc new file mode 100644 index 000000000..f3ca99cdf --- /dev/null +++ b/ehpcinstant/src/model/DescribeJobMetricDataResult.cc @@ -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 +#include + +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_; +} + diff --git a/ehpcinstant/src/model/DescribeJobMetricLastRequest.cc b/ehpcinstant/src/model/DescribeJobMetricLastRequest.cc new file mode 100644 index 000000000..d6ff95d40 --- /dev/null +++ b/ehpcinstant/src/model/DescribeJobMetricLastRequest.cc @@ -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 + +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::getArrayIndex() const { + return arrayIndex_; +} + +void DescribeJobMetricLastRequest::setArrayIndex(const std::vector &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])); + } +} + diff --git a/ehpcinstant/src/model/DescribeJobMetricLastResult.cc b/ehpcinstant/src/model/DescribeJobMetricLastResult.cc new file mode 100644 index 000000000..96944baf4 --- /dev/null +++ b/ehpcinstant/src/model/DescribeJobMetricLastResult.cc @@ -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 +#include + +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::getMetrics()const +{ + return metrics_; +} + diff --git a/ehpcinstant/src/model/GetImageRequest.cc b/ehpcinstant/src/model/GetImageRequest.cc new file mode 100644 index 000000000..4ece8da80 --- /dev/null +++ b/ehpcinstant/src/model/GetImageRequest.cc @@ -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 + +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); +} + diff --git a/ehpcinstant/src/model/GetImageResult.cc b/ehpcinstant/src/model/GetImageResult.cc new file mode 100644 index 000000000..8176ac69e --- /dev/null +++ b/ehpcinstant/src/model/GetImageResult.cc @@ -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 +#include + +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_; +} + diff --git a/ehpcinstant/src/model/GetJobRequest.cc b/ehpcinstant/src/model/GetJobRequest.cc new file mode 100644 index 000000000..f19c706ba --- /dev/null +++ b/ehpcinstant/src/model/GetJobRequest.cc @@ -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 + +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); +} + diff --git a/ehpcinstant/src/model/GetJobResult.cc b/ehpcinstant/src/model/GetJobResult.cc new file mode 100644 index 000000000..5f64f4fa1 --- /dev/null +++ b/ehpcinstant/src/model/GetJobResult.cc @@ -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 +#include + +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_; +} + diff --git a/ehpcinstant/src/model/ListExecutorsRequest.cc b/ehpcinstant/src/model/ListExecutorsRequest.cc new file mode 100644 index 000000000..97873510f --- /dev/null +++ b/ehpcinstant/src/model/ListExecutorsRequest.cc @@ -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 + +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); +} + diff --git a/ehpcinstant/src/model/ListExecutorsResult.cc b/ehpcinstant/src/model/ListExecutorsResult.cc new file mode 100644 index 000000000..732dd4500 --- /dev/null +++ b/ehpcinstant/src/model/ListExecutorsResult.cc @@ -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 +#include + +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::getExecutors()const +{ + return executors_; +} + diff --git a/ehpcinstant/src/model/ListImagesRequest.cc b/ehpcinstant/src/model/ListImagesRequest.cc new file mode 100644 index 000000000..f5608def7 --- /dev/null +++ b/ehpcinstant/src/model/ListImagesRequest.cc @@ -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 + +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::getImageNames() const { + return imageNames_; +} + +void ListImagesRequest::setImageNames(const std::vector &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::getAppIds() const { + return appIds_; +} + +void ListImagesRequest::setAppIds(const std::vector &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::getImageIds() const { + return imageIds_; +} + +void ListImagesRequest::setImageIds(const std::vector &imageIds) { + imageIds_ = imageIds; + for(int dep1 = 0; dep1 != imageIds.size(); dep1++) { + setParameter(std::string("ImageIds") + "." + std::to_string(dep1 + 1), imageIds[dep1]); + } +} + diff --git a/ehpcinstant/src/model/ListImagesResult.cc b/ehpcinstant/src/model/ListImagesResult.cc new file mode 100644 index 000000000..5b5778375 --- /dev/null +++ b/ehpcinstant/src/model/ListImagesResult.cc @@ -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 +#include + +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::getImages()const +{ + return images_; +} + +bool ListImagesResult::getSuccess()const +{ + return success_; +} + diff --git a/ehpcinstant/src/model/ListJobExecutorsRequest.cc b/ehpcinstant/src/model/ListJobExecutorsRequest.cc new file mode 100644 index 000000000..ee26d5ff1 --- /dev/null +++ b/ehpcinstant/src/model/ListJobExecutorsRequest.cc @@ -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 + +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); +} + diff --git a/ehpcinstant/src/model/ListJobExecutorsResult.cc b/ehpcinstant/src/model/ListJobExecutorsResult.cc new file mode 100644 index 000000000..c1cdda0bf --- /dev/null +++ b/ehpcinstant/src/model/ListJobExecutorsResult.cc @@ -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 +#include + +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::getExecutors()const +{ + return executors_; +} + +std::string ListJobExecutorsResult::getJobId()const +{ + return jobId_; +} + diff --git a/ehpcinstant/src/model/ListJobsRequest.cc b/ehpcinstant/src/model/ListJobsRequest.cc new file mode 100644 index 000000000..f7b67674d --- /dev/null +++ b/ehpcinstant/src/model/ListJobsRequest.cc @@ -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 + +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); +} + diff --git a/ehpcinstant/src/model/ListJobsResult.cc b/ehpcinstant/src/model/ListJobsResult.cc new file mode 100644 index 000000000..45bbc92b4 --- /dev/null +++ b/ehpcinstant/src/model/ListJobsResult.cc @@ -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 +#include + +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::getJobList()const +{ + return jobList_; +} + diff --git a/ehpcinstant/src/model/RemoveImageRequest.cc b/ehpcinstant/src/model/RemoveImageRequest.cc new file mode 100644 index 000000000..1e30ac4f2 --- /dev/null +++ b/ehpcinstant/src/model/RemoveImageRequest.cc @@ -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 + +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); +} + diff --git a/ehpcinstant/src/model/RemoveImageResult.cc b/ehpcinstant/src/model/RemoveImageResult.cc new file mode 100644 index 000000000..c1d7cf84e --- /dev/null +++ b/ehpcinstant/src/model/RemoveImageResult.cc @@ -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 +#include + +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_; +} +