Procházet zdrojové kódy

Add API GetDomain.

sdk-team před 5 roky
rodič
revize
363f56d62b

+ 5 - 0
CHANGELOG

@@ -1,3 +1,8 @@
+2021-04-16 Version: 1.36.682
+- Add API GetDomain.
+- Add API ListSystemAnalyzers.
+- Add parameter domain to API ListAppGroups, ModifyAppGroup, CreateAppGroup, DescribeAppGroup, DescribeApp.
+
 2021-04-14 Version: 1.36.681
 - Support latest openAPIs.
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.681
+1.36.682

+ 4 - 0
opensearch/CMakeLists.txt

@@ -105,6 +105,8 @@ set(opensearch_public_header_model
 	include/alibabacloud/opensearch/model/DisableSlowQueryResult.h
 	include/alibabacloud/opensearch/model/EnableSlowQueryRequest.h
 	include/alibabacloud/opensearch/model/EnableSlowQueryResult.h
+	include/alibabacloud/opensearch/model/GetDomainRequest.h
+	include/alibabacloud/opensearch/model/GetDomainResult.h
 	include/alibabacloud/opensearch/model/GetModelProgressRequest.h
 	include/alibabacloud/opensearch/model/GetModelProgressResult.h
 	include/alibabacloud/opensearch/model/GetModelReportRequest.h
@@ -328,6 +330,8 @@ set(opensearch_src
 	src/model/DisableSlowQueryResult.cc
 	src/model/EnableSlowQueryRequest.cc
 	src/model/EnableSlowQueryResult.cc
+	src/model/GetDomainRequest.cc
+	src/model/GetDomainResult.cc
 	src/model/GetModelProgressRequest.cc
 	src/model/GetModelProgressResult.cc
 	src/model/GetModelReportRequest.cc

+ 8 - 0
opensearch/include/alibabacloud/opensearch/OpenSearchClient.h

@@ -106,6 +106,8 @@
 #include "model/DisableSlowQueryResult.h"
 #include "model/EnableSlowQueryRequest.h"
 #include "model/EnableSlowQueryResult.h"
+#include "model/GetDomainRequest.h"
+#include "model/GetDomainResult.h"
 #include "model/GetModelProgressRequest.h"
 #include "model/GetModelProgressResult.h"
 #include "model/GetModelReportRequest.h"
@@ -377,6 +379,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::EnableSlowQueryResult> EnableSlowQueryOutcome;
 			typedef std::future<EnableSlowQueryOutcome> EnableSlowQueryOutcomeCallable;
 			typedef std::function<void(const OpenSearchClient*, const Model::EnableSlowQueryRequest&, const EnableSlowQueryOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> EnableSlowQueryAsyncHandler;
+			typedef Outcome<Error, Model::GetDomainResult> GetDomainOutcome;
+			typedef std::future<GetDomainOutcome> GetDomainOutcomeCallable;
+			typedef std::function<void(const OpenSearchClient*, const Model::GetDomainRequest&, const GetDomainOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDomainAsyncHandler;
 			typedef Outcome<Error, Model::GetModelProgressResult> GetModelProgressOutcome;
 			typedef std::future<GetModelProgressOutcome> GetModelProgressOutcomeCallable;
 			typedef std::function<void(const OpenSearchClient*, const Model::GetModelProgressRequest&, const GetModelProgressOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetModelProgressAsyncHandler;
@@ -712,6 +717,9 @@ namespace AlibabaCloud
 			EnableSlowQueryOutcome enableSlowQuery(const Model::EnableSlowQueryRequest &request)const;
 			void enableSlowQueryAsync(const Model::EnableSlowQueryRequest& request, const EnableSlowQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			EnableSlowQueryOutcomeCallable enableSlowQueryCallable(const Model::EnableSlowQueryRequest& request) const;
+			GetDomainOutcome getDomain(const Model::GetDomainRequest &request)const;
+			void getDomainAsync(const Model::GetDomainRequest& request, const GetDomainAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			GetDomainOutcomeCallable getDomainCallable(const Model::GetDomainRequest& request) const;
 			GetModelProgressOutcome getModelProgress(const Model::GetModelProgressRequest &request)const;
 			void getModelProgressAsync(const Model::GetModelProgressRequest& request, const GetModelProgressAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetModelProgressOutcomeCallable getModelProgressCallable(const Model::GetModelProgressRequest& request) const;

+ 9 - 8
opensearch/include/alibabacloud/opensearch/model/CreateAppGroupResult.h

@@ -41,27 +41,28 @@ namespace AlibabaCloud
 						std::string spec;
 					};
 					int secondRankAlgoDeploymentId;
-					std::string status;
 					int firstRankAlgoDeploymentId;
-					int produced;
 					std::string description;
-					int updated;
-					std::string instanceId;
 					std::string processingOrderId;
 					std::string expireOn;
 					std::string currentVersion;
 					int switchedTime;
+					std::string name;
+					int created;
+					std::string commodityCode;
+					int hasPendingQuotaReviewTask;
+					std::string status;
+					int produced;
+					int updated;
+					std::string instanceId;
 					std::string projectId;
 					std::string lockMode;
-					std::string name;
 					int chargingWay;
-					int created;
 					std::string type;
 					Quota quota;
 					std::string chargeType;
-					std::string commodityCode;
-					int hasPendingQuotaReviewTask;
 					std::string id;
+					std::string domain;
 					int pendingSecondRankAlgoDeploymentId;
 					int lockedByExpiration;
 				};

+ 9 - 8
opensearch/include/alibabacloud/opensearch/model/DescribeAppGroupResult.h

@@ -41,27 +41,28 @@ namespace AlibabaCloud
 						std::string spec;
 					};
 					int secondRankAlgoDeploymentId;
-					std::string status;
 					int firstRankAlgoDeploymentId;
-					int produced;
 					std::string description;
-					int updated;
-					std::string instanceId;
 					std::string processingOrderId;
 					std::string expireOn;
 					std::string currentVersion;
 					int switchedTime;
+					std::string name;
+					int created;
+					std::string commodityCode;
+					int hasPendingQuotaReviewTask;
+					std::string status;
+					int produced;
+					int updated;
+					std::string instanceId;
 					std::string projectId;
 					std::string lockMode;
-					std::string name;
 					int chargingWay;
-					int created;
 					std::string type;
 					Quota quota;
 					std::string chargeType;
-					std::string commodityCode;
-					int hasPendingQuotaReviewTask;
 					std::string id;
+					std::string domain;
 					int pendingSecondRankAlgoDeploymentId;
 					int lockedByExpiration;
 				};

+ 18 - 5
opensearch/include/alibabacloud/opensearch/model/DescribeAppResult.h

@@ -41,18 +41,31 @@ namespace AlibabaCloud
 						int computeResource;
 						std::string spec;
 					};
+					struct Domain
+					{
+						struct Functions
+						{
+							std::vector<std::string> service;
+							std::vector<std::string> algo;
+							std::vector<std::string> qp;
+						};
+						std::string category;
+						Functions functions;
+						std::string name;
+					};
 					std::string status;
-					std::string type;
 					std::string description;
-					Quota quota;
 					std::string schema;
+					bool autoSwitch;
+					int progressPercent;
+					int created;
+					std::string type;
+					Quota quota;
 					std::vector<std::string> fetchFields;
 					std::string clusterName;
-					bool autoSwitch;
 					std::string id;
 					int algoDeploymentId;
-					int progressPercent;
-					int created;
+					Domain domain;
 				};
 
 

+ 51 - 0
opensearch/include/alibabacloud/opensearch/model/GetDomainRequest.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_OPENSEARCH_MODEL_GETDOMAINREQUEST_H_
+#define ALIBABACLOUD_OPENSEARCH_MODEL_GETDOMAINREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RoaServiceRequest.h>
+#include <alibabacloud/opensearch/OpenSearchExport.h>
+
+namespace AlibabaCloud
+{
+	namespace OpenSearch
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_OPENSEARCH_EXPORT GetDomainRequest : public RoaServiceRequest
+			{
+
+			public:
+				GetDomainRequest();
+				~GetDomainRequest();
+
+				std::string getDomainName()const;
+				void setDomainName(const std::string& domainName);
+				std::string getAppGroupIdentity()const;
+				void setAppGroupIdentity(const std::string& appGroupIdentity);
+
+            private:
+				std::string domainName_;
+				std::string appGroupIdentity_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_OPENSEARCH_MODEL_GETDOMAINREQUEST_H_

+ 53 - 0
opensearch/include/alibabacloud/opensearch/model/GetDomainResult.h

@@ -0,0 +1,53 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ALIBABACLOUD_OPENSEARCH_MODEL_GETDOMAINRESULT_H_
+#define ALIBABACLOUD_OPENSEARCH_MODEL_GETDOMAINRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/opensearch/OpenSearchExport.h>
+
+namespace AlibabaCloud
+{
+	namespace OpenSearch
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_OPENSEARCH_EXPORT GetDomainResult : public ServiceResult
+			{
+			public:
+
+
+				GetDomainResult();
+				explicit GetDomainResult(const std::string &payload);
+				~GetDomainResult();
+				std::string getRequestId()const;
+				std::string getResult()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::string requestId_;
+				std::string result_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_OPENSEARCH_MODEL_GETDOMAINRESULT_H_

+ 9 - 8
opensearch/include/alibabacloud/opensearch/model/ListAppGroupsResult.h

@@ -41,27 +41,28 @@ namespace AlibabaCloud
 						std::string spec;
 					};
 					int secondRankAlgoDeploymentId;
-					std::string status;
 					int firstRankAlgoDeploymentId;
-					int produced;
 					std::string description;
-					int updated;
-					std::string instanceId;
 					std::string processingOrderId;
 					std::string expireOn;
 					std::string currentVersion;
 					int switchedTime;
+					std::string name;
+					int created;
+					std::string commodityCode;
+					int hasPendingQuotaReviewTask;
+					std::string status;
+					int produced;
+					int updated;
+					std::string instanceId;
 					std::string projectId;
 					std::string lockMode;
-					std::string name;
 					int chargingWay;
-					int created;
 					std::string type;
 					Quota quota;
 					std::string chargeType;
-					std::string commodityCode;
-					int hasPendingQuotaReviewTask;
 					std::string id;
+					std::string domain;
 					int pendingSecondRankAlgoDeploymentId;
 					int lockedByExpiration;
 				};

+ 9 - 8
opensearch/include/alibabacloud/opensearch/model/ModifyAppGroupResult.h

@@ -41,27 +41,28 @@ namespace AlibabaCloud
 						std::string spec;
 					};
 					int secondRankAlgoDeploymentId;
-					std::string status;
 					int firstRankAlgoDeploymentId;
-					int produced;
 					std::string description;
-					int updated;
-					std::string instanceId;
 					std::string processingOrderId;
 					std::string expireOn;
 					std::string currentVersion;
 					int switchedTime;
+					std::string name;
+					int created;
+					std::string commodityCode;
+					int hasPendingQuotaReviewTask;
+					std::string status;
+					int produced;
+					int updated;
+					std::string instanceId;
 					std::string projectId;
 					std::string lockMode;
-					std::string name;
 					int chargingWay;
-					int created;
 					std::string type;
 					Quota quota;
 					std::string chargeType;
-					std::string commodityCode;
-					int hasPendingQuotaReviewTask;
 					std::string id;
+					std::string domain;
 					int pendingSecondRankAlgoDeploymentId;
 					int lockedByExpiration;
 				};

+ 36 - 0
opensearch/src/OpenSearchClient.cc

@@ -1563,6 +1563,42 @@ OpenSearchClient::EnableSlowQueryOutcomeCallable OpenSearchClient::enableSlowQue
 	return task->get_future();
 }
 
+OpenSearchClient::GetDomainOutcome OpenSearchClient::getDomain(const GetDomainRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return GetDomainOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return GetDomainOutcome(GetDomainResult(outcome.result()));
+	else
+		return GetDomainOutcome(outcome.error());
+}
+
+void OpenSearchClient::getDomainAsync(const GetDomainRequest& request, const GetDomainAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, getDomain(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+OpenSearchClient::GetDomainOutcomeCallable OpenSearchClient::getDomainCallable(const GetDomainRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<GetDomainOutcome()>>(
+			[this, request]()
+			{
+			return this->getDomain(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 OpenSearchClient::GetModelProgressOutcome OpenSearchClient::getModelProgress(const GetModelProgressRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 2 - 0
opensearch/src/model/CreateAppGroupResult.cc

@@ -86,6 +86,8 @@ void CreateAppGroupResult::parse(const std::string &payload)
 		result_.status = resultNode["status"].asString();
 	if(!resultNode["lockMode"].isNull())
 		result_.lockMode = resultNode["lockMode"].asString();
+	if(!resultNode["domain"].isNull())
+		result_.domain = resultNode["domain"].asString();
 	auto quotaNode = resultNode["quota"];
 	if(!quotaNode["docSize"].isNull())
 		result_.quota.docSize = std::stoi(quotaNode["docSize"].asString());

+ 2 - 0
opensearch/src/model/DescribeAppGroupResult.cc

@@ -86,6 +86,8 @@ void DescribeAppGroupResult::parse(const std::string &payload)
 		result_.status = resultNode["status"].asString();
 	if(!resultNode["lockMode"].isNull())
 		result_.lockMode = resultNode["lockMode"].asString();
+	if(!resultNode["domain"].isNull())
+		result_.domain = resultNode["domain"].asString();
 	auto quotaNode = resultNode["quota"];
 	if(!quotaNode["docSize"].isNull())
 		result_.quota.docSize = std::stoi(quotaNode["docSize"].asString());

+ 15 - 0
opensearch/src/model/DescribeAppResult.cc

@@ -69,6 +69,21 @@ void DescribeAppResult::parse(const std::string &payload)
 		result_.quota.qps = std::stoi(quotaNode["qps"].asString());
 	if(!quotaNode["spec"].isNull())
 		result_.quota.spec = quotaNode["spec"].asString();
+	auto domainNode = resultNode["domain"];
+	if(!domainNode["name"].isNull())
+		result_.domain.name = domainNode["name"].asString();
+	if(!domainNode["category"].isNull())
+		result_.domain.category = domainNode["category"].asString();
+	auto functionsNode = domainNode["functions"];
+		auto allQp = functionsNode["qp"]["qp"];
+		for (auto value : allQp)
+			result_.domain.functions.qp.push_back(value.asString());
+		auto allAlgo = functionsNode["algo"]["algo"];
+		for (auto value : allAlgo)
+			result_.domain.functions.algo.push_back(value.asString());
+		auto allService = functionsNode["service"]["service"];
+		for (auto value : allService)
+			result_.domain.functions.service.push_back(value.asString());
 		auto allFetchFields = resultNode["fetchFields"]["fetchFields"];
 		for (auto value : allFetchFields)
 			result_.fetchFields.push_back(value.asString());

+ 52 - 0
opensearch/src/model/GetDomainRequest.cc

@@ -0,0 +1,52 @@
+/*
+ * 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 <alibabacloud/opensearch/model/GetDomainRequest.h>
+
+using AlibabaCloud::OpenSearch::Model::GetDomainRequest;
+
+GetDomainRequest::GetDomainRequest() :
+	RoaServiceRequest("opensearch", "2017-12-25")
+{
+	setResourcePath("/v4/openapi/domains/[domainName]");
+	setMethod(HttpRequest::Method::Get);
+}
+
+GetDomainRequest::~GetDomainRequest()
+{}
+
+std::string GetDomainRequest::getDomainName()const
+{
+	return domainName_;
+}
+
+void GetDomainRequest::setDomainName(const std::string& domainName)
+{
+	domainName_ = domainName;
+	setParameter("DomainName", domainName);
+}
+
+std::string GetDomainRequest::getAppGroupIdentity()const
+{
+	return appGroupIdentity_;
+}
+
+void GetDomainRequest::setAppGroupIdentity(const std::string& appGroupIdentity)
+{
+	appGroupIdentity_ = appGroupIdentity;
+	setParameter("AppGroupIdentity", appGroupIdentity);
+}
+

+ 58 - 0
opensearch/src/model/GetDomainResult.cc

@@ -0,0 +1,58 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <alibabacloud/opensearch/model/GetDomainResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::OpenSearch;
+using namespace AlibabaCloud::OpenSearch::Model;
+
+GetDomainResult::GetDomainResult() :
+	ServiceResult()
+{}
+
+GetDomainResult::GetDomainResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+GetDomainResult::~GetDomainResult()
+{}
+
+void GetDomainResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	if(!value["requestId"].isNull())
+		requestId_ = value["requestId"].asString();
+	if(!value["result"].isNull())
+		result_ = value["result"].asString();
+
+}
+
+std::string GetDomainResult::getRequestId()const
+{
+	return requestId_;
+}
+
+std::string GetDomainResult::getResult()const
+{
+	return result_;
+}
+

+ 2 - 0
opensearch/src/model/ListAppGroupsResult.cc

@@ -89,6 +89,8 @@ void ListAppGroupsResult::parse(const std::string &payload)
 			resultObject.status = valueresultresultItem["status"].asString();
 		if(!valueresultresultItem["lockMode"].isNull())
 			resultObject.lockMode = valueresultresultItem["lockMode"].asString();
+		if(!valueresultresultItem["domain"].isNull())
+			resultObject.domain = valueresultresultItem["domain"].asString();
 		auto quotaNode = value["quota"];
 		if(!quotaNode["docSize"].isNull())
 			resultObject.quota.docSize = std::stoi(quotaNode["docSize"].asString());

+ 2 - 0
opensearch/src/model/ModifyAppGroupResult.cc

@@ -86,6 +86,8 @@ void ModifyAppGroupResult::parse(const std::string &payload)
 		result_.status = resultNode["status"].asString();
 	if(!resultNode["lockMode"].isNull())
 		result_.lockMode = resultNode["lockMode"].asString();
+	if(!resultNode["domain"].isNull())
+		result_.domain = resultNode["domain"].asString();
 	auto quotaNode = resultNode["quota"];
 	if(!quotaNode["docSize"].isNull())
 		result_.quota.docSize = std::stoi(quotaNode["docSize"].asString());