Add Overview Query API.

This commit is contained in:
sdk-team
2023-06-07 07:49:44 +00:00
parent 51b2160a35
commit 1e896e337a
18 changed files with 438 additions and 3 deletions

View File

@@ -1 +1 @@
1.36.1592
1.36.1593

View File

@@ -73,6 +73,8 @@ set(schedulerx2_public_header_model
include/alibabacloud/schedulerx2/model/GetJobInstanceListResult.h
include/alibabacloud/schedulerx2/model/GetLogRequest.h
include/alibabacloud/schedulerx2/model/GetLogResult.h
include/alibabacloud/schedulerx2/model/GetOverviewRequest.h
include/alibabacloud/schedulerx2/model/GetOverviewResult.h
include/alibabacloud/schedulerx2/model/GetWorkFlowRequest.h
include/alibabacloud/schedulerx2/model/GetWorkFlowResult.h
include/alibabacloud/schedulerx2/model/GetWorkerListRequest.h
@@ -164,6 +166,8 @@ set(schedulerx2_src
src/model/GetJobInstanceListResult.cc
src/model/GetLogRequest.cc
src/model/GetLogResult.cc
src/model/GetOverviewRequest.cc
src/model/GetOverviewResult.cc
src/model/GetWorkFlowRequest.cc
src/model/GetWorkFlowResult.cc
src/model/GetWorkerListRequest.cc

View File

@@ -74,6 +74,8 @@
#include "model/GetJobInstanceListResult.h"
#include "model/GetLogRequest.h"
#include "model/GetLogResult.h"
#include "model/GetOverviewRequest.h"
#include "model/GetOverviewResult.h"
#include "model/GetWorkFlowRequest.h"
#include "model/GetWorkFlowResult.h"
#include "model/GetWorkerListRequest.h"
@@ -197,6 +199,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::GetLogResult> GetLogOutcome;
typedef std::future<GetLogOutcome> GetLogOutcomeCallable;
typedef std::function<void(const Schedulerx2Client*, const Model::GetLogRequest&, const GetLogOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetLogAsyncHandler;
typedef Outcome<Error, Model::GetOverviewResult> GetOverviewOutcome;
typedef std::future<GetOverviewOutcome> GetOverviewOutcomeCallable;
typedef std::function<void(const Schedulerx2Client*, const Model::GetOverviewRequest&, const GetOverviewOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetOverviewAsyncHandler;
typedef Outcome<Error, Model::GetWorkFlowResult> GetWorkFlowOutcome;
typedef std::future<GetWorkFlowOutcome> GetWorkFlowOutcomeCallable;
typedef std::function<void(const Schedulerx2Client*, const Model::GetWorkFlowRequest&, const GetWorkFlowOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetWorkFlowAsyncHandler;
@@ -334,6 +339,9 @@ namespace AlibabaCloud
GetLogOutcome getLog(const Model::GetLogRequest &request)const;
void getLogAsync(const Model::GetLogRequest& request, const GetLogAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetLogOutcomeCallable getLogCallable(const Model::GetLogRequest& request) const;
GetOverviewOutcome getOverview(const Model::GetOverviewRequest &request)const;
void getOverviewAsync(const Model::GetOverviewRequest& request, const GetOverviewAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetOverviewOutcomeCallable getOverviewCallable(const Model::GetOverviewRequest& request) const;
GetWorkFlowOutcome getWorkFlow(const Model::GetWorkFlowRequest &request)const;
void getWorkFlowAsync(const Model::GetWorkFlowRequest& request, const GetWorkFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetWorkFlowOutcomeCallable getWorkFlowCallable(const Model::GetWorkFlowRequest& request) const;

View File

@@ -74,6 +74,8 @@ public:
void setStatus(int status);
std::string getNamespaceSource() const;
void setNamespaceSource(const std::string &namespaceSource);
std::string getTimezone() const;
void setTimezone(const std::string &timezone);
std::string getDescription() const;
void setDescription(const std::string &description);
std::string getContent() const;
@@ -129,6 +131,7 @@ private:
std::string parameters_;
int status_;
std::string namespaceSource_;
std::string timezone_;
std::string description_;
std::string content_;
long timeout_;

View File

@@ -36,6 +36,8 @@ public:
void setGroupId(const std::string &groupId);
long getJobId() const;
void setJobId(long jobId);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string get_Namespace() const;
void set_Namespace(const std::string &_namespace);
long getJobInstanceId() const;
@@ -45,6 +47,7 @@ private:
std::string namespaceSource_;
std::string groupId_;
long jobId_;
std::string regionId_;
std::string _namespace_;
long jobInstanceId_;
};

View File

@@ -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_SCHEDULERX2_MODEL_GETOVERVIEWREQUEST_H_
#define ALIBABACLOUD_SCHEDULERX2_MODEL_GETOVERVIEWREQUEST_H_
#include <alibabacloud/schedulerx2/Schedulerx2Export.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Schedulerx2 {
namespace Model {
class ALIBABACLOUD_SCHEDULERX2_EXPORT GetOverviewRequest : public RpcServiceRequest {
public:
GetOverviewRequest();
~GetOverviewRequest();
int getMetricType() const;
void setMetricType(int metricType);
std::string getNamespaceSource() const;
void setNamespaceSource(const std::string &namespaceSource);
std::string getGroupId() const;
void setGroupId(const std::string &groupId);
long getEndTime() const;
void setEndTime(long endTime);
long getStartTime() const;
void setStartTime(long startTime);
std::string getOperate() const;
void setOperate(const std::string &operate);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string get_Namespace() const;
void set_Namespace(const std::string &_namespace);
private:
int metricType_;
std::string namespaceSource_;
std::string groupId_;
long endTime_;
long startTime_;
std::string operate_;
std::string regionId_;
std::string _namespace_;
};
} // namespace Model
} // namespace Schedulerx2
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_SCHEDULERX2_MODEL_GETOVERVIEWREQUEST_H_

View File

@@ -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_SCHEDULERX2_MODEL_GETOVERVIEWRESULT_H_
#define ALIBABACLOUD_SCHEDULERX2_MODEL_GETOVERVIEWRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/schedulerx2/Schedulerx2Export.h>
namespace AlibabaCloud
{
namespace Schedulerx2
{
namespace Model
{
class ALIBABACLOUD_SCHEDULERX2_EXPORT GetOverviewResult : public ServiceResult
{
public:
GetOverviewResult();
explicit GetOverviewResult(const std::string &payload);
~GetOverviewResult();
std::string getMessage()const;
std::string getData()const;
int getCode()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::string data_;
int code_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_SCHEDULERX2_MODEL_GETOVERVIEWRESULT_H_

View File

@@ -32,6 +32,8 @@ public:
~ListGroupsRequest();
std::string getNamespaceSource() const;
void setNamespaceSource(const std::string &namespaceSource);
std::string getAppGroupName() const;
void setAppGroupName(const std::string &appGroupName);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string get_Namespace() const;
@@ -39,6 +41,7 @@ public:
private:
std::string namespaceSource_;
std::string appGroupName_;
std::string regionId_;
std::string _namespace_;
};

View File

@@ -30,11 +30,17 @@ class ALIBABACLOUD_SCHEDULERX2_EXPORT ListNamespacesRequest : public RpcServiceR
public:
ListNamespacesRequest();
~ListNamespacesRequest();
std::string getNamespaceName() const;
void setNamespaceName(const std::string &namespaceName);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string get_Namespace() const;
void set_Namespace(const std::string &_namespace);
private:
std::string namespaceName_;
std::string regionId_;
std::string _namespace_;
};
} // namespace Model
} // namespace Schedulerx2

View File

@@ -70,8 +70,12 @@ public:
void setTimeType(int timeType);
std::string getParameters() const;
void setParameters(const std::string &parameters);
std::string get_Template() const;
void set_Template(const std::string &_template);
std::string getNamespaceSource() const;
void setNamespaceSource(const std::string &namespaceSource);
std::string getTimezone() const;
void setTimezone(const std::string &timezone);
std::string getDescription() const;
void setDescription(const std::string &description);
std::string getContent() const;
@@ -104,6 +108,8 @@ public:
void setClassName(const std::string &className);
std::string get_Namespace() const;
void set_Namespace(const std::string &_namespace);
std::string getXAttrs() const;
void setXAttrs(const std::string &xAttrs);
int getMaxConcurrency() const;
void setMaxConcurrency(int maxConcurrency);
@@ -125,7 +131,9 @@ private:
std::string name_;
int timeType_;
std::string parameters_;
std::string _template_;
std::string namespaceSource_;
std::string timezone_;
std::string description_;
std::string content_;
long timeout_;
@@ -142,6 +150,7 @@ private:
int queueSize_;
std::string className_;
std::string _namespace_;
std::string xAttrs_;
int maxConcurrency_;
};
} // namespace Model

View File

@@ -987,6 +987,42 @@ Schedulerx2Client::GetLogOutcomeCallable Schedulerx2Client::getLogCallable(const
return task->get_future();
}
Schedulerx2Client::GetOverviewOutcome Schedulerx2Client::getOverview(const GetOverviewRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetOverviewOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetOverviewOutcome(GetOverviewResult(outcome.result()));
else
return GetOverviewOutcome(outcome.error());
}
void Schedulerx2Client::getOverviewAsync(const GetOverviewRequest& request, const GetOverviewAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getOverview(request), context);
};
asyncExecute(new Runnable(fn));
}
Schedulerx2Client::GetOverviewOutcomeCallable Schedulerx2Client::getOverviewCallable(const GetOverviewRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetOverviewOutcome()>>(
[this, request]()
{
return this->getOverview(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Schedulerx2Client::GetWorkFlowOutcome Schedulerx2Client::getWorkFlow(const GetWorkFlowRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -203,6 +203,15 @@ void CreateJobRequest::setNamespaceSource(const std::string &namespaceSource) {
setBodyParameter(std::string("NamespaceSource"), namespaceSource);
}
std::string CreateJobRequest::getTimezone() const {
return timezone_;
}
void CreateJobRequest::setTimezone(const std::string &timezone) {
timezone_ = timezone;
setBodyParameter(std::string("Timezone"), timezone);
}
std::string CreateJobRequest::getDescription() const {
return description_;
}

View File

@@ -52,6 +52,15 @@ void GetJobInstanceRequest::setJobId(long jobId) {
setParameter(std::string("JobId"), std::to_string(jobId));
}
std::string GetJobInstanceRequest::getRegionId() const {
return regionId_;
}
void GetJobInstanceRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string GetJobInstanceRequest::get_Namespace() const {
return _namespace_;
}

View File

@@ -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 <alibabacloud/schedulerx2/model/GetOverviewRequest.h>
using AlibabaCloud::Schedulerx2::Model::GetOverviewRequest;
GetOverviewRequest::GetOverviewRequest()
: RpcServiceRequest("schedulerx2", "2019-04-30", "GetOverview") {
setMethod(HttpRequest::Method::Post);
}
GetOverviewRequest::~GetOverviewRequest() {}
int GetOverviewRequest::getMetricType() const {
return metricType_;
}
void GetOverviewRequest::setMetricType(int metricType) {
metricType_ = metricType;
setParameter(std::string("MetricType"), std::to_string(metricType));
}
std::string GetOverviewRequest::getNamespaceSource() const {
return namespaceSource_;
}
void GetOverviewRequest::setNamespaceSource(const std::string &namespaceSource) {
namespaceSource_ = namespaceSource;
setParameter(std::string("NamespaceSource"), namespaceSource);
}
std::string GetOverviewRequest::getGroupId() const {
return groupId_;
}
void GetOverviewRequest::setGroupId(const std::string &groupId) {
groupId_ = groupId;
setParameter(std::string("GroupId"), groupId);
}
long GetOverviewRequest::getEndTime() const {
return endTime_;
}
void GetOverviewRequest::setEndTime(long endTime) {
endTime_ = endTime;
setParameter(std::string("EndTime"), std::to_string(endTime));
}
long GetOverviewRequest::getStartTime() const {
return startTime_;
}
void GetOverviewRequest::setStartTime(long startTime) {
startTime_ = startTime;
setParameter(std::string("StartTime"), std::to_string(startTime));
}
std::string GetOverviewRequest::getOperate() const {
return operate_;
}
void GetOverviewRequest::setOperate(const std::string &operate) {
operate_ = operate;
setParameter(std::string("Operate"), operate);
}
std::string GetOverviewRequest::getRegionId() const {
return regionId_;
}
void GetOverviewRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string GetOverviewRequest::get_Namespace() const {
return _namespace_;
}
void GetOverviewRequest::set_Namespace(const std::string &_namespace) {
_namespace_ = _namespace;
setParameter(std::string("Namespace"), _namespace);
}

View File

@@ -0,0 +1,72 @@
/*
* 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/schedulerx2/model/GetOverviewResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Schedulerx2;
using namespace AlibabaCloud::Schedulerx2::Model;
GetOverviewResult::GetOverviewResult() :
ServiceResult()
{}
GetOverviewResult::GetOverviewResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetOverviewResult::~GetOverviewResult()
{}
void GetOverviewResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Data"].isNull())
data_ = value["Data"].asString();
}
std::string GetOverviewResult::getMessage()const
{
return message_;
}
std::string GetOverviewResult::getData()const
{
return data_;
}
int GetOverviewResult::getCode()const
{
return code_;
}
bool GetOverviewResult::getSuccess()const
{
return success_;
}

View File

@@ -20,7 +20,7 @@ using AlibabaCloud::Schedulerx2::Model::ListGroupsRequest;
ListGroupsRequest::ListGroupsRequest()
: RpcServiceRequest("schedulerx2", "2019-04-30", "ListGroups") {
setMethod(HttpRequest::Method::Get);
setMethod(HttpRequest::Method::Post);
}
ListGroupsRequest::~ListGroupsRequest() {}
@@ -34,6 +34,15 @@ void ListGroupsRequest::setNamespaceSource(const std::string &namespaceSource) {
setParameter(std::string("NamespaceSource"), namespaceSource);
}
std::string ListGroupsRequest::getAppGroupName() const {
return appGroupName_;
}
void ListGroupsRequest::setAppGroupName(const std::string &appGroupName) {
appGroupName_ = appGroupName;
setParameter(std::string("AppGroupName"), appGroupName);
}
std::string ListGroupsRequest::getRegionId() const {
return regionId_;
}

View File

@@ -20,11 +20,20 @@ using AlibabaCloud::Schedulerx2::Model::ListNamespacesRequest;
ListNamespacesRequest::ListNamespacesRequest()
: RpcServiceRequest("schedulerx2", "2019-04-30", "ListNamespaces") {
setMethod(HttpRequest::Method::Get);
setMethod(HttpRequest::Method::Post);
}
ListNamespacesRequest::~ListNamespacesRequest() {}
std::string ListNamespacesRequest::getNamespaceName() const {
return namespaceName_;
}
void ListNamespacesRequest::setNamespaceName(const std::string &namespaceName) {
namespaceName_ = namespaceName;
setParameter(std::string("NamespaceName"), namespaceName);
}
std::string ListNamespacesRequest::getRegionId() const {
return regionId_;
}
@@ -34,3 +43,12 @@ void ListNamespacesRequest::setRegionId(const std::string &regionId) {
setParameter(std::string("RegionId"), regionId);
}
std::string ListNamespacesRequest::get_Namespace() const {
return _namespace_;
}
void ListNamespacesRequest::set_Namespace(const std::string &_namespace) {
_namespace_ = _namespace;
setParameter(std::string("Namespace"), _namespace);
}

View File

@@ -185,6 +185,15 @@ void UpdateJobRequest::setParameters(const std::string &parameters) {
setBodyParameter(std::string("Parameters"), parameters);
}
std::string UpdateJobRequest::get_Template() const {
return _template_;
}
void UpdateJobRequest::set_Template(const std::string &_template) {
_template_ = _template;
setBodyParameter(std::string("Template"), _template);
}
std::string UpdateJobRequest::getNamespaceSource() const {
return namespaceSource_;
}
@@ -194,6 +203,15 @@ void UpdateJobRequest::setNamespaceSource(const std::string &namespaceSource) {
setBodyParameter(std::string("NamespaceSource"), namespaceSource);
}
std::string UpdateJobRequest::getTimezone() const {
return timezone_;
}
void UpdateJobRequest::setTimezone(const std::string &timezone) {
timezone_ = timezone;
setBodyParameter(std::string("Timezone"), timezone);
}
std::string UpdateJobRequest::getDescription() const {
return description_;
}
@@ -338,6 +356,15 @@ void UpdateJobRequest::set_Namespace(const std::string &_namespace) {
setBodyParameter(std::string("Namespace"), _namespace);
}
std::string UpdateJobRequest::getXAttrs() const {
return xAttrs_;
}
void UpdateJobRequest::setXAttrs(const std::string &xAttrs) {
xAttrs_ = xAttrs;
setBodyParameter(std::string("XAttrs"), xAttrs);
}
int UpdateJobRequest::getMaxConcurrency() const {
return maxConcurrency_;
}