diff --git a/CHANGELOG b/CHANGELOG index 8c420fcb3..4760d01e8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-01-11 Version: patch +- Create a new sdk. + 2021-01-11 Version: patch - Add result value spanId for GetTrace api. diff --git a/eais/CMakeLists.txt b/eais/CMakeLists.txt new file mode 100644 index 000000000..9bb70ed5e --- /dev/null +++ b/eais/CMakeLists.txt @@ -0,0 +1,114 @@ +# +# 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(eais_public_header + include/alibabacloud/eais/EaisClient.h + include/alibabacloud/eais/EaisExport.h ) + +set(eais_public_header_model + include/alibabacloud/eais/model/AttachEaiRequest.h + include/alibabacloud/eais/model/AttachEaiResult.h + include/alibabacloud/eais/model/CreateEaiRequest.h + include/alibabacloud/eais/model/CreateEaiResult.h + include/alibabacloud/eais/model/CreateEaiAllRequest.h + include/alibabacloud/eais/model/CreateEaiAllResult.h + include/alibabacloud/eais/model/DeleteEaiRequest.h + include/alibabacloud/eais/model/DeleteEaiResult.h + include/alibabacloud/eais/model/DeleteEaiAllRequest.h + include/alibabacloud/eais/model/DeleteEaiAllResult.h + include/alibabacloud/eais/model/DescribeEaisRequest.h + include/alibabacloud/eais/model/DescribeEaisResult.h + include/alibabacloud/eais/model/DescribeRegionsRequest.h + include/alibabacloud/eais/model/DescribeRegionsResult.h + include/alibabacloud/eais/model/DetachEaiRequest.h + include/alibabacloud/eais/model/DetachEaiResult.h ) + +set(eais_src + src/EaisClient.cc + src/model/AttachEaiRequest.cc + src/model/AttachEaiResult.cc + src/model/CreateEaiRequest.cc + src/model/CreateEaiResult.cc + src/model/CreateEaiAllRequest.cc + src/model/CreateEaiAllResult.cc + src/model/DeleteEaiRequest.cc + src/model/DeleteEaiResult.cc + src/model/DeleteEaiAllRequest.cc + src/model/DeleteEaiAllResult.cc + src/model/DescribeEaisRequest.cc + src/model/DescribeEaisResult.cc + src/model/DescribeRegionsRequest.cc + src/model/DescribeRegionsResult.cc + src/model/DetachEaiRequest.cc + src/model/DetachEaiResult.cc ) + +add_library(eais ${LIB_TYPE} + ${eais_public_header} + ${eais_public_header_model} + ${eais_src}) + +set_target_properties(eais + 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}eais + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(eais + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_EAIS_LIBRARY) +endif() + +target_include_directories(eais + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(eais + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(eais + jsoncpp) + target_include_directories(eais + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(eais + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(eais + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(eais + PRIVATE /usr/include/jsoncpp) + target_link_libraries(eais + jsoncpp) +endif() + +install(FILES ${eais_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/eais) +install(FILES ${eais_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/eais/model) +install(TARGETS eais + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/EaisClient.h b/eais/include/alibabacloud/eais/EaisClient.h new file mode 100644 index 000000000..64af960ef --- /dev/null +++ b/eais/include/alibabacloud/eais/EaisClient.h @@ -0,0 +1,110 @@ +/* + * 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_EAIS_EAISCLIENT_H_ +#define ALIBABACLOUD_EAIS_EAISCLIENT_H_ + +#include +#include +#include +#include +#include "EaisExport.h" +#include "model/AttachEaiRequest.h" +#include "model/AttachEaiResult.h" +#include "model/CreateEaiRequest.h" +#include "model/CreateEaiResult.h" +#include "model/CreateEaiAllRequest.h" +#include "model/CreateEaiAllResult.h" +#include "model/DeleteEaiRequest.h" +#include "model/DeleteEaiResult.h" +#include "model/DeleteEaiAllRequest.h" +#include "model/DeleteEaiAllResult.h" +#include "model/DescribeEaisRequest.h" +#include "model/DescribeEaisResult.h" +#include "model/DescribeRegionsRequest.h" +#include "model/DescribeRegionsResult.h" +#include "model/DetachEaiRequest.h" +#include "model/DetachEaiResult.h" + + +namespace AlibabaCloud +{ + namespace Eais + { + class ALIBABACLOUD_EAIS_EXPORT EaisClient : public RpcServiceClient + { + public: + typedef Outcome AttachEaiOutcome; + typedef std::future AttachEaiOutcomeCallable; + typedef std::function&)> AttachEaiAsyncHandler; + typedef Outcome CreateEaiOutcome; + typedef std::future CreateEaiOutcomeCallable; + typedef std::function&)> CreateEaiAsyncHandler; + typedef Outcome CreateEaiAllOutcome; + typedef std::future CreateEaiAllOutcomeCallable; + typedef std::function&)> CreateEaiAllAsyncHandler; + typedef Outcome DeleteEaiOutcome; + typedef std::future DeleteEaiOutcomeCallable; + typedef std::function&)> DeleteEaiAsyncHandler; + typedef Outcome DeleteEaiAllOutcome; + typedef std::future DeleteEaiAllOutcomeCallable; + typedef std::function&)> DeleteEaiAllAsyncHandler; + typedef Outcome DescribeEaisOutcome; + typedef std::future DescribeEaisOutcomeCallable; + typedef std::function&)> DescribeEaisAsyncHandler; + typedef Outcome DescribeRegionsOutcome; + typedef std::future DescribeRegionsOutcomeCallable; + typedef std::function&)> DescribeRegionsAsyncHandler; + typedef Outcome DetachEaiOutcome; + typedef std::future DetachEaiOutcomeCallable; + typedef std::function&)> DetachEaiAsyncHandler; + + EaisClient(const Credentials &credentials, const ClientConfiguration &configuration); + EaisClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + EaisClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~EaisClient(); + AttachEaiOutcome attachEai(const Model::AttachEaiRequest &request)const; + void attachEaiAsync(const Model::AttachEaiRequest& request, const AttachEaiAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + AttachEaiOutcomeCallable attachEaiCallable(const Model::AttachEaiRequest& request) const; + CreateEaiOutcome createEai(const Model::CreateEaiRequest &request)const; + void createEaiAsync(const Model::CreateEaiRequest& request, const CreateEaiAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateEaiOutcomeCallable createEaiCallable(const Model::CreateEaiRequest& request) const; + CreateEaiAllOutcome createEaiAll(const Model::CreateEaiAllRequest &request)const; + void createEaiAllAsync(const Model::CreateEaiAllRequest& request, const CreateEaiAllAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateEaiAllOutcomeCallable createEaiAllCallable(const Model::CreateEaiAllRequest& request) const; + DeleteEaiOutcome deleteEai(const Model::DeleteEaiRequest &request)const; + void deleteEaiAsync(const Model::DeleteEaiRequest& request, const DeleteEaiAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteEaiOutcomeCallable deleteEaiCallable(const Model::DeleteEaiRequest& request) const; + DeleteEaiAllOutcome deleteEaiAll(const Model::DeleteEaiAllRequest &request)const; + void deleteEaiAllAsync(const Model::DeleteEaiAllRequest& request, const DeleteEaiAllAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteEaiAllOutcomeCallable deleteEaiAllCallable(const Model::DeleteEaiAllRequest& request) const; + DescribeEaisOutcome describeEais(const Model::DescribeEaisRequest &request)const; + void describeEaisAsync(const Model::DescribeEaisRequest& request, const DescribeEaisAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeEaisOutcomeCallable describeEaisCallable(const Model::DescribeEaisRequest& request) const; + DescribeRegionsOutcome describeRegions(const Model::DescribeRegionsRequest &request)const; + void describeRegionsAsync(const Model::DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeRegionsOutcomeCallable describeRegionsCallable(const Model::DescribeRegionsRequest& request) const; + DetachEaiOutcome detachEai(const Model::DetachEaiRequest &request)const; + void detachEaiAsync(const Model::DetachEaiRequest& request, const DetachEaiAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DetachEaiOutcomeCallable detachEaiCallable(const Model::DetachEaiRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_EAIS_EAISCLIENT_H_ diff --git a/eais/include/alibabacloud/eais/EaisExport.h b/eais/include/alibabacloud/eais/EaisExport.h new file mode 100644 index 000000000..c03eee4ee --- /dev/null +++ b/eais/include/alibabacloud/eais/EaisExport.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_EAIS_EAISEXPORT_H_ +#define ALIBABACLOUD_EAIS_EAISEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_EAIS_LIBRARY) +# define ALIBABACLOUD_EAIS_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_EAIS_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_EAIS_EXPORT +#endif + +#endif // !ALIBABACLOUD_EAIS_EAISEXPORT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/AttachEaiRequest.h b/eais/include/alibabacloud/eais/model/AttachEaiRequest.h new file mode 100644 index 000000000..b331f76ec --- /dev/null +++ b/eais/include/alibabacloud/eais/model/AttachEaiRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_EAIS_MODEL_ATTACHEAIREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_ATTACHEAIREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT AttachEaiRequest : public RpcServiceRequest + { + + public: + AttachEaiRequest(); + ~AttachEaiRequest(); + + std::string getClientInstanceId()const; + void setClientInstanceId(const std::string& clientInstanceId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getElasticAcceleratedInstanceId()const; + void setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId); + + private: + std::string clientInstanceId_; + std::string regionId_; + std::string elasticAcceleratedInstanceId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_ATTACHEAIREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/AttachEaiResult.h b/eais/include/alibabacloud/eais/model/AttachEaiResult.h new file mode 100644 index 000000000..dcde4a864 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/AttachEaiResult.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_EAIS_MODEL_ATTACHEAIRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_ATTACHEAIRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT AttachEaiResult : public ServiceResult + { + public: + + + AttachEaiResult(); + explicit AttachEaiResult(const std::string &payload); + ~AttachEaiResult(); + std::string getClientInstanceId()const; + std::string getElasticAcceleratedInstanceId()const; + + protected: + void parse(const std::string &payload); + private: + std::string clientInstanceId_; + std::string elasticAcceleratedInstanceId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_ATTACHEAIRESULT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/CreateEaiAllRequest.h b/eais/include/alibabacloud/eais/model/CreateEaiAllRequest.h new file mode 100644 index 000000000..e5aada3f4 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/CreateEaiAllRequest.h @@ -0,0 +1,90 @@ +/* + * 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_EAIS_MODEL_CREATEEAIALLREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_CREATEEAIALLREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT CreateEaiAllRequest : public RpcServiceRequest + { + + public: + CreateEaiAllRequest(); + ~CreateEaiAllRequest(); + + std::string getClientImageId()const; + void setClientImageId(const std::string& clientImageId); + std::string getClientSystemDiskCategory()const; + void setClientSystemDiskCategory(const std::string& clientSystemDiskCategory); + int getClientInternetMaxBandwidthOut()const; + void setClientInternetMaxBandwidthOut(int clientInternetMaxBandwidthOut); + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); + std::string getClientInstanceName()const; + void setClientInstanceName(const std::string& clientInstanceName); + int getClientInternetMaxBandwidthIn()const; + void setClientInternetMaxBandwidthIn(int clientInternetMaxBandwidthIn); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + int getClientSystemDiskSize()const; + void setClientSystemDiskSize(int clientSystemDiskSize); + std::string getClientVSwitchId()const; + void setClientVSwitchId(const std::string& clientVSwitchId); + std::string getClientPassword()const; + void setClientPassword(const std::string& clientPassword); + std::string getClientInstanceType()const; + void setClientInstanceType(const std::string& clientInstanceType); + std::string getClientSecurityGroupId()const; + void setClientSecurityGroupId(const std::string& clientSecurityGroupId); + std::string getEaiInstanceType()const; + void setEaiInstanceType(const std::string& eaiInstanceType); + std::string getClientZoneId()const; + void setClientZoneId(const std::string& clientZoneId); + std::string getInstanceName()const; + void setInstanceName(const std::string& instanceName); + + private: + std::string clientImageId_; + std::string clientSystemDiskCategory_; + int clientInternetMaxBandwidthOut_; + std::string clientToken_; + std::string clientInstanceName_; + int clientInternetMaxBandwidthIn_; + std::string regionId_; + int clientSystemDiskSize_; + std::string clientVSwitchId_; + std::string clientPassword_; + std::string clientInstanceType_; + std::string clientSecurityGroupId_; + std::string eaiInstanceType_; + std::string clientZoneId_; + std::string instanceName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_CREATEEAIALLREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/CreateEaiAllResult.h b/eais/include/alibabacloud/eais/model/CreateEaiAllResult.h new file mode 100644 index 000000000..6ddf55ed2 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/CreateEaiAllResult.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_EAIS_MODEL_CREATEEAIALLRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_CREATEEAIALLRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT CreateEaiAllResult : public ServiceResult + { + public: + + + CreateEaiAllResult(); + explicit CreateEaiAllResult(const std::string &payload); + ~CreateEaiAllResult(); + std::string getClientInstanceId()const; + std::string getElasticAcceleratedInstanceId()const; + + protected: + void parse(const std::string &payload); + private: + std::string clientInstanceId_; + std::string elasticAcceleratedInstanceId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_CREATEEAIALLRESULT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/CreateEaiRequest.h b/eais/include/alibabacloud/eais/model/CreateEaiRequest.h new file mode 100644 index 000000000..091d8a630 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/CreateEaiRequest.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_EAIS_MODEL_CREATEEAIREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_CREATEEAIREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT CreateEaiRequest : public RpcServiceRequest + { + + public: + CreateEaiRequest(); + ~CreateEaiRequest(); + + std::string getClientToken()const; + void setClientToken(const std::string& clientToken); + std::string getInstanceName()const; + void setInstanceName(const std::string& instanceName); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getInstanceType()const; + void setInstanceType(const std::string& instanceType); + + private: + std::string clientToken_; + std::string instanceName_; + std::string regionId_; + std::string instanceType_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_CREATEEAIREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/CreateEaiResult.h b/eais/include/alibabacloud/eais/model/CreateEaiResult.h new file mode 100644 index 000000000..0d5e07d2a --- /dev/null +++ b/eais/include/alibabacloud/eais/model/CreateEaiResult.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_EAIS_MODEL_CREATEEAIRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_CREATEEAIRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT CreateEaiResult : public ServiceResult + { + public: + + + CreateEaiResult(); + explicit CreateEaiResult(const std::string &payload); + ~CreateEaiResult(); + std::string getElasticAcceleratedInstanceId()const; + + protected: + void parse(const std::string &payload); + private: + std::string elasticAcceleratedInstanceId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_CREATEEAIRESULT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DeleteEaiAllRequest.h b/eais/include/alibabacloud/eais/model/DeleteEaiAllRequest.h new file mode 100644 index 000000000..6a717140a --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DeleteEaiAllRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_EAIS_MODEL_DELETEEAIALLREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_DELETEEAIALLREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DeleteEaiAllRequest : public RpcServiceRequest + { + + public: + DeleteEaiAllRequest(); + ~DeleteEaiAllRequest(); + + std::string getClientInstanceId()const; + void setClientInstanceId(const std::string& clientInstanceId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getElasticAcceleratedInstanceId()const; + void setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId); + + private: + std::string clientInstanceId_; + std::string regionId_; + std::string elasticAcceleratedInstanceId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DELETEEAIALLREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DeleteEaiAllResult.h b/eais/include/alibabacloud/eais/model/DeleteEaiAllResult.h new file mode 100644 index 000000000..4b45c7ee4 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DeleteEaiAllResult.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_EAIS_MODEL_DELETEEAIALLRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_DELETEEAIALLRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DeleteEaiAllResult : public ServiceResult + { + public: + + + DeleteEaiAllResult(); + explicit DeleteEaiAllResult(const std::string &payload); + ~DeleteEaiAllResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DELETEEAIALLRESULT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DeleteEaiRequest.h b/eais/include/alibabacloud/eais/model/DeleteEaiRequest.h new file mode 100644 index 000000000..0085ef606 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DeleteEaiRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_EAIS_MODEL_DELETEEAIREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_DELETEEAIREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DeleteEaiRequest : public RpcServiceRequest + { + + public: + DeleteEaiRequest(); + ~DeleteEaiRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getElasticAcceleratedInstanceId()const; + void setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId); + bool getForce()const; + void setForce(bool force); + + private: + std::string regionId_; + std::string elasticAcceleratedInstanceId_; + bool force_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DELETEEAIREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DeleteEaiResult.h b/eais/include/alibabacloud/eais/model/DeleteEaiResult.h new file mode 100644 index 000000000..7c30f2b01 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DeleteEaiResult.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_EAIS_MODEL_DELETEEAIRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_DELETEEAIRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DeleteEaiResult : public ServiceResult + { + public: + + + DeleteEaiResult(); + explicit DeleteEaiResult(const std::string &payload); + ~DeleteEaiResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DELETEEAIRESULT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DescribeEaisRequest.h b/eais/include/alibabacloud/eais/model/DescribeEaisRequest.h new file mode 100644 index 000000000..4489866d0 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DescribeEaisRequest.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_EAIS_MODEL_DESCRIBEEAISREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_DESCRIBEEAISREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DescribeEaisRequest : public RpcServiceRequest + { + + public: + DescribeEaisRequest(); + ~DescribeEaisRequest(); + + std::string getElasticAcceleratedInstanceIds()const; + void setElasticAcceleratedInstanceIds(const std::string& elasticAcceleratedInstanceIds); + std::string getInstanceName()const; + void setInstanceName(const std::string& instanceName); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getInstanceType()const; + void setInstanceType(const std::string& instanceType); + std::string getStatus()const; + void setStatus(const std::string& status); + + private: + std::string elasticAcceleratedInstanceIds_; + std::string instanceName_; + std::string regionId_; + std::string instanceType_; + std::string status_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DESCRIBEEAISREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DescribeEaisResult.h b/eais/include/alibabacloud/eais/model/DescribeEaisResult.h new file mode 100644 index 000000000..0bbfffb6e --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DescribeEaisResult.h @@ -0,0 +1,77 @@ +/* + * 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_EAIS_MODEL_DESCRIBEEAISRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_DESCRIBEEAISRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DescribeEaisResult : public ServiceResult + { + public: + struct Instance + { + struct Tag + { + std::string tagKey; + std::string tagValue; + }; + std::string instanceName; + std::string status; + std::string clientInstanceType; + std::string description; + std::string clientInstanceName; + std::string zoneId; + std::string creationTime; + std::string clientInstanceId; + std::string regionId; + std::string instanceType; + std::vector tags; + std::string elasticAcceleratedInstanceId; + }; + + + DescribeEaisResult(); + explicit DescribeEaisResult(const std::string &payload); + ~DescribeEaisResult(); + std::vector getInstances()const; + int getTotalCount()const; + int getPageSize()const; + int getPageNumber()const; + + protected: + void parse(const std::string &payload); + private: + std::vector instances_; + int totalCount_; + int pageSize_; + int pageNumber_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DESCRIBEEAISRESULT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DescribeRegionsRequest.h b/eais/include/alibabacloud/eais/model/DescribeRegionsRequest.h new file mode 100644 index 000000000..702da471b --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DescribeRegionsRequest.h @@ -0,0 +1,45 @@ +/* + * 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_EAIS_MODEL_DESCRIBEREGIONSREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_DESCRIBEREGIONSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DescribeRegionsRequest : public RpcServiceRequest + { + + public: + DescribeRegionsRequest(); + ~DescribeRegionsRequest(); + + + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DESCRIBEREGIONSREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DescribeRegionsResult.h b/eais/include/alibabacloud/eais/model/DescribeRegionsResult.h new file mode 100644 index 000000000..b5c6fff74 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DescribeRegionsResult.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_EAIS_MODEL_DESCRIBEREGIONSRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_DESCRIBEREGIONSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DescribeRegionsResult : public ServiceResult + { + public: + struct Region + { + std::string regionId; + std::string regionEndpoint; + std::string localName; + }; + + + DescribeRegionsResult(); + explicit DescribeRegionsResult(const std::string &payload); + ~DescribeRegionsResult(); + std::vector getRegions()const; + + protected: + void parse(const std::string &payload); + private: + std::vector regions_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DESCRIBEREGIONSRESULT_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DetachEaiRequest.h b/eais/include/alibabacloud/eais/model/DetachEaiRequest.h new file mode 100644 index 000000000..8583df824 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DetachEaiRequest.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_EAIS_MODEL_DETACHEAIREQUEST_H_ +#define ALIBABACLOUD_EAIS_MODEL_DETACHEAIREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DetachEaiRequest : public RpcServiceRequest + { + + public: + DetachEaiRequest(); + ~DetachEaiRequest(); + + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getElasticAcceleratedInstanceId()const; + void setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId); + + private: + std::string regionId_; + std::string elasticAcceleratedInstanceId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DETACHEAIREQUEST_H_ \ No newline at end of file diff --git a/eais/include/alibabacloud/eais/model/DetachEaiResult.h b/eais/include/alibabacloud/eais/model/DetachEaiResult.h new file mode 100644 index 000000000..34fd40692 --- /dev/null +++ b/eais/include/alibabacloud/eais/model/DetachEaiResult.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_EAIS_MODEL_DETACHEAIRESULT_H_ +#define ALIBABACLOUD_EAIS_MODEL_DETACHEAIRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Eais + { + namespace Model + { + class ALIBABACLOUD_EAIS_EXPORT DetachEaiResult : public ServiceResult + { + public: + + + DetachEaiResult(); + explicit DetachEaiResult(const std::string &payload); + ~DetachEaiResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_EAIS_MODEL_DETACHEAIRESULT_H_ \ No newline at end of file diff --git a/eais/src/EaisClient.cc b/eais/src/EaisClient.cc new file mode 100644 index 000000000..6c3a48e65 --- /dev/null +++ b/eais/src/EaisClient.cc @@ -0,0 +1,341 @@ +/* + * 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::Eais; +using namespace AlibabaCloud::Eais::Model; + +namespace +{ + const std::string SERVICE_NAME = "eais"; +} + +EaisClient::EaisClient(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, "eais"); +} + +EaisClient::EaisClient(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, "eais"); +} + +EaisClient::EaisClient(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, "eais"); +} + +EaisClient::~EaisClient() +{} + +EaisClient::AttachEaiOutcome EaisClient::attachEai(const AttachEaiRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return AttachEaiOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return AttachEaiOutcome(AttachEaiResult(outcome.result())); + else + return AttachEaiOutcome(outcome.error()); +} + +void EaisClient::attachEaiAsync(const AttachEaiRequest& request, const AttachEaiAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, attachEai(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::AttachEaiOutcomeCallable EaisClient::attachEaiCallable(const AttachEaiRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->attachEai(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +EaisClient::CreateEaiOutcome EaisClient::createEai(const CreateEaiRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateEaiOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateEaiOutcome(CreateEaiResult(outcome.result())); + else + return CreateEaiOutcome(outcome.error()); +} + +void EaisClient::createEaiAsync(const CreateEaiRequest& request, const CreateEaiAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createEai(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::CreateEaiOutcomeCallable EaisClient::createEaiCallable(const CreateEaiRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createEai(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +EaisClient::CreateEaiAllOutcome EaisClient::createEaiAll(const CreateEaiAllRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateEaiAllOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateEaiAllOutcome(CreateEaiAllResult(outcome.result())); + else + return CreateEaiAllOutcome(outcome.error()); +} + +void EaisClient::createEaiAllAsync(const CreateEaiAllRequest& request, const CreateEaiAllAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createEaiAll(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::CreateEaiAllOutcomeCallable EaisClient::createEaiAllCallable(const CreateEaiAllRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createEaiAll(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +EaisClient::DeleteEaiOutcome EaisClient::deleteEai(const DeleteEaiRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteEaiOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteEaiOutcome(DeleteEaiResult(outcome.result())); + else + return DeleteEaiOutcome(outcome.error()); +} + +void EaisClient::deleteEaiAsync(const DeleteEaiRequest& request, const DeleteEaiAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteEai(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::DeleteEaiOutcomeCallable EaisClient::deleteEaiCallable(const DeleteEaiRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteEai(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +EaisClient::DeleteEaiAllOutcome EaisClient::deleteEaiAll(const DeleteEaiAllRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteEaiAllOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteEaiAllOutcome(DeleteEaiAllResult(outcome.result())); + else + return DeleteEaiAllOutcome(outcome.error()); +} + +void EaisClient::deleteEaiAllAsync(const DeleteEaiAllRequest& request, const DeleteEaiAllAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteEaiAll(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::DeleteEaiAllOutcomeCallable EaisClient::deleteEaiAllCallable(const DeleteEaiAllRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteEaiAll(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +EaisClient::DescribeEaisOutcome EaisClient::describeEais(const DescribeEaisRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeEaisOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeEaisOutcome(DescribeEaisResult(outcome.result())); + else + return DescribeEaisOutcome(outcome.error()); +} + +void EaisClient::describeEaisAsync(const DescribeEaisRequest& request, const DescribeEaisAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeEais(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::DescribeEaisOutcomeCallable EaisClient::describeEaisCallable(const DescribeEaisRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeEais(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +EaisClient::DescribeRegionsOutcome EaisClient::describeRegions(const DescribeRegionsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeRegionsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeRegionsOutcome(DescribeRegionsResult(outcome.result())); + else + return DescribeRegionsOutcome(outcome.error()); +} + +void EaisClient::describeRegionsAsync(const DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeRegions(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::DescribeRegionsOutcomeCallable EaisClient::describeRegionsCallable(const DescribeRegionsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeRegions(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +EaisClient::DetachEaiOutcome EaisClient::detachEai(const DetachEaiRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DetachEaiOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DetachEaiOutcome(DetachEaiResult(outcome.result())); + else + return DetachEaiOutcome(outcome.error()); +} + +void EaisClient::detachEaiAsync(const DetachEaiRequest& request, const DetachEaiAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, detachEai(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +EaisClient::DetachEaiOutcomeCallable EaisClient::detachEaiCallable(const DetachEaiRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->detachEai(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/eais/src/model/AttachEaiRequest.cc b/eais/src/model/AttachEaiRequest.cc new file mode 100644 index 000000000..6f1df1b80 --- /dev/null +++ b/eais/src/model/AttachEaiRequest.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::Eais::Model::AttachEaiRequest; + +AttachEaiRequest::AttachEaiRequest() : + RpcServiceRequest("eais", "2019-06-24", "AttachEai") +{ + setMethod(HttpRequest::Method::Post); +} + +AttachEaiRequest::~AttachEaiRequest() +{} + +std::string AttachEaiRequest::getClientInstanceId()const +{ + return clientInstanceId_; +} + +void AttachEaiRequest::setClientInstanceId(const std::string& clientInstanceId) +{ + clientInstanceId_ = clientInstanceId; + setParameter("ClientInstanceId", clientInstanceId); +} + +std::string AttachEaiRequest::getRegionId()const +{ + return regionId_; +} + +void AttachEaiRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string AttachEaiRequest::getElasticAcceleratedInstanceId()const +{ + return elasticAcceleratedInstanceId_; +} + +void AttachEaiRequest::setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId) +{ + elasticAcceleratedInstanceId_ = elasticAcceleratedInstanceId; + setParameter("ElasticAcceleratedInstanceId", elasticAcceleratedInstanceId); +} + diff --git a/eais/src/model/AttachEaiResult.cc b/eais/src/model/AttachEaiResult.cc new file mode 100644 index 000000000..ab81c5c0e --- /dev/null +++ b/eais/src/model/AttachEaiResult.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::Eais; +using namespace AlibabaCloud::Eais::Model; + +AttachEaiResult::AttachEaiResult() : + ServiceResult() +{} + +AttachEaiResult::AttachEaiResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +AttachEaiResult::~AttachEaiResult() +{} + +void AttachEaiResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["ElasticAcceleratedInstanceId"].isNull()) + elasticAcceleratedInstanceId_ = value["ElasticAcceleratedInstanceId"].asString(); + if(!value["ClientInstanceId"].isNull()) + clientInstanceId_ = value["ClientInstanceId"].asString(); + +} + +std::string AttachEaiResult::getClientInstanceId()const +{ + return clientInstanceId_; +} + +std::string AttachEaiResult::getElasticAcceleratedInstanceId()const +{ + return elasticAcceleratedInstanceId_; +} + diff --git a/eais/src/model/CreateEaiAllRequest.cc b/eais/src/model/CreateEaiAllRequest.cc new file mode 100644 index 000000000..056795456 --- /dev/null +++ b/eais/src/model/CreateEaiAllRequest.cc @@ -0,0 +1,194 @@ +/* + * 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::Eais::Model::CreateEaiAllRequest; + +CreateEaiAllRequest::CreateEaiAllRequest() : + RpcServiceRequest("eais", "2019-06-24", "CreateEaiAll") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateEaiAllRequest::~CreateEaiAllRequest() +{} + +std::string CreateEaiAllRequest::getClientImageId()const +{ + return clientImageId_; +} + +void CreateEaiAllRequest::setClientImageId(const std::string& clientImageId) +{ + clientImageId_ = clientImageId; + setParameter("ClientImageId", clientImageId); +} + +std::string CreateEaiAllRequest::getClientSystemDiskCategory()const +{ + return clientSystemDiskCategory_; +} + +void CreateEaiAllRequest::setClientSystemDiskCategory(const std::string& clientSystemDiskCategory) +{ + clientSystemDiskCategory_ = clientSystemDiskCategory; + setParameter("ClientSystemDiskCategory", clientSystemDiskCategory); +} + +int CreateEaiAllRequest::getClientInternetMaxBandwidthOut()const +{ + return clientInternetMaxBandwidthOut_; +} + +void CreateEaiAllRequest::setClientInternetMaxBandwidthOut(int clientInternetMaxBandwidthOut) +{ + clientInternetMaxBandwidthOut_ = clientInternetMaxBandwidthOut; + setParameter("ClientInternetMaxBandwidthOut", std::to_string(clientInternetMaxBandwidthOut)); +} + +std::string CreateEaiAllRequest::getClientToken()const +{ + return clientToken_; +} + +void CreateEaiAllRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + +std::string CreateEaiAllRequest::getClientInstanceName()const +{ + return clientInstanceName_; +} + +void CreateEaiAllRequest::setClientInstanceName(const std::string& clientInstanceName) +{ + clientInstanceName_ = clientInstanceName; + setParameter("ClientInstanceName", clientInstanceName); +} + +int CreateEaiAllRequest::getClientInternetMaxBandwidthIn()const +{ + return clientInternetMaxBandwidthIn_; +} + +void CreateEaiAllRequest::setClientInternetMaxBandwidthIn(int clientInternetMaxBandwidthIn) +{ + clientInternetMaxBandwidthIn_ = clientInternetMaxBandwidthIn; + setParameter("ClientInternetMaxBandwidthIn", std::to_string(clientInternetMaxBandwidthIn)); +} + +std::string CreateEaiAllRequest::getRegionId()const +{ + return regionId_; +} + +void CreateEaiAllRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +int CreateEaiAllRequest::getClientSystemDiskSize()const +{ + return clientSystemDiskSize_; +} + +void CreateEaiAllRequest::setClientSystemDiskSize(int clientSystemDiskSize) +{ + clientSystemDiskSize_ = clientSystemDiskSize; + setParameter("ClientSystemDiskSize", std::to_string(clientSystemDiskSize)); +} + +std::string CreateEaiAllRequest::getClientVSwitchId()const +{ + return clientVSwitchId_; +} + +void CreateEaiAllRequest::setClientVSwitchId(const std::string& clientVSwitchId) +{ + clientVSwitchId_ = clientVSwitchId; + setParameter("ClientVSwitchId", clientVSwitchId); +} + +std::string CreateEaiAllRequest::getClientPassword()const +{ + return clientPassword_; +} + +void CreateEaiAllRequest::setClientPassword(const std::string& clientPassword) +{ + clientPassword_ = clientPassword; + setParameter("ClientPassword", clientPassword); +} + +std::string CreateEaiAllRequest::getClientInstanceType()const +{ + return clientInstanceType_; +} + +void CreateEaiAllRequest::setClientInstanceType(const std::string& clientInstanceType) +{ + clientInstanceType_ = clientInstanceType; + setParameter("ClientInstanceType", clientInstanceType); +} + +std::string CreateEaiAllRequest::getClientSecurityGroupId()const +{ + return clientSecurityGroupId_; +} + +void CreateEaiAllRequest::setClientSecurityGroupId(const std::string& clientSecurityGroupId) +{ + clientSecurityGroupId_ = clientSecurityGroupId; + setParameter("ClientSecurityGroupId", clientSecurityGroupId); +} + +std::string CreateEaiAllRequest::getEaiInstanceType()const +{ + return eaiInstanceType_; +} + +void CreateEaiAllRequest::setEaiInstanceType(const std::string& eaiInstanceType) +{ + eaiInstanceType_ = eaiInstanceType; + setParameter("EaiInstanceType", eaiInstanceType); +} + +std::string CreateEaiAllRequest::getClientZoneId()const +{ + return clientZoneId_; +} + +void CreateEaiAllRequest::setClientZoneId(const std::string& clientZoneId) +{ + clientZoneId_ = clientZoneId; + setParameter("ClientZoneId", clientZoneId); +} + +std::string CreateEaiAllRequest::getInstanceName()const +{ + return instanceName_; +} + +void CreateEaiAllRequest::setInstanceName(const std::string& instanceName) +{ + instanceName_ = instanceName; + setParameter("InstanceName", instanceName); +} + diff --git a/eais/src/model/CreateEaiAllResult.cc b/eais/src/model/CreateEaiAllResult.cc new file mode 100644 index 000000000..e9e71c5c0 --- /dev/null +++ b/eais/src/model/CreateEaiAllResult.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::Eais; +using namespace AlibabaCloud::Eais::Model; + +CreateEaiAllResult::CreateEaiAllResult() : + ServiceResult() +{} + +CreateEaiAllResult::CreateEaiAllResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateEaiAllResult::~CreateEaiAllResult() +{} + +void CreateEaiAllResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["ElasticAcceleratedInstanceId"].isNull()) + elasticAcceleratedInstanceId_ = value["ElasticAcceleratedInstanceId"].asString(); + if(!value["ClientInstanceId"].isNull()) + clientInstanceId_ = value["ClientInstanceId"].asString(); + +} + +std::string CreateEaiAllResult::getClientInstanceId()const +{ + return clientInstanceId_; +} + +std::string CreateEaiAllResult::getElasticAcceleratedInstanceId()const +{ + return elasticAcceleratedInstanceId_; +} + diff --git a/eais/src/model/CreateEaiRequest.cc b/eais/src/model/CreateEaiRequest.cc new file mode 100644 index 000000000..777d8d168 --- /dev/null +++ b/eais/src/model/CreateEaiRequest.cc @@ -0,0 +1,73 @@ +/* + * 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::Eais::Model::CreateEaiRequest; + +CreateEaiRequest::CreateEaiRequest() : + RpcServiceRequest("eais", "2019-06-24", "CreateEai") +{ + setMethod(HttpRequest::Method::Post); +} + +CreateEaiRequest::~CreateEaiRequest() +{} + +std::string CreateEaiRequest::getClientToken()const +{ + return clientToken_; +} + +void CreateEaiRequest::setClientToken(const std::string& clientToken) +{ + clientToken_ = clientToken; + setParameter("ClientToken", clientToken); +} + +std::string CreateEaiRequest::getInstanceName()const +{ + return instanceName_; +} + +void CreateEaiRequest::setInstanceName(const std::string& instanceName) +{ + instanceName_ = instanceName; + setParameter("InstanceName", instanceName); +} + +std::string CreateEaiRequest::getRegionId()const +{ + return regionId_; +} + +void CreateEaiRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string CreateEaiRequest::getInstanceType()const +{ + return instanceType_; +} + +void CreateEaiRequest::setInstanceType(const std::string& instanceType) +{ + instanceType_ = instanceType; + setParameter("InstanceType", instanceType); +} + diff --git a/eais/src/model/CreateEaiResult.cc b/eais/src/model/CreateEaiResult.cc new file mode 100644 index 000000000..ae57a8e83 --- /dev/null +++ b/eais/src/model/CreateEaiResult.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::Eais; +using namespace AlibabaCloud::Eais::Model; + +CreateEaiResult::CreateEaiResult() : + ServiceResult() +{} + +CreateEaiResult::CreateEaiResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateEaiResult::~CreateEaiResult() +{} + +void CreateEaiResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["ElasticAcceleratedInstanceId"].isNull()) + elasticAcceleratedInstanceId_ = value["ElasticAcceleratedInstanceId"].asString(); + +} + +std::string CreateEaiResult::getElasticAcceleratedInstanceId()const +{ + return elasticAcceleratedInstanceId_; +} + diff --git a/eais/src/model/DeleteEaiAllRequest.cc b/eais/src/model/DeleteEaiAllRequest.cc new file mode 100644 index 000000000..0123b64a5 --- /dev/null +++ b/eais/src/model/DeleteEaiAllRequest.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::Eais::Model::DeleteEaiAllRequest; + +DeleteEaiAllRequest::DeleteEaiAllRequest() : + RpcServiceRequest("eais", "2019-06-24", "DeleteEaiAll") +{ + setMethod(HttpRequest::Method::Post); +} + +DeleteEaiAllRequest::~DeleteEaiAllRequest() +{} + +std::string DeleteEaiAllRequest::getClientInstanceId()const +{ + return clientInstanceId_; +} + +void DeleteEaiAllRequest::setClientInstanceId(const std::string& clientInstanceId) +{ + clientInstanceId_ = clientInstanceId; + setParameter("ClientInstanceId", clientInstanceId); +} + +std::string DeleteEaiAllRequest::getRegionId()const +{ + return regionId_; +} + +void DeleteEaiAllRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string DeleteEaiAllRequest::getElasticAcceleratedInstanceId()const +{ + return elasticAcceleratedInstanceId_; +} + +void DeleteEaiAllRequest::setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId) +{ + elasticAcceleratedInstanceId_ = elasticAcceleratedInstanceId; + setParameter("ElasticAcceleratedInstanceId", elasticAcceleratedInstanceId); +} + diff --git a/eais/src/model/DeleteEaiAllResult.cc b/eais/src/model/DeleteEaiAllResult.cc new file mode 100644 index 000000000..86052dedd --- /dev/null +++ b/eais/src/model/DeleteEaiAllResult.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::Eais; +using namespace AlibabaCloud::Eais::Model; + +DeleteEaiAllResult::DeleteEaiAllResult() : + ServiceResult() +{} + +DeleteEaiAllResult::DeleteEaiAllResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteEaiAllResult::~DeleteEaiAllResult() +{} + +void DeleteEaiAllResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/eais/src/model/DeleteEaiRequest.cc b/eais/src/model/DeleteEaiRequest.cc new file mode 100644 index 000000000..48adb95ed --- /dev/null +++ b/eais/src/model/DeleteEaiRequest.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::Eais::Model::DeleteEaiRequest; + +DeleteEaiRequest::DeleteEaiRequest() : + RpcServiceRequest("eais", "2019-06-24", "DeleteEai") +{ + setMethod(HttpRequest::Method::Post); +} + +DeleteEaiRequest::~DeleteEaiRequest() +{} + +std::string DeleteEaiRequest::getRegionId()const +{ + return regionId_; +} + +void DeleteEaiRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string DeleteEaiRequest::getElasticAcceleratedInstanceId()const +{ + return elasticAcceleratedInstanceId_; +} + +void DeleteEaiRequest::setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId) +{ + elasticAcceleratedInstanceId_ = elasticAcceleratedInstanceId; + setParameter("ElasticAcceleratedInstanceId", elasticAcceleratedInstanceId); +} + +bool DeleteEaiRequest::getForce()const +{ + return force_; +} + +void DeleteEaiRequest::setForce(bool force) +{ + force_ = force; + setParameter("Force", force ? "true" : "false"); +} + diff --git a/eais/src/model/DeleteEaiResult.cc b/eais/src/model/DeleteEaiResult.cc new file mode 100644 index 000000000..18a5e6628 --- /dev/null +++ b/eais/src/model/DeleteEaiResult.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::Eais; +using namespace AlibabaCloud::Eais::Model; + +DeleteEaiResult::DeleteEaiResult() : + ServiceResult() +{} + +DeleteEaiResult::DeleteEaiResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteEaiResult::~DeleteEaiResult() +{} + +void DeleteEaiResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/eais/src/model/DescribeEaisRequest.cc b/eais/src/model/DescribeEaisRequest.cc new file mode 100644 index 000000000..503ea84a3 --- /dev/null +++ b/eais/src/model/DescribeEaisRequest.cc @@ -0,0 +1,84 @@ +/* + * 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::Eais::Model::DescribeEaisRequest; + +DescribeEaisRequest::DescribeEaisRequest() : + RpcServiceRequest("eais", "2019-06-24", "DescribeEais") +{ + setMethod(HttpRequest::Method::Post); +} + +DescribeEaisRequest::~DescribeEaisRequest() +{} + +std::string DescribeEaisRequest::getElasticAcceleratedInstanceIds()const +{ + return elasticAcceleratedInstanceIds_; +} + +void DescribeEaisRequest::setElasticAcceleratedInstanceIds(const std::string& elasticAcceleratedInstanceIds) +{ + elasticAcceleratedInstanceIds_ = elasticAcceleratedInstanceIds; + setParameter("ElasticAcceleratedInstanceIds", elasticAcceleratedInstanceIds); +} + +std::string DescribeEaisRequest::getInstanceName()const +{ + return instanceName_; +} + +void DescribeEaisRequest::setInstanceName(const std::string& instanceName) +{ + instanceName_ = instanceName; + setParameter("InstanceName", instanceName); +} + +std::string DescribeEaisRequest::getRegionId()const +{ + return regionId_; +} + +void DescribeEaisRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string DescribeEaisRequest::getInstanceType()const +{ + return instanceType_; +} + +void DescribeEaisRequest::setInstanceType(const std::string& instanceType) +{ + instanceType_ = instanceType; + setParameter("InstanceType", instanceType); +} + +std::string DescribeEaisRequest::getStatus()const +{ + return status_; +} + +void DescribeEaisRequest::setStatus(const std::string& status) +{ + status_ = status; + setParameter("Status", status); +} + diff --git a/eais/src/model/DescribeEaisResult.cc b/eais/src/model/DescribeEaisResult.cc new file mode 100644 index 000000000..a7ab39c27 --- /dev/null +++ b/eais/src/model/DescribeEaisResult.cc @@ -0,0 +1,108 @@ +/* + * 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::Eais; +using namespace AlibabaCloud::Eais::Model; + +DescribeEaisResult::DescribeEaisResult() : + ServiceResult() +{} + +DescribeEaisResult::DescribeEaisResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeEaisResult::~DescribeEaisResult() +{} + +void DescribeEaisResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allInstancesNode = value["Instances"]["Instance"]; + for (auto valueInstancesInstance : allInstancesNode) + { + Instance instancesObject; + if(!valueInstancesInstance["RegionId"].isNull()) + instancesObject.regionId = valueInstancesInstance["RegionId"].asString(); + if(!valueInstancesInstance["ZoneId"].isNull()) + instancesObject.zoneId = valueInstancesInstance["ZoneId"].asString(); + if(!valueInstancesInstance["CreationTime"].isNull()) + instancesObject.creationTime = valueInstancesInstance["CreationTime"].asString(); + if(!valueInstancesInstance["InstanceName"].isNull()) + instancesObject.instanceName = valueInstancesInstance["InstanceName"].asString(); + if(!valueInstancesInstance["Description"].isNull()) + instancesObject.description = valueInstancesInstance["Description"].asString(); + if(!valueInstancesInstance["Status"].isNull()) + instancesObject.status = valueInstancesInstance["Status"].asString(); + if(!valueInstancesInstance["ElasticAcceleratedInstanceId"].isNull()) + instancesObject.elasticAcceleratedInstanceId = valueInstancesInstance["ElasticAcceleratedInstanceId"].asString(); + if(!valueInstancesInstance["ClientInstanceId"].isNull()) + instancesObject.clientInstanceId = valueInstancesInstance["ClientInstanceId"].asString(); + if(!valueInstancesInstance["InstanceType"].isNull()) + instancesObject.instanceType = valueInstancesInstance["InstanceType"].asString(); + if(!valueInstancesInstance["ClientInstanceType"].isNull()) + instancesObject.clientInstanceType = valueInstancesInstance["ClientInstanceType"].asString(); + if(!valueInstancesInstance["ClientInstanceName"].isNull()) + instancesObject.clientInstanceName = valueInstancesInstance["ClientInstanceName"].asString(); + auto allTagsNode = valueInstancesInstance["Tags"]["Tag"]; + for (auto valueInstancesInstanceTagsTag : allTagsNode) + { + Instance::Tag tagsObject; + if(!valueInstancesInstanceTagsTag["TagValue"].isNull()) + tagsObject.tagValue = valueInstancesInstanceTagsTag["TagValue"].asString(); + if(!valueInstancesInstanceTagsTag["TagKey"].isNull()) + tagsObject.tagKey = valueInstancesInstanceTagsTag["TagKey"].asString(); + instancesObject.tags.push_back(tagsObject); + } + instances_.push_back(instancesObject); + } + if(!value["PageNumber"].isNull()) + pageNumber_ = std::stoi(value["PageNumber"].asString()); + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + +} + +std::vector DescribeEaisResult::getInstances()const +{ + return instances_; +} + +int DescribeEaisResult::getTotalCount()const +{ + return totalCount_; +} + +int DescribeEaisResult::getPageSize()const +{ + return pageSize_; +} + +int DescribeEaisResult::getPageNumber()const +{ + return pageNumber_; +} + diff --git a/eais/src/model/DescribeRegionsRequest.cc b/eais/src/model/DescribeRegionsRequest.cc new file mode 100644 index 000000000..6375355e5 --- /dev/null +++ b/eais/src/model/DescribeRegionsRequest.cc @@ -0,0 +1,29 @@ +/* + * 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::Eais::Model::DescribeRegionsRequest; + +DescribeRegionsRequest::DescribeRegionsRequest() : + RpcServiceRequest("eais", "2019-06-24", "DescribeRegions") +{ + setMethod(HttpRequest::Method::Post); +} + +DescribeRegionsRequest::~DescribeRegionsRequest() +{} + diff --git a/eais/src/model/DescribeRegionsResult.cc b/eais/src/model/DescribeRegionsResult.cc new file mode 100644 index 000000000..0acd6ece7 --- /dev/null +++ b/eais/src/model/DescribeRegionsResult.cc @@ -0,0 +1,61 @@ +/* + * 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::Eais; +using namespace AlibabaCloud::Eais::Model; + +DescribeRegionsResult::DescribeRegionsResult() : + ServiceResult() +{} + +DescribeRegionsResult::DescribeRegionsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeRegionsResult::~DescribeRegionsResult() +{} + +void DescribeRegionsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allRegionsNode = value["Regions"]["Region"]; + for (auto valueRegionsRegion : allRegionsNode) + { + Region regionsObject; + if(!valueRegionsRegion["RegionId"].isNull()) + regionsObject.regionId = valueRegionsRegion["RegionId"].asString(); + if(!valueRegionsRegion["RegionEndpoint"].isNull()) + regionsObject.regionEndpoint = valueRegionsRegion["RegionEndpoint"].asString(); + if(!valueRegionsRegion["LocalName"].isNull()) + regionsObject.localName = valueRegionsRegion["LocalName"].asString(); + regions_.push_back(regionsObject); + } + +} + +std::vector DescribeRegionsResult::getRegions()const +{ + return regions_; +} + diff --git a/eais/src/model/DetachEaiRequest.cc b/eais/src/model/DetachEaiRequest.cc new file mode 100644 index 000000000..eaa27818d --- /dev/null +++ b/eais/src/model/DetachEaiRequest.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 + +using AlibabaCloud::Eais::Model::DetachEaiRequest; + +DetachEaiRequest::DetachEaiRequest() : + RpcServiceRequest("eais", "2019-06-24", "DetachEai") +{ + setMethod(HttpRequest::Method::Post); +} + +DetachEaiRequest::~DetachEaiRequest() +{} + +std::string DetachEaiRequest::getRegionId()const +{ + return regionId_; +} + +void DetachEaiRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string DetachEaiRequest::getElasticAcceleratedInstanceId()const +{ + return elasticAcceleratedInstanceId_; +} + +void DetachEaiRequest::setElasticAcceleratedInstanceId(const std::string& elasticAcceleratedInstanceId) +{ + elasticAcceleratedInstanceId_ = elasticAcceleratedInstanceId; + setParameter("ElasticAcceleratedInstanceId", elasticAcceleratedInstanceId); +} + diff --git a/eais/src/model/DetachEaiResult.cc b/eais/src/model/DetachEaiResult.cc new file mode 100644 index 000000000..9d6ea770e --- /dev/null +++ b/eais/src/model/DetachEaiResult.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::Eais; +using namespace AlibabaCloud::Eais::Model; + +DetachEaiResult::DetachEaiResult() : + ServiceResult() +{} + +DetachEaiResult::DetachEaiResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DetachEaiResult::~DetachEaiResult() +{} + +void DetachEaiResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +