RunasUserPassword is not required in CreateJobFile.

This commit is contained in:
sdk-team
2022-11-21 07:17:08 +00:00
parent 14f9dd0353
commit 3b6ccb6d6f
8 changed files with 307 additions and 1 deletions

View File

@@ -1887,6 +1887,42 @@ EHPCClient::GetIfEcsTypeSupportHtConfigOutcomeCallable EHPCClient::getIfEcsTypeS
return task->get_future();
}
EHPCClient::GetJobLogOutcome EHPCClient::getJobLog(const GetJobLogRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetJobLogOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetJobLogOutcome(GetJobLogResult(outcome.result()));
else
return GetJobLogOutcome(outcome.error());
}
void EHPCClient::getJobLogAsync(const GetJobLogRequest& request, const GetJobLogAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getJobLog(request), context);
};
asyncExecute(new Runnable(fn));
}
EHPCClient::GetJobLogOutcomeCallable EHPCClient::getJobLogCallable(const GetJobLogRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetJobLogOutcome()>>(
[this, request]()
{
return this->getJobLog(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
EHPCClient::GetPostScriptsOutcome EHPCClient::getPostScripts(const GetPostScriptsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,81 @@
/*
* 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/ehpc/model/GetJobLogRequest.h>
using AlibabaCloud::EHPC::Model::GetJobLogRequest;
GetJobLogRequest::GetJobLogRequest()
: RpcServiceRequest("ehpc", "2018-04-12", "GetJobLog") {
setMethod(HttpRequest::Method::Get);
}
GetJobLogRequest::~GetJobLogRequest() {}
long GetJobLogRequest::getOffset() const {
return offset_;
}
void GetJobLogRequest::setOffset(long offset) {
offset_ = offset;
setParameter(std::string("Offset"), std::to_string(offset));
}
std::string GetJobLogRequest::getExecHost() const {
return execHost_;
}
void GetJobLogRequest::setExecHost(const std::string &execHost) {
execHost_ = execHost;
setParameter(std::string("ExecHost"), execHost);
}
std::string GetJobLogRequest::getClusterId() const {
return clusterId_;
}
void GetJobLogRequest::setClusterId(const std::string &clusterId) {
clusterId_ = clusterId;
setParameter(std::string("ClusterId"), clusterId);
}
std::string GetJobLogRequest::getAccessKeyId() const {
return accessKeyId_;
}
void GetJobLogRequest::setAccessKeyId(const std::string &accessKeyId) {
accessKeyId_ = accessKeyId;
setParameter(std::string("AccessKeyId"), accessKeyId);
}
std::string GetJobLogRequest::getJobId() const {
return jobId_;
}
void GetJobLogRequest::setJobId(const std::string &jobId) {
jobId_ = jobId;
setParameter(std::string("JobId"), jobId);
}
int GetJobLogRequest::getSize() const {
return size_;
}
void GetJobLogRequest::setSize(int size) {
size_ = size;
setParameter(std::string("Size"), std::to_string(size));
}

View File

@@ -0,0 +1,65 @@
/*
* 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/ehpc/model/GetJobLogResult.h>
#include <json/json.h>
using namespace AlibabaCloud::EHPC;
using namespace AlibabaCloud::EHPC::Model;
GetJobLogResult::GetJobLogResult() :
ServiceResult()
{}
GetJobLogResult::GetJobLogResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetJobLogResult::~GetJobLogResult()
{}
void GetJobLogResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["JobId"].isNull())
jobId_ = value["JobId"].asString();
if(!value["OutputLog"].isNull())
outputLog_ = value["OutputLog"].asString();
if(!value["ErrorLog"].isNull())
errorLog_ = value["ErrorLog"].asString();
}
std::string GetJobLogResult::getOutputLog()const
{
return outputLog_;
}
std::string GetJobLogResult::getErrorLog()const
{
return errorLog_;
}
std::string GetJobLogResult::getJobId()const
{
return jobId_;
}