TESLAMAXCOMPUTE SDK Auto Released By shenshi,Version:1.34.10

Signed-off-by: haowei.yao <haowei.yao@alibaba-inc.com>
This commit is contained in:
haowei.yao
2019-03-13 16:05:42 +08:00
parent c99809b8e4
commit 43169f9d50
9 changed files with 292 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
2019-03-13 Version: 1.34.10
1, Distinguish between system and service parameters
2019-03-12 Version: 1.34.9
1, add agency infomation
2, update sdk core resources

View File

@@ -1 +1 @@
1.34.9
1.34.10

View File

@@ -31,6 +31,8 @@ set(teslamaxcompute_public_header_model
include/alibabacloud/teslamaxcompute/model/QueryTopologyResult.h
include/alibabacloud/teslamaxcompute/model/GetInstancesStatusCountRequest.h
include/alibabacloud/teslamaxcompute/model/GetInstancesStatusCountResult.h
include/alibabacloud/teslamaxcompute/model/ListUserQuotasRequest.h
include/alibabacloud/teslamaxcompute/model/ListUserQuotasResult.h
include/alibabacloud/teslamaxcompute/model/QueryCustomerSaleInfoRequest.h
include/alibabacloud/teslamaxcompute/model/QueryCustomerSaleInfoResult.h
include/alibabacloud/teslamaxcompute/model/GetQuotaInstanceRequest.h
@@ -52,6 +54,8 @@ set(teslamaxcompute_src
src/model/QueryTopologyResult.cc
src/model/GetInstancesStatusCountRequest.cc
src/model/GetInstancesStatusCountResult.cc
src/model/ListUserQuotasRequest.cc
src/model/ListUserQuotasResult.cc
src/model/QueryCustomerSaleInfoRequest.cc
src/model/QueryCustomerSaleInfoResult.cc
src/model/GetQuotaInstanceRequest.cc

View File

@@ -32,6 +32,8 @@
#include "model/QueryTopologyResult.h"
#include "model/GetInstancesStatusCountRequest.h"
#include "model/GetInstancesStatusCountResult.h"
#include "model/ListUserQuotasRequest.h"
#include "model/ListUserQuotasResult.h"
#include "model/QueryCustomerSaleInfoRequest.h"
#include "model/QueryCustomerSaleInfoResult.h"
#include "model/GetQuotaInstanceRequest.h"
@@ -64,6 +66,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::GetInstancesStatusCountResult> GetInstancesStatusCountOutcome;
typedef std::future<GetInstancesStatusCountOutcome> GetInstancesStatusCountOutcomeCallable;
typedef std::function<void(const TeslaMaxComputeClient*, const Model::GetInstancesStatusCountRequest&, const GetInstancesStatusCountOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetInstancesStatusCountAsyncHandler;
typedef Outcome<Error, Model::ListUserQuotasResult> ListUserQuotasOutcome;
typedef std::future<ListUserQuotasOutcome> ListUserQuotasOutcomeCallable;
typedef std::function<void(const TeslaMaxComputeClient*, const Model::ListUserQuotasRequest&, const ListUserQuotasOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListUserQuotasAsyncHandler;
typedef Outcome<Error, Model::QueryCustomerSaleInfoResult> QueryCustomerSaleInfoOutcome;
typedef std::future<QueryCustomerSaleInfoOutcome> QueryCustomerSaleInfoOutcomeCallable;
typedef std::function<void(const TeslaMaxComputeClient*, const Model::QueryCustomerSaleInfoRequest&, const QueryCustomerSaleInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryCustomerSaleInfoAsyncHandler;
@@ -96,6 +101,9 @@ namespace AlibabaCloud
GetInstancesStatusCountOutcome getInstancesStatusCount(const Model::GetInstancesStatusCountRequest &request)const;
void getInstancesStatusCountAsync(const Model::GetInstancesStatusCountRequest& request, const GetInstancesStatusCountAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetInstancesStatusCountOutcomeCallable getInstancesStatusCountCallable(const Model::GetInstancesStatusCountRequest& request) const;
ListUserQuotasOutcome listUserQuotas(const Model::ListUserQuotasRequest &request)const;
void listUserQuotasAsync(const Model::ListUserQuotasRequest& request, const ListUserQuotasAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListUserQuotasOutcomeCallable listUserQuotasCallable(const Model::ListUserQuotasRequest& request) const;
QueryCustomerSaleInfoOutcome queryCustomerSaleInfo(const Model::QueryCustomerSaleInfoRequest &request)const;
void queryCustomerSaleInfoAsync(const Model::QueryCustomerSaleInfoRequest& request, const QueryCustomerSaleInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryCustomerSaleInfoOutcomeCallable queryCustomerSaleInfoCallable(const Model::QueryCustomerSaleInfoRequest& request) const;

View File

@@ -0,0 +1,45 @@
/*
* 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_TESLAMAXCOMPUTE_MODEL_LISTUSERQUOTASREQUEST_H_
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_LISTUSERQUOTASREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
namespace AlibabaCloud
{
namespace TeslaMaxCompute
{
namespace Model
{
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT ListUserQuotasRequest : public RpcServiceRequest
{
public:
ListUserQuotasRequest();
~ListUserQuotasRequest();
private:
};
}
}
}
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_LISTUSERQUOTASREQUEST_H_

View File

@@ -0,0 +1,75 @@
/*
* 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_TESLAMAXCOMPUTE_MODEL_LISTUSERQUOTASRESULT_H_
#define ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_LISTUSERQUOTASRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/teslamaxcompute/TeslaMaxComputeExport.h>
namespace AlibabaCloud
{
namespace TeslaMaxCompute
{
namespace Model
{
class ALIBABACLOUD_TESLAMAXCOMPUTE_EXPORT ListUserQuotasResult : public ServiceResult
{
public:
struct Data
{
struct Error
{
std::string message;
std::string code;
std::string timestamp;
};
struct Quotas
{
long parentid;
long quotaid;
std::string nick;
std::string cluster;
std::string region;
std::string name;
};
Error error;
std::vector<Quotas> detail;
};
ListUserQuotasResult();
explicit ListUserQuotasResult(const std::string &payload);
~ListUserQuotasResult();
std::string getMessage()const;
Data getData()const;
int getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
int code_;
};
}
}
}
#endif // !ALIBABACLOUD_TESLAMAXCOMPUTE_MODEL_LISTUSERQUOTASRESULT_H_

View File

@@ -31,21 +31,21 @@ TeslaMaxComputeClient::TeslaMaxComputeClient(const Credentials &credentials, con
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "teslamaxcompute");
}
TeslaMaxComputeClient::TeslaMaxComputeClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "teslamaxcompute");
}
TeslaMaxComputeClient::TeslaMaxComputeClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "teslamaxcompute");
}
TeslaMaxComputeClient::~TeslaMaxComputeClient()
@@ -231,6 +231,42 @@ TeslaMaxComputeClient::GetInstancesStatusCountOutcomeCallable TeslaMaxComputeCli
return task->get_future();
}
TeslaMaxComputeClient::ListUserQuotasOutcome TeslaMaxComputeClient::listUserQuotas(const ListUserQuotasRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListUserQuotasOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListUserQuotasOutcome(ListUserQuotasResult(outcome.result()));
else
return ListUserQuotasOutcome(outcome.error());
}
void TeslaMaxComputeClient::listUserQuotasAsync(const ListUserQuotasRequest& request, const ListUserQuotasAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listUserQuotas(request), context);
};
asyncExecute(new Runnable(fn));
}
TeslaMaxComputeClient::ListUserQuotasOutcomeCallable TeslaMaxComputeClient::listUserQuotasCallable(const ListUserQuotasRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListUserQuotasOutcome()>>(
[this, request]()
{
return this->listUserQuotas(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
TeslaMaxComputeClient::QueryCustomerSaleInfoOutcome TeslaMaxComputeClient::queryCustomerSaleInfo(const QueryCustomerSaleInfoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,27 @@
/*
* 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/teslamaxcompute/model/ListUserQuotasRequest.h>
using AlibabaCloud::TeslaMaxCompute::Model::ListUserQuotasRequest;
ListUserQuotasRequest::ListUserQuotasRequest() :
RpcServiceRequest("teslamaxcompute", "2018-01-04", "ListUserQuotas")
{}
ListUserQuotasRequest::~ListUserQuotasRequest()
{}

View File

@@ -0,0 +1,90 @@
/*
* 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/teslamaxcompute/model/ListUserQuotasResult.h>
#include <json/json.h>
using namespace AlibabaCloud::TeslaMaxCompute;
using namespace AlibabaCloud::TeslaMaxCompute::Model;
ListUserQuotasResult::ListUserQuotasResult() :
ServiceResult()
{}
ListUserQuotasResult::ListUserQuotasResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListUserQuotasResult::~ListUserQuotasResult()
{}
void ListUserQuotasResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto dataNode = value["Data"];
auto allDetail = value["Detail"]["Quotas"];
for (auto value : allDetail)
{
Data::Quotas quotasObject;
if(!value["Quotaid"].isNull())
quotasObject.quotaid = std::stol(value["Quotaid"].asString());
if(!value["Cluster"].isNull())
quotasObject.cluster = value["Cluster"].asString();
if(!value["Region"].isNull())
quotasObject.region = value["Region"].asString();
if(!value["Name"].isNull())
quotasObject.name = value["Name"].asString();
if(!value["Parentid"].isNull())
quotasObject.parentid = std::stol(value["Parentid"].asString());
if(!value["Nick"].isNull())
quotasObject.nick = value["Nick"].asString();
data_.detail.push_back(quotasObject);
}
auto errorNode = dataNode["Error"];
if(!errorNode["Code"].isNull())
data_.error.code = errorNode["Code"].asString();
if(!errorNode["Message"].isNull())
data_.error.message = errorNode["Message"].asString();
if(!errorNode["Timestamp"].isNull())
data_.error.timestamp = errorNode["Timestamp"].asString();
if(!value["Message"].isNull())
message_ = value["Message"].asString();
if(!value["Code"].isNull())
code_ = std::stoi(value["Code"].asString());
}
std::string ListUserQuotasResult::getMessage()const
{
return message_;
}
ListUserQuotasResult::Data ListUserQuotasResult::getData()const
{
return data_;
}
int ListUserQuotasResult::getCode()const
{
return code_;
}