diff --git a/VERSION b/VERSION index 77545cefc..3d6f7749c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1742 \ No newline at end of file +1.36.1743 \ No newline at end of file diff --git a/swas-open/CMakeLists.txt b/swas-open/CMakeLists.txt index 9f3277ced..9afee7a32 100644 --- a/swas-open/CMakeLists.txt +++ b/swas-open/CMakeLists.txt @@ -23,6 +23,8 @@ set(swas-open_public_header set(swas-open_public_header_model include/alibabacloud/swas-open/model/AllocatePublicConnectionRequest.h include/alibabacloud/swas-open/model/AllocatePublicConnectionResult.h + include/alibabacloud/swas-open/model/CreateCommandRequest.h + include/alibabacloud/swas-open/model/CreateCommandResult.h include/alibabacloud/swas-open/model/CreateCustomImageRequest.h include/alibabacloud/swas-open/model/CreateCustomImageResult.h include/alibabacloud/swas-open/model/CreateFirewallRuleRequest.h @@ -35,6 +37,8 @@ set(swas-open_public_header_model include/alibabacloud/swas-open/model/CreateInstancesResult.h include/alibabacloud/swas-open/model/CreateSnapshotRequest.h include/alibabacloud/swas-open/model/CreateSnapshotResult.h + include/alibabacloud/swas-open/model/DeleteCommandRequest.h + include/alibabacloud/swas-open/model/DeleteCommandResult.h include/alibabacloud/swas-open/model/DeleteCustomImageRequest.h include/alibabacloud/swas-open/model/DeleteCustomImageResult.h include/alibabacloud/swas-open/model/DeleteFirewallRuleRequest.h @@ -49,6 +53,10 @@ set(swas-open_public_header_model include/alibabacloud/swas-open/model/DescribeCloudAssistantStatusResult.h include/alibabacloud/swas-open/model/DescribeCloudMonitorAgentStatusesRequest.h include/alibabacloud/swas-open/model/DescribeCloudMonitorAgentStatusesResult.h + include/alibabacloud/swas-open/model/DescribeCommandInvocationsRequest.h + include/alibabacloud/swas-open/model/DescribeCommandInvocationsResult.h + include/alibabacloud/swas-open/model/DescribeCommandsRequest.h + include/alibabacloud/swas-open/model/DescribeCommandsResult.h include/alibabacloud/swas-open/model/DescribeDatabaseErrorLogsRequest.h include/alibabacloud/swas-open/model/DescribeDatabaseErrorLogsResult.h include/alibabacloud/swas-open/model/DescribeDatabaseInstanceMetricDataRequest.h @@ -81,6 +89,8 @@ set(swas-open_public_header_model include/alibabacloud/swas-open/model/InstallCloudAssistantResult.h include/alibabacloud/swas-open/model/InstallCloudMonitorAgentRequest.h include/alibabacloud/swas-open/model/InstallCloudMonitorAgentResult.h + include/alibabacloud/swas-open/model/InvokeCommandRequest.h + include/alibabacloud/swas-open/model/InvokeCommandResult.h include/alibabacloud/swas-open/model/ListCustomImagesRequest.h include/alibabacloud/swas-open/model/ListCustomImagesResult.h include/alibabacloud/swas-open/model/ListDisksRequest.h @@ -147,6 +157,8 @@ set(swas-open_public_header_model include/alibabacloud/swas-open/model/StopInstanceResult.h include/alibabacloud/swas-open/model/StopInstancesRequest.h include/alibabacloud/swas-open/model/StopInstancesResult.h + include/alibabacloud/swas-open/model/UpdateCommandAttributeRequest.h + include/alibabacloud/swas-open/model/UpdateCommandAttributeResult.h include/alibabacloud/swas-open/model/UpdateDiskAttributeRequest.h include/alibabacloud/swas-open/model/UpdateDiskAttributeResult.h include/alibabacloud/swas-open/model/UpdateInstanceAttributeRequest.h @@ -162,6 +174,8 @@ set(swas-open_src src/SWAS-OPENClient.cc src/model/AllocatePublicConnectionRequest.cc src/model/AllocatePublicConnectionResult.cc + src/model/CreateCommandRequest.cc + src/model/CreateCommandResult.cc src/model/CreateCustomImageRequest.cc src/model/CreateCustomImageResult.cc src/model/CreateFirewallRuleRequest.cc @@ -174,6 +188,8 @@ set(swas-open_src src/model/CreateInstancesResult.cc src/model/CreateSnapshotRequest.cc src/model/CreateSnapshotResult.cc + src/model/DeleteCommandRequest.cc + src/model/DeleteCommandResult.cc src/model/DeleteCustomImageRequest.cc src/model/DeleteCustomImageResult.cc src/model/DeleteFirewallRuleRequest.cc @@ -188,6 +204,10 @@ set(swas-open_src src/model/DescribeCloudAssistantStatusResult.cc src/model/DescribeCloudMonitorAgentStatusesRequest.cc src/model/DescribeCloudMonitorAgentStatusesResult.cc + src/model/DescribeCommandInvocationsRequest.cc + src/model/DescribeCommandInvocationsResult.cc + src/model/DescribeCommandsRequest.cc + src/model/DescribeCommandsResult.cc src/model/DescribeDatabaseErrorLogsRequest.cc src/model/DescribeDatabaseErrorLogsResult.cc src/model/DescribeDatabaseInstanceMetricDataRequest.cc @@ -220,6 +240,8 @@ set(swas-open_src src/model/InstallCloudAssistantResult.cc src/model/InstallCloudMonitorAgentRequest.cc src/model/InstallCloudMonitorAgentResult.cc + src/model/InvokeCommandRequest.cc + src/model/InvokeCommandResult.cc src/model/ListCustomImagesRequest.cc src/model/ListCustomImagesResult.cc src/model/ListDisksRequest.cc @@ -286,6 +308,8 @@ set(swas-open_src src/model/StopInstanceResult.cc src/model/StopInstancesRequest.cc src/model/StopInstancesResult.cc + src/model/UpdateCommandAttributeRequest.cc + src/model/UpdateCommandAttributeResult.cc src/model/UpdateDiskAttributeRequest.cc src/model/UpdateDiskAttributeResult.cc src/model/UpdateInstanceAttributeRequest.cc diff --git a/swas-open/include/alibabacloud/swas-open/SWAS_OPENClient.h b/swas-open/include/alibabacloud/swas-open/SWAS_OPENClient.h index dd9331607..54d4dfbcf 100644 --- a/swas-open/include/alibabacloud/swas-open/SWAS_OPENClient.h +++ b/swas-open/include/alibabacloud/swas-open/SWAS_OPENClient.h @@ -24,6 +24,8 @@ #include "SWAS_OPENExport.h" #include "model/AllocatePublicConnectionRequest.h" #include "model/AllocatePublicConnectionResult.h" +#include "model/CreateCommandRequest.h" +#include "model/CreateCommandResult.h" #include "model/CreateCustomImageRequest.h" #include "model/CreateCustomImageResult.h" #include "model/CreateFirewallRuleRequest.h" @@ -36,6 +38,8 @@ #include "model/CreateInstancesResult.h" #include "model/CreateSnapshotRequest.h" #include "model/CreateSnapshotResult.h" +#include "model/DeleteCommandRequest.h" +#include "model/DeleteCommandResult.h" #include "model/DeleteCustomImageRequest.h" #include "model/DeleteCustomImageResult.h" #include "model/DeleteFirewallRuleRequest.h" @@ -50,6 +54,10 @@ #include "model/DescribeCloudAssistantStatusResult.h" #include "model/DescribeCloudMonitorAgentStatusesRequest.h" #include "model/DescribeCloudMonitorAgentStatusesResult.h" +#include "model/DescribeCommandInvocationsRequest.h" +#include "model/DescribeCommandInvocationsResult.h" +#include "model/DescribeCommandsRequest.h" +#include "model/DescribeCommandsResult.h" #include "model/DescribeDatabaseErrorLogsRequest.h" #include "model/DescribeDatabaseErrorLogsResult.h" #include "model/DescribeDatabaseInstanceMetricDataRequest.h" @@ -82,6 +90,8 @@ #include "model/InstallCloudAssistantResult.h" #include "model/InstallCloudMonitorAgentRequest.h" #include "model/InstallCloudMonitorAgentResult.h" +#include "model/InvokeCommandRequest.h" +#include "model/InvokeCommandResult.h" #include "model/ListCustomImagesRequest.h" #include "model/ListCustomImagesResult.h" #include "model/ListDisksRequest.h" @@ -148,6 +158,8 @@ #include "model/StopInstanceResult.h" #include "model/StopInstancesRequest.h" #include "model/StopInstancesResult.h" +#include "model/UpdateCommandAttributeRequest.h" +#include "model/UpdateCommandAttributeResult.h" #include "model/UpdateDiskAttributeRequest.h" #include "model/UpdateDiskAttributeResult.h" #include "model/UpdateInstanceAttributeRequest.h" @@ -170,6 +182,9 @@ namespace AlibabaCloud typedef Outcome AllocatePublicConnectionOutcome; typedef std::future AllocatePublicConnectionOutcomeCallable; typedef std::function&)> AllocatePublicConnectionAsyncHandler; + typedef Outcome CreateCommandOutcome; + typedef std::future CreateCommandOutcomeCallable; + typedef std::function&)> CreateCommandAsyncHandler; typedef Outcome CreateCustomImageOutcome; typedef std::future CreateCustomImageOutcomeCallable; typedef std::function&)> CreateCustomImageAsyncHandler; @@ -188,6 +203,9 @@ namespace AlibabaCloud typedef Outcome CreateSnapshotOutcome; typedef std::future CreateSnapshotOutcomeCallable; typedef std::function&)> CreateSnapshotAsyncHandler; + typedef Outcome DeleteCommandOutcome; + typedef std::future DeleteCommandOutcomeCallable; + typedef std::function&)> DeleteCommandAsyncHandler; typedef Outcome DeleteCustomImageOutcome; typedef std::future DeleteCustomImageOutcomeCallable; typedef std::function&)> DeleteCustomImageAsyncHandler; @@ -209,6 +227,12 @@ namespace AlibabaCloud typedef Outcome DescribeCloudMonitorAgentStatusesOutcome; typedef std::future DescribeCloudMonitorAgentStatusesOutcomeCallable; typedef std::function&)> DescribeCloudMonitorAgentStatusesAsyncHandler; + typedef Outcome DescribeCommandInvocationsOutcome; + typedef std::future DescribeCommandInvocationsOutcomeCallable; + typedef std::function&)> DescribeCommandInvocationsAsyncHandler; + typedef Outcome DescribeCommandsOutcome; + typedef std::future DescribeCommandsOutcomeCallable; + typedef std::function&)> DescribeCommandsAsyncHandler; typedef Outcome DescribeDatabaseErrorLogsOutcome; typedef std::future DescribeDatabaseErrorLogsOutcomeCallable; typedef std::function&)> DescribeDatabaseErrorLogsAsyncHandler; @@ -257,6 +281,9 @@ namespace AlibabaCloud typedef Outcome InstallCloudMonitorAgentOutcome; typedef std::future InstallCloudMonitorAgentOutcomeCallable; typedef std::function&)> InstallCloudMonitorAgentAsyncHandler; + typedef Outcome InvokeCommandOutcome; + typedef std::future InvokeCommandOutcomeCallable; + typedef std::function&)> InvokeCommandAsyncHandler; typedef Outcome ListCustomImagesOutcome; typedef std::future ListCustomImagesOutcomeCallable; typedef std::function&)> ListCustomImagesAsyncHandler; @@ -356,6 +383,9 @@ namespace AlibabaCloud typedef Outcome StopInstancesOutcome; typedef std::future StopInstancesOutcomeCallable; typedef std::function&)> StopInstancesAsyncHandler; + typedef Outcome UpdateCommandAttributeOutcome; + typedef std::future UpdateCommandAttributeOutcomeCallable; + typedef std::function&)> UpdateCommandAttributeAsyncHandler; typedef Outcome UpdateDiskAttributeOutcome; typedef std::future UpdateDiskAttributeOutcomeCallable; typedef std::function&)> UpdateDiskAttributeAsyncHandler; @@ -379,6 +409,9 @@ namespace AlibabaCloud AllocatePublicConnectionOutcome allocatePublicConnection(const Model::AllocatePublicConnectionRequest &request)const; void allocatePublicConnectionAsync(const Model::AllocatePublicConnectionRequest& request, const AllocatePublicConnectionAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AllocatePublicConnectionOutcomeCallable allocatePublicConnectionCallable(const Model::AllocatePublicConnectionRequest& request) const; + CreateCommandOutcome createCommand(const Model::CreateCommandRequest &request)const; + void createCommandAsync(const Model::CreateCommandRequest& request, const CreateCommandAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + CreateCommandOutcomeCallable createCommandCallable(const Model::CreateCommandRequest& request) const; CreateCustomImageOutcome createCustomImage(const Model::CreateCustomImageRequest &request)const; void createCustomImageAsync(const Model::CreateCustomImageRequest& request, const CreateCustomImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateCustomImageOutcomeCallable createCustomImageCallable(const Model::CreateCustomImageRequest& request) const; @@ -397,6 +430,9 @@ namespace AlibabaCloud CreateSnapshotOutcome createSnapshot(const Model::CreateSnapshotRequest &request)const; void createSnapshotAsync(const Model::CreateSnapshotRequest& request, const CreateSnapshotAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CreateSnapshotOutcomeCallable createSnapshotCallable(const Model::CreateSnapshotRequest& request) const; + DeleteCommandOutcome deleteCommand(const Model::DeleteCommandRequest &request)const; + void deleteCommandAsync(const Model::DeleteCommandRequest& request, const DeleteCommandAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteCommandOutcomeCallable deleteCommandCallable(const Model::DeleteCommandRequest& request) const; DeleteCustomImageOutcome deleteCustomImage(const Model::DeleteCustomImageRequest &request)const; void deleteCustomImageAsync(const Model::DeleteCustomImageRequest& request, const DeleteCustomImageAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteCustomImageOutcomeCallable deleteCustomImageCallable(const Model::DeleteCustomImageRequest& request) const; @@ -418,6 +454,12 @@ namespace AlibabaCloud DescribeCloudMonitorAgentStatusesOutcome describeCloudMonitorAgentStatuses(const Model::DescribeCloudMonitorAgentStatusesRequest &request)const; void describeCloudMonitorAgentStatusesAsync(const Model::DescribeCloudMonitorAgentStatusesRequest& request, const DescribeCloudMonitorAgentStatusesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeCloudMonitorAgentStatusesOutcomeCallable describeCloudMonitorAgentStatusesCallable(const Model::DescribeCloudMonitorAgentStatusesRequest& request) const; + DescribeCommandInvocationsOutcome describeCommandInvocations(const Model::DescribeCommandInvocationsRequest &request)const; + void describeCommandInvocationsAsync(const Model::DescribeCommandInvocationsRequest& request, const DescribeCommandInvocationsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeCommandInvocationsOutcomeCallable describeCommandInvocationsCallable(const Model::DescribeCommandInvocationsRequest& request) const; + DescribeCommandsOutcome describeCommands(const Model::DescribeCommandsRequest &request)const; + void describeCommandsAsync(const Model::DescribeCommandsRequest& request, const DescribeCommandsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DescribeCommandsOutcomeCallable describeCommandsCallable(const Model::DescribeCommandsRequest& request) const; DescribeDatabaseErrorLogsOutcome describeDatabaseErrorLogs(const Model::DescribeDatabaseErrorLogsRequest &request)const; void describeDatabaseErrorLogsAsync(const Model::DescribeDatabaseErrorLogsRequest& request, const DescribeDatabaseErrorLogsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DescribeDatabaseErrorLogsOutcomeCallable describeDatabaseErrorLogsCallable(const Model::DescribeDatabaseErrorLogsRequest& request) const; @@ -466,6 +508,9 @@ namespace AlibabaCloud InstallCloudMonitorAgentOutcome installCloudMonitorAgent(const Model::InstallCloudMonitorAgentRequest &request)const; void installCloudMonitorAgentAsync(const Model::InstallCloudMonitorAgentRequest& request, const InstallCloudMonitorAgentAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; InstallCloudMonitorAgentOutcomeCallable installCloudMonitorAgentCallable(const Model::InstallCloudMonitorAgentRequest& request) const; + InvokeCommandOutcome invokeCommand(const Model::InvokeCommandRequest &request)const; + void invokeCommandAsync(const Model::InvokeCommandRequest& request, const InvokeCommandAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + InvokeCommandOutcomeCallable invokeCommandCallable(const Model::InvokeCommandRequest& request) const; ListCustomImagesOutcome listCustomImages(const Model::ListCustomImagesRequest &request)const; void listCustomImagesAsync(const Model::ListCustomImagesRequest& request, const ListCustomImagesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListCustomImagesOutcomeCallable listCustomImagesCallable(const Model::ListCustomImagesRequest& request) const; @@ -565,6 +610,9 @@ namespace AlibabaCloud StopInstancesOutcome stopInstances(const Model::StopInstancesRequest &request)const; void stopInstancesAsync(const Model::StopInstancesRequest& request, const StopInstancesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; StopInstancesOutcomeCallable stopInstancesCallable(const Model::StopInstancesRequest& request) const; + UpdateCommandAttributeOutcome updateCommandAttribute(const Model::UpdateCommandAttributeRequest &request)const; + void updateCommandAttributeAsync(const Model::UpdateCommandAttributeRequest& request, const UpdateCommandAttributeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + UpdateCommandAttributeOutcomeCallable updateCommandAttributeCallable(const Model::UpdateCommandAttributeRequest& request) const; UpdateDiskAttributeOutcome updateDiskAttribute(const Model::UpdateDiskAttributeRequest &request)const; void updateDiskAttributeAsync(const Model::UpdateDiskAttributeRequest& request, const UpdateDiskAttributeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; UpdateDiskAttributeOutcomeCallable updateDiskAttributeCallable(const Model::UpdateDiskAttributeRequest& request) const; diff --git a/swas-open/include/alibabacloud/swas-open/model/CreateCommandRequest.h b/swas-open/include/alibabacloud/swas-open/model/CreateCommandRequest.h new file mode 100644 index 000000000..682174cbd --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/CreateCommandRequest.h @@ -0,0 +1,63 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_SWAS_OPEN_MODEL_CREATECOMMANDREQUEST_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_CREATECOMMANDREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SWAS_OPEN { +namespace Model { +class ALIBABACLOUD_SWAS_OPEN_EXPORT CreateCommandRequest : public RpcServiceRequest { +public: + CreateCommandRequest(); + ~CreateCommandRequest(); + std::string getWorkingDir() const; + void setWorkingDir(const std::string &workingDir); + std::string getDescription() const; + void setDescription(const std::string &description); + std::string getType() const; + void setType(const std::string &type); + std::string getCommandContent() const; + void setCommandContent(const std::string &commandContent); + long getTimeout() const; + void setTimeout(long timeout); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + std::string getName() const; + void setName(const std::string &name); + bool getEnableParameter() const; + void setEnableParameter(bool enableParameter); + +private: + std::string workingDir_; + std::string description_; + std::string type_; + std::string commandContent_; + long timeout_; + std::string regionId_; + std::string name_; + bool enableParameter_; +}; +} // namespace Model +} // namespace SWAS_OPEN +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_CREATECOMMANDREQUEST_H_ diff --git a/swas-open/include/alibabacloud/swas-open/model/CreateCommandResult.h b/swas-open/include/alibabacloud/swas-open/model/CreateCommandResult.h new file mode 100644 index 000000000..10779e27a --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/CreateCommandResult.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_SWAS_OPEN_MODEL_CREATECOMMANDRESULT_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_CREATECOMMANDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SWAS_OPEN + { + namespace Model + { + class ALIBABACLOUD_SWAS_OPEN_EXPORT CreateCommandResult : public ServiceResult + { + public: + + + CreateCommandResult(); + explicit CreateCommandResult(const std::string &payload); + ~CreateCommandResult(); + std::string getCommandId()const; + + protected: + void parse(const std::string &payload); + private: + std::string commandId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_CREATECOMMANDRESULT_H_ \ No newline at end of file diff --git a/swas-open/include/alibabacloud/swas-open/model/DeleteCommandRequest.h b/swas-open/include/alibabacloud/swas-open/model/DeleteCommandRequest.h new file mode 100644 index 000000000..2d6a59eda --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/DeleteCommandRequest.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_SWAS_OPEN_MODEL_DELETECOMMANDREQUEST_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_DELETECOMMANDREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SWAS_OPEN { +namespace Model { +class ALIBABACLOUD_SWAS_OPEN_EXPORT DeleteCommandRequest : public RpcServiceRequest { +public: + DeleteCommandRequest(); + ~DeleteCommandRequest(); + std::string getCommandId() const; + void setCommandId(const std::string &commandId); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + +private: + std::string commandId_; + std::string regionId_; +}; +} // namespace Model +} // namespace SWAS_OPEN +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_DELETECOMMANDREQUEST_H_ diff --git a/swas-open/include/alibabacloud/swas-open/model/DeleteCommandResult.h b/swas-open/include/alibabacloud/swas-open/model/DeleteCommandResult.h new file mode 100644 index 000000000..2c71dd654 --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/DeleteCommandResult.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_SWAS_OPEN_MODEL_DELETECOMMANDRESULT_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_DELETECOMMANDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SWAS_OPEN + { + namespace Model + { + class ALIBABACLOUD_SWAS_OPEN_EXPORT DeleteCommandResult : public ServiceResult + { + public: + + + DeleteCommandResult(); + explicit DeleteCommandResult(const std::string &payload); + ~DeleteCommandResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_DELETECOMMANDRESULT_H_ \ No newline at end of file diff --git a/swas-open/include/alibabacloud/swas-open/model/DescribeCommandInvocationsRequest.h b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandInvocationsRequest.h new file mode 100644 index 000000000..0958bed36 --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandInvocationsRequest.h @@ -0,0 +1,66 @@ +/* + * 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_SWAS_OPEN_MODEL_DESCRIBECOMMANDINVOCATIONSREQUEST_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDINVOCATIONSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SWAS_OPEN { +namespace Model { +class ALIBABACLOUD_SWAS_OPEN_EXPORT DescribeCommandInvocationsRequest : public RpcServiceRequest { +public: + DescribeCommandInvocationsRequest(); + ~DescribeCommandInvocationsRequest(); + std::string getCommandId() const; + void setCommandId(const std::string &commandId); + std::string getPageNumber() const; + void setPageNumber(const std::string &pageNumber); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + std::string getPageSize() const; + void setPageSize(const std::string &pageSize); + std::string getInvokeId() const; + void setInvokeId(const std::string &invokeId); + std::string getCommandName() const; + void setCommandName(const std::string &commandName); + std::string getCommandType() const; + void setCommandType(const std::string &commandType); + std::string getInstanceId() const; + void setInstanceId(const std::string &instanceId); + std::string getInvocationStatus() const; + void setInvocationStatus(const std::string &invocationStatus); + +private: + std::string commandId_; + std::string pageNumber_; + std::string regionId_; + std::string pageSize_; + std::string invokeId_; + std::string commandName_; + std::string commandType_; + std::string instanceId_; + std::string invocationStatus_; +}; +} // namespace Model +} // namespace SWAS_OPEN +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDINVOCATIONSREQUEST_H_ diff --git a/swas-open/include/alibabacloud/swas-open/model/DescribeCommandInvocationsResult.h b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandInvocationsResult.h new file mode 100644 index 000000000..cc9199084 --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandInvocationsResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDINVOCATIONSRESULT_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDINVOCATIONSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SWAS_OPEN + { + namespace Model + { + class ALIBABACLOUD_SWAS_OPEN_EXPORT DescribeCommandInvocationsResult : public ServiceResult + { + public: + struct Command + { + struct InvokeInstance + { + std::string invocationStatus; + std::string finishTime; + std::string instanceId; + std::string output; + long exitCode; + std::string errorInfo; + std::string startTime; + std::string errorCode; + }; + std::string invocationStatus; + std::string parameters; + std::string commandDescription; + long timeout; + std::vector invokeInstances; + std::string workingDir; + std::string commandContent; + std::string commandType; + std::string username; + std::string creationTime; + std::string commandId; + std::string commandName; + std::string invokeId; + }; + + + DescribeCommandInvocationsResult(); + explicit DescribeCommandInvocationsResult(const std::string &payload); + ~DescribeCommandInvocationsResult(); + int getTotalCount()const; + int getPageSize()const; + int getPageNumber()const; + std::vector getCommandInvocations()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + int pageSize_; + int pageNumber_; + std::vector commandInvocations_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDINVOCATIONSRESULT_H_ \ No newline at end of file diff --git a/swas-open/include/alibabacloud/swas-open/model/DescribeCommandsRequest.h b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandsRequest.h new file mode 100644 index 000000000..ebb238aed --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandsRequest.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_SWAS_OPEN_MODEL_DESCRIBECOMMANDSREQUEST_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDSREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SWAS_OPEN { +namespace Model { +class ALIBABACLOUD_SWAS_OPEN_EXPORT DescribeCommandsRequest : public RpcServiceRequest { +public: + DescribeCommandsRequest(); + ~DescribeCommandsRequest(); + std::string getType() const; + void setType(const std::string &type); + std::string getCommandId() const; + void setCommandId(const std::string &commandId); + std::string getPageNumber() const; + void setPageNumber(const std::string &pageNumber); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + std::string getProvider() const; + void setProvider(const std::string &provider); + std::string getName() const; + void setName(const std::string &name); + std::string getPageSize() const; + void setPageSize(const std::string &pageSize); + +private: + std::string type_; + std::string commandId_; + std::string pageNumber_; + std::string regionId_; + std::string provider_; + std::string name_; + std::string pageSize_; +}; +} // namespace Model +} // namespace SWAS_OPEN +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDSREQUEST_H_ diff --git a/swas-open/include/alibabacloud/swas-open/model/DescribeCommandsResult.h b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandsResult.h new file mode 100644 index 000000000..240545a6d --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/DescribeCommandsResult.h @@ -0,0 +1,80 @@ +/* + * 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_SWAS_OPEN_MODEL_DESCRIBECOMMANDSRESULT_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SWAS_OPEN + { + namespace Model + { + class ALIBABACLOUD_SWAS_OPEN_EXPORT DescribeCommandsResult : public ServiceResult + { + public: + struct Command + { + struct ParameterDefinition + { + std::string defaultValue; + std::string description; + bool required; + std::string parameterName; + std::vector possibleValues; + }; + std::string workingDir; + std::string commandContent; + std::vector parameterDefinitions; + std::string type; + std::string description; + std::vector parameterNames; + long timeout; + std::string creationTime; + bool enableParameter; + std::string commandId; + std::string name; + std::string provider; + }; + + + DescribeCommandsResult(); + explicit DescribeCommandsResult(const std::string &payload); + ~DescribeCommandsResult(); + int getTotalCount()const; + int getPageSize()const; + int getPageNumber()const; + std::vector getCommands()const; + + protected: + void parse(const std::string &payload); + private: + int totalCount_; + int pageSize_; + int pageNumber_; + std::vector commands_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_DESCRIBECOMMANDSRESULT_H_ \ No newline at end of file diff --git a/swas-open/include/alibabacloud/swas-open/model/InvokeCommandRequest.h b/swas-open/include/alibabacloud/swas-open/model/InvokeCommandRequest.h new file mode 100644 index 000000000..44664da49 --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/InvokeCommandRequest.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_SWAS_OPEN_MODEL_INVOKECOMMANDREQUEST_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_INVOKECOMMANDREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SWAS_OPEN { +namespace Model { +class ALIBABACLOUD_SWAS_OPEN_EXPORT InvokeCommandRequest : public RpcServiceRequest { +public: + InvokeCommandRequest(); + ~InvokeCommandRequest(); + std::string getCommandId() const; + void setCommandId(const std::string &commandId); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + std::string getInstanceIds() const; + void setInstanceIds(const std::string &instanceIds); + std::map getParameters() const; + void setParameters(const std::map ¶meters); + std::string getUsername() const; + void setUsername(const std::string &username); + +private: + std::string commandId_; + std::string regionId_; + std::string instanceIds_; + std::map parameters_; + std::string username_; +}; +} // namespace Model +} // namespace SWAS_OPEN +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_INVOKECOMMANDREQUEST_H_ diff --git a/swas-open/include/alibabacloud/swas-open/model/InvokeCommandResult.h b/swas-open/include/alibabacloud/swas-open/model/InvokeCommandResult.h new file mode 100644 index 000000000..0d8d54c09 --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/InvokeCommandResult.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_SWAS_OPEN_MODEL_INVOKECOMMANDRESULT_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_INVOKECOMMANDRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SWAS_OPEN + { + namespace Model + { + class ALIBABACLOUD_SWAS_OPEN_EXPORT InvokeCommandResult : public ServiceResult + { + public: + + + InvokeCommandResult(); + explicit InvokeCommandResult(const std::string &payload); + ~InvokeCommandResult(); + std::string getInvokeId()const; + + protected: + void parse(const std::string &payload); + private: + std::string invokeId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_INVOKECOMMANDRESULT_H_ \ No newline at end of file diff --git a/swas-open/include/alibabacloud/swas-open/model/UpdateCommandAttributeRequest.h b/swas-open/include/alibabacloud/swas-open/model/UpdateCommandAttributeRequest.h new file mode 100644 index 000000000..65c3b5252 --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/UpdateCommandAttributeRequest.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_SWAS_OPEN_MODEL_UPDATECOMMANDATTRIBUTEREQUEST_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_UPDATECOMMANDATTRIBUTEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace SWAS_OPEN { +namespace Model { +class ALIBABACLOUD_SWAS_OPEN_EXPORT UpdateCommandAttributeRequest : public RpcServiceRequest { +public: + UpdateCommandAttributeRequest(); + ~UpdateCommandAttributeRequest(); + std::string getWorkingDir() const; + void setWorkingDir(const std::string &workingDir); + std::string getDescription() const; + void setDescription(const std::string &description); + std::string getCommandId() const; + void setCommandId(const std::string &commandId); + long getTimeout() const; + void setTimeout(long timeout); + std::string getRegionId() const; + void setRegionId(const std::string ®ionId); + std::string getName() const; + void setName(const std::string &name); + +private: + std::string workingDir_; + std::string description_; + std::string commandId_; + long timeout_; + std::string regionId_; + std::string name_; +}; +} // namespace Model +} // namespace SWAS_OPEN +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_UPDATECOMMANDATTRIBUTEREQUEST_H_ diff --git a/swas-open/include/alibabacloud/swas-open/model/UpdateCommandAttributeResult.h b/swas-open/include/alibabacloud/swas-open/model/UpdateCommandAttributeResult.h new file mode 100644 index 000000000..53c1ba888 --- /dev/null +++ b/swas-open/include/alibabacloud/swas-open/model/UpdateCommandAttributeResult.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_SWAS_OPEN_MODEL_UPDATECOMMANDATTRIBUTERESULT_H_ +#define ALIBABACLOUD_SWAS_OPEN_MODEL_UPDATECOMMANDATTRIBUTERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace SWAS_OPEN + { + namespace Model + { + class ALIBABACLOUD_SWAS_OPEN_EXPORT UpdateCommandAttributeResult : public ServiceResult + { + public: + + + UpdateCommandAttributeResult(); + explicit UpdateCommandAttributeResult(const std::string &payload); + ~UpdateCommandAttributeResult(); + + protected: + void parse(const std::string &payload); + private: + + }; + } + } +} +#endif // !ALIBABACLOUD_SWAS_OPEN_MODEL_UPDATECOMMANDATTRIBUTERESULT_H_ \ No newline at end of file diff --git a/swas-open/src/SWAS-OPENClient.cc b/swas-open/src/SWAS-OPENClient.cc index 9be6a1acf..82844a798 100644 --- a/swas-open/src/SWAS-OPENClient.cc +++ b/swas-open/src/SWAS-OPENClient.cc @@ -87,6 +87,42 @@ SWAS_OPENClient::AllocatePublicConnectionOutcomeCallable SWAS_OPENClient::alloca return task->get_future(); } +SWAS_OPENClient::CreateCommandOutcome SWAS_OPENClient::createCommand(const CreateCommandRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return CreateCommandOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return CreateCommandOutcome(CreateCommandResult(outcome.result())); + else + return CreateCommandOutcome(outcome.error()); +} + +void SWAS_OPENClient::createCommandAsync(const CreateCommandRequest& request, const CreateCommandAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, createCommand(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SWAS_OPENClient::CreateCommandOutcomeCallable SWAS_OPENClient::createCommandCallable(const CreateCommandRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->createCommand(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + SWAS_OPENClient::CreateCustomImageOutcome SWAS_OPENClient::createCustomImage(const CreateCustomImageRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -303,6 +339,42 @@ SWAS_OPENClient::CreateSnapshotOutcomeCallable SWAS_OPENClient::createSnapshotCa return task->get_future(); } +SWAS_OPENClient::DeleteCommandOutcome SWAS_OPENClient::deleteCommand(const DeleteCommandRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteCommandOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteCommandOutcome(DeleteCommandResult(outcome.result())); + else + return DeleteCommandOutcome(outcome.error()); +} + +void SWAS_OPENClient::deleteCommandAsync(const DeleteCommandRequest& request, const DeleteCommandAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteCommand(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SWAS_OPENClient::DeleteCommandOutcomeCallable SWAS_OPENClient::deleteCommandCallable(const DeleteCommandRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteCommand(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + SWAS_OPENClient::DeleteCustomImageOutcome SWAS_OPENClient::deleteCustomImage(const DeleteCustomImageRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -555,6 +627,78 @@ SWAS_OPENClient::DescribeCloudMonitorAgentStatusesOutcomeCallable SWAS_OPENClien return task->get_future(); } +SWAS_OPENClient::DescribeCommandInvocationsOutcome SWAS_OPENClient::describeCommandInvocations(const DescribeCommandInvocationsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeCommandInvocationsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeCommandInvocationsOutcome(DescribeCommandInvocationsResult(outcome.result())); + else + return DescribeCommandInvocationsOutcome(outcome.error()); +} + +void SWAS_OPENClient::describeCommandInvocationsAsync(const DescribeCommandInvocationsRequest& request, const DescribeCommandInvocationsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeCommandInvocations(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SWAS_OPENClient::DescribeCommandInvocationsOutcomeCallable SWAS_OPENClient::describeCommandInvocationsCallable(const DescribeCommandInvocationsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeCommandInvocations(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +SWAS_OPENClient::DescribeCommandsOutcome SWAS_OPENClient::describeCommands(const DescribeCommandsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DescribeCommandsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DescribeCommandsOutcome(DescribeCommandsResult(outcome.result())); + else + return DescribeCommandsOutcome(outcome.error()); +} + +void SWAS_OPENClient::describeCommandsAsync(const DescribeCommandsRequest& request, const DescribeCommandsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, describeCommands(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SWAS_OPENClient::DescribeCommandsOutcomeCallable SWAS_OPENClient::describeCommandsCallable(const DescribeCommandsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->describeCommands(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + SWAS_OPENClient::DescribeDatabaseErrorLogsOutcome SWAS_OPENClient::describeDatabaseErrorLogs(const DescribeDatabaseErrorLogsRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1131,6 +1275,42 @@ SWAS_OPENClient::InstallCloudMonitorAgentOutcomeCallable SWAS_OPENClient::instal return task->get_future(); } +SWAS_OPENClient::InvokeCommandOutcome SWAS_OPENClient::invokeCommand(const InvokeCommandRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return InvokeCommandOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return InvokeCommandOutcome(InvokeCommandResult(outcome.result())); + else + return InvokeCommandOutcome(outcome.error()); +} + +void SWAS_OPENClient::invokeCommandAsync(const InvokeCommandRequest& request, const InvokeCommandAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, invokeCommand(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SWAS_OPENClient::InvokeCommandOutcomeCallable SWAS_OPENClient::invokeCommandCallable(const InvokeCommandRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->invokeCommand(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + SWAS_OPENClient::ListCustomImagesOutcome SWAS_OPENClient::listCustomImages(const ListCustomImagesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -2319,6 +2499,42 @@ SWAS_OPENClient::StopInstancesOutcomeCallable SWAS_OPENClient::stopInstancesCall return task->get_future(); } +SWAS_OPENClient::UpdateCommandAttributeOutcome SWAS_OPENClient::updateCommandAttribute(const UpdateCommandAttributeRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return UpdateCommandAttributeOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return UpdateCommandAttributeOutcome(UpdateCommandAttributeResult(outcome.result())); + else + return UpdateCommandAttributeOutcome(outcome.error()); +} + +void SWAS_OPENClient::updateCommandAttributeAsync(const UpdateCommandAttributeRequest& request, const UpdateCommandAttributeAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, updateCommandAttribute(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SWAS_OPENClient::UpdateCommandAttributeOutcomeCallable SWAS_OPENClient::updateCommandAttributeCallable(const UpdateCommandAttributeRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->updateCommandAttribute(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + SWAS_OPENClient::UpdateDiskAttributeOutcome SWAS_OPENClient::updateDiskAttribute(const UpdateDiskAttributeRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/swas-open/src/model/CreateCommandRequest.cc b/swas-open/src/model/CreateCommandRequest.cc new file mode 100644 index 000000000..6b2c4c6b3 --- /dev/null +++ b/swas-open/src/model/CreateCommandRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::SWAS_OPEN::Model::CreateCommandRequest; + +CreateCommandRequest::CreateCommandRequest() + : RpcServiceRequest("swas-open", "2020-06-01", "CreateCommand") { + setMethod(HttpRequest::Method::Post); +} + +CreateCommandRequest::~CreateCommandRequest() {} + +std::string CreateCommandRequest::getWorkingDir() const { + return workingDir_; +} + +void CreateCommandRequest::setWorkingDir(const std::string &workingDir) { + workingDir_ = workingDir; + setParameter(std::string("WorkingDir"), workingDir); +} + +std::string CreateCommandRequest::getDescription() const { + return description_; +} + +void CreateCommandRequest::setDescription(const std::string &description) { + description_ = description; + setParameter(std::string("Description"), description); +} + +std::string CreateCommandRequest::getType() const { + return type_; +} + +void CreateCommandRequest::setType(const std::string &type) { + type_ = type; + setParameter(std::string("Type"), type); +} + +std::string CreateCommandRequest::getCommandContent() const { + return commandContent_; +} + +void CreateCommandRequest::setCommandContent(const std::string &commandContent) { + commandContent_ = commandContent; + setParameter(std::string("CommandContent"), commandContent); +} + +long CreateCommandRequest::getTimeout() const { + return timeout_; +} + +void CreateCommandRequest::setTimeout(long timeout) { + timeout_ = timeout; + setParameter(std::string("Timeout"), std::to_string(timeout)); +} + +std::string CreateCommandRequest::getRegionId() const { + return regionId_; +} + +void CreateCommandRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + +std::string CreateCommandRequest::getName() const { + return name_; +} + +void CreateCommandRequest::setName(const std::string &name) { + name_ = name; + setParameter(std::string("Name"), name); +} + +bool CreateCommandRequest::getEnableParameter() const { + return enableParameter_; +} + +void CreateCommandRequest::setEnableParameter(bool enableParameter) { + enableParameter_ = enableParameter; + setParameter(std::string("EnableParameter"), enableParameter ? "true" : "false"); +} + diff --git a/swas-open/src/model/CreateCommandResult.cc b/swas-open/src/model/CreateCommandResult.cc new file mode 100644 index 000000000..39d0682f0 --- /dev/null +++ b/swas-open/src/model/CreateCommandResult.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::SWAS_OPEN; +using namespace AlibabaCloud::SWAS_OPEN::Model; + +CreateCommandResult::CreateCommandResult() : + ServiceResult() +{} + +CreateCommandResult::CreateCommandResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +CreateCommandResult::~CreateCommandResult() +{} + +void CreateCommandResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["CommandId"].isNull()) + commandId_ = value["CommandId"].asString(); + +} + +std::string CreateCommandResult::getCommandId()const +{ + return commandId_; +} + diff --git a/swas-open/src/model/DeleteCommandRequest.cc b/swas-open/src/model/DeleteCommandRequest.cc new file mode 100644 index 000000000..19deb0319 --- /dev/null +++ b/swas-open/src/model/DeleteCommandRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::SWAS_OPEN::Model::DeleteCommandRequest; + +DeleteCommandRequest::DeleteCommandRequest() + : RpcServiceRequest("swas-open", "2020-06-01", "DeleteCommand") { + setMethod(HttpRequest::Method::Post); +} + +DeleteCommandRequest::~DeleteCommandRequest() {} + +std::string DeleteCommandRequest::getCommandId() const { + return commandId_; +} + +void DeleteCommandRequest::setCommandId(const std::string &commandId) { + commandId_ = commandId; + setParameter(std::string("CommandId"), commandId); +} + +std::string DeleteCommandRequest::getRegionId() const { + return regionId_; +} + +void DeleteCommandRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + diff --git a/swas-open/src/model/DeleteCommandResult.cc b/swas-open/src/model/DeleteCommandResult.cc new file mode 100644 index 000000000..c92334180 --- /dev/null +++ b/swas-open/src/model/DeleteCommandResult.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::SWAS_OPEN; +using namespace AlibabaCloud::SWAS_OPEN::Model; + +DeleteCommandResult::DeleteCommandResult() : + ServiceResult() +{} + +DeleteCommandResult::DeleteCommandResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteCommandResult::~DeleteCommandResult() +{} + +void DeleteCommandResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} + diff --git a/swas-open/src/model/DescribeCommandInvocationsRequest.cc b/swas-open/src/model/DescribeCommandInvocationsRequest.cc new file mode 100644 index 000000000..13d442f8a --- /dev/null +++ b/swas-open/src/model/DescribeCommandInvocationsRequest.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 + +using AlibabaCloud::SWAS_OPEN::Model::DescribeCommandInvocationsRequest; + +DescribeCommandInvocationsRequest::DescribeCommandInvocationsRequest() + : RpcServiceRequest("swas-open", "2020-06-01", "DescribeCommandInvocations") { + setMethod(HttpRequest::Method::Post); +} + +DescribeCommandInvocationsRequest::~DescribeCommandInvocationsRequest() {} + +std::string DescribeCommandInvocationsRequest::getCommandId() const { + return commandId_; +} + +void DescribeCommandInvocationsRequest::setCommandId(const std::string &commandId) { + commandId_ = commandId; + setParameter(std::string("CommandId"), commandId); +} + +std::string DescribeCommandInvocationsRequest::getPageNumber() const { + return pageNumber_; +} + +void DescribeCommandInvocationsRequest::setPageNumber(const std::string &pageNumber) { + pageNumber_ = pageNumber; + setParameter(std::string("PageNumber"), pageNumber); +} + +std::string DescribeCommandInvocationsRequest::getRegionId() const { + return regionId_; +} + +void DescribeCommandInvocationsRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + +std::string DescribeCommandInvocationsRequest::getPageSize() const { + return pageSize_; +} + +void DescribeCommandInvocationsRequest::setPageSize(const std::string &pageSize) { + pageSize_ = pageSize; + setParameter(std::string("PageSize"), pageSize); +} + +std::string DescribeCommandInvocationsRequest::getInvokeId() const { + return invokeId_; +} + +void DescribeCommandInvocationsRequest::setInvokeId(const std::string &invokeId) { + invokeId_ = invokeId; + setParameter(std::string("InvokeId"), invokeId); +} + +std::string DescribeCommandInvocationsRequest::getCommandName() const { + return commandName_; +} + +void DescribeCommandInvocationsRequest::setCommandName(const std::string &commandName) { + commandName_ = commandName; + setParameter(std::string("CommandName"), commandName); +} + +std::string DescribeCommandInvocationsRequest::getCommandType() const { + return commandType_; +} + +void DescribeCommandInvocationsRequest::setCommandType(const std::string &commandType) { + commandType_ = commandType; + setParameter(std::string("CommandType"), commandType); +} + +std::string DescribeCommandInvocationsRequest::getInstanceId() const { + return instanceId_; +} + +void DescribeCommandInvocationsRequest::setInstanceId(const std::string &instanceId) { + instanceId_ = instanceId; + setParameter(std::string("InstanceId"), instanceId); +} + +std::string DescribeCommandInvocationsRequest::getInvocationStatus() const { + return invocationStatus_; +} + +void DescribeCommandInvocationsRequest::setInvocationStatus(const std::string &invocationStatus) { + invocationStatus_ = invocationStatus; + setParameter(std::string("InvocationStatus"), invocationStatus); +} + diff --git a/swas-open/src/model/DescribeCommandInvocationsResult.cc b/swas-open/src/model/DescribeCommandInvocationsResult.cc new file mode 100644 index 000000000..486f4ff8e --- /dev/null +++ b/swas-open/src/model/DescribeCommandInvocationsResult.cc @@ -0,0 +1,122 @@ +/* + * 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::SWAS_OPEN; +using namespace AlibabaCloud::SWAS_OPEN::Model; + +DescribeCommandInvocationsResult::DescribeCommandInvocationsResult() : + ServiceResult() +{} + +DescribeCommandInvocationsResult::DescribeCommandInvocationsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeCommandInvocationsResult::~DescribeCommandInvocationsResult() +{} + +void DescribeCommandInvocationsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allCommandInvocationsNode = value["CommandInvocations"]["command"]; + for (auto valueCommandInvocationscommand : allCommandInvocationsNode) + { + Command commandInvocationsObject; + if(!valueCommandInvocationscommand["InvokeId"].isNull()) + commandInvocationsObject.invokeId = valueCommandInvocationscommand["InvokeId"].asString(); + if(!valueCommandInvocationscommand["CreationTime"].isNull()) + commandInvocationsObject.creationTime = valueCommandInvocationscommand["CreationTime"].asString(); + if(!valueCommandInvocationscommand["CommandId"].isNull()) + commandInvocationsObject.commandId = valueCommandInvocationscommand["CommandId"].asString(); + if(!valueCommandInvocationscommand["InvocationStatus"].isNull()) + commandInvocationsObject.invocationStatus = valueCommandInvocationscommand["InvocationStatus"].asString(); + if(!valueCommandInvocationscommand["CommandName"].isNull()) + commandInvocationsObject.commandName = valueCommandInvocationscommand["CommandName"].asString(); + if(!valueCommandInvocationscommand["CommandType"].isNull()) + commandInvocationsObject.commandType = valueCommandInvocationscommand["CommandType"].asString(); + if(!valueCommandInvocationscommand["CommandDescription"].isNull()) + commandInvocationsObject.commandDescription = valueCommandInvocationscommand["CommandDescription"].asString(); + if(!valueCommandInvocationscommand["Username"].isNull()) + commandInvocationsObject.username = valueCommandInvocationscommand["Username"].asString(); + if(!valueCommandInvocationscommand["WorkingDir"].isNull()) + commandInvocationsObject.workingDir = valueCommandInvocationscommand["WorkingDir"].asString(); + if(!valueCommandInvocationscommand["Timeout"].isNull()) + commandInvocationsObject.timeout = std::stol(valueCommandInvocationscommand["Timeout"].asString()); + if(!valueCommandInvocationscommand["CommandContent"].isNull()) + commandInvocationsObject.commandContent = valueCommandInvocationscommand["CommandContent"].asString(); + if(!valueCommandInvocationscommand["Parameters"].isNull()) + commandInvocationsObject.parameters = valueCommandInvocationscommand["Parameters"].asString(); + auto allInvokeInstancesNode = valueCommandInvocationscommand["InvokeInstances"]["invokeInstance"]; + for (auto valueCommandInvocationscommandInvokeInstancesinvokeInstance : allInvokeInstancesNode) + { + Command::InvokeInstance invokeInstancesObject; + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["InstanceId"].isNull()) + invokeInstancesObject.instanceId = valueCommandInvocationscommandInvokeInstancesinvokeInstance["InstanceId"].asString(); + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["StartTime"].isNull()) + invokeInstancesObject.startTime = valueCommandInvocationscommandInvokeInstancesinvokeInstance["StartTime"].asString(); + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["FinishTime"].isNull()) + invokeInstancesObject.finishTime = valueCommandInvocationscommandInvokeInstancesinvokeInstance["FinishTime"].asString(); + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["InvocationStatus"].isNull()) + invokeInstancesObject.invocationStatus = valueCommandInvocationscommandInvokeInstancesinvokeInstance["InvocationStatus"].asString(); + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["Output"].isNull()) + invokeInstancesObject.output = valueCommandInvocationscommandInvokeInstancesinvokeInstance["Output"].asString(); + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["ExitCode"].isNull()) + invokeInstancesObject.exitCode = std::stol(valueCommandInvocationscommandInvokeInstancesinvokeInstance["ExitCode"].asString()); + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorInfo"].isNull()) + invokeInstancesObject.errorInfo = valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorInfo"].asString(); + if(!valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorCode"].isNull()) + invokeInstancesObject.errorCode = valueCommandInvocationscommandInvokeInstancesinvokeInstance["ErrorCode"].asString(); + commandInvocationsObject.invokeInstances.push_back(invokeInstancesObject); + } + commandInvocations_.push_back(commandInvocationsObject); + } + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + if(!value["PageNumber"].isNull()) + pageNumber_ = std::stoi(value["PageNumber"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + +} + +int DescribeCommandInvocationsResult::getTotalCount()const +{ + return totalCount_; +} + +int DescribeCommandInvocationsResult::getPageSize()const +{ + return pageSize_; +} + +int DescribeCommandInvocationsResult::getPageNumber()const +{ + return pageNumber_; +} + +std::vector DescribeCommandInvocationsResult::getCommandInvocations()const +{ + return commandInvocations_; +} + diff --git a/swas-open/src/model/DescribeCommandsRequest.cc b/swas-open/src/model/DescribeCommandsRequest.cc new file mode 100644 index 000000000..24b71e4eb --- /dev/null +++ b/swas-open/src/model/DescribeCommandsRequest.cc @@ -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. + */ + +#include + +using AlibabaCloud::SWAS_OPEN::Model::DescribeCommandsRequest; + +DescribeCommandsRequest::DescribeCommandsRequest() + : RpcServiceRequest("swas-open", "2020-06-01", "DescribeCommands") { + setMethod(HttpRequest::Method::Post); +} + +DescribeCommandsRequest::~DescribeCommandsRequest() {} + +std::string DescribeCommandsRequest::getType() const { + return type_; +} + +void DescribeCommandsRequest::setType(const std::string &type) { + type_ = type; + setParameter(std::string("Type"), type); +} + +std::string DescribeCommandsRequest::getCommandId() const { + return commandId_; +} + +void DescribeCommandsRequest::setCommandId(const std::string &commandId) { + commandId_ = commandId; + setParameter(std::string("CommandId"), commandId); +} + +std::string DescribeCommandsRequest::getPageNumber() const { + return pageNumber_; +} + +void DescribeCommandsRequest::setPageNumber(const std::string &pageNumber) { + pageNumber_ = pageNumber; + setParameter(std::string("PageNumber"), pageNumber); +} + +std::string DescribeCommandsRequest::getRegionId() const { + return regionId_; +} + +void DescribeCommandsRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + +std::string DescribeCommandsRequest::getProvider() const { + return provider_; +} + +void DescribeCommandsRequest::setProvider(const std::string &provider) { + provider_ = provider; + setParameter(std::string("Provider"), provider); +} + +std::string DescribeCommandsRequest::getName() const { + return name_; +} + +void DescribeCommandsRequest::setName(const std::string &name) { + name_ = name; + setParameter(std::string("Name"), name); +} + +std::string DescribeCommandsRequest::getPageSize() const { + return pageSize_; +} + +void DescribeCommandsRequest::setPageSize(const std::string &pageSize) { + pageSize_ = pageSize; + setParameter(std::string("PageSize"), pageSize); +} + diff --git a/swas-open/src/model/DescribeCommandsResult.cc b/swas-open/src/model/DescribeCommandsResult.cc new file mode 100644 index 000000000..d593c65b2 --- /dev/null +++ b/swas-open/src/model/DescribeCommandsResult.cc @@ -0,0 +1,116 @@ +/* + * 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::SWAS_OPEN; +using namespace AlibabaCloud::SWAS_OPEN::Model; + +DescribeCommandsResult::DescribeCommandsResult() : + ServiceResult() +{} + +DescribeCommandsResult::DescribeCommandsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DescribeCommandsResult::~DescribeCommandsResult() +{} + +void DescribeCommandsResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + auto allCommandsNode = value["Commands"]["command"]; + for (auto valueCommandscommand : allCommandsNode) + { + Command commandsObject; + if(!valueCommandscommand["CommandId"].isNull()) + commandsObject.commandId = valueCommandscommand["CommandId"].asString(); + if(!valueCommandscommand["CreationTime"].isNull()) + commandsObject.creationTime = valueCommandscommand["CreationTime"].asString(); + if(!valueCommandscommand["Name"].isNull()) + commandsObject.name = valueCommandscommand["Name"].asString(); + if(!valueCommandscommand["Provider"].isNull()) + commandsObject.provider = valueCommandscommand["Provider"].asString(); + if(!valueCommandscommand["Type"].isNull()) + commandsObject.type = valueCommandscommand["Type"].asString(); + if(!valueCommandscommand["Timeout"].isNull()) + commandsObject.timeout = std::stol(valueCommandscommand["Timeout"].asString()); + if(!valueCommandscommand["Description"].isNull()) + commandsObject.description = valueCommandscommand["Description"].asString(); + if(!valueCommandscommand["WorkingDir"].isNull()) + commandsObject.workingDir = valueCommandscommand["WorkingDir"].asString(); + if(!valueCommandscommand["CommandContent"].isNull()) + commandsObject.commandContent = valueCommandscommand["CommandContent"].asString(); + if(!valueCommandscommand["EnableParameter"].isNull()) + commandsObject.enableParameter = valueCommandscommand["EnableParameter"].asString() == "true"; + auto allParameterDefinitionsNode = valueCommandscommand["ParameterDefinitions"]["parameterDefinition"]; + for (auto valueCommandscommandParameterDefinitionsparameterDefinition : allParameterDefinitionsNode) + { + Command::ParameterDefinition parameterDefinitionsObject; + if(!valueCommandscommandParameterDefinitionsparameterDefinition["Required"].isNull()) + parameterDefinitionsObject.required = valueCommandscommandParameterDefinitionsparameterDefinition["Required"].asString() == "true"; + if(!valueCommandscommandParameterDefinitionsparameterDefinition["Description"].isNull()) + parameterDefinitionsObject.description = valueCommandscommandParameterDefinitionsparameterDefinition["Description"].asString(); + if(!valueCommandscommandParameterDefinitionsparameterDefinition["DefaultValue"].isNull()) + parameterDefinitionsObject.defaultValue = valueCommandscommandParameterDefinitionsparameterDefinition["DefaultValue"].asString(); + if(!valueCommandscommandParameterDefinitionsparameterDefinition["ParameterName"].isNull()) + parameterDefinitionsObject.parameterName = valueCommandscommandParameterDefinitionsparameterDefinition["ParameterName"].asString(); + auto allPossibleValues = value["PossibleValues"]["possibleValue"]; + for (auto value : allPossibleValues) + parameterDefinitionsObject.possibleValues.push_back(value.asString()); + commandsObject.parameterDefinitions.push_back(parameterDefinitionsObject); + } + auto allParameterNames = value["ParameterNames"]["parameterName"]; + for (auto value : allParameterNames) + commandsObject.parameterNames.push_back(value.asString()); + commands_.push_back(commandsObject); + } + if(!value["TotalCount"].isNull()) + totalCount_ = std::stoi(value["TotalCount"].asString()); + if(!value["PageNumber"].isNull()) + pageNumber_ = std::stoi(value["PageNumber"].asString()); + if(!value["PageSize"].isNull()) + pageSize_ = std::stoi(value["PageSize"].asString()); + +} + +int DescribeCommandsResult::getTotalCount()const +{ + return totalCount_; +} + +int DescribeCommandsResult::getPageSize()const +{ + return pageSize_; +} + +int DescribeCommandsResult::getPageNumber()const +{ + return pageNumber_; +} + +std::vector DescribeCommandsResult::getCommands()const +{ + return commands_; +} + diff --git a/swas-open/src/model/InvokeCommandRequest.cc b/swas-open/src/model/InvokeCommandRequest.cc new file mode 100644 index 000000000..b25a9981d --- /dev/null +++ b/swas-open/src/model/InvokeCommandRequest.cc @@ -0,0 +1,74 @@ +/* + * 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::SWAS_OPEN::Model::InvokeCommandRequest; + +InvokeCommandRequest::InvokeCommandRequest() + : RpcServiceRequest("swas-open", "2020-06-01", "InvokeCommand") { + setMethod(HttpRequest::Method::Post); +} + +InvokeCommandRequest::~InvokeCommandRequest() {} + +std::string InvokeCommandRequest::getCommandId() const { + return commandId_; +} + +void InvokeCommandRequest::setCommandId(const std::string &commandId) { + commandId_ = commandId; + setParameter(std::string("CommandId"), commandId); +} + +std::string InvokeCommandRequest::getRegionId() const { + return regionId_; +} + +void InvokeCommandRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + +std::string InvokeCommandRequest::getInstanceIds() const { + return instanceIds_; +} + +void InvokeCommandRequest::setInstanceIds(const std::string &instanceIds) { + instanceIds_ = instanceIds; + setParameter(std::string("InstanceIds"), instanceIds); +} + +std::map InvokeCommandRequest::getParameters() const { + return parameters_; +} + +void InvokeCommandRequest::setParameters(const std::map ¶meters) { + parameters_ = parameters; + for(auto const &iter1 : parameters) { + setParameter(std::string("Parameters") + "." + iter1.first, iter1.second); + } +} + +std::string InvokeCommandRequest::getUsername() const { + return username_; +} + +void InvokeCommandRequest::setUsername(const std::string &username) { + username_ = username; + setParameter(std::string("Username"), username); +} + diff --git a/swas-open/src/model/InvokeCommandResult.cc b/swas-open/src/model/InvokeCommandResult.cc new file mode 100644 index 000000000..cdb6193a4 --- /dev/null +++ b/swas-open/src/model/InvokeCommandResult.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::SWAS_OPEN; +using namespace AlibabaCloud::SWAS_OPEN::Model; + +InvokeCommandResult::InvokeCommandResult() : + ServiceResult() +{} + +InvokeCommandResult::InvokeCommandResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +InvokeCommandResult::~InvokeCommandResult() +{} + +void InvokeCommandResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["InvokeId"].isNull()) + invokeId_ = value["InvokeId"].asString(); + +} + +std::string InvokeCommandResult::getInvokeId()const +{ + return invokeId_; +} + diff --git a/swas-open/src/model/UpdateCommandAttributeRequest.cc b/swas-open/src/model/UpdateCommandAttributeRequest.cc new file mode 100644 index 000000000..c38d97a08 --- /dev/null +++ b/swas-open/src/model/UpdateCommandAttributeRequest.cc @@ -0,0 +1,81 @@ +/* + * 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::SWAS_OPEN::Model::UpdateCommandAttributeRequest; + +UpdateCommandAttributeRequest::UpdateCommandAttributeRequest() + : RpcServiceRequest("swas-open", "2020-06-01", "UpdateCommandAttribute") { + setMethod(HttpRequest::Method::Post); +} + +UpdateCommandAttributeRequest::~UpdateCommandAttributeRequest() {} + +std::string UpdateCommandAttributeRequest::getWorkingDir() const { + return workingDir_; +} + +void UpdateCommandAttributeRequest::setWorkingDir(const std::string &workingDir) { + workingDir_ = workingDir; + setParameter(std::string("WorkingDir"), workingDir); +} + +std::string UpdateCommandAttributeRequest::getDescription() const { + return description_; +} + +void UpdateCommandAttributeRequest::setDescription(const std::string &description) { + description_ = description; + setParameter(std::string("Description"), description); +} + +std::string UpdateCommandAttributeRequest::getCommandId() const { + return commandId_; +} + +void UpdateCommandAttributeRequest::setCommandId(const std::string &commandId) { + commandId_ = commandId; + setParameter(std::string("CommandId"), commandId); +} + +long UpdateCommandAttributeRequest::getTimeout() const { + return timeout_; +} + +void UpdateCommandAttributeRequest::setTimeout(long timeout) { + timeout_ = timeout; + setParameter(std::string("Timeout"), std::to_string(timeout)); +} + +std::string UpdateCommandAttributeRequest::getRegionId() const { + return regionId_; +} + +void UpdateCommandAttributeRequest::setRegionId(const std::string ®ionId) { + regionId_ = regionId; + setParameter(std::string("RegionId"), regionId); +} + +std::string UpdateCommandAttributeRequest::getName() const { + return name_; +} + +void UpdateCommandAttributeRequest::setName(const std::string &name) { + name_ = name; + setParameter(std::string("Name"), name); +} + diff --git a/swas-open/src/model/UpdateCommandAttributeResult.cc b/swas-open/src/model/UpdateCommandAttributeResult.cc new file mode 100644 index 000000000..44e87da8d --- /dev/null +++ b/swas-open/src/model/UpdateCommandAttributeResult.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::SWAS_OPEN; +using namespace AlibabaCloud::SWAS_OPEN::Model; + +UpdateCommandAttributeResult::UpdateCommandAttributeResult() : + ServiceResult() +{} + +UpdateCommandAttributeResult::UpdateCommandAttributeResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +UpdateCommandAttributeResult::~UpdateCommandAttributeResult() +{} + +void UpdateCommandAttributeResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + +} +