diff --git a/VERSION b/VERSION index 15c90f986..a75c14d7d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.1252 \ No newline at end of file +1.36.1253 \ No newline at end of file diff --git a/sas/CMakeLists.txt b/sas/CMakeLists.txt index 88018ac8f..bb6d3ecc4 100644 --- a/sas/CMakeLists.txt +++ b/sas/CMakeLists.txt @@ -25,6 +25,8 @@ set(sas_public_header_model include/alibabacloud/sas/model/AddInstallCodeResult.h include/alibabacloud/sas/model/AddVpcHoneyPotRequest.h include/alibabacloud/sas/model/AddVpcHoneyPotResult.h + include/alibabacloud/sas/model/BindAuthToMachineRequest.h + include/alibabacloud/sas/model/BindAuthToMachineResult.h include/alibabacloud/sas/model/CheckQuaraFileIdRequest.h include/alibabacloud/sas/model/CheckQuaraFileIdResult.h include/alibabacloud/sas/model/CheckSecurityEventIdRequest.h @@ -468,6 +470,8 @@ set(sas_src src/model/AddInstallCodeResult.cc src/model/AddVpcHoneyPotRequest.cc src/model/AddVpcHoneyPotResult.cc + src/model/BindAuthToMachineRequest.cc + src/model/BindAuthToMachineResult.cc src/model/CheckQuaraFileIdRequest.cc src/model/CheckQuaraFileIdResult.cc src/model/CheckSecurityEventIdRequest.cc diff --git a/sas/include/alibabacloud/sas/SasClient.h b/sas/include/alibabacloud/sas/SasClient.h index b355b16db..223c7c5f1 100644 --- a/sas/include/alibabacloud/sas/SasClient.h +++ b/sas/include/alibabacloud/sas/SasClient.h @@ -26,6 +26,8 @@ #include "model/AddInstallCodeResult.h" #include "model/AddVpcHoneyPotRequest.h" #include "model/AddVpcHoneyPotResult.h" +#include "model/BindAuthToMachineRequest.h" +#include "model/BindAuthToMachineResult.h" #include "model/CheckQuaraFileIdRequest.h" #include "model/CheckQuaraFileIdResult.h" #include "model/CheckSecurityEventIdRequest.h" @@ -477,6 +479,9 @@ namespace AlibabaCloud typedef Outcome AddVpcHoneyPotOutcome; typedef std::future AddVpcHoneyPotOutcomeCallable; typedef std::function&)> AddVpcHoneyPotAsyncHandler; + typedef Outcome BindAuthToMachineOutcome; + typedef std::future BindAuthToMachineOutcomeCallable; + typedef std::function&)> BindAuthToMachineAsyncHandler; typedef Outcome CheckQuaraFileIdOutcome; typedef std::future CheckQuaraFileIdOutcomeCallable; typedef std::function&)> CheckQuaraFileIdAsyncHandler; @@ -1142,6 +1147,9 @@ namespace AlibabaCloud AddVpcHoneyPotOutcome addVpcHoneyPot(const Model::AddVpcHoneyPotRequest &request)const; void addVpcHoneyPotAsync(const Model::AddVpcHoneyPotRequest& request, const AddVpcHoneyPotAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; AddVpcHoneyPotOutcomeCallable addVpcHoneyPotCallable(const Model::AddVpcHoneyPotRequest& request) const; + BindAuthToMachineOutcome bindAuthToMachine(const Model::BindAuthToMachineRequest &request)const; + void bindAuthToMachineAsync(const Model::BindAuthToMachineRequest& request, const BindAuthToMachineAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + BindAuthToMachineOutcomeCallable bindAuthToMachineCallable(const Model::BindAuthToMachineRequest& request) const; CheckQuaraFileIdOutcome checkQuaraFileId(const Model::CheckQuaraFileIdRequest &request)const; void checkQuaraFileIdAsync(const Model::CheckQuaraFileIdRequest& request, const CheckQuaraFileIdAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; CheckQuaraFileIdOutcomeCallable checkQuaraFileIdCallable(const Model::CheckQuaraFileIdRequest& request) const; diff --git a/sas/include/alibabacloud/sas/model/BindAuthToMachineRequest.h b/sas/include/alibabacloud/sas/model/BindAuthToMachineRequest.h new file mode 100644 index 000000000..41e51d769 --- /dev/null +++ b/sas/include/alibabacloud/sas/model/BindAuthToMachineRequest.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_SAS_MODEL_BINDAUTHTOMACHINEREQUEST_H_ +#define ALIBABACLOUD_SAS_MODEL_BINDAUTHTOMACHINEREQUEST_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud { +namespace Sas { +namespace Model { +class ALIBABACLOUD_SAS_EXPORT BindAuthToMachineRequest : public RpcServiceRequest { +public: + BindAuthToMachineRequest(); + ~BindAuthToMachineRequest(); + std::string getCriteria() const; + void setCriteria(const std::string &criteria); + bool getBindAll() const; + void setBindAll(bool bindAll); + std::vector getBind() const; + void setBind(const std::vector &bind); + std::string getSourceIp() const; + void setSourceIp(const std::string &sourceIp); + int getAuthVersion() const; + void setAuthVersion(int authVersion); + std::string getLogicalExp() const; + void setLogicalExp(const std::string &logicalExp); + int getAutoBind() const; + void setAutoBind(int autoBind); + std::vector getUnBind() const; + void setUnBind(const std::vector &unBind); + +private: + std::string criteria_; + bool bindAll_; + std::vector bind_; + std::string sourceIp_; + int authVersion_; + std::string logicalExp_; + int autoBind_; + std::vector unBind_; +}; +} // namespace Model +} // namespace Sas +} // namespace AlibabaCloud +#endif // !ALIBABACLOUD_SAS_MODEL_BINDAUTHTOMACHINEREQUEST_H_ diff --git a/sas/include/alibabacloud/sas/model/BindAuthToMachineResult.h b/sas/include/alibabacloud/sas/model/BindAuthToMachineResult.h new file mode 100644 index 000000000..1240688bc --- /dev/null +++ b/sas/include/alibabacloud/sas/model/BindAuthToMachineResult.h @@ -0,0 +1,61 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_SAS_MODEL_BINDAUTHTOMACHINERESULT_H_ +#define ALIBABACLOUD_SAS_MODEL_BINDAUTHTOMACHINERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Sas + { + namespace Model + { + class ALIBABACLOUD_SAS_EXPORT BindAuthToMachineResult : public ServiceResult + { + public: + + + BindAuthToMachineResult(); + explicit BindAuthToMachineResult(const std::string &payload); + ~BindAuthToMachineResult(); + int getInsufficientCoreCount()const; + int getInsufficientCount()const; + int getBindCount()const; + int getInsufficientEcsCount()const; + int getUnBindCount()const; + int getResultCode()const; + + protected: + void parse(const std::string &payload); + private: + int insufficientCoreCount_; + int insufficientCount_; + int bindCount_; + int insufficientEcsCount_; + int unBindCount_; + int resultCode_; + + }; + } + } +} +#endif // !ALIBABACLOUD_SAS_MODEL_BINDAUTHTOMACHINERESULT_H_ \ No newline at end of file diff --git a/sas/include/alibabacloud/sas/model/DescribeAssetDetailByUuidsRequest.h b/sas/include/alibabacloud/sas/model/DescribeAssetDetailByUuidsRequest.h index 212bac855..f97450a1e 100644 --- a/sas/include/alibabacloud/sas/model/DescribeAssetDetailByUuidsRequest.h +++ b/sas/include/alibabacloud/sas/model/DescribeAssetDetailByUuidsRequest.h @@ -32,11 +32,14 @@ public: ~DescribeAssetDetailByUuidsRequest(); std::string getSourceIp() const; void setSourceIp(const std::string &sourceIp); + std::string getLang() const; + void setLang(const std::string &lang); std::string getUuids() const; void setUuids(const std::string &uuids); private: std::string sourceIp_; + std::string lang_; std::string uuids_; }; } // namespace Model diff --git a/sas/include/alibabacloud/sas/model/DescribeCloudCenterInstancesRequest.h b/sas/include/alibabacloud/sas/model/DescribeCloudCenterInstancesRequest.h index 81fea7d8d..d48b57f82 100644 --- a/sas/include/alibabacloud/sas/model/DescribeCloudCenterInstancesRequest.h +++ b/sas/include/alibabacloud/sas/model/DescribeCloudCenterInstancesRequest.h @@ -44,6 +44,8 @@ public: void setPageSize(int pageSize); std::string getLogicalExp() const; void setLogicalExp(const std::string &logicalExp); + std::string getLang() const; + void setLang(const std::string &lang); std::string getResourceDirectoryAccountId() const; void setResourceDirectoryAccountId(const std::string &resourceDirectoryAccountId); int getCurrentPage() const; @@ -61,6 +63,7 @@ private: bool noPage_; int pageSize_; std::string logicalExp_; + std::string lang_; std::string resourceDirectoryAccountId_; int currentPage_; std::string machineTypes_; diff --git a/sas/include/alibabacloud/sas/model/DescribeFrontVulPatchListRequest.h b/sas/include/alibabacloud/sas/model/DescribeFrontVulPatchListRequest.h index 907480332..7360a2a1a 100644 --- a/sas/include/alibabacloud/sas/model/DescribeFrontVulPatchListRequest.h +++ b/sas/include/alibabacloud/sas/model/DescribeFrontVulPatchListRequest.h @@ -36,6 +36,8 @@ public: void setSourceIp(const std::string &sourceIp); std::string getOperateType() const; void setOperateType(const std::string &operateType); + std::string getLang() const; + void setLang(const std::string &lang); std::string getInfo() const; void setInfo(const std::string &info); @@ -43,6 +45,7 @@ private: std::string type_; std::string sourceIp_; std::string operateType_; + std::string lang_; std::string info_; }; } // namespace Model diff --git a/sas/include/alibabacloud/sas/model/DescribeInstanceAntiBruteForceRulesRequest.h b/sas/include/alibabacloud/sas/model/DescribeInstanceAntiBruteForceRulesRequest.h index 695fa2e8a..2b4148651 100644 --- a/sas/include/alibabacloud/sas/model/DescribeInstanceAntiBruteForceRulesRequest.h +++ b/sas/include/alibabacloud/sas/model/DescribeInstanceAntiBruteForceRulesRequest.h @@ -32,14 +32,20 @@ public: ~DescribeInstanceAntiBruteForceRulesRequest(); long getResourceOwnerId() const; void setResourceOwnerId(long resourceOwnerId); + int getCurrentPage() const; + void setCurrentPage(int currentPage); std::string getSourceIp() const; void setSourceIp(const std::string &sourceIp); + int getPageSize() const; + void setPageSize(int pageSize); std::vector getUuidList() const; void setUuidList(const std::vector &uuidList); private: long resourceOwnerId_; + int currentPage_; std::string sourceIp_; + int pageSize_; std::vector uuidList_; }; } // namespace Model diff --git a/sas/src/SasClient.cc b/sas/src/SasClient.cc index 65224e8e5..88fa9cb06 100644 --- a/sas/src/SasClient.cc +++ b/sas/src/SasClient.cc @@ -123,6 +123,42 @@ SasClient::AddVpcHoneyPotOutcomeCallable SasClient::addVpcHoneyPotCallable(const return task->get_future(); } +SasClient::BindAuthToMachineOutcome SasClient::bindAuthToMachine(const BindAuthToMachineRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return BindAuthToMachineOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return BindAuthToMachineOutcome(BindAuthToMachineResult(outcome.result())); + else + return BindAuthToMachineOutcome(outcome.error()); +} + +void SasClient::bindAuthToMachineAsync(const BindAuthToMachineRequest& request, const BindAuthToMachineAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, bindAuthToMachine(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +SasClient::BindAuthToMachineOutcomeCallable SasClient::bindAuthToMachineCallable(const BindAuthToMachineRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->bindAuthToMachine(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + SasClient::CheckQuaraFileIdOutcome SasClient::checkQuaraFileId(const CheckQuaraFileIdRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/sas/src/model/BindAuthToMachineRequest.cc b/sas/src/model/BindAuthToMachineRequest.cc new file mode 100644 index 000000000..d7c4d79b5 --- /dev/null +++ b/sas/src/model/BindAuthToMachineRequest.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 + +using AlibabaCloud::Sas::Model::BindAuthToMachineRequest; + +BindAuthToMachineRequest::BindAuthToMachineRequest() + : RpcServiceRequest("sas", "2018-12-03", "BindAuthToMachine") { + setMethod(HttpRequest::Method::Post); +} + +BindAuthToMachineRequest::~BindAuthToMachineRequest() {} + +std::string BindAuthToMachineRequest::getCriteria() const { + return criteria_; +} + +void BindAuthToMachineRequest::setCriteria(const std::string &criteria) { + criteria_ = criteria; + setParameter(std::string("Criteria"), criteria); +} + +bool BindAuthToMachineRequest::getBindAll() const { + return bindAll_; +} + +void BindAuthToMachineRequest::setBindAll(bool bindAll) { + bindAll_ = bindAll; + setParameter(std::string("BindAll"), bindAll ? "true" : "false"); +} + +std::vector BindAuthToMachineRequest::getBind() const { + return bind_; +} + +void BindAuthToMachineRequest::setBind(const std::vector &bind) { + bind_ = bind; +} + +std::string BindAuthToMachineRequest::getSourceIp() const { + return sourceIp_; +} + +void BindAuthToMachineRequest::setSourceIp(const std::string &sourceIp) { + sourceIp_ = sourceIp; + setParameter(std::string("SourceIp"), sourceIp); +} + +int BindAuthToMachineRequest::getAuthVersion() const { + return authVersion_; +} + +void BindAuthToMachineRequest::setAuthVersion(int authVersion) { + authVersion_ = authVersion; + setParameter(std::string("AuthVersion"), std::to_string(authVersion)); +} + +std::string BindAuthToMachineRequest::getLogicalExp() const { + return logicalExp_; +} + +void BindAuthToMachineRequest::setLogicalExp(const std::string &logicalExp) { + logicalExp_ = logicalExp; + setParameter(std::string("LogicalExp"), logicalExp); +} + +int BindAuthToMachineRequest::getAutoBind() const { + return autoBind_; +} + +void BindAuthToMachineRequest::setAutoBind(int autoBind) { + autoBind_ = autoBind; + setParameter(std::string("AutoBind"), std::to_string(autoBind)); +} + +std::vector BindAuthToMachineRequest::getUnBind() const { + return unBind_; +} + +void BindAuthToMachineRequest::setUnBind(const std::vector &unBind) { + unBind_ = unBind; +} + diff --git a/sas/src/model/BindAuthToMachineResult.cc b/sas/src/model/BindAuthToMachineResult.cc new file mode 100644 index 000000000..d62cee874 --- /dev/null +++ b/sas/src/model/BindAuthToMachineResult.cc @@ -0,0 +1,86 @@ +/* + * 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::Sas; +using namespace AlibabaCloud::Sas::Model; + +BindAuthToMachineResult::BindAuthToMachineResult() : + ServiceResult() +{} + +BindAuthToMachineResult::BindAuthToMachineResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +BindAuthToMachineResult::~BindAuthToMachineResult() +{} + +void BindAuthToMachineResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].asString()); + if(!value["ResultCode"].isNull()) + resultCode_ = std::stoi(value["ResultCode"].asString()); + if(!value["InsufficientCount"].isNull()) + insufficientCount_ = std::stoi(value["InsufficientCount"].asString()); + if(!value["UnBindCount"].isNull()) + unBindCount_ = std::stoi(value["UnBindCount"].asString()); + if(!value["BindCount"].isNull()) + bindCount_ = std::stoi(value["BindCount"].asString()); + if(!value["InsufficientEcsCount"].isNull()) + insufficientEcsCount_ = std::stoi(value["InsufficientEcsCount"].asString()); + if(!value["InsufficientCoreCount"].isNull()) + insufficientCoreCount_ = std::stoi(value["InsufficientCoreCount"].asString()); + +} + +int BindAuthToMachineResult::getInsufficientCoreCount()const +{ + return insufficientCoreCount_; +} + +int BindAuthToMachineResult::getInsufficientCount()const +{ + return insufficientCount_; +} + +int BindAuthToMachineResult::getBindCount()const +{ + return bindCount_; +} + +int BindAuthToMachineResult::getInsufficientEcsCount()const +{ + return insufficientEcsCount_; +} + +int BindAuthToMachineResult::getUnBindCount()const +{ + return unBindCount_; +} + +int BindAuthToMachineResult::getResultCode()const +{ + return resultCode_; +} + diff --git a/sas/src/model/DescribeAssetDetailByUuidsRequest.cc b/sas/src/model/DescribeAssetDetailByUuidsRequest.cc index 5385b77a4..c9658bd19 100644 --- a/sas/src/model/DescribeAssetDetailByUuidsRequest.cc +++ b/sas/src/model/DescribeAssetDetailByUuidsRequest.cc @@ -34,6 +34,15 @@ void DescribeAssetDetailByUuidsRequest::setSourceIp(const std::string &sourceIp) setParameter(std::string("SourceIp"), sourceIp); } +std::string DescribeAssetDetailByUuidsRequest::getLang() const { + return lang_; +} + +void DescribeAssetDetailByUuidsRequest::setLang(const std::string &lang) { + lang_ = lang; + setParameter(std::string("Lang"), lang); +} + std::string DescribeAssetDetailByUuidsRequest::getUuids() const { return uuids_; } diff --git a/sas/src/model/DescribeCloudCenterInstancesRequest.cc b/sas/src/model/DescribeCloudCenterInstancesRequest.cc index 04b85f692..794654d44 100644 --- a/sas/src/model/DescribeCloudCenterInstancesRequest.cc +++ b/sas/src/model/DescribeCloudCenterInstancesRequest.cc @@ -88,6 +88,15 @@ void DescribeCloudCenterInstancesRequest::setLogicalExp(const std::string &logic setParameter(std::string("LogicalExp"), logicalExp); } +std::string DescribeCloudCenterInstancesRequest::getLang() const { + return lang_; +} + +void DescribeCloudCenterInstancesRequest::setLang(const std::string &lang) { + lang_ = lang; + setParameter(std::string("Lang"), lang); +} + std::string DescribeCloudCenterInstancesRequest::getResourceDirectoryAccountId() const { return resourceDirectoryAccountId_; } diff --git a/sas/src/model/DescribeFrontVulPatchListRequest.cc b/sas/src/model/DescribeFrontVulPatchListRequest.cc index a8b734058..e01286a25 100644 --- a/sas/src/model/DescribeFrontVulPatchListRequest.cc +++ b/sas/src/model/DescribeFrontVulPatchListRequest.cc @@ -52,6 +52,15 @@ void DescribeFrontVulPatchListRequest::setOperateType(const std::string &operate setParameter(std::string("OperateType"), operateType); } +std::string DescribeFrontVulPatchListRequest::getLang() const { + return lang_; +} + +void DescribeFrontVulPatchListRequest::setLang(const std::string &lang) { + lang_ = lang; + setParameter(std::string("Lang"), lang); +} + std::string DescribeFrontVulPatchListRequest::getInfo() const { return info_; } diff --git a/sas/src/model/DescribeInstanceAntiBruteForceRulesRequest.cc b/sas/src/model/DescribeInstanceAntiBruteForceRulesRequest.cc index e9b5c54bf..1d3baa38e 100644 --- a/sas/src/model/DescribeInstanceAntiBruteForceRulesRequest.cc +++ b/sas/src/model/DescribeInstanceAntiBruteForceRulesRequest.cc @@ -34,6 +34,15 @@ void DescribeInstanceAntiBruteForceRulesRequest::setResourceOwnerId(long resourc setParameter(std::string("ResourceOwnerId"), std::to_string(resourceOwnerId)); } +int DescribeInstanceAntiBruteForceRulesRequest::getCurrentPage() const { + return currentPage_; +} + +void DescribeInstanceAntiBruteForceRulesRequest::setCurrentPage(int currentPage) { + currentPage_ = currentPage; + setParameter(std::string("CurrentPage"), std::to_string(currentPage)); +} + std::string DescribeInstanceAntiBruteForceRulesRequest::getSourceIp() const { return sourceIp_; } @@ -43,6 +52,15 @@ void DescribeInstanceAntiBruteForceRulesRequest::setSourceIp(const std::string & setParameter(std::string("SourceIp"), sourceIp); } +int DescribeInstanceAntiBruteForceRulesRequest::getPageSize() const { + return pageSize_; +} + +void DescribeInstanceAntiBruteForceRulesRequest::setPageSize(int pageSize) { + pageSize_ = pageSize; + setParameter(std::string("PageSize"), std::to_string(pageSize)); +} + std::vector DescribeInstanceAntiBruteForceRulesRequest::getUuidList() const { return uuidList_; }