Update autoSnapshotPolicy.
This commit is contained in:
@@ -57,6 +57,8 @@ set(dbfs_public_header_model
|
||||
include/alibabacloud/dbfs/model/GetDbfsResult.h
|
||||
include/alibabacloud/dbfs/model/GetServiceLinkedRoleRequest.h
|
||||
include/alibabacloud/dbfs/model/GetServiceLinkedRoleResult.h
|
||||
include/alibabacloud/dbfs/model/GetSnapshotLinkRequest.h
|
||||
include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h
|
||||
include/alibabacloud/dbfs/model/ListAutoSnapshotPoliciesRequest.h
|
||||
include/alibabacloud/dbfs/model/ListAutoSnapshotPoliciesResult.h
|
||||
include/alibabacloud/dbfs/model/ListAutoSnapshotPolicyAppliedDbfsRequest.h
|
||||
@@ -71,6 +73,8 @@ set(dbfs_public_header_model
|
||||
include/alibabacloud/dbfs/model/ListDbfsAttachedEcsInstancesResult.h
|
||||
include/alibabacloud/dbfs/model/ListSnapshotRequest.h
|
||||
include/alibabacloud/dbfs/model/ListSnapshotResult.h
|
||||
include/alibabacloud/dbfs/model/ListSnapshotLinksRequest.h
|
||||
include/alibabacloud/dbfs/model/ListSnapshotLinksResult.h
|
||||
include/alibabacloud/dbfs/model/ListTagKeysRequest.h
|
||||
include/alibabacloud/dbfs/model/ListTagKeysResult.h
|
||||
include/alibabacloud/dbfs/model/ListTagValuesRequest.h
|
||||
@@ -126,6 +130,8 @@ set(dbfs_src
|
||||
src/model/GetDbfsResult.cc
|
||||
src/model/GetServiceLinkedRoleRequest.cc
|
||||
src/model/GetServiceLinkedRoleResult.cc
|
||||
src/model/GetSnapshotLinkRequest.cc
|
||||
src/model/GetSnapshotLinkResult.cc
|
||||
src/model/ListAutoSnapshotPoliciesRequest.cc
|
||||
src/model/ListAutoSnapshotPoliciesResult.cc
|
||||
src/model/ListAutoSnapshotPolicyAppliedDbfsRequest.cc
|
||||
@@ -140,6 +146,8 @@ set(dbfs_src
|
||||
src/model/ListDbfsAttachedEcsInstancesResult.cc
|
||||
src/model/ListSnapshotRequest.cc
|
||||
src/model/ListSnapshotResult.cc
|
||||
src/model/ListSnapshotLinksRequest.cc
|
||||
src/model/ListSnapshotLinksResult.cc
|
||||
src/model/ListTagKeysRequest.cc
|
||||
src/model/ListTagKeysResult.cc
|
||||
src/model/ListTagValuesRequest.cc
|
||||
|
||||
@@ -58,6 +58,8 @@
|
||||
#include "model/GetDbfsResult.h"
|
||||
#include "model/GetServiceLinkedRoleRequest.h"
|
||||
#include "model/GetServiceLinkedRoleResult.h"
|
||||
#include "model/GetSnapshotLinkRequest.h"
|
||||
#include "model/GetSnapshotLinkResult.h"
|
||||
#include "model/ListAutoSnapshotPoliciesRequest.h"
|
||||
#include "model/ListAutoSnapshotPoliciesResult.h"
|
||||
#include "model/ListAutoSnapshotPolicyAppliedDbfsRequest.h"
|
||||
@@ -72,6 +74,8 @@
|
||||
#include "model/ListDbfsAttachedEcsInstancesResult.h"
|
||||
#include "model/ListSnapshotRequest.h"
|
||||
#include "model/ListSnapshotResult.h"
|
||||
#include "model/ListSnapshotLinksRequest.h"
|
||||
#include "model/ListSnapshotLinksResult.h"
|
||||
#include "model/ListTagKeysRequest.h"
|
||||
#include "model/ListTagKeysResult.h"
|
||||
#include "model/ListTagValuesRequest.h"
|
||||
@@ -151,6 +155,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::GetServiceLinkedRoleResult> GetServiceLinkedRoleOutcome;
|
||||
typedef std::future<GetServiceLinkedRoleOutcome> GetServiceLinkedRoleOutcomeCallable;
|
||||
typedef std::function<void(const DBFSClient*, const Model::GetServiceLinkedRoleRequest&, const GetServiceLinkedRoleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetServiceLinkedRoleAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetSnapshotLinkResult> GetSnapshotLinkOutcome;
|
||||
typedef std::future<GetSnapshotLinkOutcome> GetSnapshotLinkOutcomeCallable;
|
||||
typedef std::function<void(const DBFSClient*, const Model::GetSnapshotLinkRequest&, const GetSnapshotLinkOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetSnapshotLinkAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListAutoSnapshotPoliciesResult> ListAutoSnapshotPoliciesOutcome;
|
||||
typedef std::future<ListAutoSnapshotPoliciesOutcome> ListAutoSnapshotPoliciesOutcomeCallable;
|
||||
typedef std::function<void(const DBFSClient*, const Model::ListAutoSnapshotPoliciesRequest&, const ListAutoSnapshotPoliciesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListAutoSnapshotPoliciesAsyncHandler;
|
||||
@@ -172,6 +179,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::ListSnapshotResult> ListSnapshotOutcome;
|
||||
typedef std::future<ListSnapshotOutcome> ListSnapshotOutcomeCallable;
|
||||
typedef std::function<void(const DBFSClient*, const Model::ListSnapshotRequest&, const ListSnapshotOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListSnapshotAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListSnapshotLinksResult> ListSnapshotLinksOutcome;
|
||||
typedef std::future<ListSnapshotLinksOutcome> ListSnapshotLinksOutcomeCallable;
|
||||
typedef std::function<void(const DBFSClient*, const Model::ListSnapshotLinksRequest&, const ListSnapshotLinksOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListSnapshotLinksAsyncHandler;
|
||||
typedef Outcome<Error, Model::ListTagKeysResult> ListTagKeysOutcome;
|
||||
typedef std::future<ListTagKeysOutcome> ListTagKeysOutcomeCallable;
|
||||
typedef std::function<void(const DBFSClient*, const Model::ListTagKeysRequest&, const ListTagKeysOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListTagKeysAsyncHandler;
|
||||
@@ -255,6 +265,9 @@ namespace AlibabaCloud
|
||||
GetServiceLinkedRoleOutcome getServiceLinkedRole(const Model::GetServiceLinkedRoleRequest &request)const;
|
||||
void getServiceLinkedRoleAsync(const Model::GetServiceLinkedRoleRequest& request, const GetServiceLinkedRoleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetServiceLinkedRoleOutcomeCallable getServiceLinkedRoleCallable(const Model::GetServiceLinkedRoleRequest& request) const;
|
||||
GetSnapshotLinkOutcome getSnapshotLink(const Model::GetSnapshotLinkRequest &request)const;
|
||||
void getSnapshotLinkAsync(const Model::GetSnapshotLinkRequest& request, const GetSnapshotLinkAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetSnapshotLinkOutcomeCallable getSnapshotLinkCallable(const Model::GetSnapshotLinkRequest& request) const;
|
||||
ListAutoSnapshotPoliciesOutcome listAutoSnapshotPolicies(const Model::ListAutoSnapshotPoliciesRequest &request)const;
|
||||
void listAutoSnapshotPoliciesAsync(const Model::ListAutoSnapshotPoliciesRequest& request, const ListAutoSnapshotPoliciesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListAutoSnapshotPoliciesOutcomeCallable listAutoSnapshotPoliciesCallable(const Model::ListAutoSnapshotPoliciesRequest& request) const;
|
||||
@@ -276,6 +289,9 @@ namespace AlibabaCloud
|
||||
ListSnapshotOutcome listSnapshot(const Model::ListSnapshotRequest &request)const;
|
||||
void listSnapshotAsync(const Model::ListSnapshotRequest& request, const ListSnapshotAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListSnapshotOutcomeCallable listSnapshotCallable(const Model::ListSnapshotRequest& request) const;
|
||||
ListSnapshotLinksOutcome listSnapshotLinks(const Model::ListSnapshotLinksRequest &request)const;
|
||||
void listSnapshotLinksAsync(const Model::ListSnapshotLinksRequest& request, const ListSnapshotLinksAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListSnapshotLinksOutcomeCallable listSnapshotLinksCallable(const Model::ListSnapshotLinksRequest& request) const;
|
||||
ListTagKeysOutcome listTagKeys(const Model::ListTagKeysRequest &request)const;
|
||||
void listTagKeysAsync(const Model::ListTagKeysRequest& request, const ListTagKeysAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ListTagKeysOutcomeCallable listTagKeysCallable(const Model::ListTagKeysRequest& request) const;
|
||||
|
||||
@@ -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_DBFS_MODEL_GETSNAPSHOTLINKREQUEST_H_
|
||||
#define ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/dbfs/DBFSExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace DBFS {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DBFS_EXPORT GetSnapshotLinkRequest : public RpcServiceRequest {
|
||||
public:
|
||||
GetSnapshotLinkRequest();
|
||||
~GetSnapshotLinkRequest();
|
||||
std::string getLinkId() const;
|
||||
void setLinkId(const std::string &linkId);
|
||||
std::string getRegionId() const;
|
||||
void setRegionId(const std::string ®ionId);
|
||||
|
||||
private:
|
||||
std::string linkId_;
|
||||
std::string regionId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace DBFS
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKREQUEST_H_
|
||||
67
dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h
Normal file
67
dbfs/include/alibabacloud/dbfs/model/GetSnapshotLinkResult.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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_DBFS_MODEL_GETSNAPSHOTLINKRESULT_H_
|
||||
#define ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/dbfs/DBFSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DBFS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DBFS_EXPORT GetSnapshotLinkResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct EcsListItem
|
||||
{
|
||||
std::string ecsId;
|
||||
};
|
||||
std::string status;
|
||||
int snapshotCount;
|
||||
std::string category;
|
||||
std::string fsName;
|
||||
std::vector<EcsListItem> ecsList;
|
||||
std::string fsId;
|
||||
long totalSize;
|
||||
int sourceSize;
|
||||
std::string linkId;
|
||||
};
|
||||
|
||||
|
||||
GetSnapshotLinkResult();
|
||||
explicit GetSnapshotLinkResult(const std::string &payload);
|
||||
~GetSnapshotLinkResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DBFS_MODEL_GETSNAPSHOTLINKRESULT_H_
|
||||
@@ -35,12 +35,12 @@ namespace AlibabaCloud
|
||||
struct DbfsListItem
|
||||
{
|
||||
std::string status;
|
||||
std::string snapshotCount;
|
||||
int snapshotCount;
|
||||
std::string fsName;
|
||||
long sizeG;
|
||||
std::string fsId;
|
||||
std::string regionId;
|
||||
std::string totalSize;
|
||||
long totalSize;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace AlibabaCloud
|
||||
struct DbfsListItem
|
||||
{
|
||||
std::string status;
|
||||
std::string snapshotCount;
|
||||
int snapshotCount;
|
||||
std::string fsName;
|
||||
long sizeG;
|
||||
std::string fsId;
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSREQUEST_H_
|
||||
#define ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSREQUEST_H_
|
||||
|
||||
#include <alibabacloud/dbfs/DBFSExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace DBFS {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_DBFS_EXPORT ListSnapshotLinksRequest : public RpcServiceRequest {
|
||||
public:
|
||||
ListSnapshotLinksRequest();
|
||||
~ListSnapshotLinksRequest();
|
||||
std::string getFilterValue() const;
|
||||
void setFilterValue(const std::string &filterValue);
|
||||
int getPageNumber() const;
|
||||
void setPageNumber(int pageNumber);
|
||||
std::string getFilterKey() const;
|
||||
void setFilterKey(const std::string &filterKey);
|
||||
std::string getRegionId() const;
|
||||
void setRegionId(const std::string ®ionId);
|
||||
int getPageSize() const;
|
||||
void setPageSize(int pageSize);
|
||||
|
||||
private:
|
||||
std::string filterValue_;
|
||||
int pageNumber_;
|
||||
std::string filterKey_;
|
||||
std::string regionId_;
|
||||
int pageSize_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace DBFS
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSREQUEST_H_
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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_DBFS_MODEL_LISTSNAPSHOTLINKSRESULT_H_
|
||||
#define ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/dbfs/DBFSExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace DBFS
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_DBFS_EXPORT ListSnapshotLinksResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Info
|
||||
{
|
||||
struct EcsListItem
|
||||
{
|
||||
std::string ecsId;
|
||||
};
|
||||
std::string status;
|
||||
int snapshotCount;
|
||||
std::string fsName;
|
||||
std::vector<Info::EcsListItem> ecsList;
|
||||
std::string fsId;
|
||||
long totalSize;
|
||||
int sourceSize;
|
||||
std::string linkId;
|
||||
};
|
||||
|
||||
|
||||
ListSnapshotLinksResult();
|
||||
explicit ListSnapshotLinksResult(const std::string &payload);
|
||||
~ListSnapshotLinksResult();
|
||||
std::vector<Info> getSnapshotLinks()const;
|
||||
int getTotalCount()const;
|
||||
int getPageSize()const;
|
||||
int getPageNumber()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<Info> snapshotLinks_;
|
||||
int totalCount_;
|
||||
int pageSize_;
|
||||
int pageNumber_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_DBFS_MODEL_LISTSNAPSHOTLINKSRESULT_H_
|
||||
@@ -31,21 +31,21 @@ DBFSClient::DBFSClient(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, "dbfs");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
DBFSClient::DBFSClient(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, "dbfs");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
DBFSClient::DBFSClient(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, "dbfs");
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
DBFSClient::~DBFSClient()
|
||||
@@ -699,6 +699,42 @@ DBFSClient::GetServiceLinkedRoleOutcomeCallable DBFSClient::getServiceLinkedRole
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DBFSClient::GetSnapshotLinkOutcome DBFSClient::getSnapshotLink(const GetSnapshotLinkRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetSnapshotLinkOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetSnapshotLinkOutcome(GetSnapshotLinkResult(outcome.result()));
|
||||
else
|
||||
return GetSnapshotLinkOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DBFSClient::getSnapshotLinkAsync(const GetSnapshotLinkRequest& request, const GetSnapshotLinkAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getSnapshotLink(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DBFSClient::GetSnapshotLinkOutcomeCallable DBFSClient::getSnapshotLinkCallable(const GetSnapshotLinkRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetSnapshotLinkOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getSnapshotLink(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DBFSClient::ListAutoSnapshotPoliciesOutcome DBFSClient::listAutoSnapshotPolicies(const ListAutoSnapshotPoliciesRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -951,6 +987,42 @@ DBFSClient::ListSnapshotOutcomeCallable DBFSClient::listSnapshotCallable(const L
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DBFSClient::ListSnapshotLinksOutcome DBFSClient::listSnapshotLinks(const ListSnapshotLinksRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ListSnapshotLinksOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ListSnapshotLinksOutcome(ListSnapshotLinksResult(outcome.result()));
|
||||
else
|
||||
return ListSnapshotLinksOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void DBFSClient::listSnapshotLinksAsync(const ListSnapshotLinksRequest& request, const ListSnapshotLinksAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, listSnapshotLinks(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
DBFSClient::ListSnapshotLinksOutcomeCallable DBFSClient::listSnapshotLinksCallable(const ListSnapshotLinksRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ListSnapshotLinksOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->listSnapshotLinks(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
DBFSClient::ListTagKeysOutcome DBFSClient::listTagKeys(const ListTagKeysRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
45
dbfs/src/model/GetSnapshotLinkRequest.cc
Normal file
45
dbfs/src/model/GetSnapshotLinkRequest.cc
Normal 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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/dbfs/model/GetSnapshotLinkRequest.h>
|
||||
|
||||
using AlibabaCloud::DBFS::Model::GetSnapshotLinkRequest;
|
||||
|
||||
GetSnapshotLinkRequest::GetSnapshotLinkRequest()
|
||||
: RpcServiceRequest("dbfs", "2020-04-18", "GetSnapshotLink") {
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
GetSnapshotLinkRequest::~GetSnapshotLinkRequest() {}
|
||||
|
||||
std::string GetSnapshotLinkRequest::getLinkId() const {
|
||||
return linkId_;
|
||||
}
|
||||
|
||||
void GetSnapshotLinkRequest::setLinkId(const std::string &linkId) {
|
||||
linkId_ = linkId;
|
||||
setParameter(std::string("LinkId"), linkId);
|
||||
}
|
||||
|
||||
std::string GetSnapshotLinkRequest::getRegionId() const {
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void GetSnapshotLinkRequest::setRegionId(const std::string ®ionId) {
|
||||
regionId_ = regionId;
|
||||
setParameter(std::string("RegionId"), regionId);
|
||||
}
|
||||
|
||||
74
dbfs/src/model/GetSnapshotLinkResult.cc
Normal file
74
dbfs/src/model/GetSnapshotLinkResult.cc
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 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/dbfs/model/GetSnapshotLinkResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::DBFS;
|
||||
using namespace AlibabaCloud::DBFS::Model;
|
||||
|
||||
GetSnapshotLinkResult::GetSnapshotLinkResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetSnapshotLinkResult::GetSnapshotLinkResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetSnapshotLinkResult::~GetSnapshotLinkResult()
|
||||
{}
|
||||
|
||||
void GetSnapshotLinkResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Status"].isNull())
|
||||
data_.status = dataNode["Status"].asString();
|
||||
if(!dataNode["TotalSize"].isNull())
|
||||
data_.totalSize = std::stol(dataNode["TotalSize"].asString());
|
||||
if(!dataNode["SourceSize"].isNull())
|
||||
data_.sourceSize = std::stoi(dataNode["SourceSize"].asString());
|
||||
if(!dataNode["FsId"].isNull())
|
||||
data_.fsId = dataNode["FsId"].asString();
|
||||
if(!dataNode["SnapshotCount"].isNull())
|
||||
data_.snapshotCount = std::stoi(dataNode["SnapshotCount"].asString());
|
||||
if(!dataNode["FsName"].isNull())
|
||||
data_.fsName = dataNode["FsName"].asString();
|
||||
if(!dataNode["LinkId"].isNull())
|
||||
data_.linkId = dataNode["LinkId"].asString();
|
||||
if(!dataNode["Category"].isNull())
|
||||
data_.category = dataNode["Category"].asString();
|
||||
auto allEcsListNode = dataNode["EcsList"]["EcsListItem"];
|
||||
for (auto dataNodeEcsListEcsListItem : allEcsListNode)
|
||||
{
|
||||
Data::EcsListItem ecsListItemObject;
|
||||
if(!dataNodeEcsListEcsListItem["EcsId"].isNull())
|
||||
ecsListItemObject.ecsId = dataNodeEcsListEcsListItem["EcsId"].asString();
|
||||
data_.ecsList.push_back(ecsListItemObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GetSnapshotLinkResult::Data GetSnapshotLinkResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ void ListAutoSnapshotPolicyAppliedDbfsResult::parse(const std::string &payload)
|
||||
if(!valueDbfsListDbfsListItem["RegionId"].isNull())
|
||||
dbfsListObject.regionId = valueDbfsListDbfsListItem["RegionId"].asString();
|
||||
if(!valueDbfsListDbfsListItem["SnapshotCount"].isNull())
|
||||
dbfsListObject.snapshotCount = valueDbfsListDbfsListItem["SnapshotCount"].asString();
|
||||
dbfsListObject.snapshotCount = std::stoi(valueDbfsListDbfsListItem["SnapshotCount"].asString());
|
||||
if(!valueDbfsListDbfsListItem["TotalSize"].isNull())
|
||||
dbfsListObject.totalSize = valueDbfsListDbfsListItem["TotalSize"].asString();
|
||||
dbfsListObject.totalSize = std::stol(valueDbfsListDbfsListItem["TotalSize"].asString());
|
||||
dbfsList_.push_back(dbfsListObject);
|
||||
}
|
||||
if(!value["PageNumber"].isNull())
|
||||
|
||||
@@ -54,7 +54,7 @@ void ListAutoSnapshotPolicyUnappliedDbfsResult::parse(const std::string &payload
|
||||
if(!valueDbfsListDbfsListItem["RegionId"].isNull())
|
||||
dbfsListObject.regionId = valueDbfsListDbfsListItem["RegionId"].asString();
|
||||
if(!valueDbfsListDbfsListItem["SnapshotCount"].isNull())
|
||||
dbfsListObject.snapshotCount = valueDbfsListDbfsListItem["SnapshotCount"].asString();
|
||||
dbfsListObject.snapshotCount = std::stoi(valueDbfsListDbfsListItem["SnapshotCount"].asString());
|
||||
if(!valueDbfsListDbfsListItem["TotalSize"].isNull())
|
||||
dbfsListObject.totalSize = std::stol(valueDbfsListDbfsListItem["TotalSize"].asString());
|
||||
dbfsList_.push_back(dbfsListObject);
|
||||
|
||||
72
dbfs/src/model/ListSnapshotLinksRequest.cc
Normal file
72
dbfs/src/model/ListSnapshotLinksRequest.cc
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* 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/dbfs/model/ListSnapshotLinksRequest.h>
|
||||
|
||||
using AlibabaCloud::DBFS::Model::ListSnapshotLinksRequest;
|
||||
|
||||
ListSnapshotLinksRequest::ListSnapshotLinksRequest()
|
||||
: RpcServiceRequest("dbfs", "2020-04-18", "ListSnapshotLinks") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListSnapshotLinksRequest::~ListSnapshotLinksRequest() {}
|
||||
|
||||
std::string ListSnapshotLinksRequest::getFilterValue() const {
|
||||
return filterValue_;
|
||||
}
|
||||
|
||||
void ListSnapshotLinksRequest::setFilterValue(const std::string &filterValue) {
|
||||
filterValue_ = filterValue;
|
||||
setParameter(std::string("FilterValue"), filterValue);
|
||||
}
|
||||
|
||||
int ListSnapshotLinksRequest::getPageNumber() const {
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
void ListSnapshotLinksRequest::setPageNumber(int pageNumber) {
|
||||
pageNumber_ = pageNumber;
|
||||
setParameter(std::string("PageNumber"), std::to_string(pageNumber));
|
||||
}
|
||||
|
||||
std::string ListSnapshotLinksRequest::getFilterKey() const {
|
||||
return filterKey_;
|
||||
}
|
||||
|
||||
void ListSnapshotLinksRequest::setFilterKey(const std::string &filterKey) {
|
||||
filterKey_ = filterKey;
|
||||
setParameter(std::string("FilterKey"), filterKey);
|
||||
}
|
||||
|
||||
std::string ListSnapshotLinksRequest::getRegionId() const {
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ListSnapshotLinksRequest::setRegionId(const std::string ®ionId) {
|
||||
regionId_ = regionId;
|
||||
setParameter(std::string("RegionId"), regionId);
|
||||
}
|
||||
|
||||
int ListSnapshotLinksRequest::getPageSize() const {
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
void ListSnapshotLinksRequest::setPageSize(int pageSize) {
|
||||
pageSize_ = pageSize;
|
||||
setParameter(std::string("PageSize"), std::to_string(pageSize));
|
||||
}
|
||||
|
||||
98
dbfs/src/model/ListSnapshotLinksResult.cc
Normal file
98
dbfs/src/model/ListSnapshotLinksResult.cc
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* 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/dbfs/model/ListSnapshotLinksResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::DBFS;
|
||||
using namespace AlibabaCloud::DBFS::Model;
|
||||
|
||||
ListSnapshotLinksResult::ListSnapshotLinksResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListSnapshotLinksResult::ListSnapshotLinksResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListSnapshotLinksResult::~ListSnapshotLinksResult()
|
||||
{}
|
||||
|
||||
void ListSnapshotLinksResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allSnapshotLinksNode = value["SnapshotLinks"]["Info"];
|
||||
for (auto valueSnapshotLinksInfo : allSnapshotLinksNode)
|
||||
{
|
||||
Info snapshotLinksObject;
|
||||
if(!valueSnapshotLinksInfo["Status"].isNull())
|
||||
snapshotLinksObject.status = valueSnapshotLinksInfo["Status"].asString();
|
||||
if(!valueSnapshotLinksInfo["TotalSize"].isNull())
|
||||
snapshotLinksObject.totalSize = std::stol(valueSnapshotLinksInfo["TotalSize"].asString());
|
||||
if(!valueSnapshotLinksInfo["SourceSize"].isNull())
|
||||
snapshotLinksObject.sourceSize = std::stoi(valueSnapshotLinksInfo["SourceSize"].asString());
|
||||
if(!valueSnapshotLinksInfo["FsId"].isNull())
|
||||
snapshotLinksObject.fsId = valueSnapshotLinksInfo["FsId"].asString();
|
||||
if(!valueSnapshotLinksInfo["SnapshotCount"].isNull())
|
||||
snapshotLinksObject.snapshotCount = std::stoi(valueSnapshotLinksInfo["SnapshotCount"].asString());
|
||||
if(!valueSnapshotLinksInfo["FsName"].isNull())
|
||||
snapshotLinksObject.fsName = valueSnapshotLinksInfo["FsName"].asString();
|
||||
if(!valueSnapshotLinksInfo["LinkId"].isNull())
|
||||
snapshotLinksObject.linkId = valueSnapshotLinksInfo["LinkId"].asString();
|
||||
auto allEcsListNode = valueSnapshotLinksInfo["EcsList"]["EcsListItem"];
|
||||
for (auto valueSnapshotLinksInfoEcsListEcsListItem : allEcsListNode)
|
||||
{
|
||||
Info::EcsListItem ecsListObject;
|
||||
if(!valueSnapshotLinksInfoEcsListEcsListItem["EcsId"].isNull())
|
||||
ecsListObject.ecsId = valueSnapshotLinksInfoEcsListEcsListItem["EcsId"].asString();
|
||||
snapshotLinksObject.ecsList.push_back(ecsListObject);
|
||||
}
|
||||
snapshotLinks_.push_back(snapshotLinksObject);
|
||||
}
|
||||
if(!value["TotalCount"].isNull())
|
||||
totalCount_ = std::stoi(value["TotalCount"].asString());
|
||||
if(!value["PageSize"].isNull())
|
||||
pageSize_ = std::stoi(value["PageSize"].asString());
|
||||
if(!value["PageNumber"].isNull())
|
||||
pageNumber_ = std::stoi(value["PageNumber"].asString());
|
||||
|
||||
}
|
||||
|
||||
std::vector<ListSnapshotLinksResult::Info> ListSnapshotLinksResult::getSnapshotLinks()const
|
||||
{
|
||||
return snapshotLinks_;
|
||||
}
|
||||
|
||||
int ListSnapshotLinksResult::getTotalCount()const
|
||||
{
|
||||
return totalCount_;
|
||||
}
|
||||
|
||||
int ListSnapshotLinksResult::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
}
|
||||
|
||||
int ListSnapshotLinksResult::getPageNumber()const
|
||||
{
|
||||
return pageNumber_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user