Add status operation api.

This commit is contained in:
sdk-team
2024-06-18 09:20:10 +00:00
parent 4a7816979a
commit 8c606d0357
18 changed files with 756 additions and 13 deletions

View File

@@ -1 +1 @@
1.36.1936
1.36.1937

View File

@@ -38,7 +38,13 @@ set(computenest_public_header_model
include/alibabacloud/computenest/model/ListServiceInstanceResourcesRequest.h
include/alibabacloud/computenest/model/ListServiceInstanceResourcesResult.h
include/alibabacloud/computenest/model/ListServiceInstancesRequest.h
include/alibabacloud/computenest/model/ListServiceInstancesResult.h )
include/alibabacloud/computenest/model/ListServiceInstancesResult.h
include/alibabacloud/computenest/model/RestartServiceInstanceRequest.h
include/alibabacloud/computenest/model/RestartServiceInstanceResult.h
include/alibabacloud/computenest/model/StartServiceInstanceRequest.h
include/alibabacloud/computenest/model/StartServiceInstanceResult.h
include/alibabacloud/computenest/model/StopServiceInstanceRequest.h
include/alibabacloud/computenest/model/StopServiceInstanceResult.h )
set(computenest_src
src/ComputeNestClient.cc
@@ -59,7 +65,13 @@ set(computenest_src
src/model/ListServiceInstanceResourcesRequest.cc
src/model/ListServiceInstanceResourcesResult.cc
src/model/ListServiceInstancesRequest.cc
src/model/ListServiceInstancesResult.cc )
src/model/ListServiceInstancesResult.cc
src/model/RestartServiceInstanceRequest.cc
src/model/RestartServiceInstanceResult.cc
src/model/StartServiceInstanceRequest.cc
src/model/StartServiceInstanceResult.cc
src/model/StopServiceInstanceRequest.cc
src/model/StopServiceInstanceResult.cc )
add_library(computenest ${LIB_TYPE}
${computenest_public_header}

View File

@@ -40,6 +40,12 @@
#include "model/ListServiceInstanceResourcesResult.h"
#include "model/ListServiceInstancesRequest.h"
#include "model/ListServiceInstancesResult.h"
#include "model/RestartServiceInstanceRequest.h"
#include "model/RestartServiceInstanceResult.h"
#include "model/StartServiceInstanceRequest.h"
#include "model/StartServiceInstanceResult.h"
#include "model/StopServiceInstanceRequest.h"
#include "model/StopServiceInstanceResult.h"
namespace AlibabaCloud
@@ -76,6 +82,15 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListServiceInstancesResult> ListServiceInstancesOutcome;
typedef std::future<ListServiceInstancesOutcome> ListServiceInstancesOutcomeCallable;
typedef std::function<void(const ComputeNestClient*, const Model::ListServiceInstancesRequest&, const ListServiceInstancesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListServiceInstancesAsyncHandler;
typedef Outcome<Error, Model::RestartServiceInstanceResult> RestartServiceInstanceOutcome;
typedef std::future<RestartServiceInstanceOutcome> RestartServiceInstanceOutcomeCallable;
typedef std::function<void(const ComputeNestClient*, const Model::RestartServiceInstanceRequest&, const RestartServiceInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RestartServiceInstanceAsyncHandler;
typedef Outcome<Error, Model::StartServiceInstanceResult> StartServiceInstanceOutcome;
typedef std::future<StartServiceInstanceOutcome> StartServiceInstanceOutcomeCallable;
typedef std::function<void(const ComputeNestClient*, const Model::StartServiceInstanceRequest&, const StartServiceInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StartServiceInstanceAsyncHandler;
typedef Outcome<Error, Model::StopServiceInstanceResult> StopServiceInstanceOutcome;
typedef std::future<StopServiceInstanceOutcome> StopServiceInstanceOutcomeCallable;
typedef std::function<void(const ComputeNestClient*, const Model::StopServiceInstanceRequest&, const StopServiceInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StopServiceInstanceAsyncHandler;
ComputeNestClient(const Credentials &credentials, const ClientConfiguration &configuration);
ComputeNestClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
@@ -108,6 +123,15 @@ namespace AlibabaCloud
ListServiceInstancesOutcome listServiceInstances(const Model::ListServiceInstancesRequest &request)const;
void listServiceInstancesAsync(const Model::ListServiceInstancesRequest& request, const ListServiceInstancesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListServiceInstancesOutcomeCallable listServiceInstancesCallable(const Model::ListServiceInstancesRequest& request) const;
RestartServiceInstanceOutcome restartServiceInstance(const Model::RestartServiceInstanceRequest &request)const;
void restartServiceInstanceAsync(const Model::RestartServiceInstanceRequest& request, const RestartServiceInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
RestartServiceInstanceOutcomeCallable restartServiceInstanceCallable(const Model::RestartServiceInstanceRequest& request) const;
StartServiceInstanceOutcome startServiceInstance(const Model::StartServiceInstanceRequest &request)const;
void startServiceInstanceAsync(const Model::StartServiceInstanceRequest& request, const StartServiceInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
StartServiceInstanceOutcomeCallable startServiceInstanceCallable(const Model::StartServiceInstanceRequest& request) const;
StopServiceInstanceOutcome stopServiceInstance(const Model::StopServiceInstanceRequest &request)const;
void stopServiceInstanceAsync(const Model::StopServiceInstanceRequest& request, const StopServiceInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
StopServiceInstanceOutcomeCallable stopServiceInstanceCallable(const Model::StopServiceInstanceRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;

View File

@@ -36,6 +36,11 @@ namespace AlibabaCloud
{
struct Service
{
struct Commodity
{
std::string type;
std::string saasBoostMetadata;
};
struct ServiceInfo
{
std::string locale;
@@ -45,6 +50,7 @@ namespace AlibabaCloud
};
std::string status;
std::string deployType;
Commodity commodity;
std::string version;
std::string supplierName;
std::string serviceType;
@@ -59,30 +65,31 @@ namespace AlibabaCloud
std::string value;
std::string key;
};
std::string status;
std::string operatedServiceInstanceId;
long progress;
std::string parameters;
std::string endTime;
std::string resourceGroupId;
std::string operationEndTime;
std::string createTime;
bool enableInstanceOps;
Service service;
std::string payType;
std::string source;
std::string name;
std::string bizStatus;
std::string operationStartTime;
std::string serviceInstanceId;
std::string serviceType;
std::string templateName;
std::string marketInstanceId;
std::vector<ServiceInstance::Tag> tags;
std::string status;
long progress;
std::string parameters;
std::string createTime;
Service service;
std::string payType;
std::string orderId;
std::string bizStatus;
std::string statusDetail;
std::string outputs;
std::string updateTime;
std::string templateName;
std::string resources;
std::string marketInstanceId;
std::vector<ServiceInstance::Tag> tags;
};

View File

@@ -0,0 +1,48 @@
/*
* 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_COMPUTENEST_MODEL_RESTARTSERVICEINSTANCEREQUEST_H_
#define ALIBABACLOUD_COMPUTENEST_MODEL_RESTARTSERVICEINSTANCEREQUEST_H_
#include <alibabacloud/computenest/ComputeNestExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace ComputeNest {
namespace Model {
class ALIBABACLOUD_COMPUTENEST_EXPORT RestartServiceInstanceRequest : public RpcServiceRequest {
public:
RestartServiceInstanceRequest();
~RestartServiceInstanceRequest();
std::string getClientToken() const;
void setClientToken(const std::string &clientToken);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getServiceInstanceId() const;
void setServiceInstanceId(const std::string &serviceInstanceId);
private:
std::string clientToken_;
std::string regionId_;
std::string serviceInstanceId_;
};
} // namespace Model
} // namespace ComputeNest
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_COMPUTENEST_MODEL_RESTARTSERVICEINSTANCEREQUEST_H_

View File

@@ -0,0 +1,49 @@
/*
* 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_COMPUTENEST_MODEL_RESTARTSERVICEINSTANCERESULT_H_
#define ALIBABACLOUD_COMPUTENEST_MODEL_RESTARTSERVICEINSTANCERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/computenest/ComputeNestExport.h>
namespace AlibabaCloud
{
namespace ComputeNest
{
namespace Model
{
class ALIBABACLOUD_COMPUTENEST_EXPORT RestartServiceInstanceResult : public ServiceResult
{
public:
RestartServiceInstanceResult();
explicit RestartServiceInstanceResult(const std::string &payload);
~RestartServiceInstanceResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_COMPUTENEST_MODEL_RESTARTSERVICEINSTANCERESULT_H_

View File

@@ -0,0 +1,48 @@
/*
* 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_COMPUTENEST_MODEL_STARTSERVICEINSTANCEREQUEST_H_
#define ALIBABACLOUD_COMPUTENEST_MODEL_STARTSERVICEINSTANCEREQUEST_H_
#include <alibabacloud/computenest/ComputeNestExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace ComputeNest {
namespace Model {
class ALIBABACLOUD_COMPUTENEST_EXPORT StartServiceInstanceRequest : public RpcServiceRequest {
public:
StartServiceInstanceRequest();
~StartServiceInstanceRequest();
std::string getClientToken() const;
void setClientToken(const std::string &clientToken);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getServiceInstanceId() const;
void setServiceInstanceId(const std::string &serviceInstanceId);
private:
std::string clientToken_;
std::string regionId_;
std::string serviceInstanceId_;
};
} // namespace Model
} // namespace ComputeNest
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_COMPUTENEST_MODEL_STARTSERVICEINSTANCEREQUEST_H_

View File

@@ -0,0 +1,49 @@
/*
* 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_COMPUTENEST_MODEL_STARTSERVICEINSTANCERESULT_H_
#define ALIBABACLOUD_COMPUTENEST_MODEL_STARTSERVICEINSTANCERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/computenest/ComputeNestExport.h>
namespace AlibabaCloud
{
namespace ComputeNest
{
namespace Model
{
class ALIBABACLOUD_COMPUTENEST_EXPORT StartServiceInstanceResult : public ServiceResult
{
public:
StartServiceInstanceResult();
explicit StartServiceInstanceResult(const std::string &payload);
~StartServiceInstanceResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_COMPUTENEST_MODEL_STARTSERVICEINSTANCERESULT_H_

View File

@@ -0,0 +1,48 @@
/*
* 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_COMPUTENEST_MODEL_STOPSERVICEINSTANCEREQUEST_H_
#define ALIBABACLOUD_COMPUTENEST_MODEL_STOPSERVICEINSTANCEREQUEST_H_
#include <alibabacloud/computenest/ComputeNestExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace ComputeNest {
namespace Model {
class ALIBABACLOUD_COMPUTENEST_EXPORT StopServiceInstanceRequest : public RpcServiceRequest {
public:
StopServiceInstanceRequest();
~StopServiceInstanceRequest();
std::string getClientToken() const;
void setClientToken(const std::string &clientToken);
std::string getRegionId() const;
void setRegionId(const std::string &regionId);
std::string getServiceInstanceId() const;
void setServiceInstanceId(const std::string &serviceInstanceId);
private:
std::string clientToken_;
std::string regionId_;
std::string serviceInstanceId_;
};
} // namespace Model
} // namespace ComputeNest
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_COMPUTENEST_MODEL_STOPSERVICEINSTANCEREQUEST_H_

View File

@@ -0,0 +1,49 @@
/*
* 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_COMPUTENEST_MODEL_STOPSERVICEINSTANCERESULT_H_
#define ALIBABACLOUD_COMPUTENEST_MODEL_STOPSERVICEINSTANCERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/computenest/ComputeNestExport.h>
namespace AlibabaCloud
{
namespace ComputeNest
{
namespace Model
{
class ALIBABACLOUD_COMPUTENEST_EXPORT StopServiceInstanceResult : public ServiceResult
{
public:
StopServiceInstanceResult();
explicit StopServiceInstanceResult(const std::string &payload);
~StopServiceInstanceResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_COMPUTENEST_MODEL_STOPSERVICEINSTANCERESULT_H_

View File

@@ -375,3 +375,111 @@ ComputeNestClient::ListServiceInstancesOutcomeCallable ComputeNestClient::listSe
return task->get_future();
}
ComputeNestClient::RestartServiceInstanceOutcome ComputeNestClient::restartServiceInstance(const RestartServiceInstanceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return RestartServiceInstanceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return RestartServiceInstanceOutcome(RestartServiceInstanceResult(outcome.result()));
else
return RestartServiceInstanceOutcome(outcome.error());
}
void ComputeNestClient::restartServiceInstanceAsync(const RestartServiceInstanceRequest& request, const RestartServiceInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, restartServiceInstance(request), context);
};
asyncExecute(new Runnable(fn));
}
ComputeNestClient::RestartServiceInstanceOutcomeCallable ComputeNestClient::restartServiceInstanceCallable(const RestartServiceInstanceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<RestartServiceInstanceOutcome()>>(
[this, request]()
{
return this->restartServiceInstance(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ComputeNestClient::StartServiceInstanceOutcome ComputeNestClient::startServiceInstance(const StartServiceInstanceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StartServiceInstanceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StartServiceInstanceOutcome(StartServiceInstanceResult(outcome.result()));
else
return StartServiceInstanceOutcome(outcome.error());
}
void ComputeNestClient::startServiceInstanceAsync(const StartServiceInstanceRequest& request, const StartServiceInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, startServiceInstance(request), context);
};
asyncExecute(new Runnable(fn));
}
ComputeNestClient::StartServiceInstanceOutcomeCallable ComputeNestClient::startServiceInstanceCallable(const StartServiceInstanceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StartServiceInstanceOutcome()>>(
[this, request]()
{
return this->startServiceInstance(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ComputeNestClient::StopServiceInstanceOutcome ComputeNestClient::stopServiceInstance(const StopServiceInstanceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StopServiceInstanceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StopServiceInstanceOutcome(StopServiceInstanceResult(outcome.result()));
else
return StopServiceInstanceOutcome(outcome.error());
}
void ComputeNestClient::stopServiceInstanceAsync(const StopServiceInstanceRequest& request, const StopServiceInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, stopServiceInstance(request), context);
};
asyncExecute(new Runnable(fn));
}
ComputeNestClient::StopServiceInstanceOutcomeCallable ComputeNestClient::stopServiceInstanceCallable(const StopServiceInstanceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StopServiceInstanceOutcome()>>(
[this, request]()
{
return this->stopServiceInstance(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}

View File

@@ -87,6 +87,8 @@ void ListServiceInstancesResult::parse(const std::string &payload)
serviceInstancesObject.resourceGroupId = valueServiceInstancesServiceInstance["ResourceGroupId"].asString();
if(!valueServiceInstancesServiceInstance["BizStatus"].isNull())
serviceInstancesObject.bizStatus = valueServiceInstancesServiceInstance["BizStatus"].asString();
if(!valueServiceInstancesServiceInstance["OrderId"].isNull())
serviceInstancesObject.orderId = valueServiceInstancesServiceInstance["OrderId"].asString();
auto allTagsNode = valueServiceInstancesServiceInstance["Tags"]["Tag"];
for (auto valueServiceInstancesServiceInstanceTagsTag : allTagsNode)
{
@@ -130,6 +132,11 @@ void ListServiceInstancesResult::parse(const std::string &payload)
serviceInfoObject.shortDescription = serviceNodeServiceInfosServiceInfo["ShortDescription"].asString();
serviceInstancesObject.service.serviceInfos.push_back(serviceInfoObject);
}
auto commodityNode = serviceNode["Commodity"];
if(!commodityNode["SaasBoostMetadata"].isNull())
serviceInstancesObject.service.commodity.saasBoostMetadata = commodityNode["SaasBoostMetadata"].asString();
if(!commodityNode["Type"].isNull())
serviceInstancesObject.service.commodity.type = commodityNode["Type"].asString();
serviceInstances_.push_back(serviceInstancesObject);
}
if(!value["NextToken"].isNull())

View File

@@ -0,0 +1,54 @@
/*
* 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/computenest/model/RestartServiceInstanceRequest.h>
using AlibabaCloud::ComputeNest::Model::RestartServiceInstanceRequest;
RestartServiceInstanceRequest::RestartServiceInstanceRequest()
: RpcServiceRequest("computenest", "2021-06-01", "RestartServiceInstance") {
setMethod(HttpRequest::Method::Post);
}
RestartServiceInstanceRequest::~RestartServiceInstanceRequest() {}
std::string RestartServiceInstanceRequest::getClientToken() const {
return clientToken_;
}
void RestartServiceInstanceRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string RestartServiceInstanceRequest::getRegionId() const {
return regionId_;
}
void RestartServiceInstanceRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string RestartServiceInstanceRequest::getServiceInstanceId() const {
return serviceInstanceId_;
}
void RestartServiceInstanceRequest::setServiceInstanceId(const std::string &serviceInstanceId) {
serviceInstanceId_ = serviceInstanceId;
setParameter(std::string("ServiceInstanceId"), serviceInstanceId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/computenest/model/RestartServiceInstanceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::ComputeNest;
using namespace AlibabaCloud::ComputeNest::Model;
RestartServiceInstanceResult::RestartServiceInstanceResult() :
ServiceResult()
{}
RestartServiceInstanceResult::RestartServiceInstanceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
RestartServiceInstanceResult::~RestartServiceInstanceResult()
{}
void RestartServiceInstanceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,54 @@
/*
* 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/computenest/model/StartServiceInstanceRequest.h>
using AlibabaCloud::ComputeNest::Model::StartServiceInstanceRequest;
StartServiceInstanceRequest::StartServiceInstanceRequest()
: RpcServiceRequest("computenest", "2021-06-01", "StartServiceInstance") {
setMethod(HttpRequest::Method::Post);
}
StartServiceInstanceRequest::~StartServiceInstanceRequest() {}
std::string StartServiceInstanceRequest::getClientToken() const {
return clientToken_;
}
void StartServiceInstanceRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string StartServiceInstanceRequest::getRegionId() const {
return regionId_;
}
void StartServiceInstanceRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string StartServiceInstanceRequest::getServiceInstanceId() const {
return serviceInstanceId_;
}
void StartServiceInstanceRequest::setServiceInstanceId(const std::string &serviceInstanceId) {
serviceInstanceId_ = serviceInstanceId;
setParameter(std::string("ServiceInstanceId"), serviceInstanceId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/computenest/model/StartServiceInstanceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::ComputeNest;
using namespace AlibabaCloud::ComputeNest::Model;
StartServiceInstanceResult::StartServiceInstanceResult() :
ServiceResult()
{}
StartServiceInstanceResult::StartServiceInstanceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
StartServiceInstanceResult::~StartServiceInstanceResult()
{}
void StartServiceInstanceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -0,0 +1,54 @@
/*
* 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/computenest/model/StopServiceInstanceRequest.h>
using AlibabaCloud::ComputeNest::Model::StopServiceInstanceRequest;
StopServiceInstanceRequest::StopServiceInstanceRequest()
: RpcServiceRequest("computenest", "2021-06-01", "StopServiceInstance") {
setMethod(HttpRequest::Method::Post);
}
StopServiceInstanceRequest::~StopServiceInstanceRequest() {}
std::string StopServiceInstanceRequest::getClientToken() const {
return clientToken_;
}
void StopServiceInstanceRequest::setClientToken(const std::string &clientToken) {
clientToken_ = clientToken;
setParameter(std::string("ClientToken"), clientToken);
}
std::string StopServiceInstanceRequest::getRegionId() const {
return regionId_;
}
void StopServiceInstanceRequest::setRegionId(const std::string &regionId) {
regionId_ = regionId;
setParameter(std::string("RegionId"), regionId);
}
std::string StopServiceInstanceRequest::getServiceInstanceId() const {
return serviceInstanceId_;
}
void StopServiceInstanceRequest::setServiceInstanceId(const std::string &serviceInstanceId) {
serviceInstanceId_ = serviceInstanceId;
setParameter(std::string("ServiceInstanceId"), serviceInstanceId);
}

View File

@@ -0,0 +1,44 @@
/*
* 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/computenest/model/StopServiceInstanceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::ComputeNest;
using namespace AlibabaCloud::ComputeNest::Model;
StopServiceInstanceResult::StopServiceInstanceResult() :
ServiceResult()
{}
StopServiceInstanceResult::StopServiceInstanceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
StopServiceInstanceResult::~StopServiceInstanceResult()
{}
void StopServiceInstanceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}