From 9693807164703e9a39ebf1b4971d04ea6c6e466b Mon Sep 17 00:00:00 2001 From: sdk-team Date: Wed, 19 Aug 2020 16:03:11 +0800 Subject: [PATCH] Generated 2020-08-01 for SmartHosting. --- CHANGELOG | 3 + VERSION | 2 +- smarthosting/CMakeLists.txt | 98 ++++++++ .../smarthosting/SmartHostingClient.h | 78 +++++++ .../smarthosting/SmartHostingExport.h | 32 +++ .../model/ListManagedHostsRequest.h | 99 ++++++++ .../model/ListManagedHostsResult.h | 102 +++++++++ .../model/ListManagedPrivateSpacesRequest.h | 87 +++++++ .../model/ListManagedPrivateSpacesResult.h | 117 ++++++++++ .../model/ListManagedRacksRequest.h | 78 +++++++ .../model/ListManagedRacksResult.h | 75 +++++++ .../UpdateManagedHostAttributesRequest.h | 69 ++++++ .../model/UpdateManagedHostAttributesResult.h | 49 ++++ smarthosting/src/SmartHostingClient.cc | 197 ++++++++++++++++ .../src/model/ListManagedHostsRequest.cc | 212 ++++++++++++++++++ .../src/model/ListManagedHostsResult.cc | 136 +++++++++++ .../model/ListManagedPrivateSpacesRequest.cc | 168 ++++++++++++++ .../model/ListManagedPrivateSpacesResult.cc | 158 +++++++++++++ .../src/model/ListManagedRacksRequest.cc | 152 +++++++++++++ .../src/model/ListManagedRacksResult.cc | 97 ++++++++ .../UpdateManagedHostAttributesRequest.cc | 117 ++++++++++ .../UpdateManagedHostAttributesResult.cc | 44 ++++ 22 files changed, 2169 insertions(+), 1 deletion(-) create mode 100644 smarthosting/CMakeLists.txt create mode 100644 smarthosting/include/alibabacloud/smarthosting/SmartHostingClient.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/SmartHostingExport.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsRequest.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsResult.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesRequest.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesResult.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksRequest.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksResult.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesRequest.h create mode 100644 smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesResult.h create mode 100644 smarthosting/src/SmartHostingClient.cc create mode 100644 smarthosting/src/model/ListManagedHostsRequest.cc create mode 100644 smarthosting/src/model/ListManagedHostsResult.cc create mode 100644 smarthosting/src/model/ListManagedPrivateSpacesRequest.cc create mode 100644 smarthosting/src/model/ListManagedPrivateSpacesResult.cc create mode 100644 smarthosting/src/model/ListManagedRacksRequest.cc create mode 100644 smarthosting/src/model/ListManagedRacksResult.cc create mode 100644 smarthosting/src/model/UpdateManagedHostAttributesRequest.cc create mode 100644 smarthosting/src/model/UpdateManagedHostAttributesResult.cc diff --git a/CHANGELOG b/CHANGELOG index 8efc98830..39a001076 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-08-19 Version: 1.36.599 +- Generated 2020-08-01 for `SmartHosting`. + 2020-08-18 Version: 1.36.598 - Support for describe hbaseue multi-zone model. diff --git a/VERSION b/VERSION index d1a0bc42b..fe5c24783 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.598 \ No newline at end of file +1.36.599 \ No newline at end of file diff --git a/smarthosting/CMakeLists.txt b/smarthosting/CMakeLists.txt new file mode 100644 index 000000000..a24ec3786 --- /dev/null +++ b/smarthosting/CMakeLists.txt @@ -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. +# + +set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include) + +set(smarthosting_public_header + include/alibabacloud/smarthosting/SmartHostingClient.h + include/alibabacloud/smarthosting/SmartHostingExport.h ) + +set(smarthosting_public_header_model + include/alibabacloud/smarthosting/model/ListManagedHostsRequest.h + include/alibabacloud/smarthosting/model/ListManagedHostsResult.h + include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesRequest.h + include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesResult.h + include/alibabacloud/smarthosting/model/ListManagedRacksRequest.h + include/alibabacloud/smarthosting/model/ListManagedRacksResult.h + include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesRequest.h + include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesResult.h ) + +set(smarthosting_src + src/SmartHostingClient.cc + src/model/ListManagedHostsRequest.cc + src/model/ListManagedHostsResult.cc + src/model/ListManagedPrivateSpacesRequest.cc + src/model/ListManagedPrivateSpacesResult.cc + src/model/ListManagedRacksRequest.cc + src/model/ListManagedRacksResult.cc + src/model/UpdateManagedHostAttributesRequest.cc + src/model/UpdateManagedHostAttributesResult.cc ) + +add_library(smarthosting ${LIB_TYPE} + ${smarthosting_public_header} + ${smarthosting_public_header_model} + ${smarthosting_src}) + +set_target_properties(smarthosting + 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}smarthosting + ) + +if(${LIB_TYPE} STREQUAL "SHARED") + set_target_properties(smarthosting + PROPERTIES + DEFINE_SYMBOL ALIBABACLOUD_SMARTHOSTING_LIBRARY) +endif() + +target_include_directories(smarthosting + PRIVATE include + ${CMAKE_SOURCE_DIR}/core/include + ) +target_link_libraries(smarthosting + core) + +if(CMAKE_HOST_WIN32) + ExternalProject_Get_Property(jsoncpp INSTALL_DIR) + set(jsoncpp_install_dir ${INSTALL_DIR}) + add_dependencies(smarthosting + jsoncpp) + target_include_directories(smarthosting + PRIVATE ${jsoncpp_install_dir}/include) + target_link_libraries(smarthosting + ${jsoncpp_install_dir}/lib/jsoncpp.lib) + set_target_properties(smarthosting + PROPERTIES + COMPILE_OPTIONS "/bigobj") +else() + target_include_directories(smarthosting + PRIVATE /usr/include/jsoncpp) + target_link_libraries(smarthosting + jsoncpp) +endif() + +install(FILES ${smarthosting_public_header} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/smarthosting) +install(FILES ${smarthosting_public_header_model} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/smarthosting/model) +install(TARGETS smarthosting + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/SmartHostingClient.h b/smarthosting/include/alibabacloud/smarthosting/SmartHostingClient.h new file mode 100644 index 000000000..3db39a0ad --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/SmartHostingClient.h @@ -0,0 +1,78 @@ +/* + * 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_SMARTHOSTING_SMARTHOSTINGCLIENT_H_ +#define ALIBABACLOUD_SMARTHOSTING_SMARTHOSTINGCLIENT_H_ + +#include +#include +#include +#include +#include "SmartHostingExport.h" +#include "model/ListManagedHostsRequest.h" +#include "model/ListManagedHostsResult.h" +#include "model/ListManagedPrivateSpacesRequest.h" +#include "model/ListManagedPrivateSpacesResult.h" +#include "model/ListManagedRacksRequest.h" +#include "model/ListManagedRacksResult.h" +#include "model/UpdateManagedHostAttributesRequest.h" +#include "model/UpdateManagedHostAttributesResult.h" + + +namespace AlibabaCloud +{ + namespace SmartHosting + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT SmartHostingClient : public RpcServiceClient + { + public: + typedef Outcome ListManagedHostsOutcome; + typedef std::future ListManagedHostsOutcomeCallable; + typedef std::function&)> ListManagedHostsAsyncHandler; + typedef Outcome ListManagedPrivateSpacesOutcome; + typedef std::future ListManagedPrivateSpacesOutcomeCallable; + typedef std::function&)> ListManagedPrivateSpacesAsyncHandler; + typedef Outcome ListManagedRacksOutcome; + typedef std::future ListManagedRacksOutcomeCallable; + typedef std::function&)> ListManagedRacksAsyncHandler; + typedef Outcome UpdateManagedHostAttributesOutcome; + typedef std::future UpdateManagedHostAttributesOutcomeCallable; + typedef std::function&)> UpdateManagedHostAttributesAsyncHandler; + + SmartHostingClient(const Credentials &credentials, const ClientConfiguration &configuration); + SmartHostingClient(const std::shared_ptr &credentialsProvider, const ClientConfiguration &configuration); + SmartHostingClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration); + ~SmartHostingClient(); + ListManagedHostsOutcome listManagedHosts(const Model::ListManagedHostsRequest &request)const; + void listManagedHostsAsync(const Model::ListManagedHostsRequest& request, const ListManagedHostsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListManagedHostsOutcomeCallable listManagedHostsCallable(const Model::ListManagedHostsRequest& request) const; + ListManagedPrivateSpacesOutcome listManagedPrivateSpaces(const Model::ListManagedPrivateSpacesRequest &request)const; + void listManagedPrivateSpacesAsync(const Model::ListManagedPrivateSpacesRequest& request, const ListManagedPrivateSpacesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListManagedPrivateSpacesOutcomeCallable listManagedPrivateSpacesCallable(const Model::ListManagedPrivateSpacesRequest& request) const; + ListManagedRacksOutcome listManagedRacks(const Model::ListManagedRacksRequest &request)const; + void listManagedRacksAsync(const Model::ListManagedRacksRequest& request, const ListManagedRacksAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListManagedRacksOutcomeCallable listManagedRacksCallable(const Model::ListManagedRacksRequest& request) const; + UpdateManagedHostAttributesOutcome updateManagedHostAttributes(const Model::UpdateManagedHostAttributesRequest &request)const; + void updateManagedHostAttributesAsync(const Model::UpdateManagedHostAttributesRequest& request, const UpdateManagedHostAttributesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateManagedHostAttributesOutcomeCallable updateManagedHostAttributesCallable(const Model::UpdateManagedHostAttributesRequest& request) const; + + private: + std::shared_ptr endpointProvider_; + }; + } +} + +#endif // !ALIBABACLOUD_SMARTHOSTING_SMARTHOSTINGCLIENT_H_ diff --git a/smarthosting/include/alibabacloud/smarthosting/SmartHostingExport.h b/smarthosting/include/alibabacloud/smarthosting/SmartHostingExport.h new file mode 100644 index 000000000..5092ace1f --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/SmartHostingExport.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_SMARTHOSTING_SMARTHOSTINGEXPORT_H_ +#define ALIBABACLOUD_SMARTHOSTING_SMARTHOSTINGEXPORT_H_ + +#include + +#if defined(ALIBABACLOUD_SHARED) +# if defined(ALIBABACLOUD_SMARTHOSTING_LIBRARY) +# define ALIBABACLOUD_SMARTHOSTING_EXPORT ALIBABACLOUD_DECL_EXPORT +# else +# define ALIBABACLOUD_SMARTHOSTING_EXPORT ALIBABACLOUD_DECL_IMPORT +# endif +#else +# define ALIBABACLOUD_SMARTHOSTING_EXPORT +#endif + +#endif // !ALIBABACLOUD_SMARTHOSTING_SMARTHOSTINGEXPORT_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsRequest.h b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsRequest.h new file mode 100644 index 000000000..72267646d --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsRequest.h @@ -0,0 +1,99 @@ +/* + * 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_SMARTHOSTING_MODEL_LISTMANAGEDHOSTSREQUEST_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDHOSTSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT ListManagedHostsRequest : public RpcServiceRequest + { + public: + struct Tag + { + std::string key; + std::string value; + }; + + public: + ListManagedHostsRequest(); + ~ListManagedHostsRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getHostType()const; + void setHostType(const std::string& hostType); + std::string getMode()const; + void setMode(const std::string& mode); + std::string getResourceGroupId()const; + void setResourceGroupId(const std::string& resourceGroupId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getNextToken()const; + void setNextToken(const std::string& nextToken); + std::vector getTag()const; + void setTag(const std::vector& tag); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getOwnerAccount()const; + void setOwnerAccount(const std::string& ownerAccount); + std::vector getManagedHostId()const; + void setManagedHostId(const std::vector& managedHostId); + long getOwnerId()const; + void setOwnerId(long ownerId); + std::string getManagedPrivateSpaceId()const; + void setManagedPrivateSpaceId(const std::string& managedPrivateSpaceId); + std::string getZoneId()const; + void setZoneId(const std::string& zoneId); + int getMaxResults()const; + void setMaxResults(int maxResults); + std::string getManagedHostName()const; + void setManagedHostName(const std::string& managedHostName); + std::string getStatus()const; + void setStatus(const std::string& status); + + private: + long resourceOwnerId_; + std::string hostType_; + std::string mode_; + std::string resourceGroupId_; + std::string regionId_; + std::string nextToken_; + std::vector tag_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + std::vector managedHostId_; + long ownerId_; + std::string managedPrivateSpaceId_; + std::string zoneId_; + int maxResults_; + std::string managedHostName_; + std::string status_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDHOSTSREQUEST_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsResult.h b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsResult.h new file mode 100644 index 000000000..3f4e26cb4 --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedHostsResult.h @@ -0,0 +1,102 @@ +/* + * 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_SMARTHOSTING_MODEL_LISTMANAGEDHOSTSRESULT_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDHOSTSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT ListManagedHostsResult : public ServiceResult + { + public: + struct ManagedHostSet + { + struct CapacityAttribute + { + int availableMemories; + int totalMemories; + int availableVcpus; + int totalVcpus; + }; + struct HostAttribute + { + std::string hostType; + std::string cpuModelName; + }; + struct NetworkAssociation + { + struct SwitchSet + { + std::string switchId; + }; + std::vector switchSets; + }; + struct InstanceSet + { + std::string instanceId; + }; + struct Tag + { + std::string value; + std::string key; + }; + std::string status; + std::string resourceGroupId; + std::string mode; + HostAttribute hostAttribute; + std::string managedHostId; + std::vector supportedCustomInstanceTypeFamilies; + std::vector instanceSets; + NetworkAssociation networkAssociation; + std::vector supportedInstanceTypeFamilies; + std::string managedHostName; + CapacityAttribute capacityAttribute; + std::vector supportedInstanceTypes; + std::vector tags; + }; + + + ListManagedHostsResult(); + explicit ListManagedHostsResult(const std::string &payload); + ~ListManagedHostsResult(); + int getTotalCount()const; + std::string getNextToken()const; + int getPageSize()const; + std::vector getManagedHostSets()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + std::string nextToken_; + int pageSize_; + std::vector managedHostSets_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDHOSTSRESULT_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesRequest.h b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesRequest.h new file mode 100644 index 000000000..863f04853 --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesRequest.h @@ -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. + */ + +#ifndef ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDPRIVATESPACESREQUEST_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDPRIVATESPACESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT ListManagedPrivateSpacesRequest : public RpcServiceRequest + { + public: + struct Tag + { + std::string key; + std::string value; + }; + + public: + ListManagedPrivateSpacesRequest(); + ~ListManagedPrivateSpacesRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getManagedPrivateSpaceName()const; + void setManagedPrivateSpaceName(const std::string& managedPrivateSpaceName); + std::string getResourceGroupId()const; + void setResourceGroupId(const std::string& resourceGroupId); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getNextToken()const; + void setNextToken(const std::string& nextToken); + std::vector getTag()const; + void setTag(const std::vector& tag); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getOwnerAccount()const; + void setOwnerAccount(const std::string& ownerAccount); + long getOwnerId()const; + void setOwnerId(long ownerId); + std::vector getManagedPrivateSpaceId()const; + void setManagedPrivateSpaceId(const std::vector& managedPrivateSpaceId); + std::string getZoneId()const; + void setZoneId(const std::string& zoneId); + int getMaxResults()const; + void setMaxResults(int maxResults); + + private: + long resourceOwnerId_; + std::string managedPrivateSpaceName_; + std::string resourceGroupId_; + std::string regionId_; + std::string nextToken_; + std::vector tag_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::vector managedPrivateSpaceId_; + std::string zoneId_; + int maxResults_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDPRIVATESPACESREQUEST_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesResult.h b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesResult.h new file mode 100644 index 000000000..1659a62f8 --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedPrivateSpacesResult.h @@ -0,0 +1,117 @@ +/* + * 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_SMARTHOSTING_MODEL_LISTMANAGEDPRIVATESPACESRESULT_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDPRIVATESPACESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT ListManagedPrivateSpacesResult : public ServiceResult + { + public: + struct ManagedPrivateSpaceSet + { + struct CapacityAttribute + { + int availableMemories; + int availableHostCount; + int reservedVcpus; + int totalMemories; + int availableVcpus; + int totalVcpus; + int reservedHostCount; + int reservedMemories; + int totalHostCount; + }; + struct LifecycleAttribute + { + std::string deliveryTime; + std::string expirationTime; + std::string receptionTime; + }; + struct LocationAttribute + { + std::string address; + }; + struct DeploymentAttribute + { + struct DeploymentStep + { + std::string status; + std::string expectTime; + std::string actualTime; + bool currentStep; + }; + std::string description; + std::string createTime; + std::string contractId; + std::vector deploymentSteps; + }; + struct ManagedHostSet + { + std::string managedHostStatus; + std::string managedHostId; + }; + struct Tag + { + std::string value; + std::string key; + }; + std::vector deploymentAttributes; + std::string description; + std::string resourceGroupId; + std::string zoneId; + LifecycleAttribute lifecycleAttribute; + std::string managedPrivateSpaceId; + std::string managedPrivateSpaceName; + std::vector managedHostSets; + std::string saleMode; + std::string creationTime; + CapacityAttribute capacityAttribute; + LocationAttribute locationAttribute; + std::vector tags; + }; + + + ListManagedPrivateSpacesResult(); + explicit ListManagedPrivateSpacesResult(const std::string &payload); + ~ListManagedPrivateSpacesResult(); + int getTotalCount()const; + std::vector getManagedPrivateSpaceSets()const; + std::string getNextToken()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + std::vector managedPrivateSpaceSets_; + std::string nextToken_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDPRIVATESPACESRESULT_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksRequest.h b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksRequest.h new file mode 100644 index 000000000..0f22ecb61 --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksRequest.h @@ -0,0 +1,78 @@ +/* + * 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_SMARTHOSTING_MODEL_LISTMANAGEDRACKSREQUEST_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDRACKSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT ListManagedRacksRequest : public RpcServiceRequest + { + + public: + ListManagedRacksRequest(); + ~ListManagedRacksRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getHostType()const; + void setHostType(const std::string& hostType); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getNextToken()const; + void setNextToken(const std::string& nextToken); + std::vector getManagedRackId()const; + void setManagedRackId(const std::vector& managedRackId); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getOwnerAccount()const; + void setOwnerAccount(const std::string& ownerAccount); + long getOwnerId()const; + void setOwnerId(long ownerId); + std::string getManagedPrivateSpaceId()const; + void setManagedPrivateSpaceId(const std::string& managedPrivateSpaceId); + std::string getZoneId()const; + void setZoneId(const std::string& zoneId); + int getMaxResults()const; + void setMaxResults(int maxResults); + + private: + long resourceOwnerId_; + std::string hostType_; + std::string regionId_; + std::string nextToken_; + std::vector managedRackId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + long ownerId_; + std::string managedPrivateSpaceId_; + std::string zoneId_; + int maxResults_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDRACKSREQUEST_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksResult.h b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksResult.h new file mode 100644 index 000000000..710f2b0a9 --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/ListManagedRacksResult.h @@ -0,0 +1,75 @@ +/* + * 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_SMARTHOSTING_MODEL_LISTMANAGEDRACKSRESULT_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDRACKSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT ListManagedRacksResult : public ServiceResult + { + public: + struct ManagedRacksSet + { + struct ManagedHostSet + { + struct HostAttribute + { + std::string hostType; + std::string cpuModelName; + }; + std::string status; + std::string description; + HostAttribute hostAttribute; + std::string managedHostId; + }; + std::string managedRackId; + std::string zoneId; + std::vector managedHostSets; + }; + + + ListManagedRacksResult(); + explicit ListManagedRacksResult(const std::string &payload); + ~ListManagedRacksResult(); + int getTotalCount()const; + std::string getNextToken()const; + int getPageSize()const; + std::vector getManagedRacksSets()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + std::string nextToken_; + int pageSize_; + std::vector managedRacksSets_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_LISTMANAGEDRACKSRESULT_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesRequest.h b/smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesRequest.h new file mode 100644 index 000000000..60581d8fe --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesRequest.h @@ -0,0 +1,69 @@ +/* + * 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_SMARTHOSTING_MODEL_UPDATEMANAGEDHOSTATTRIBUTESREQUEST_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_UPDATEMANAGEDHOSTATTRIBUTESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT UpdateManagedHostAttributesRequest : public RpcServiceRequest + { + + public: + UpdateManagedHostAttributesRequest(); + ~UpdateManagedHostAttributesRequest(); + + long getResourceOwnerId()const; + void setResourceOwnerId(long resourceOwnerId); + std::string getMode()const; + void setMode(const std::string& mode); + std::string getRegionId()const; + void setRegionId(const std::string& regionId); + std::string getResourceOwnerAccount()const; + void setResourceOwnerAccount(const std::string& resourceOwnerAccount); + std::string getOwnerAccount()const; + void setOwnerAccount(const std::string& ownerAccount); + std::string getManagedHostId()const; + void setManagedHostId(const std::string& managedHostId); + long getOwnerId()const; + void setOwnerId(long ownerId); + std::string getManagedHostName()const; + void setManagedHostName(const std::string& managedHostName); + + private: + long resourceOwnerId_; + std::string mode_; + std::string regionId_; + std::string resourceOwnerAccount_; + std::string ownerAccount_; + std::string managedHostId_; + long ownerId_; + std::string managedHostName_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_UPDATEMANAGEDHOSTATTRIBUTESREQUEST_H_ \ No newline at end of file diff --git a/smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesResult.h b/smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesResult.h new file mode 100644 index 000000000..940c39522 --- /dev/null +++ b/smarthosting/include/alibabacloud/smarthosting/model/UpdateManagedHostAttributesResult.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_SMARTHOSTING_MODEL_UPDATEMANAGEDHOSTATTRIBUTESRESULT_H_ +#define ALIBABACLOUD_SMARTHOSTING_MODEL_UPDATEMANAGEDHOSTATTRIBUTESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SmartHosting + { + namespace Model + { + class ALIBABACLOUD_SMARTHOSTING_EXPORT UpdateManagedHostAttributesResult : public ServiceResult + { + public: + + + UpdateManagedHostAttributesResult(); + explicit UpdateManagedHostAttributesResult(const std::string &payload); + ~UpdateManagedHostAttributesResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_SMARTHOSTING_MODEL_UPDATEMANAGEDHOSTATTRIBUTESRESULT_H_ \ No newline at end of file diff --git a/smarthosting/src/SmartHostingClient.cc b/smarthosting/src/SmartHostingClient.cc new file mode 100644 index 000000000..807b311bf --- /dev/null +++ b/smarthosting/src/SmartHostingClient.cc @@ -0,0 +1,197 @@ +/* + * 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::SmartHosting; +using namespace AlibabaCloud::SmartHosting::Model; + +namespace +{ + const std::string SERVICE_NAME = "SmartHosting"; +} + +SmartHostingClient::SmartHostingClient(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, "SmartHosting"); +} + +SmartHostingClient::SmartHostingClient(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, "SmartHosting"); +} + +SmartHostingClient::SmartHostingClient(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, "SmartHosting"); +} + +SmartHostingClient::~SmartHostingClient() +{} + +SmartHostingClient::ListManagedHostsOutcome SmartHostingClient::listManagedHosts(const ListManagedHostsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListManagedHostsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListManagedHostsOutcome(ListManagedHostsResult(outcome.result())); + else + return ListManagedHostsOutcome(outcome.error()); +} + +void SmartHostingClient::listManagedHostsAsync(const ListManagedHostsRequest& request, const ListManagedHostsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listManagedHosts(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SmartHostingClient::ListManagedHostsOutcomeCallable SmartHostingClient::listManagedHostsCallable(const ListManagedHostsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listManagedHosts(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +SmartHostingClient::ListManagedPrivateSpacesOutcome SmartHostingClient::listManagedPrivateSpaces(const ListManagedPrivateSpacesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListManagedPrivateSpacesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListManagedPrivateSpacesOutcome(ListManagedPrivateSpacesResult(outcome.result())); + else + return ListManagedPrivateSpacesOutcome(outcome.error()); +} + +void SmartHostingClient::listManagedPrivateSpacesAsync(const ListManagedPrivateSpacesRequest& request, const ListManagedPrivateSpacesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listManagedPrivateSpaces(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SmartHostingClient::ListManagedPrivateSpacesOutcomeCallable SmartHostingClient::listManagedPrivateSpacesCallable(const ListManagedPrivateSpacesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listManagedPrivateSpaces(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +SmartHostingClient::ListManagedRacksOutcome SmartHostingClient::listManagedRacks(const ListManagedRacksRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListManagedRacksOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListManagedRacksOutcome(ListManagedRacksResult(outcome.result())); + else + return ListManagedRacksOutcome(outcome.error()); +} + +void SmartHostingClient::listManagedRacksAsync(const ListManagedRacksRequest& request, const ListManagedRacksAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listManagedRacks(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SmartHostingClient::ListManagedRacksOutcomeCallable SmartHostingClient::listManagedRacksCallable(const ListManagedRacksRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listManagedRacks(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +SmartHostingClient::UpdateManagedHostAttributesOutcome SmartHostingClient::updateManagedHostAttributes(const UpdateManagedHostAttributesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateManagedHostAttributesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateManagedHostAttributesOutcome(UpdateManagedHostAttributesResult(outcome.result())); + else + return UpdateManagedHostAttributesOutcome(outcome.error()); +} + +void SmartHostingClient::updateManagedHostAttributesAsync(const UpdateManagedHostAttributesRequest& request, const UpdateManagedHostAttributesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateManagedHostAttributes(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SmartHostingClient::UpdateManagedHostAttributesOutcomeCallable SmartHostingClient::updateManagedHostAttributesCallable(const UpdateManagedHostAttributesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateManagedHostAttributes(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + diff --git a/smarthosting/src/model/ListManagedHostsRequest.cc b/smarthosting/src/model/ListManagedHostsRequest.cc new file mode 100644 index 000000000..acf13b9a5 --- /dev/null +++ b/smarthosting/src/model/ListManagedHostsRequest.cc @@ -0,0 +1,212 @@ +/* + * 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::SmartHosting::Model::ListManagedHostsRequest; + +ListManagedHostsRequest::ListManagedHostsRequest() : + RpcServiceRequest("smarthosting", "2020-08-01", "ListManagedHosts") +{ + setMethod(HttpRequest::Method::Post); +} + +ListManagedHostsRequest::~ListManagedHostsRequest() +{} + +long ListManagedHostsRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void ListManagedHostsRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string ListManagedHostsRequest::getHostType()const +{ + return hostType_; +} + +void ListManagedHostsRequest::setHostType(const std::string& hostType) +{ + hostType_ = hostType; + setParameter("HostType", hostType); +} + +std::string ListManagedHostsRequest::getMode()const +{ + return mode_; +} + +void ListManagedHostsRequest::setMode(const std::string& mode) +{ + mode_ = mode; + setParameter("Mode", mode); +} + +std::string ListManagedHostsRequest::getResourceGroupId()const +{ + return resourceGroupId_; +} + +void ListManagedHostsRequest::setResourceGroupId(const std::string& resourceGroupId) +{ + resourceGroupId_ = resourceGroupId; + setParameter("ResourceGroupId", resourceGroupId); +} + +std::string ListManagedHostsRequest::getRegionId()const +{ + return regionId_; +} + +void ListManagedHostsRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string ListManagedHostsRequest::getNextToken()const +{ + return nextToken_; +} + +void ListManagedHostsRequest::setNextToken(const std::string& nextToken) +{ + nextToken_ = nextToken; + setParameter("NextToken", nextToken); +} + +std::vector ListManagedHostsRequest::getTag()const +{ + return tag_; +} + +void ListManagedHostsRequest::setTag(const std::vector& tag) +{ + tag_ = tag; + for(int dep1 = 0; dep1!= tag.size(); dep1++) { + auto tagObj = tag.at(dep1); + std::string tagObjStr = "Tag." + std::to_string(dep1 + 1); + setParameter(tagObjStr + ".Key", tagObj.key); + setParameter(tagObjStr + ".Value", tagObj.value); + } +} + +std::string ListManagedHostsRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void ListManagedHostsRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string ListManagedHostsRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void ListManagedHostsRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +std::vector ListManagedHostsRequest::getManagedHostId()const +{ + return managedHostId_; +} + +void ListManagedHostsRequest::setManagedHostId(const std::vector& managedHostId) +{ + managedHostId_ = managedHostId; + for(int dep1 = 0; dep1!= managedHostId.size(); dep1++) { + setParameter("ManagedHostId."+ std::to_string(dep1), managedHostId.at(dep1)); + } +} + +long ListManagedHostsRequest::getOwnerId()const +{ + return ownerId_; +} + +void ListManagedHostsRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string ListManagedHostsRequest::getManagedPrivateSpaceId()const +{ + return managedPrivateSpaceId_; +} + +void ListManagedHostsRequest::setManagedPrivateSpaceId(const std::string& managedPrivateSpaceId) +{ + managedPrivateSpaceId_ = managedPrivateSpaceId; + setParameter("ManagedPrivateSpaceId", managedPrivateSpaceId); +} + +std::string ListManagedHostsRequest::getZoneId()const +{ + return zoneId_; +} + +void ListManagedHostsRequest::setZoneId(const std::string& zoneId) +{ + zoneId_ = zoneId; + setParameter("ZoneId", zoneId); +} + +int ListManagedHostsRequest::getMaxResults()const +{ + return maxResults_; +} + +void ListManagedHostsRequest::setMaxResults(int maxResults) +{ + maxResults_ = maxResults; + setParameter("MaxResults", std::to_string(maxResults)); +} + +std::string ListManagedHostsRequest::getManagedHostName()const +{ + return managedHostName_; +} + +void ListManagedHostsRequest::setManagedHostName(const std::string& managedHostName) +{ + managedHostName_ = managedHostName; + setParameter("ManagedHostName", managedHostName); +} + +std::string ListManagedHostsRequest::getStatus()const +{ + return status_; +} + +void ListManagedHostsRequest::setStatus(const std::string& status) +{ + status_ = status; + setParameter("Status", status); +} + diff --git a/smarthosting/src/model/ListManagedHostsResult.cc b/smarthosting/src/model/ListManagedHostsResult.cc new file mode 100644 index 000000000..754b81083 --- /dev/null +++ b/smarthosting/src/model/ListManagedHostsResult.cc @@ -0,0 +1,136 @@ +/* + * 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::SmartHosting; +using namespace AlibabaCloud::SmartHosting::Model; + +ListManagedHostsResult::ListManagedHostsResult() : + ServiceResult() +{} + +ListManagedHostsResult::ListManagedHostsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListManagedHostsResult::~ListManagedHostsResult() +{} + +void ListManagedHostsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allManagedHostSetsNode = value["ManagedHostSets"]["ManagedHostSet"]; + for (auto valueManagedHostSetsManagedHostSet : allManagedHostSetsNode) + { + ManagedHostSet managedHostSetsObject; + if(!valueManagedHostSetsManagedHostSet["ManagedHostId"].isNull()) + managedHostSetsObject.managedHostId = valueManagedHostSetsManagedHostSet["ManagedHostId"].asString(); + if(!valueManagedHostSetsManagedHostSet["ManagedHostName"].isNull()) + managedHostSetsObject.managedHostName = valueManagedHostSetsManagedHostSet["ManagedHostName"].asString(); + if(!valueManagedHostSetsManagedHostSet["Mode"].isNull()) + managedHostSetsObject.mode = valueManagedHostSetsManagedHostSet["Mode"].asString(); + if(!valueManagedHostSetsManagedHostSet["ResourceGroupId"].isNull()) + managedHostSetsObject.resourceGroupId = valueManagedHostSetsManagedHostSet["ResourceGroupId"].asString(); + if(!valueManagedHostSetsManagedHostSet["Status"].isNull()) + managedHostSetsObject.status = valueManagedHostSetsManagedHostSet["Status"].asString(); + auto allInstanceSetsNode = allManagedHostSetsNode["InstanceSets"]["InstanceSet"]; + for (auto allManagedHostSetsNodeInstanceSetsInstanceSet : allInstanceSetsNode) + { + ManagedHostSet::InstanceSet instanceSetsObject; + if(!allManagedHostSetsNodeInstanceSetsInstanceSet["InstanceId"].isNull()) + instanceSetsObject.instanceId = allManagedHostSetsNodeInstanceSetsInstanceSet["InstanceId"].asString(); + managedHostSetsObject.instanceSets.push_back(instanceSetsObject); + } + auto allTagsNode = allManagedHostSetsNode["Tags"]["Tag"]; + for (auto allManagedHostSetsNodeTagsTag : allTagsNode) + { + ManagedHostSet::Tag tagsObject; + if(!allManagedHostSetsNodeTagsTag["Key"].isNull()) + tagsObject.key = allManagedHostSetsNodeTagsTag["Key"].asString(); + if(!allManagedHostSetsNodeTagsTag["Value"].isNull()) + tagsObject.value = allManagedHostSetsNodeTagsTag["Value"].asString(); + managedHostSetsObject.tags.push_back(tagsObject); + } + auto capacityAttributeNode = value["CapacityAttribute"]; + if(!capacityAttributeNode["AvailableMemories"].isNull()) + managedHostSetsObject.capacityAttribute.availableMemories = std::stoi(capacityAttributeNode["AvailableMemories"].asString()); + if(!capacityAttributeNode["AvailableVcpus"].isNull()) + managedHostSetsObject.capacityAttribute.availableVcpus = std::stoi(capacityAttributeNode["AvailableVcpus"].asString()); + if(!capacityAttributeNode["TotalMemories"].isNull()) + managedHostSetsObject.capacityAttribute.totalMemories = std::stoi(capacityAttributeNode["TotalMemories"].asString()); + if(!capacityAttributeNode["TotalVcpus"].isNull()) + managedHostSetsObject.capacityAttribute.totalVcpus = std::stoi(capacityAttributeNode["TotalVcpus"].asString()); + auto hostAttributeNode = value["HostAttribute"]; + if(!hostAttributeNode["CpuModelName"].isNull()) + managedHostSetsObject.hostAttribute.cpuModelName = hostAttributeNode["CpuModelName"].asString(); + if(!hostAttributeNode["HostType"].isNull()) + managedHostSetsObject.hostAttribute.hostType = hostAttributeNode["HostType"].asString(); + auto networkAssociationNode = value["NetworkAssociation"]; + auto allSwitchSetsNode = networkAssociationNode["SwitchSets"]["SwitchSet"]; + for (auto networkAssociationNodeSwitchSetsSwitchSet : allSwitchSetsNode) + { + ManagedHostSet::NetworkAssociation::SwitchSet switchSetObject; + if(!networkAssociationNodeSwitchSetsSwitchSet["SwitchId"].isNull()) + switchSetObject.switchId = networkAssociationNodeSwitchSetsSwitchSet["SwitchId"].asString(); + managedHostSetsObject.networkAssociation.switchSets.push_back(switchSetObject); + } + auto allSupportedCustomInstanceTypeFamilies = value["SupportedCustomInstanceTypeFamilies"]["SupportedCustomInstanceTypeFamily"]; + for (auto value : allSupportedCustomInstanceTypeFamilies) + managedHostSetsObject.supportedCustomInstanceTypeFamilies.push_back(value.asString()); + auto allSupportedInstanceTypeFamilies = value["SupportedInstanceTypeFamilies"]["SupportedInstanceTypeFamily"]; + for (auto value : allSupportedInstanceTypeFamilies) + managedHostSetsObject.supportedInstanceTypeFamilies.push_back(value.asString()); + auto allSupportedInstanceTypes = value["SupportedInstanceTypes"]["SupportedInstanceType"]; + for (auto value : allSupportedInstanceTypes) + managedHostSetsObject.supportedInstanceTypes.push_back(value.asString()); + managedHostSets_.push_back(managedHostSetsObject); + } + if(!value["NextToken"].isNull()) + nextToken_ = value["NextToken"].asString(); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + +} + +int ListManagedHostsResult::getTotalCount()const +{ + return totalCount_; +} + +std::string ListManagedHostsResult::getNextToken()const +{ + return nextToken_; +} + +int ListManagedHostsResult::getPageSize()const +{ + return pageSize_; +} + +std::vector ListManagedHostsResult::getManagedHostSets()const +{ + return managedHostSets_; +} + diff --git a/smarthosting/src/model/ListManagedPrivateSpacesRequest.cc b/smarthosting/src/model/ListManagedPrivateSpacesRequest.cc new file mode 100644 index 000000000..b191c81ff --- /dev/null +++ b/smarthosting/src/model/ListManagedPrivateSpacesRequest.cc @@ -0,0 +1,168 @@ +/* + * 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::SmartHosting::Model::ListManagedPrivateSpacesRequest; + +ListManagedPrivateSpacesRequest::ListManagedPrivateSpacesRequest() : + RpcServiceRequest("smarthosting", "2020-08-01", "ListManagedPrivateSpaces") +{ + setMethod(HttpRequest::Method::Post); +} + +ListManagedPrivateSpacesRequest::~ListManagedPrivateSpacesRequest() +{} + +long ListManagedPrivateSpacesRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void ListManagedPrivateSpacesRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string ListManagedPrivateSpacesRequest::getManagedPrivateSpaceName()const +{ + return managedPrivateSpaceName_; +} + +void ListManagedPrivateSpacesRequest::setManagedPrivateSpaceName(const std::string& managedPrivateSpaceName) +{ + managedPrivateSpaceName_ = managedPrivateSpaceName; + setParameter("ManagedPrivateSpaceName", managedPrivateSpaceName); +} + +std::string ListManagedPrivateSpacesRequest::getResourceGroupId()const +{ + return resourceGroupId_; +} + +void ListManagedPrivateSpacesRequest::setResourceGroupId(const std::string& resourceGroupId) +{ + resourceGroupId_ = resourceGroupId; + setParameter("ResourceGroupId", resourceGroupId); +} + +std::string ListManagedPrivateSpacesRequest::getRegionId()const +{ + return regionId_; +} + +void ListManagedPrivateSpacesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string ListManagedPrivateSpacesRequest::getNextToken()const +{ + return nextToken_; +} + +void ListManagedPrivateSpacesRequest::setNextToken(const std::string& nextToken) +{ + nextToken_ = nextToken; + setParameter("NextToken", nextToken); +} + +std::vector ListManagedPrivateSpacesRequest::getTag()const +{ + return tag_; +} + +void ListManagedPrivateSpacesRequest::setTag(const std::vector& tag) +{ + tag_ = tag; + for(int dep1 = 0; dep1!= tag.size(); dep1++) { + auto tagObj = tag.at(dep1); + std::string tagObjStr = "Tag." + std::to_string(dep1 + 1); + setParameter(tagObjStr + ".Key", tagObj.key); + setParameter(tagObjStr + ".Value", tagObj.value); + } +} + +std::string ListManagedPrivateSpacesRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void ListManagedPrivateSpacesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string ListManagedPrivateSpacesRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void ListManagedPrivateSpacesRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +long ListManagedPrivateSpacesRequest::getOwnerId()const +{ + return ownerId_; +} + +void ListManagedPrivateSpacesRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::vector ListManagedPrivateSpacesRequest::getManagedPrivateSpaceId()const +{ + return managedPrivateSpaceId_; +} + +void ListManagedPrivateSpacesRequest::setManagedPrivateSpaceId(const std::vector& managedPrivateSpaceId) +{ + managedPrivateSpaceId_ = managedPrivateSpaceId; + for(int dep1 = 0; dep1!= managedPrivateSpaceId.size(); dep1++) { + setParameter("ManagedPrivateSpaceId."+ std::to_string(dep1), managedPrivateSpaceId.at(dep1)); + } +} + +std::string ListManagedPrivateSpacesRequest::getZoneId()const +{ + return zoneId_; +} + +void ListManagedPrivateSpacesRequest::setZoneId(const std::string& zoneId) +{ + zoneId_ = zoneId; + setParameter("ZoneId", zoneId); +} + +int ListManagedPrivateSpacesRequest::getMaxResults()const +{ + return maxResults_; +} + +void ListManagedPrivateSpacesRequest::setMaxResults(int maxResults) +{ + maxResults_ = maxResults; + setParameter("MaxResults", std::to_string(maxResults)); +} + diff --git a/smarthosting/src/model/ListManagedPrivateSpacesResult.cc b/smarthosting/src/model/ListManagedPrivateSpacesResult.cc new file mode 100644 index 000000000..85b4c3f17 --- /dev/null +++ b/smarthosting/src/model/ListManagedPrivateSpacesResult.cc @@ -0,0 +1,158 @@ +/* + * 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::SmartHosting; +using namespace AlibabaCloud::SmartHosting::Model; + +ListManagedPrivateSpacesResult::ListManagedPrivateSpacesResult() : + ServiceResult() +{} + +ListManagedPrivateSpacesResult::ListManagedPrivateSpacesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListManagedPrivateSpacesResult::~ListManagedPrivateSpacesResult() +{} + +void ListManagedPrivateSpacesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allManagedPrivateSpaceSetsNode = value["ManagedPrivateSpaceSets"]["ManagedPrivateSpaceSet"]; + for (auto valueManagedPrivateSpaceSetsManagedPrivateSpaceSet : allManagedPrivateSpaceSetsNode) + { + ManagedPrivateSpaceSet managedPrivateSpaceSetsObject; + if(!valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["CreationTime"].isNull()) + managedPrivateSpaceSetsObject.creationTime = valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["CreationTime"].asString(); + if(!valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["Description"].isNull()) + managedPrivateSpaceSetsObject.description = valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["Description"].asString(); + if(!valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ManagedPrivateSpaceId"].isNull()) + managedPrivateSpaceSetsObject.managedPrivateSpaceId = valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ManagedPrivateSpaceId"].asString(); + if(!valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ManagedPrivateSpaceName"].isNull()) + managedPrivateSpaceSetsObject.managedPrivateSpaceName = valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ManagedPrivateSpaceName"].asString(); + if(!valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ResourceGroupId"].isNull()) + managedPrivateSpaceSetsObject.resourceGroupId = valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ResourceGroupId"].asString(); + if(!valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["SaleMode"].isNull()) + managedPrivateSpaceSetsObject.saleMode = valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["SaleMode"].asString(); + if(!valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ZoneId"].isNull()) + managedPrivateSpaceSetsObject.zoneId = valueManagedPrivateSpaceSetsManagedPrivateSpaceSet["ZoneId"].asString(); + auto allDeploymentAttributesNode = allManagedPrivateSpaceSetsNode["DeploymentAttributes"]["DeploymentAttribute"]; + for (auto allManagedPrivateSpaceSetsNodeDeploymentAttributesDeploymentAttribute : allDeploymentAttributesNode) + { + ManagedPrivateSpaceSet::DeploymentAttribute deploymentAttributesObject; + if(!allManagedPrivateSpaceSetsNodeDeploymentAttributesDeploymentAttribute["ContractId"].isNull()) + deploymentAttributesObject.contractId = allManagedPrivateSpaceSetsNodeDeploymentAttributesDeploymentAttribute["ContractId"].asString(); + if(!allManagedPrivateSpaceSetsNodeDeploymentAttributesDeploymentAttribute["CreateTime"].isNull()) + deploymentAttributesObject.createTime = allManagedPrivateSpaceSetsNodeDeploymentAttributesDeploymentAttribute["CreateTime"].asString(); + if(!allManagedPrivateSpaceSetsNodeDeploymentAttributesDeploymentAttribute["Description"].isNull()) + deploymentAttributesObject.description = allManagedPrivateSpaceSetsNodeDeploymentAttributesDeploymentAttribute["Description"].asString(); + auto allDeploymentStepsNode = allDeploymentAttributesNode["DeploymentSteps"]["DeploymentStep"]; + for (auto allDeploymentAttributesNodeDeploymentStepsDeploymentStep : allDeploymentStepsNode) + { + ManagedPrivateSpaceSet::DeploymentAttribute::DeploymentStep deploymentStepsObject; + if(!allDeploymentAttributesNodeDeploymentStepsDeploymentStep["ActualTime"].isNull()) + deploymentStepsObject.actualTime = allDeploymentAttributesNodeDeploymentStepsDeploymentStep["ActualTime"].asString(); + if(!allDeploymentAttributesNodeDeploymentStepsDeploymentStep["CurrentStep"].isNull()) + deploymentStepsObject.currentStep = allDeploymentAttributesNodeDeploymentStepsDeploymentStep["CurrentStep"].asString() == "true"; + if(!allDeploymentAttributesNodeDeploymentStepsDeploymentStep["ExpectTime"].isNull()) + deploymentStepsObject.expectTime = allDeploymentAttributesNodeDeploymentStepsDeploymentStep["ExpectTime"].asString(); + if(!allDeploymentAttributesNodeDeploymentStepsDeploymentStep["Status"].isNull()) + deploymentStepsObject.status = allDeploymentAttributesNodeDeploymentStepsDeploymentStep["Status"].asString(); + deploymentAttributesObject.deploymentSteps.push_back(deploymentStepsObject); + } + managedPrivateSpaceSetsObject.deploymentAttributes.push_back(deploymentAttributesObject); + } + auto allManagedHostSetsNode = allManagedPrivateSpaceSetsNode["ManagedHostSets"]["ManagedHostSet"]; + for (auto allManagedPrivateSpaceSetsNodeManagedHostSetsManagedHostSet : allManagedHostSetsNode) + { + ManagedPrivateSpaceSet::ManagedHostSet managedHostSetsObject; + if(!allManagedPrivateSpaceSetsNodeManagedHostSetsManagedHostSet["ManagedHostId"].isNull()) + managedHostSetsObject.managedHostId = allManagedPrivateSpaceSetsNodeManagedHostSetsManagedHostSet["ManagedHostId"].asString(); + if(!allManagedPrivateSpaceSetsNodeManagedHostSetsManagedHostSet["ManagedHostStatus"].isNull()) + managedHostSetsObject.managedHostStatus = allManagedPrivateSpaceSetsNodeManagedHostSetsManagedHostSet["ManagedHostStatus"].asString(); + managedPrivateSpaceSetsObject.managedHostSets.push_back(managedHostSetsObject); + } + auto allTagsNode = allManagedPrivateSpaceSetsNode["Tags"]["Tag"]; + for (auto allManagedPrivateSpaceSetsNodeTagsTag : allTagsNode) + { + ManagedPrivateSpaceSet::Tag tagsObject; + if(!allManagedPrivateSpaceSetsNodeTagsTag["Key"].isNull()) + tagsObject.key = allManagedPrivateSpaceSetsNodeTagsTag["Key"].asString(); + if(!allManagedPrivateSpaceSetsNodeTagsTag["Value"].isNull()) + tagsObject.value = allManagedPrivateSpaceSetsNodeTagsTag["Value"].asString(); + managedPrivateSpaceSetsObject.tags.push_back(tagsObject); + } + auto capacityAttributeNode = value["CapacityAttribute"]; + if(!capacityAttributeNode["AvailableHostCount"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.availableHostCount = std::stoi(capacityAttributeNode["AvailableHostCount"].asString()); + if(!capacityAttributeNode["AvailableMemories"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.availableMemories = std::stoi(capacityAttributeNode["AvailableMemories"].asString()); + if(!capacityAttributeNode["AvailableVcpus"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.availableVcpus = std::stoi(capacityAttributeNode["AvailableVcpus"].asString()); + if(!capacityAttributeNode["ReservedHostCount"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.reservedHostCount = std::stoi(capacityAttributeNode["ReservedHostCount"].asString()); + if(!capacityAttributeNode["ReservedMemories"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.reservedMemories = std::stoi(capacityAttributeNode["ReservedMemories"].asString()); + if(!capacityAttributeNode["ReservedVcpus"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.reservedVcpus = std::stoi(capacityAttributeNode["ReservedVcpus"].asString()); + if(!capacityAttributeNode["TotalHostCount"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.totalHostCount = std::stoi(capacityAttributeNode["TotalHostCount"].asString()); + if(!capacityAttributeNode["TotalMemories"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.totalMemories = std::stoi(capacityAttributeNode["TotalMemories"].asString()); + if(!capacityAttributeNode["TotalVcpus"].isNull()) + managedPrivateSpaceSetsObject.capacityAttribute.totalVcpus = std::stoi(capacityAttributeNode["TotalVcpus"].asString()); + auto lifecycleAttributeNode = value["LifecycleAttribute"]; + if(!lifecycleAttributeNode["DeliveryTime"].isNull()) + managedPrivateSpaceSetsObject.lifecycleAttribute.deliveryTime = lifecycleAttributeNode["DeliveryTime"].asString(); + if(!lifecycleAttributeNode["ExpirationTime"].isNull()) + managedPrivateSpaceSetsObject.lifecycleAttribute.expirationTime = lifecycleAttributeNode["ExpirationTime"].asString(); + if(!lifecycleAttributeNode["ReceptionTime"].isNull()) + managedPrivateSpaceSetsObject.lifecycleAttribute.receptionTime = lifecycleAttributeNode["ReceptionTime"].asString(); + auto locationAttributeNode = value["LocationAttribute"]; + if(!locationAttributeNode["Address"].isNull()) + managedPrivateSpaceSetsObject.locationAttribute.address = locationAttributeNode["Address"].asString(); + managedPrivateSpaceSets_.push_back(managedPrivateSpaceSetsObject); + } + if(!value["NextToken"].isNull()) + nextToken_ = value["NextToken"].asString(); + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + +} + +int ListManagedPrivateSpacesResult::getTotalCount()const +{ + return totalCount_; +} + +std::vector ListManagedPrivateSpacesResult::getManagedPrivateSpaceSets()const +{ + return managedPrivateSpaceSets_; +} + +std::string ListManagedPrivateSpacesResult::getNextToken()const +{ + return nextToken_; +} + diff --git a/smarthosting/src/model/ListManagedRacksRequest.cc b/smarthosting/src/model/ListManagedRacksRequest.cc new file mode 100644 index 000000000..a2cffb258 --- /dev/null +++ b/smarthosting/src/model/ListManagedRacksRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::SmartHosting::Model::ListManagedRacksRequest; + +ListManagedRacksRequest::ListManagedRacksRequest() : + RpcServiceRequest("smarthosting", "2020-08-01", "ListManagedRacks") +{ + setMethod(HttpRequest::Method::Post); +} + +ListManagedRacksRequest::~ListManagedRacksRequest() +{} + +long ListManagedRacksRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void ListManagedRacksRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string ListManagedRacksRequest::getHostType()const +{ + return hostType_; +} + +void ListManagedRacksRequest::setHostType(const std::string& hostType) +{ + hostType_ = hostType; + setParameter("HostType", hostType); +} + +std::string ListManagedRacksRequest::getRegionId()const +{ + return regionId_; +} + +void ListManagedRacksRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string ListManagedRacksRequest::getNextToken()const +{ + return nextToken_; +} + +void ListManagedRacksRequest::setNextToken(const std::string& nextToken) +{ + nextToken_ = nextToken; + setParameter("NextToken", nextToken); +} + +std::vector ListManagedRacksRequest::getManagedRackId()const +{ + return managedRackId_; +} + +void ListManagedRacksRequest::setManagedRackId(const std::vector& managedRackId) +{ + managedRackId_ = managedRackId; + for(int dep1 = 0; dep1!= managedRackId.size(); dep1++) { + setParameter("ManagedRackId."+ std::to_string(dep1), managedRackId.at(dep1)); + } +} + +std::string ListManagedRacksRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void ListManagedRacksRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string ListManagedRacksRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void ListManagedRacksRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +long ListManagedRacksRequest::getOwnerId()const +{ + return ownerId_; +} + +void ListManagedRacksRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string ListManagedRacksRequest::getManagedPrivateSpaceId()const +{ + return managedPrivateSpaceId_; +} + +void ListManagedRacksRequest::setManagedPrivateSpaceId(const std::string& managedPrivateSpaceId) +{ + managedPrivateSpaceId_ = managedPrivateSpaceId; + setParameter("ManagedPrivateSpaceId", managedPrivateSpaceId); +} + +std::string ListManagedRacksRequest::getZoneId()const +{ + return zoneId_; +} + +void ListManagedRacksRequest::setZoneId(const std::string& zoneId) +{ + zoneId_ = zoneId; + setParameter("ZoneId", zoneId); +} + +int ListManagedRacksRequest::getMaxResults()const +{ + return maxResults_; +} + +void ListManagedRacksRequest::setMaxResults(int maxResults) +{ + maxResults_ = maxResults; + setParameter("MaxResults", std::to_string(maxResults)); +} + diff --git a/smarthosting/src/model/ListManagedRacksResult.cc b/smarthosting/src/model/ListManagedRacksResult.cc new file mode 100644 index 000000000..e9cfb637a --- /dev/null +++ b/smarthosting/src/model/ListManagedRacksResult.cc @@ -0,0 +1,97 @@ +/* + * 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::SmartHosting; +using namespace AlibabaCloud::SmartHosting::Model; + +ListManagedRacksResult::ListManagedRacksResult() : + ServiceResult() +{} + +ListManagedRacksResult::ListManagedRacksResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListManagedRacksResult::~ListManagedRacksResult() +{} + +void ListManagedRacksResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allManagedRacksSetsNode = value["ManagedRacksSets"]["ManagedRacksSet"]; + for (auto valueManagedRacksSetsManagedRacksSet : allManagedRacksSetsNode) + { + ManagedRacksSet managedRacksSetsObject; + if(!valueManagedRacksSetsManagedRacksSet["ManagedRackId"].isNull()) + managedRacksSetsObject.managedRackId = valueManagedRacksSetsManagedRacksSet["ManagedRackId"].asString(); + if(!valueManagedRacksSetsManagedRacksSet["ZoneId"].isNull()) + managedRacksSetsObject.zoneId = valueManagedRacksSetsManagedRacksSet["ZoneId"].asString(); + auto allManagedHostSetsNode = allManagedRacksSetsNode["ManagedHostSets"]["ManagedHostSet"]; + for (auto allManagedRacksSetsNodeManagedHostSetsManagedHostSet : allManagedHostSetsNode) + { + ManagedRacksSet::ManagedHostSet managedHostSetsObject; + if(!allManagedRacksSetsNodeManagedHostSetsManagedHostSet["Description"].isNull()) + managedHostSetsObject.description = allManagedRacksSetsNodeManagedHostSetsManagedHostSet["Description"].asString(); + if(!allManagedRacksSetsNodeManagedHostSetsManagedHostSet["ManagedHostId"].isNull()) + managedHostSetsObject.managedHostId = allManagedRacksSetsNodeManagedHostSetsManagedHostSet["ManagedHostId"].asString(); + if(!allManagedRacksSetsNodeManagedHostSetsManagedHostSet["Status"].isNull()) + managedHostSetsObject.status = allManagedRacksSetsNodeManagedHostSetsManagedHostSet["Status"].asString(); + auto hostAttributeNode = value["HostAttribute"]; + if(!hostAttributeNode["CpuModelName"].isNull()) + managedHostSetsObject.hostAttribute.cpuModelName = hostAttributeNode["CpuModelName"].asString(); + if(!hostAttributeNode["HostType"].isNull()) + managedHostSetsObject.hostAttribute.hostType = hostAttributeNode["HostType"].asString(); + managedRacksSetsObject.managedHostSets.push_back(managedHostSetsObject); + } + managedRacksSets_.push_back(managedRacksSetsObject); + } + if(!value["NextToken"].isNull()) + nextToken_ = value["NextToken"].asString(); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + +} + +int ListManagedRacksResult::getTotalCount()const +{ + return totalCount_; +} + +std::string ListManagedRacksResult::getNextToken()const +{ + return nextToken_; +} + +int ListManagedRacksResult::getPageSize()const +{ + return pageSize_; +} + +std::vector ListManagedRacksResult::getManagedRacksSets()const +{ + return managedRacksSets_; +} + diff --git a/smarthosting/src/model/UpdateManagedHostAttributesRequest.cc b/smarthosting/src/model/UpdateManagedHostAttributesRequest.cc new file mode 100644 index 000000000..531bc6b52 --- /dev/null +++ b/smarthosting/src/model/UpdateManagedHostAttributesRequest.cc @@ -0,0 +1,117 @@ +/* + * 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::SmartHosting::Model::UpdateManagedHostAttributesRequest; + +UpdateManagedHostAttributesRequest::UpdateManagedHostAttributesRequest() : + RpcServiceRequest("smarthosting", "2020-08-01", "UpdateManagedHostAttributes") +{ + setMethod(HttpRequest::Method::Post); +} + +UpdateManagedHostAttributesRequest::~UpdateManagedHostAttributesRequest() +{} + +long UpdateManagedHostAttributesRequest::getResourceOwnerId()const +{ + return resourceOwnerId_; +} + +void UpdateManagedHostAttributesRequest::setResourceOwnerId(long resourceOwnerId) +{ + resourceOwnerId_ = resourceOwnerId; + setParameter("ResourceOwnerId", std::to_string(resourceOwnerId)); +} + +std::string UpdateManagedHostAttributesRequest::getMode()const +{ + return mode_; +} + +void UpdateManagedHostAttributesRequest::setMode(const std::string& mode) +{ + mode_ = mode; + setParameter("Mode", mode); +} + +std::string UpdateManagedHostAttributesRequest::getRegionId()const +{ + return regionId_; +} + +void UpdateManagedHostAttributesRequest::setRegionId(const std::string& regionId) +{ + regionId_ = regionId; + setParameter("RegionId", regionId); +} + +std::string UpdateManagedHostAttributesRequest::getResourceOwnerAccount()const +{ + return resourceOwnerAccount_; +} + +void UpdateManagedHostAttributesRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount) +{ + resourceOwnerAccount_ = resourceOwnerAccount; + setParameter("ResourceOwnerAccount", resourceOwnerAccount); +} + +std::string UpdateManagedHostAttributesRequest::getOwnerAccount()const +{ + return ownerAccount_; +} + +void UpdateManagedHostAttributesRequest::setOwnerAccount(const std::string& ownerAccount) +{ + ownerAccount_ = ownerAccount; + setParameter("OwnerAccount", ownerAccount); +} + +std::string UpdateManagedHostAttributesRequest::getManagedHostId()const +{ + return managedHostId_; +} + +void UpdateManagedHostAttributesRequest::setManagedHostId(const std::string& managedHostId) +{ + managedHostId_ = managedHostId; + setParameter("ManagedHostId", managedHostId); +} + +long UpdateManagedHostAttributesRequest::getOwnerId()const +{ + return ownerId_; +} + +void UpdateManagedHostAttributesRequest::setOwnerId(long ownerId) +{ + ownerId_ = ownerId; + setParameter("OwnerId", std::to_string(ownerId)); +} + +std::string UpdateManagedHostAttributesRequest::getManagedHostName()const +{ + return managedHostName_; +} + +void UpdateManagedHostAttributesRequest::setManagedHostName(const std::string& managedHostName) +{ + managedHostName_ = managedHostName; + setParameter("ManagedHostName", managedHostName); +} + diff --git a/smarthosting/src/model/UpdateManagedHostAttributesResult.cc b/smarthosting/src/model/UpdateManagedHostAttributesResult.cc new file mode 100644 index 000000000..73bc4d339 --- /dev/null +++ b/smarthosting/src/model/UpdateManagedHostAttributesResult.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::SmartHosting; +using namespace AlibabaCloud::SmartHosting::Model; + +UpdateManagedHostAttributesResult::UpdateManagedHostAttributesResult() : + ServiceResult() +{} + +UpdateManagedHostAttributesResult::UpdateManagedHostAttributesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateManagedHostAttributesResult::~UpdateManagedHostAttributesResult() +{} + +void UpdateManagedHostAttributesResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +