Support Elastic Desktop Service.

This commit is contained in:
sdk-team
2022-07-18 03:41:11 +00:00
parent f9cb2e2167
commit e4a6e73946
21 changed files with 334 additions and 4 deletions

View File

@@ -51,6 +51,8 @@ set(nas_public_header_model
include/alibabacloud/nas/model/CreateDataFlowResult.h
include/alibabacloud/nas/model/CreateDataFlowTaskRequest.h
include/alibabacloud/nas/model/CreateDataFlowTaskResult.h
include/alibabacloud/nas/model/CreateFileRequest.h
include/alibabacloud/nas/model/CreateFileResult.h
include/alibabacloud/nas/model/CreateFileSystemRequest.h
include/alibabacloud/nas/model/CreateFileSystemResult.h
include/alibabacloud/nas/model/CreateFilesetRequest.h
@@ -252,6 +254,8 @@ set(nas_src
src/model/CreateDataFlowResult.cc
src/model/CreateDataFlowTaskRequest.cc
src/model/CreateDataFlowTaskResult.cc
src/model/CreateFileRequest.cc
src/model/CreateFileResult.cc
src/model/CreateFileSystemRequest.cc
src/model/CreateFileSystemResult.cc
src/model/CreateFilesetRequest.cc

View File

@@ -52,6 +52,8 @@
#include "model/CreateDataFlowResult.h"
#include "model/CreateDataFlowTaskRequest.h"
#include "model/CreateDataFlowTaskResult.h"
#include "model/CreateFileRequest.h"
#include "model/CreateFileResult.h"
#include "model/CreateFileSystemRequest.h"
#include "model/CreateFileSystemResult.h"
#include "model/CreateFilesetRequest.h"
@@ -274,6 +276,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::CreateDataFlowTaskResult> CreateDataFlowTaskOutcome;
typedef std::future<CreateDataFlowTaskOutcome> CreateDataFlowTaskOutcomeCallable;
typedef std::function<void(const NASClient*, const Model::CreateDataFlowTaskRequest&, const CreateDataFlowTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateDataFlowTaskAsyncHandler;
typedef Outcome<Error, Model::CreateFileResult> CreateFileOutcome;
typedef std::future<CreateFileOutcome> CreateFileOutcomeCallable;
typedef std::function<void(const NASClient*, const Model::CreateFileRequest&, const CreateFileOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateFileAsyncHandler;
typedef Outcome<Error, Model::CreateFileSystemResult> CreateFileSystemOutcome;
typedef std::future<CreateFileSystemOutcome> CreateFileSystemOutcomeCallable;
typedef std::function<void(const NASClient*, const Model::CreateFileSystemRequest&, const CreateFileSystemOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateFileSystemAsyncHandler;
@@ -576,6 +581,9 @@ namespace AlibabaCloud
CreateDataFlowTaskOutcome createDataFlowTask(const Model::CreateDataFlowTaskRequest &request)const;
void createDataFlowTaskAsync(const Model::CreateDataFlowTaskRequest& request, const CreateDataFlowTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateDataFlowTaskOutcomeCallable createDataFlowTaskCallable(const Model::CreateDataFlowTaskRequest& request) const;
CreateFileOutcome createFile(const Model::CreateFileRequest &request)const;
void createFileAsync(const Model::CreateFileRequest& request, const CreateFileAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateFileOutcomeCallable createFileCallable(const Model::CreateFileRequest& request) const;
CreateFileSystemOutcome createFileSystem(const Model::CreateFileSystemRequest &request)const;
void createFileSystemAsync(const Model::CreateFileSystemRequest& request, const CreateFileSystemAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateFileSystemOutcomeCallable createFileSystemCallable(const Model::CreateFileSystemRequest& request) const;

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.
*/
#ifndef ALIBABACLOUD_NAS_MODEL_CREATEFILEREQUEST_H_
#define ALIBABACLOUD_NAS_MODEL_CREATEFILEREQUEST_H_
#include <alibabacloud/nas/NASExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace NAS {
namespace Model {
class ALIBABACLOUD_NAS_EXPORT CreateFileRequest : public RpcServiceRequest {
public:
CreateFileRequest();
~CreateFileRequest();
bool getOwnerAccessInheritable() const;
void setOwnerAccessInheritable(bool ownerAccessInheritable);
std::string getType() const;
void setType(const std::string &type);
std::string getPath() const;
void setPath(const std::string &path);
std::string getFileSystemId() const;
void setFileSystemId(const std::string &fileSystemId);
std::string getOwner() const;
void setOwner(const std::string &owner);
private:
bool ownerAccessInheritable_;
std::string type_;
std::string path_;
std::string fileSystemId_;
std::string owner_;
};
} // namespace Model
} // namespace NAS
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_NAS_MODEL_CREATEFILEREQUEST_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_NAS_MODEL_CREATEFILERESULT_H_
#define ALIBABACLOUD_NAS_MODEL_CREATEFILERESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/nas/NASExport.h>
namespace AlibabaCloud
{
namespace NAS
{
namespace Model
{
class ALIBABACLOUD_NAS_EXPORT CreateFileResult : public ServiceResult
{
public:
CreateFileResult();
explicit CreateFileResult(const std::string &payload);
~CreateFileResult();
protected:
void parse(const std::string &payload);
private:
};
}
}
}
#endif // !ALIBABACLOUD_NAS_MODEL_CREATEFILERESULT_H_

View File

@@ -54,6 +54,7 @@ namespace AlibabaCloud
std::string networkType;
std::vector<MountTarget::ClientMasterNode> clientMasterNodes;
std::vector<MountTarget::Tag> tags;
std::string iPVersion;
};

View File

@@ -36,6 +36,7 @@ namespace AlibabaCloud
{
std::string homeDirPath;
bool enableAnonymousAccess;
std::string authCenter;
bool enabled;
std::string superAdminSid;
bool rejectUnencryptedAccess;

View File

@@ -36,11 +36,17 @@ public:
void setKeytabMd5(const std::string &keytabMd5);
std::string getFileSystemId() const;
void setFileSystemId(const std::string &fileSystemId);
std::string getAuthCenter() const;
void setAuthCenter(const std::string &authCenter);
std::string getAuthMethod() const;
void setAuthMethod(const std::string &authMethod);
private:
std::string keytab_;
std::string keytabMd5_;
std::string fileSystemId_;
std::string authCenter_;
std::string authMethod_;
};
} // namespace Model
} // namespace NAS

View File

@@ -37,6 +37,7 @@ namespace AlibabaCloud
std::string status;
long reservedDays;
long size;
long secondarySize;
std::string enableTime;
};

View File

@@ -35,6 +35,7 @@ namespace AlibabaCloud
struct Entry
{
std::string type;
std::string owner;
std::string storageType;
std::string inode;
std::string atime;

View File

@@ -42,10 +42,14 @@ public:
void setRejectUnencryptedAccess(bool rejectUnencryptedAccess);
std::string getFileSystemId() const;
void setFileSystemId(const std::string &fileSystemId);
std::string getAuthCenter() const;
void setAuthCenter(const std::string &authCenter);
std::string getHomeDirPath() const;
void setHomeDirPath(const std::string &homeDirPath);
bool getEnableAnonymousAccess() const;
void setEnableAnonymousAccess(bool enableAnonymousAccess);
std::string getAuthMethod() const;
void setAuthMethod(const std::string &authMethod);
private:
bool encryptData_;
@@ -54,8 +58,10 @@ private:
std::string keytabMd5_;
bool rejectUnencryptedAccess_;
std::string fileSystemId_;
std::string authCenter_;
std::string homeDirPath_;
bool enableAnonymousAccess_;
std::string authMethod_;
};
} // namespace Model
} // namespace NAS

View File

@@ -31,21 +31,21 @@ NASClient::NASClient(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, "nas");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "NAS");
}
NASClient::NASClient(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, "nas");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "NAS");
}
NASClient::NASClient(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, "nas");
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "NAS");
}
NASClient::~NASClient()
@@ -591,6 +591,42 @@ NASClient::CreateDataFlowTaskOutcomeCallable NASClient::createDataFlowTaskCallab
return task->get_future();
}
NASClient::CreateFileOutcome NASClient::createFile(const CreateFileRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateFileOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateFileOutcome(CreateFileResult(outcome.result()));
else
return CreateFileOutcome(outcome.error());
}
void NASClient::createFileAsync(const CreateFileRequest& request, const CreateFileAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createFile(request), context);
};
asyncExecute(new Runnable(fn));
}
NASClient::CreateFileOutcomeCallable NASClient::createFileCallable(const CreateFileRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateFileOutcome()>>(
[this, request]()
{
return this->createFile(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
NASClient::CreateFileSystemOutcome NASClient::createFileSystem(const CreateFileSystemRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View 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/nas/model/CreateFileRequest.h>
using AlibabaCloud::NAS::Model::CreateFileRequest;
CreateFileRequest::CreateFileRequest()
: RpcServiceRequest("nas", "2017-06-26", "CreateFile") {
setMethod(HttpRequest::Method::Post);
}
CreateFileRequest::~CreateFileRequest() {}
bool CreateFileRequest::getOwnerAccessInheritable() const {
return ownerAccessInheritable_;
}
void CreateFileRequest::setOwnerAccessInheritable(bool ownerAccessInheritable) {
ownerAccessInheritable_ = ownerAccessInheritable;
setParameter(std::string("OwnerAccessInheritable"), ownerAccessInheritable ? "true" : "false");
}
std::string CreateFileRequest::getType() const {
return type_;
}
void CreateFileRequest::setType(const std::string &type) {
type_ = type;
setParameter(std::string("Type"), type);
}
std::string CreateFileRequest::getPath() const {
return path_;
}
void CreateFileRequest::setPath(const std::string &path) {
path_ = path;
setParameter(std::string("Path"), path);
}
std::string CreateFileRequest::getFileSystemId() const {
return fileSystemId_;
}
void CreateFileRequest::setFileSystemId(const std::string &fileSystemId) {
fileSystemId_ = fileSystemId;
setParameter(std::string("FileSystemId"), fileSystemId);
}
std::string CreateFileRequest::getOwner() const {
return owner_;
}
void CreateFileRequest::setOwner(const std::string &owner) {
owner_ = owner;
setParameter(std::string("Owner"), owner);
}

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

View File

@@ -57,6 +57,8 @@ void DescribeMountTargetsResult::parse(const std::string &payload)
mountTargetsObject.vswId = valueMountTargetsMountTarget["VswId"].asString();
if(!valueMountTargetsMountTarget["NetworkType"].isNull())
mountTargetsObject.networkType = valueMountTargetsMountTarget["NetworkType"].asString();
if(!valueMountTargetsMountTarget["IPVersion"].isNull())
mountTargetsObject.iPVersion = valueMountTargetsMountTarget["IPVersion"].asString();
auto allClientMasterNodesNode = valueMountTargetsMountTarget["ClientMasterNodes"]["ClientMasterNode"];
for (auto valueMountTargetsMountTargetClientMasterNodesClientMasterNode : allClientMasterNodesNode)
{

View File

@@ -42,6 +42,8 @@ void DescribeSmbAclResult::parse(const std::string &payload)
auto aclNode = value["Acl"];
if(!aclNode["AuthMethod"].isNull())
acl_.authMethod = aclNode["AuthMethod"].asString();
if(!aclNode["AuthCenter"].isNull())
acl_.authCenter = aclNode["AuthCenter"].asString();
if(!aclNode["EnableAnonymousAccess"].isNull())
acl_.enableAnonymousAccess = aclNode["EnableAnonymousAccess"].asString() == "true";
if(!aclNode["Enabled"].isNull())

View File

@@ -52,3 +52,21 @@ void EnableSmbAclRequest::setFileSystemId(const std::string &fileSystemId) {
setParameter(std::string("FileSystemId"), fileSystemId);
}
std::string EnableSmbAclRequest::getAuthCenter() const {
return authCenter_;
}
void EnableSmbAclRequest::setAuthCenter(const std::string &authCenter) {
authCenter_ = authCenter;
setParameter(std::string("AuthCenter"), authCenter);
}
std::string EnableSmbAclRequest::getAuthMethod() const {
return authMethod_;
}
void EnableSmbAclRequest::setAuthMethod(const std::string &authMethod) {
authMethod_ = authMethod;
setParameter(std::string("AuthMethod"), authMethod);
}

View File

@@ -42,6 +42,8 @@ void GetRecycleBinAttributeResult::parse(const std::string &payload)
auto recycleBinAttributeNode = value["RecycleBinAttribute"];
if(!recycleBinAttributeNode["Size"].isNull())
recycleBinAttribute_.size = std::stol(recycleBinAttributeNode["Size"].asString());
if(!recycleBinAttributeNode["SecondarySize"].isNull())
recycleBinAttribute_.secondarySize = std::stol(recycleBinAttributeNode["SecondarySize"].asString());
if(!recycleBinAttributeNode["Status"].isNull())
recycleBinAttribute_.status = recycleBinAttributeNode["Status"].asString();
if(!recycleBinAttributeNode["ReservedDays"].isNull())

View File

@@ -65,6 +65,8 @@ void ListDirectoriesAndFilesResult::parse(const std::string &payload)
entriesObject.inode = valueEntriesEntry["Inode"].asString();
if(!valueEntriesEntry["FileId"].isNull())
entriesObject.fileId = valueEntriesEntry["FileId"].asString();
if(!valueEntriesEntry["Owner"].isNull())
entriesObject.owner = valueEntriesEntry["Owner"].asString();
entries_.push_back(entriesObject);
}
if(!value["NextToken"].isNull())

View File

@@ -79,6 +79,15 @@ void ModifySmbAclRequest::setFileSystemId(const std::string &fileSystemId) {
setParameter(std::string("FileSystemId"), fileSystemId);
}
std::string ModifySmbAclRequest::getAuthCenter() const {
return authCenter_;
}
void ModifySmbAclRequest::setAuthCenter(const std::string &authCenter) {
authCenter_ = authCenter;
setParameter(std::string("AuthCenter"), authCenter);
}
std::string ModifySmbAclRequest::getHomeDirPath() const {
return homeDirPath_;
}
@@ -97,3 +106,12 @@ void ModifySmbAclRequest::setEnableAnonymousAccess(bool enableAnonymousAccess) {
setParameter(std::string("EnableAnonymousAccess"), enableAnonymousAccess ? "true" : "false");
}
std::string ModifySmbAclRequest::getAuthMethod() const {
return authMethod_;
}
void ModifySmbAclRequest::setAuthMethod(const std::string &authMethod) {
authMethod_ = authMethod;
setParameter(std::string("AuthMethod"), authMethod);
}