Support filtering keys and secrets.

This commit is contained in:
sdk-team
2020-09-28 05:07:41 +00:00
parent d4c20caaed
commit 60799e2b22
18 changed files with 483 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
2020-09-28 Version: patch
- Support filtering keys and secrets.
- Support opening KMS service and describing service status by API.
- Add a prefix limitation for SecretName.
2020-09-27 Version: patch
- Update domain API.

View File

@@ -47,6 +47,8 @@ set(kms_public_header_model
include/alibabacloud/kms/model/DeleteKeyMaterialResult.h
include/alibabacloud/kms/model/DeleteSecretRequest.h
include/alibabacloud/kms/model/DeleteSecretResult.h
include/alibabacloud/kms/model/DescribeAccountKmsStatusRequest.h
include/alibabacloud/kms/model/DescribeAccountKmsStatusResult.h
include/alibabacloud/kms/model/DescribeKeyRequest.h
include/alibabacloud/kms/model/DescribeKeyResult.h
include/alibabacloud/kms/model/DescribeKeyVersionRequest.h
@@ -95,6 +97,8 @@ set(kms_public_header_model
include/alibabacloud/kms/model/ListSecretVersionIdsResult.h
include/alibabacloud/kms/model/ListSecretsRequest.h
include/alibabacloud/kms/model/ListSecretsResult.h
include/alibabacloud/kms/model/OpenKmsServiceRequest.h
include/alibabacloud/kms/model/OpenKmsServiceResult.h
include/alibabacloud/kms/model/PutSecretValueRequest.h
include/alibabacloud/kms/model/PutSecretValueResult.h
include/alibabacloud/kms/model/ReEncryptRequest.h
@@ -146,6 +150,8 @@ set(kms_src
src/model/DeleteKeyMaterialResult.cc
src/model/DeleteSecretRequest.cc
src/model/DeleteSecretResult.cc
src/model/DescribeAccountKmsStatusRequest.cc
src/model/DescribeAccountKmsStatusResult.cc
src/model/DescribeKeyRequest.cc
src/model/DescribeKeyResult.cc
src/model/DescribeKeyVersionRequest.cc
@@ -194,6 +200,8 @@ set(kms_src
src/model/ListSecretVersionIdsResult.cc
src/model/ListSecretsRequest.cc
src/model/ListSecretsResult.cc
src/model/OpenKmsServiceRequest.cc
src/model/OpenKmsServiceResult.cc
src/model/PutSecretValueRequest.cc
src/model/PutSecretValueResult.cc
src/model/ReEncryptRequest.cc

View File

@@ -48,6 +48,8 @@
#include "model/DeleteKeyMaterialResult.h"
#include "model/DeleteSecretRequest.h"
#include "model/DeleteSecretResult.h"
#include "model/DescribeAccountKmsStatusRequest.h"
#include "model/DescribeAccountKmsStatusResult.h"
#include "model/DescribeKeyRequest.h"
#include "model/DescribeKeyResult.h"
#include "model/DescribeKeyVersionRequest.h"
@@ -96,6 +98,8 @@
#include "model/ListSecretVersionIdsResult.h"
#include "model/ListSecretsRequest.h"
#include "model/ListSecretsResult.h"
#include "model/OpenKmsServiceRequest.h"
#include "model/OpenKmsServiceResult.h"
#include "model/PutSecretValueRequest.h"
#include "model/PutSecretValueResult.h"
#include "model/ReEncryptRequest.h"
@@ -166,6 +170,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::DeleteSecretResult> DeleteSecretOutcome;
typedef std::future<DeleteSecretOutcome> DeleteSecretOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::DeleteSecretRequest&, const DeleteSecretOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteSecretAsyncHandler;
typedef Outcome<Error, Model::DescribeAccountKmsStatusResult> DescribeAccountKmsStatusOutcome;
typedef std::future<DescribeAccountKmsStatusOutcome> DescribeAccountKmsStatusOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::DescribeAccountKmsStatusRequest&, const DescribeAccountKmsStatusOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeAccountKmsStatusAsyncHandler;
typedef Outcome<Error, Model::DescribeKeyResult> DescribeKeyOutcome;
typedef std::future<DescribeKeyOutcome> DescribeKeyOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::DescribeKeyRequest&, const DescribeKeyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeKeyAsyncHandler;
@@ -238,6 +245,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ListSecretsResult> ListSecretsOutcome;
typedef std::future<ListSecretsOutcome> ListSecretsOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::ListSecretsRequest&, const ListSecretsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListSecretsAsyncHandler;
typedef Outcome<Error, Model::OpenKmsServiceResult> OpenKmsServiceOutcome;
typedef std::future<OpenKmsServiceOutcome> OpenKmsServiceOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::OpenKmsServiceRequest&, const OpenKmsServiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> OpenKmsServiceAsyncHandler;
typedef Outcome<Error, Model::PutSecretValueResult> PutSecretValueOutcome;
typedef std::future<PutSecretValueOutcome> PutSecretValueOutcomeCallable;
typedef std::function<void(const KmsClient*, const Model::PutSecretValueRequest&, const PutSecretValueOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PutSecretValueAsyncHandler;
@@ -315,6 +325,9 @@ namespace AlibabaCloud
DeleteSecretOutcome deleteSecret(const Model::DeleteSecretRequest &request)const;
void deleteSecretAsync(const Model::DeleteSecretRequest& request, const DeleteSecretAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DeleteSecretOutcomeCallable deleteSecretCallable(const Model::DeleteSecretRequest& request) const;
DescribeAccountKmsStatusOutcome describeAccountKmsStatus(const Model::DescribeAccountKmsStatusRequest &request)const;
void describeAccountKmsStatusAsync(const Model::DescribeAccountKmsStatusRequest& request, const DescribeAccountKmsStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeAccountKmsStatusOutcomeCallable describeAccountKmsStatusCallable(const Model::DescribeAccountKmsStatusRequest& request) const;
DescribeKeyOutcome describeKey(const Model::DescribeKeyRequest &request)const;
void describeKeyAsync(const Model::DescribeKeyRequest& request, const DescribeKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeKeyOutcomeCallable describeKeyCallable(const Model::DescribeKeyRequest& request) const;
@@ -387,6 +400,9 @@ namespace AlibabaCloud
ListSecretsOutcome listSecrets(const Model::ListSecretsRequest &request)const;
void listSecretsAsync(const Model::ListSecretsRequest& request, const ListSecretsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListSecretsOutcomeCallable listSecretsCallable(const Model::ListSecretsRequest& request) const;
OpenKmsServiceOutcome openKmsService(const Model::OpenKmsServiceRequest &request)const;
void openKmsServiceAsync(const Model::OpenKmsServiceRequest& request, const OpenKmsServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
OpenKmsServiceOutcomeCallable openKmsServiceCallable(const Model::OpenKmsServiceRequest& request) const;
PutSecretValueOutcome putSecretValue(const Model::PutSecretValueRequest &request)const;
void putSecretValueAsync(const Model::PutSecretValueRequest& request, const PutSecretValueAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
PutSecretValueOutcomeCallable putSecretValueCallable(const Model::PutSecretValueRequest& 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_KMS_MODEL_DESCRIBEACCOUNTKMSSTATUSREQUEST_H_
#define ALIBABACLOUD_KMS_MODEL_DESCRIBEACCOUNTKMSSTATUSREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT DescribeAccountKmsStatusRequest : public RpcServiceRequest
{
public:
DescribeAccountKmsStatusRequest();
~DescribeAccountKmsStatusRequest();
private:
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_DESCRIBEACCOUNTKMSSTATUSREQUEST_H_

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_KMS_MODEL_DESCRIBEACCOUNTKMSSTATUSRESULT_H_
#define ALIBABACLOUD_KMS_MODEL_DESCRIBEACCOUNTKMSSTATUSRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT DescribeAccountKmsStatusResult : public ServiceResult
{
public:
DescribeAccountKmsStatusResult();
explicit DescribeAccountKmsStatusResult(const std::string &payload);
~DescribeAccountKmsStatusResult();
std::string getAccountStatus()const;
protected:
void parse(const std::string &payload);
private:
std::string accountStatus_;
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_DESCRIBEACCOUNTKMSSTATUSRESULT_H_

View File

@@ -37,11 +37,14 @@ namespace AlibabaCloud
int getPageSize()const;
void setPageSize(int pageSize);
std::string getFilters()const;
void setFilters(const std::string& filters);
int getPageNumber()const;
void setPageNumber(int pageNumber);
private:
int pageSize_;
std::string filters_;
int pageNumber_;
};

View File

@@ -37,6 +37,8 @@ namespace AlibabaCloud
int getPageSize()const;
void setPageSize(int pageSize);
std::string getFilters()const;
void setFilters(const std::string& filters);
std::string getFetchTags()const;
void setFetchTags(const std::string& fetchTags);
int getPageNumber()const;
@@ -44,6 +46,7 @@ namespace AlibabaCloud
private:
int pageSize_;
std::string filters_;
std::string fetchTags_;
int pageNumber_;

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_KMS_MODEL_OPENKMSSERVICEREQUEST_H_
#define ALIBABACLOUD_KMS_MODEL_OPENKMSSERVICEREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT OpenKmsServiceRequest : public RpcServiceRequest
{
public:
OpenKmsServiceRequest();
~OpenKmsServiceRequest();
private:
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_OPENKMSSERVICEREQUEST_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_KMS_MODEL_OPENKMSSERVICERESULT_H_
#define ALIBABACLOUD_KMS_MODEL_OPENKMSSERVICERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/kms/KmsExport.h>
namespace AlibabaCloud
{
namespace Kms
{
namespace Model
{
class ALIBABACLOUD_KMS_EXPORT OpenKmsServiceResult : public ServiceResult
{
public:
OpenKmsServiceResult();
explicit OpenKmsServiceResult(const std::string &payload);
~OpenKmsServiceResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_KMS_MODEL_OPENKMSSERVICERESULT_H_

View File

@@ -31,21 +31,21 @@ KmsClient::KmsClient(const Credentials &credentials, const ClientConfiguration &
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, "kms-service");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "kms");
}
KmsClient::KmsClient(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, "kms-service");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "kms");
}
KmsClient::KmsClient(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, "kms-service");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "kms");
}
KmsClient::~KmsClient()
@@ -519,6 +519,42 @@ KmsClient::DeleteSecretOutcomeCallable KmsClient::deleteSecretCallable(const Del
return task->get_future();
}
KmsClient::DescribeAccountKmsStatusOutcome KmsClient::describeAccountKmsStatus(const DescribeAccountKmsStatusRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeAccountKmsStatusOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeAccountKmsStatusOutcome(DescribeAccountKmsStatusResult(outcome.result()));
else
return DescribeAccountKmsStatusOutcome(outcome.error());
}
void KmsClient::describeAccountKmsStatusAsync(const DescribeAccountKmsStatusRequest& request, const DescribeAccountKmsStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeAccountKmsStatus(request), context);
};
asyncExecute(new Runnable(fn));
}
KmsClient::DescribeAccountKmsStatusOutcomeCallable KmsClient::describeAccountKmsStatusCallable(const DescribeAccountKmsStatusRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeAccountKmsStatusOutcome()>>(
[this, request]()
{
return this->describeAccountKmsStatus(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
KmsClient::DescribeKeyOutcome KmsClient::describeKey(const DescribeKeyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1383,6 +1419,42 @@ KmsClient::ListSecretsOutcomeCallable KmsClient::listSecretsCallable(const ListS
return task->get_future();
}
KmsClient::OpenKmsServiceOutcome KmsClient::openKmsService(const OpenKmsServiceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return OpenKmsServiceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return OpenKmsServiceOutcome(OpenKmsServiceResult(outcome.result()));
else
return OpenKmsServiceOutcome(outcome.error());
}
void KmsClient::openKmsServiceAsync(const OpenKmsServiceRequest& request, const OpenKmsServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, openKmsService(request), context);
};
asyncExecute(new Runnable(fn));
}
KmsClient::OpenKmsServiceOutcomeCallable KmsClient::openKmsServiceCallable(const OpenKmsServiceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<OpenKmsServiceOutcome()>>(
[this, request]()
{
return this->openKmsService(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
KmsClient::PutSecretValueOutcome KmsClient::putSecretValue(const PutSecretValueRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

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/kms/model/DescribeAccountKmsStatusRequest.h>
using AlibabaCloud::Kms::Model::DescribeAccountKmsStatusRequest;
DescribeAccountKmsStatusRequest::DescribeAccountKmsStatusRequest() :
RpcServiceRequest("kms", "2016-01-20", "DescribeAccountKmsStatus")
{
setMethod(HttpRequest::Method::Post);
}
DescribeAccountKmsStatusRequest::~DescribeAccountKmsStatusRequest()
{}

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.
*/
#include <alibabacloud/kms/model/DescribeAccountKmsStatusResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Kms;
using namespace AlibabaCloud::Kms::Model;
DescribeAccountKmsStatusResult::DescribeAccountKmsStatusResult() :
ServiceResult()
{}
DescribeAccountKmsStatusResult::DescribeAccountKmsStatusResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeAccountKmsStatusResult::~DescribeAccountKmsStatusResult()
{}
void DescribeAccountKmsStatusResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
if(!value["AccountStatus"].isNull())
accountStatus_ = value["AccountStatus"].asString();
}
std::string DescribeAccountKmsStatusResult::getAccountStatus()const
{
return accountStatus_;
}

View File

@@ -38,6 +38,17 @@ void ListKeysRequest::setPageSize(int pageSize)
setParameter("PageSize", std::to_string(pageSize));
}
std::string ListKeysRequest::getFilters()const
{
return filters_;
}
void ListKeysRequest::setFilters(const std::string& filters)
{
filters_ = filters;
setParameter("Filters", filters);
}
int ListKeysRequest::getPageNumber()const
{
return pageNumber_;

View File

@@ -43,18 +43,18 @@ void ListKeysResult::parse(const std::string &payload)
for (auto valueKeysKey : allKeysNode)
{
Key keysObject;
if(!valueKeysKey["KeyId"].isNull())
keysObject.keyId = valueKeysKey["KeyId"].asString();
if(!valueKeysKey["KeyArn"].isNull())
keysObject.keyArn = valueKeysKey["KeyArn"].asString();
if(!valueKeysKey["KeyId"].isNull())
keysObject.keyId = valueKeysKey["KeyId"].asString();
keys_.push_back(keysObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
if(!value["PageNumber"].isNull())
pageNumber_ = std::stoi(value["PageNumber"].asString());
if(!value["PageSize"].isNull())
pageSize_ = std::stoi(value["PageSize"].asString());
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
}

View File

@@ -38,6 +38,17 @@ void ListSecretsRequest::setPageSize(int pageSize)
setParameter("PageSize", std::to_string(pageSize));
}
std::string ListSecretsRequest::getFilters()const
{
return filters_;
}
void ListSecretsRequest::setFilters(const std::string& filters)
{
filters_ = filters;
setParameter("Filters", filters);
}
std::string ListSecretsRequest::getFetchTags()const
{
return fetchTags_;

View File

@@ -43,14 +43,14 @@ void ListSecretsResult::parse(const std::string &payload)
for (auto valueSecretListSecret : allSecretListNode)
{
Secret secretListObject;
if(!valueSecretListSecret["SecretName"].isNull())
secretListObject.secretName = valueSecretListSecret["SecretName"].asString();
if(!valueSecretListSecret["CreateTime"].isNull())
secretListObject.createTime = valueSecretListSecret["CreateTime"].asString();
if(!valueSecretListSecret["UpdateTime"].isNull())
secretListObject.updateTime = valueSecretListSecret["UpdateTime"].asString();
if(!valueSecretListSecret["PlannedDeleteTime"].isNull())
secretListObject.plannedDeleteTime = valueSecretListSecret["PlannedDeleteTime"].asString();
if(!valueSecretListSecret["SecretName"].isNull())
secretListObject.secretName = valueSecretListSecret["SecretName"].asString();
if(!valueSecretListSecret["UpdateTime"].isNull())
secretListObject.updateTime = valueSecretListSecret["UpdateTime"].asString();
auto allTagsNode = allSecretListNode["Tags"]["Tag"];
for (auto allSecretListNodeTagsTag : allTagsNode)
{

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/kms/model/OpenKmsServiceRequest.h>
using AlibabaCloud::Kms::Model::OpenKmsServiceRequest;
OpenKmsServiceRequest::OpenKmsServiceRequest() :
RpcServiceRequest("kms", "2016-01-20", "OpenKmsService")
{
setMethod(HttpRequest::Method::Post);
}
OpenKmsServiceRequest::~OpenKmsServiceRequest()
{}

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/kms/model/OpenKmsServiceResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Kms;
using namespace AlibabaCloud::Kms::Model;
OpenKmsServiceResult::OpenKmsServiceResult() :
ServiceResult()
{}
OpenKmsServiceResult::OpenKmsServiceResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
OpenKmsServiceResult::~OpenKmsServiceResult()
{}
void OpenKmsServiceResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}