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

@@ -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_;
}