Get Job Support Query By Job Name.

This commit is contained in:
sdk-team
2022-03-21 07:50:30 +00:00
parent adf8ff200a
commit b924b1d42c
17 changed files with 356 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2022-03-21 Version: 1.36.1087
- Get Job Support Query By Job Name.
- Add Api Create Namespace.
- Create App Support Set User Defined App Key.
2022-03-18 Version: 1.36.1086
- Supported CreateStandardGroup, ListStandardGroups API.

View File

@@ -1 +1 @@
1.36.1086
1.36.1087

View File

@@ -31,6 +31,8 @@ set(schedulerx2_public_header_model
include/alibabacloud/schedulerx2/model/CreateAppGroupResult.h
include/alibabacloud/schedulerx2/model/CreateJobRequest.h
include/alibabacloud/schedulerx2/model/CreateJobResult.h
include/alibabacloud/schedulerx2/model/CreateNamespaceRequest.h
include/alibabacloud/schedulerx2/model/CreateNamespaceResult.h
include/alibabacloud/schedulerx2/model/DeleteJobRequest.h
include/alibabacloud/schedulerx2/model/DeleteJobResult.h
include/alibabacloud/schedulerx2/model/DeleteWorkflowRequest.h
@@ -88,6 +90,8 @@ set(schedulerx2_src
src/model/CreateAppGroupResult.cc
src/model/CreateJobRequest.cc
src/model/CreateJobResult.cc
src/model/CreateNamespaceRequest.cc
src/model/CreateNamespaceResult.cc
src/model/DeleteJobRequest.cc
src/model/DeleteJobResult.cc
src/model/DeleteWorkflowRequest.cc

View File

@@ -32,6 +32,8 @@
#include "model/CreateAppGroupResult.h"
#include "model/CreateJobRequest.h"
#include "model/CreateJobResult.h"
#include "model/CreateNamespaceRequest.h"
#include "model/CreateNamespaceResult.h"
#include "model/DeleteJobRequest.h"
#include "model/DeleteJobResult.h"
#include "model/DeleteWorkflowRequest.h"
@@ -100,6 +102,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::CreateJobResult> CreateJobOutcome;
typedef std::future<CreateJobOutcome> CreateJobOutcomeCallable;
typedef std::function<void(const Schedulerx2Client*, const Model::CreateJobRequest&, const CreateJobOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateJobAsyncHandler;
typedef Outcome<Error, Model::CreateNamespaceResult> CreateNamespaceOutcome;
typedef std::future<CreateNamespaceOutcome> CreateNamespaceOutcomeCallable;
typedef std::function<void(const Schedulerx2Client*, const Model::CreateNamespaceRequest&, const CreateNamespaceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateNamespaceAsyncHandler;
typedef Outcome<Error, Model::DeleteJobResult> DeleteJobOutcome;
typedef std::future<DeleteJobOutcome> DeleteJobOutcomeCallable;
typedef std::function<void(const Schedulerx2Client*, const Model::DeleteJobRequest&, const DeleteJobOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteJobAsyncHandler;
@@ -186,6 +191,9 @@ namespace AlibabaCloud
CreateJobOutcome createJob(const Model::CreateJobRequest &request)const;
void createJobAsync(const Model::CreateJobRequest& request, const CreateJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateJobOutcomeCallable createJobCallable(const Model::CreateJobRequest& request) const;
CreateNamespaceOutcome createNamespace(const Model::CreateNamespaceRequest &request)const;
void createNamespaceAsync(const Model::CreateNamespaceRequest& request, const CreateNamespaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateNamespaceOutcomeCallable createNamespaceCallable(const Model::CreateNamespaceRequest& request) const;
DeleteJobOutcome deleteJob(const Model::DeleteJobRequest &request)const;
void deleteJobAsync(const Model::DeleteJobRequest& request, const DeleteJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DeleteJobOutcomeCallable deleteJobCallable(const Model::DeleteJobRequest& request) const;

View File

@@ -42,6 +42,8 @@ public:
void setGroupId(const std::string &groupId);
std::string getDescription() const;
void setDescription(const std::string &description);
std::string getMonitorConfigJson() const;
void setMonitorConfigJson(const std::string &monitorConfigJson);
std::string getAppName() const;
void setAppName(const std::string &appName);
std::string getRegionId() const;
@@ -50,6 +52,10 @@ public:
void set_Namespace(const std::string &_namespace);
std::string getAlarmJson() const;
void setAlarmJson(const std::string &alarmJson);
std::string getAppKey() const;
void setAppKey(const std::string &appKey);
std::string getMonitorContactsJson() const;
void setMonitorContactsJson(const std::string &monitorContactsJson);
private:
int maxJobs_;
@@ -58,10 +64,13 @@ private:
std::string metricsThresholdJson_;
std::string groupId_;
std::string description_;
std::string monitorConfigJson_;
std::string appName_;
std::string regionId_;
std::string _namespace_;
std::string alarmJson_;
std::string appKey_;
std::string monitorContactsJson_;
};
} // namespace Model
} // namespace Schedulerx2

View File

@@ -35,6 +35,7 @@ namespace AlibabaCloud
struct Data
{
long appGroupId;
std::string appKey;
};

View File

@@ -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_SCHEDULERX2_MODEL_CREATENAMESPACEREQUEST_H_
#define ALIBABACLOUD_SCHEDULERX2_MODEL_CREATENAMESPACEREQUEST_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 CreateNamespaceRequest : public RpcServiceRequest {
public:
CreateNamespaceRequest();
~CreateNamespaceRequest();
std::string getUid() const;
void setUid(const std::string &uid);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getName() const;
void setName(const std::string &name);
std::string getDescription() const;
void setDescription(const std::string &description);
private:
std::string uid_;
std::string regionId_;
std::string name_;
std::string description_;
};
} // namespace Model
} // namespace Schedulerx2
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_SCHEDULERX2_MODEL_CREATENAMESPACEREQUEST_H_

View File

@@ -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_SCHEDULERX2_MODEL_CREATENAMESPACERESULT_H_
#define ALIBABACLOUD_SCHEDULERX2_MODEL_CREATENAMESPACERESULT_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 CreateNamespaceResult : public ServiceResult
{
public:
struct Data
{
std::string namespaceUid;
};
CreateNamespaceResult();
explicit CreateNamespaceResult(const std::string &payload);
~CreateNamespaceResult();
std::string getMessage()const;
Data getData()const;
int getCode()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
int code_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_SCHEDULERX2_MODEL_CREATENAMESPACERESULT_H_

View File

@@ -40,6 +40,8 @@ public:
void setRegionId(const std::string &regionId);
std::string get_Namespace() const;
void set_Namespace(const std::string &_namespace);
std::string getJobName() const;
void setJobName(const std::string &jobName);
private:
std::string namespaceSource_;
@@ -47,6 +49,7 @@ private:
long jobId_;
std::string regionId_;
std::string _namespace_;
std::string jobName_;
};
} // namespace Model
} // namespace Schedulerx2

