Support TemplateContent.

This commit is contained in:
sdk-team
2020-12-02 09:17:21 +00:00
parent d28ae22685
commit 357519c7f6
16 changed files with 593 additions and 14 deletions

View File

@@ -735,6 +735,42 @@ OosClient::GetSecretParametersByPathOutcomeCallable OosClient::getSecretParamete
return task->get_future();
}
OosClient::GetServiceSettingsOutcome OosClient::getServiceSettings(const GetServiceSettingsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetServiceSettingsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetServiceSettingsOutcome(GetServiceSettingsResult(outcome.result()));
else
return GetServiceSettingsOutcome(outcome.error());
}
void OosClient::getServiceSettingsAsync(const GetServiceSettingsRequest& request, const GetServiceSettingsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getServiceSettings(request), context);
};
asyncExecute(new Runnable(fn));
}
OosClient::GetServiceSettingsOutcomeCallable OosClient::getServiceSettingsCallable(const GetServiceSettingsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetServiceSettingsOutcome()>>(
[this, request]()
{
return this->getServiceSettings(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OosClient::GetTemplateOutcome OosClient::getTemplate(const GetTemplateRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1419,6 +1455,42 @@ OosClient::SearchInventoryOutcomeCallable OosClient::searchInventoryCallable(con
return task->get_future();
}
OosClient::SetServiceSettingsOutcome OosClient::setServiceSettings(const SetServiceSettingsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return SetServiceSettingsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return SetServiceSettingsOutcome(SetServiceSettingsResult(outcome.result()));
else
return SetServiceSettingsOutcome(outcome.error());
}
void OosClient::setServiceSettingsAsync(const SetServiceSettingsRequest& request, const SetServiceSettingsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, setServiceSettings(request), context);
};
asyncExecute(new Runnable(fn));
}
OosClient::SetServiceSettingsOutcomeCallable OosClient::setServiceSettingsCallable(const SetServiceSettingsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<SetServiceSettingsOutcome()>>(
[this, request]()
{
return this->setServiceSettings(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
OosClient::StartExecutionOutcome OosClient::startExecution(const StartExecutionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -47,14 +47,14 @@ void GetInventorySchemaResult::parse(const std::string &payload)
schemasObject.typeName = valueSchemasSchema["TypeName"].asString();
if(!valueSchemasSchema["Version"].isNull())
schemasObject.version = valueSchemasSchema["Version"].asString();
auto allAttributesNode = allSchemasNode["Attributes"]["Attribute"];
for (auto allSchemasNodeAttributesAttribute : allAttributesNode)
auto allAttributesNode = valueSchemasSchema["Attributes"]["Attribute"];
for (auto valueSchemasSchemaAttributesAttribute : allAttributesNode)
{
Schema::Attribute attributesObject;
if(!allSchemasNodeAttributesAttribute["Name"].isNull())
attributesObject.name = allSchemasNodeAttributesAttribute["Name"].asString();
if(!allSchemasNodeAttributesAttribute["DataType"].isNull())
attributesObject.dataType = allSchemasNodeAttributesAttribute["DataType"].asString();
if(!valueSchemasSchemaAttributesAttribute["Name"].isNull())
attributesObject.name = valueSchemasSchemaAttributesAttribute["Name"].asString();
if(!valueSchemasSchemaAttributesAttribute["DataType"].isNull())
attributesObject.dataType = valueSchemasSchemaAttributesAttribute["DataType"].asString();
schemasObject.attributes.push_back(attributesObject);
}
schemas_.push_back(schemasObject);

View File

@@ -0,0 +1,29 @@
/*
* 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/oos/model/GetServiceSettingsRequest.h>
using AlibabaCloud::Oos::Model::GetServiceSettingsRequest;
GetServiceSettingsRequest::GetServiceSettingsRequest() :
RpcServiceRequest("oos", "2019-06-01", "GetServiceSettings")
{
setMethod(HttpRequest::Method::Post);
}
GetServiceSettingsRequest::~GetServiceSettingsRequest()
{}

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/oos/model/GetServiceSettingsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Oos;
using namespace AlibabaCloud::Oos::Model;
GetServiceSettingsResult::GetServiceSettingsResult() :
ServiceResult()
{}
GetServiceSettingsResult::GetServiceSettingsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetServiceSettingsResult::~GetServiceSettingsResult()
{}
void GetServiceSettingsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allServiceSettingsNode = value["ServiceSettings"]["ServiceSetting"];
for (auto valueServiceSettingsServiceSetting : allServiceSettingsNode)
{
ServiceSetting serviceSettingsObject;
if(!valueServiceSettingsServiceSetting["DeliveryOssEnabled"].isNull())
serviceSettingsObject.deliveryOssEnabled = valueServiceSettingsServiceSetting["DeliveryOssEnabled"].asString() == "true";
if(!valueServiceSettingsServiceSetting["DeliveryOssBucketName"].isNull())
serviceSettingsObject.deliveryOssBucketName = valueServiceSettingsServiceSetting["DeliveryOssBucketName"].asString();
if(!valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].isNull())
serviceSettingsObject.deliveryOssKeyPrefix = valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].asString();
if(!valueServiceSettingsServiceSetting["DeliverySlsEnabled"].isNull())
serviceSettingsObject.deliverySlsEnabled = valueServiceSettingsServiceSetting["DeliverySlsEnabled"].asString() == "true";
if(!valueServiceSettingsServiceSetting["DeliverySlsProjectName"].isNull())
serviceSettingsObject.deliverySlsProjectName = valueServiceSettingsServiceSetting["DeliverySlsProjectName"].asString();
serviceSettings_.push_back(serviceSettingsObject);
}
}
std::vector<GetServiceSettingsResult::ServiceSetting> GetServiceSettingsResult::getServiceSettings()const
{
return serviceSettings_;
}

View File

@@ -101,16 +101,16 @@ void ListExecutionsResult::parse(const std::string &payload)
executionsObject.lastSuccessfulTriggerTime = valueExecutionsExecution["LastSuccessfulTriggerTime"].asString();
if(!valueExecutionsExecution["ResourceStatus"].isNull())
executionsObject.resourceStatus = valueExecutionsExecution["ResourceStatus"].asString();
auto allCurrentTasksNode = allExecutionsNode["CurrentTasks"]["CurrentTask"];
for (auto allExecutionsNodeCurrentTasksCurrentTask : allCurrentTasksNode)
auto allCurrentTasksNode = valueExecutionsExecution["CurrentTasks"]["CurrentTask"];
for (auto valueExecutionsExecutionCurrentTasksCurrentTask : allCurrentTasksNode)
{
Execution::CurrentTask currentTasksObject;
if(!allExecutionsNodeCurrentTasksCurrentTask["TaskExecutionId"].isNull())
currentTasksObject.taskExecutionId = allExecutionsNodeCurrentTasksCurrentTask["TaskExecutionId"].asString();
if(!allExecutionsNodeCurrentTasksCurrentTask["TaskName"].isNull())
currentTasksObject.taskName = allExecutionsNodeCurrentTasksCurrentTask["TaskName"].asString();
if(!allExecutionsNodeCurrentTasksCurrentTask["TaskAction"].isNull())
currentTasksObject.taskAction = allExecutionsNodeCurrentTasksCurrentTask["TaskAction"].asString();
if(!valueExecutionsExecutionCurrentTasksCurrentTask["TaskExecutionId"].isNull())
currentTasksObject.taskExecutionId = valueExecutionsExecutionCurrentTasksCurrentTask["TaskExecutionId"].asString();
if(!valueExecutionsExecutionCurrentTasksCurrentTask["TaskName"].isNull())
currentTasksObject.taskName = valueExecutionsExecutionCurrentTasksCurrentTask["TaskName"].asString();
if(!valueExecutionsExecutionCurrentTasksCurrentTask["TaskAction"].isNull())
currentTasksObject.taskAction = valueExecutionsExecutionCurrentTasksCurrentTask["TaskAction"].asString();
executionsObject.currentTasks.push_back(currentTasksObject);
}
executions_.push_back(executionsObject);

View File

@@ -0,0 +1,84 @@
/*
* 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/oos/model/SetServiceSettingsRequest.h>
using AlibabaCloud::Oos::Model::SetServiceSettingsRequest;
SetServiceSettingsRequest::SetServiceSettingsRequest() :
RpcServiceRequest("oos", "2019-06-01", "SetServiceSettings")
{
setMethod(HttpRequest::Method::Post);
}
SetServiceSettingsRequest::~SetServiceSettingsRequest()
{}
bool SetServiceSettingsRequest::getDeliverySlsEnabled()const
{
return deliverySlsEnabled_;
}
void SetServiceSettingsRequest::setDeliverySlsEnabled(bool deliverySlsEnabled)
{
deliverySlsEnabled_ = deliverySlsEnabled;
setParameter("DeliverySlsEnabled", deliverySlsEnabled ? "true" : "false");
}
std::string SetServiceSettingsRequest::getDeliveryOssKeyPrefix()const
{
return deliveryOssKeyPrefix_;
}
void SetServiceSettingsRequest::setDeliveryOssKeyPrefix(const std::string& deliveryOssKeyPrefix)
{
deliveryOssKeyPrefix_ = deliveryOssKeyPrefix;
setParameter("DeliveryOssKeyPrefix", deliveryOssKeyPrefix);
}
bool SetServiceSettingsRequest::getDeliveryOssEnabled()const
{
return deliveryOssEnabled_;
}
void SetServiceSettingsRequest::setDeliveryOssEnabled(bool deliveryOssEnabled)
{
deliveryOssEnabled_ = deliveryOssEnabled;
setParameter("DeliveryOssEnabled", deliveryOssEnabled ? "true" : "false");
}
std::string SetServiceSettingsRequest::getDeliverySlsProjectName()const
{
return deliverySlsProjectName_;
}
void SetServiceSettingsRequest::setDeliverySlsProjectName(const std::string& deliverySlsProjectName)
{
deliverySlsProjectName_ = deliverySlsProjectName;
setParameter("DeliverySlsProjectName", deliverySlsProjectName);
}
std::string SetServiceSettingsRequest::getDeliveryOssBucketName()const
{
return deliveryOssBucketName_;
}
void SetServiceSettingsRequest::setDeliveryOssBucketName(const std::string& deliveryOssBucketName)
{
deliveryOssBucketName_ = deliveryOssBucketName;
setParameter("DeliveryOssBucketName", deliveryOssBucketName);
}

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/oos/model/SetServiceSettingsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Oos;
using namespace AlibabaCloud::Oos::Model;
SetServiceSettingsResult::SetServiceSettingsResult() :
ServiceResult()
{}
SetServiceSettingsResult::SetServiceSettingsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
SetServiceSettingsResult::~SetServiceSettingsResult()
{}
void SetServiceSettingsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allServiceSettingsNode = value["ServiceSettings"]["ServiceSetting"];
for (auto valueServiceSettingsServiceSetting : allServiceSettingsNode)
{
ServiceSetting serviceSettingsObject;
if(!valueServiceSettingsServiceSetting["DeliveryOssEnabled"].isNull())
serviceSettingsObject.deliveryOssEnabled = valueServiceSettingsServiceSetting["DeliveryOssEnabled"].asString() == "true";
if(!valueServiceSettingsServiceSetting["DeliveryOssBucketName"].isNull())
serviceSettingsObject.deliveryOssBucketName = valueServiceSettingsServiceSetting["DeliveryOssBucketName"].asString();
if(!valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].isNull())
serviceSettingsObject.deliveryOssKeyPrefix = valueServiceSettingsServiceSetting["DeliveryOssKeyPrefix"].asString();
if(!valueServiceSettingsServiceSetting["DeliverySlsEnabled"].isNull())
serviceSettingsObject.deliverySlsEnabled = valueServiceSettingsServiceSetting["DeliverySlsEnabled"].asString() == "true";
if(!valueServiceSettingsServiceSetting["DeliverySlsProjectName"].isNull())
serviceSettingsObject.deliverySlsProjectName = valueServiceSettingsServiceSetting["DeliverySlsProjectName"].asString();
serviceSettings_.push_back(serviceSettingsObject);
}
}
std::vector<SetServiceSettingsResult::ServiceSetting> SetServiceSettingsResult::getServiceSettings()const
{
return serviceSettings_;
}

View File

@@ -126,6 +126,17 @@ void StartExecutionRequest::setTags(const std::map<std::string, std::string>& ta
setJsonParameters("Tags", tags);
}
std::string StartExecutionRequest::getTemplateContent()const
{
return templateContent_;
}
void StartExecutionRequest::setTemplateContent(const std::string& templateContent)
{
templateContent_ = templateContent;
setParameter("TemplateContent", templateContent);
}
std::string StartExecutionRequest::getParentExecutionId()const
{
return parentExecutionId_;