View File

@@ -87,6 +87,7 @@ namespace AlibabaCloud
std::string className;
int attemptInterval;
std::string executeMode;
long jobId;
};
JobConfigInfo jobConfigInfo;
};

View File

@@ -231,6 +231,42 @@ Schedulerx2Client::CreateJobOutcomeCallable Schedulerx2Client::createJobCallable
return task->get_future();
}
Schedulerx2Client::CreateNamespaceOutcome Schedulerx2Client::createNamespace(const CreateNamespaceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateNamespaceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateNamespaceOutcome(CreateNamespaceResult(outcome.result()));
else
return CreateNamespaceOutcome(outcome.error());
}
void Schedulerx2Client::createNamespaceAsync(const CreateNamespaceRequest& request, const CreateNamespaceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createNamespace(request), context);
};
asyncExecute(new Runnable(fn));
}
Schedulerx2Client::CreateNamespaceOutcomeCallable Schedulerx2Client::createNamespaceCallable(const CreateNamespaceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateNamespaceOutcome()>>(
[this, request]()
{
return this->createNamespace(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Schedulerx2Client::DeleteJobOutcome Schedulerx2Client::deleteJob(const DeleteJobRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -79,6 +79,15 @@ void CreateAppGroupRequest::setDescription(const std::string &description) {
setParameter(std::string("Description"), description);
}
std::string CreateAppGroupRequest::getMonitorConfigJson() const {
return monitorConfigJson_;
}
void CreateAppGroupRequest::setMonitorConfigJson(const std::string &monitorConfigJson) {
monitorConfigJson_ = monitorConfigJson;
setParameter(std::string("MonitorConfigJson"), monitorConfigJson);
}
std::string CreateAppGroupRequest::getAppName() const {
return appName_;
}
@@ -115,3 +124,21 @@ void CreateAppGroupRequest::setAlarmJson(const std::string &alarmJson) {
setParameter(std::string("AlarmJson"), alarmJson);
}
std::string CreateAppGroupRequest::getAppKey() const {
return appKey_;
}
void CreateAppGroupRequest::setAppKey(const std::string &appKey) {
appKey_ = appKey;
setParameter(std::string("AppKey"), appKey);
}
std::string CreateAppGroupRequest::getMonitorContactsJson() const {
return monitorContactsJson_;
}
void CreateAppGroupRequest::setMonitorContactsJson(const std::string &monitorContactsJson) {
monitorContactsJson_ = monitorContactsJson;
setParameter(std::string("MonitorContactsJson"), monitorContactsJson);
}

View File

@@ -42,6 +42,8 @@ void CreateAppGroupResult::parse(const std::string &payload)
auto dataNode = value["Data"];
if(!dataNode["AppGroupId"].isNull())
data_.appGroupId = std::stol(dataNode["AppGroupId"].asString());
if(!dataNode["AppKey"].isNull())
data_.appKey = dataNode["AppKey"].asString();
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
if(!value["Message"].isNull())

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.
*/
#include <alibabacloud/schedulerx2/model/CreateNamespaceRequest.h>
using AlibabaCloud::Schedulerx2::Model::CreateNamespaceRequest;
CreateNamespaceRequest::CreateNamespaceRequest()
: RpcServiceRequest("schedulerx2", "2019-04-30", "CreateNamespace") {
setMethod(HttpRequest::Method::Post);
}
CreateNamespaceRequest::~CreateNamespaceRequest() {}
std::string CreateNamespaceRequest::getUid() const {
return uid_;
}
void CreateNamespaceRequest::setUid(const std::string &uid) {
uid_ = uid;
setParameter(std::string("Uid"), uid);
}
std::string CreateNamespaceRequest::getRegionId() const {
return regionId_;
}
void CreateNamespaceRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string CreateNamespaceRequest::getName() const {
return name_;
}
void CreateNamespaceRequest::setName(const std::string &name) {
name_ = name;
setParameter(std::string("Name"), name);
}
std::string CreateNamespaceRequest::getDescription() const {
return description_;
}
void CreateNamespaceRequest::setDescription(const std::string &description) {
description_ = description;
setParameter(std::string("Description"), description);
}

View File

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

View File

@@ -70,3 +70,12 @@ void GetJobInfoRequest::set_Namespace(const std::string &_namespace) {
setParameter(std::string("Namespace"), _namespace);
}
std::string GetJobInfoRequest::getJobName() const {
return jobName_;
}
void GetJobInfoRequest::setJobName(const std::string &jobName) {
jobName_ = jobName;
setParameter(std::string("JobName"), jobName);
}

View File

@@ -41,6 +41,8 @@ void GetJobInfoResult::parse(const std::string &payload)
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto jobConfigInfoNode = dataNode["JobConfigInfo"];
if(!jobConfigInfoNode["JobId"].isNull())
data_.jobConfigInfo.jobId = std::stol(jobConfigInfoNode["JobId"].asString());
if(!jobConfigInfoNode["Status"].isNull())
data_.jobConfigInfo.status = std::stoi(jobConfigInfoNode["Status"].asString());
if(!jobConfigInfoNode["Parameters"].isNull())