Create Lindorm Open api.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
2021-01-14 Version: patch
|
||||
- Create Lindorm Open api.
|
||||
|
||||
2021-01-13 Version: patch
|
||||
- Add SwitchInstanceHA API.
|
||||
- ModifyInstanceSpec add SourceBiz param.
|
||||
|
||||
@@ -21,8 +21,12 @@ set(hitsdb_public_header
|
||||
include/alibabacloud/hitsdb/HitsdbExport.h )
|
||||
|
||||
set(hitsdb_public_header_model
|
||||
include/alibabacloud/hitsdb/model/DescribeRegionsRequest.h
|
||||
include/alibabacloud/hitsdb/model/DescribeRegionsResult.h
|
||||
include/alibabacloud/hitsdb/model/GetInstanceIpWhiteListRequest.h
|
||||
include/alibabacloud/hitsdb/model/GetInstanceIpWhiteListResult.h
|
||||
include/alibabacloud/hitsdb/model/GetLindormInstanceRequest.h
|
||||
include/alibabacloud/hitsdb/model/GetLindormInstanceResult.h
|
||||
include/alibabacloud/hitsdb/model/GetLindormInstanceEngineListRequest.h
|
||||
include/alibabacloud/hitsdb/model/GetLindormInstanceEngineListResult.h
|
||||
include/alibabacloud/hitsdb/model/GetLindormInstanceListRequest.h
|
||||
@@ -32,8 +36,12 @@ set(hitsdb_public_header_model
|
||||
|
||||
set(hitsdb_src
|
||||
src/HitsdbClient.cc
|
||||
src/model/DescribeRegionsRequest.cc
|
||||
src/model/DescribeRegionsResult.cc
|
||||
src/model/GetInstanceIpWhiteListRequest.cc
|
||||
src/model/GetInstanceIpWhiteListResult.cc
|
||||
src/model/GetLindormInstanceRequest.cc
|
||||
src/model/GetLindormInstanceResult.cc
|
||||
src/model/GetLindormInstanceEngineListRequest.cc
|
||||
src/model/GetLindormInstanceEngineListResult.cc
|
||||
src/model/GetLindormInstanceListRequest.cc
|
||||
|
||||
@@ -22,8 +22,12 @@
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "HitsdbExport.h"
|
||||
#include "model/DescribeRegionsRequest.h"
|
||||
#include "model/DescribeRegionsResult.h"
|
||||
#include "model/GetInstanceIpWhiteListRequest.h"
|
||||
#include "model/GetInstanceIpWhiteListResult.h"
|
||||
#include "model/GetLindormInstanceRequest.h"
|
||||
#include "model/GetLindormInstanceResult.h"
|
||||
#include "model/GetLindormInstanceEngineListRequest.h"
|
||||
#include "model/GetLindormInstanceEngineListResult.h"
|
||||
#include "model/GetLindormInstanceListRequest.h"
|
||||
@@ -39,9 +43,15 @@ namespace AlibabaCloud
|
||||
class ALIBABACLOUD_HITSDB_EXPORT HitsdbClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::DescribeRegionsResult> DescribeRegionsOutcome;
|
||||
typedef std::future<DescribeRegionsOutcome> DescribeRegionsOutcomeCallable;
|
||||
typedef std::function<void(const HitsdbClient*, const Model::DescribeRegionsRequest&, const DescribeRegionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeRegionsAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetInstanceIpWhiteListResult> GetInstanceIpWhiteListOutcome;
|
||||
typedef std::future<GetInstanceIpWhiteListOutcome> GetInstanceIpWhiteListOutcomeCallable;
|
||||
typedef std::function<void(const HitsdbClient*, const Model::GetInstanceIpWhiteListRequest&, const GetInstanceIpWhiteListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetInstanceIpWhiteListAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetLindormInstanceResult> GetLindormInstanceOutcome;
|
||||
typedef std::future<GetLindormInstanceOutcome> GetLindormInstanceOutcomeCallable;
|
||||
typedef std::function<void(const HitsdbClient*, const Model::GetLindormInstanceRequest&, const GetLindormInstanceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetLindormInstanceAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetLindormInstanceEngineListResult> GetLindormInstanceEngineListOutcome;
|
||||
typedef std::future<GetLindormInstanceEngineListOutcome> GetLindormInstanceEngineListOutcomeCallable;
|
||||
typedef std::function<void(const HitsdbClient*, const Model::GetLindormInstanceEngineListRequest&, const GetLindormInstanceEngineListOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetLindormInstanceEngineListAsyncHandler;
|
||||
@@ -56,9 +66,15 @@ namespace AlibabaCloud
|
||||
HitsdbClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
HitsdbClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~HitsdbClient();
|
||||
DescribeRegionsOutcome describeRegions(const Model::DescribeRegionsRequest &request)const;
|
||||
void describeRegionsAsync(const Model::DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DescribeRegionsOutcomeCallable describeRegionsCallable(const Model::DescribeRegionsRequest& request) const;
|
||||
GetInstanceIpWhiteListOutcome getInstanceIpWhiteList(const Model::GetInstanceIpWhiteListRequest &request)const;
|
||||
void getInstanceIpWhiteListAsync(const Model::GetInstanceIpWhiteListRequest& request, const GetInstanceIpWhiteListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetInstanceIpWhiteListOutcomeCallable getInstanceIpWhiteListCallable(const Model::GetInstanceIpWhiteListRequest& request) const;
|
||||
GetLindormInstanceOutcome getLindormInstance(const Model::GetLindormInstanceRequest &request)const;
|
||||
void getLindormInstanceAsync(const Model::GetLindormInstanceRequest& request, const GetLindormInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetLindormInstanceOutcomeCallable getLindormInstanceCallable(const Model::GetLindormInstanceRequest& request) const;
|
||||
GetLindormInstanceEngineListOutcome getLindormInstanceEngineList(const Model::GetLindormInstanceEngineListRequest &request)const;
|
||||
void getLindormInstanceEngineListAsync(const Model::GetLindormInstanceEngineListRequest& request, const GetLindormInstanceEngineListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetLindormInstanceEngineListOutcomeCallable getLindormInstanceEngineListCallable(const Model::GetLindormInstanceEngineListRequest& request) const;
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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_HITSDB_MODEL_DESCRIBEREGIONSREQUEST_H_
|
||||
#define ALIBABACLOUD_HITSDB_MODEL_DESCRIBEREGIONSREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/hitsdb/HitsdbExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Hitsdb
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_HITSDB_EXPORT DescribeRegionsRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DescribeRegionsRequest();
|
||||
~DescribeRegionsRequest();
|
||||
|
||||
long getResourceOwnerId()const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
std::string getSecurityToken()const;
|
||||
void setSecurityToken(const std::string& securityToken);
|
||||
std::string getResourceOwnerAccount()const;
|
||||
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
|
||||
std::string getOwnerAccount()const;
|
||||
void setOwnerAccount(const std::string& ownerAccount);
|
||||
long getOwnerId()const;
|
||||
void setOwnerId(long ownerId);
|
||||
std::string getAcceptLanguage()const;
|
||||
void setAcceptLanguage(const std::string& acceptLanguage);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string accessKeyId_;
|
||||
std::string securityToken_;
|
||||
std::string resourceOwnerAccount_;
|
||||
std::string ownerAccount_;
|
||||
long ownerId_;
|
||||
std::string acceptLanguage_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_HITSDB_MODEL_DESCRIBEREGIONSREQUEST_H_
|
||||
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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_HITSDB_MODEL_DESCRIBEREGIONSRESULT_H_
|
||||
#define ALIBABACLOUD_HITSDB_MODEL_DESCRIBEREGIONSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/hitsdb/HitsdbExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Hitsdb
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_HITSDB_EXPORT DescribeRegionsResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Region
|
||||
{
|
||||
std::string regionId;
|
||||
std::string regionEndpoint;
|
||||
std::string localName;
|
||||
};
|
||||
|
||||
|
||||
DescribeRegionsResult();
|
||||
explicit DescribeRegionsResult(const std::string &payload);
|
||||
~DescribeRegionsResult();
|
||||
std::vector<Region> getRegions()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<Region> regions_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_HITSDB_MODEL_DESCRIBEREGIONSRESULT_H_
|
||||
@@ -41,6 +41,8 @@ namespace AlibabaCloud
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
std::string getSecurityToken()const;
|
||||
void setSecurityToken(const std::string& securityToken);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getResourceOwnerAccount()const;
|
||||
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
|
||||
std::string getOwnerAccount()const;
|
||||
@@ -54,6 +56,7 @@ namespace AlibabaCloud
|
||||
long resourceOwnerId_;
|
||||
std::string accessKeyId_;
|
||||
std::string securityToken_;
|
||||
std::string regionId_;
|
||||
std::string resourceOwnerAccount_;
|
||||
std::string ownerAccount_;
|
||||
long ownerId_;
|
||||
|
||||
@@ -45,6 +45,8 @@ namespace AlibabaCloud
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
std::string getSecurityToken()const;
|
||||
void setSecurityToken(const std::string& securityToken);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
int getPageSize()const;
|
||||
void setPageSize(int pageSize);
|
||||
std::string getQueryStr()const;
|
||||
@@ -64,6 +66,7 @@ namespace AlibabaCloud
|
||||
int pageNumber_;
|
||||
std::string accessKeyId_;
|
||||
std::string securityToken_;
|
||||
std::string regionId_;
|
||||
int pageSize_;
|
||||
std::string queryStr_;
|
||||
std::string resourceOwnerAccount_;
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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_HITSDB_MODEL_GETLINDORMINSTANCEREQUEST_H_
|
||||
#define ALIBABACLOUD_HITSDB_MODEL_GETLINDORMINSTANCEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/hitsdb/HitsdbExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Hitsdb
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_HITSDB_EXPORT GetLindormInstanceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetLindormInstanceRequest();
|
||||
~GetLindormInstanceRequest();
|
||||
|
||||
long getResourceOwnerId()const;
|
||||
void setResourceOwnerId(long resourceOwnerId);
|
||||
std::string getAccessKeyId()const;
|
||||
void setAccessKeyId(const std::string& accessKeyId);
|
||||
std::string getSecurityToken()const;
|
||||
void setSecurityToken(const std::string& securityToken);
|
||||
std::string getRegionId()const;
|
||||
void setRegionId(const std::string& regionId);
|
||||
std::string getResourceOwnerAccount()const;
|
||||
void setResourceOwnerAccount(const std::string& resourceOwnerAccount);
|
||||
std::string getOwnerAccount()const;
|
||||
void setOwnerAccount(const std::string& ownerAccount);
|
||||
long getOwnerId()const;
|
||||
void setOwnerId(long ownerId);
|
||||
std::string getInstanceId()const;
|
||||
void setInstanceId(const std::string& instanceId);
|
||||
|
||||
private:
|
||||
long resourceOwnerId_;
|
||||
std::string accessKeyId_;
|
||||
std::string securityToken_;
|
||||
std::string regionId_;
|
||||
std::string resourceOwnerAccount_;
|
||||
std::string ownerAccount_;
|
||||
long ownerId_;
|
||||
std::string instanceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_HITSDB_MODEL_GETLINDORMINSTANCEREQUEST_H_
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 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_HITSDB_MODEL_GETLINDORMINSTANCERESULT_H_
|
||||
#define ALIBABACLOUD_HITSDB_MODEL_GETLINDORMINSTANCERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/hitsdb/HitsdbExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Hitsdb
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_HITSDB_EXPORT GetLindormInstanceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Engine
|
||||
{
|
||||
std::string memorySize;
|
||||
std::string cpuCount;
|
||||
std::string version;
|
||||
std::string engine;
|
||||
bool isLastVersion;
|
||||
std::string coreCount;
|
||||
};
|
||||
|
||||
|
||||
GetLindormInstanceResult();
|
||||
explicit GetLindormInstanceResult(const std::string &payload);
|
||||
~GetLindormInstanceResult();
|
||||
std::vector<Engine> getEngineList()const;
|
||||
std::string getInstanceStorage()const;
|
||||
std::string getZoneId()const;
|
||||
std::string getInstanceId()const;
|
||||
bool getEnableBDS()const;
|
||||
std::string getCreateTime()const;
|
||||
bool getAutoRenew()const;
|
||||
int getColdStorage()const;
|
||||
std::string getDiskCategory()const;
|
||||
std::string getPayType()const;
|
||||
std::string getDeletionProtection()const;
|
||||
bool getEnableFS()const;
|
||||
std::string getVswitchId()const;
|
||||
std::string getVpcId()const;
|
||||
std::string getInstanceAlias()const;
|
||||
std::string getInstanceStatus()const;
|
||||
std::string getNetworkType()const;
|
||||
std::string getServiceType()const;
|
||||
int getEngineType()const;
|
||||
bool getEnablePhoenix()const;
|
||||
std::string getRegionId()const;
|
||||
std::string getExpireTime()const;
|
||||
long getAliUid()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::vector<Engine> engineList_;
|
||||
std::string instanceStorage_;
|
||||
std::string zoneId_;
|
||||
std::string instanceId_;
|
||||
bool enableBDS_;
|
||||
std::string createTime_;
|
||||
bool autoRenew_;
|
||||
int coldStorage_;
|
||||
std::string diskCategory_;
|
||||
std::string payType_;
|
||||
std::string deletionProtection_;
|
||||
bool enableFS_;
|
||||
std::string vswitchId_;
|
||||
std::string vpcId_;
|
||||
std::string instanceAlias_;
|
||||
std::string instanceStatus_;
|
||||
std::string networkType_;
|
||||
std::string serviceType_;
|
||||
int engineType_;
|
||||
bool enablePhoenix_;
|
||||
std::string regionId_;
|
||||
std::string expireTime_;
|
||||
long aliUid_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_HITSDB_MODEL_GETLINDORMINSTANCERESULT_H_
|
||||
@@ -51,6 +51,42 @@ HitsdbClient::HitsdbClient(const std::string & accessKeyId, const std::string &
|
||||
HitsdbClient::~HitsdbClient()
|
||||
{}
|
||||
|
||||
HitsdbClient::DescribeRegionsOutcome HitsdbClient::describeRegions(const DescribeRegionsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DescribeRegionsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DescribeRegionsOutcome(DescribeRegionsResult(outcome.result()));
|
||||
else
|
||||
return DescribeRegionsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void HitsdbClient::describeRegionsAsync(const DescribeRegionsRequest& request, const DescribeRegionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, describeRegions(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
HitsdbClient::DescribeRegionsOutcomeCallable HitsdbClient::describeRegionsCallable(const DescribeRegionsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DescribeRegionsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->describeRegions(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
HitsdbClient::GetInstanceIpWhiteListOutcome HitsdbClient::getInstanceIpWhiteList(const GetInstanceIpWhiteListRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -87,6 +123,42 @@ HitsdbClient::GetInstanceIpWhiteListOutcomeCallable HitsdbClient::getInstanceIpW
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
HitsdbClient::GetLindormInstanceOutcome HitsdbClient::getLindormInstance(const GetLindormInstanceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetLindormInstanceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetLindormInstanceOutcome(GetLindormInstanceResult(outcome.result()));
|
||||
else
|
||||
return GetLindormInstanceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void HitsdbClient::getLindormInstanceAsync(const GetLindormInstanceRequest& request, const GetLindormInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getLindormInstance(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
HitsdbClient::GetLindormInstanceOutcomeCallable HitsdbClient::getLindormInstanceCallable(const GetLindormInstanceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetLindormInstanceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getLindormInstance(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
HitsdbClient::GetLindormInstanceEngineListOutcome HitsdbClient::getLindormInstanceEngineList(const GetLindormInstanceEngineListRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
106
hitsdb/src/model/DescribeRegionsRequest.cc
Normal file
106
hitsdb/src/model/DescribeRegionsRequest.cc
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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/hitsdb/model/DescribeRegionsRequest.h>
|
||||
|
||||
using AlibabaCloud::Hitsdb::Model::DescribeRegionsRequest;
|
||||
|
||||
DescribeRegionsRequest::DescribeRegionsRequest() :
|
||||
RpcServiceRequest("hitsdb", "2020-06-15", "DescribeRegions")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DescribeRegionsRequest::~DescribeRegionsRequest()
|
||||
{}
|
||||
|
||||
long DescribeRegionsRequest::getResourceOwnerId()const
|
||||
{
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void DescribeRegionsRequest::setResourceOwnerId(long resourceOwnerId)
|
||||
{
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string DescribeRegionsRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void DescribeRegionsRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
std::string DescribeRegionsRequest::getSecurityToken()const
|
||||
{
|
||||
return securityToken_;
|
||||
}
|
||||
|
||||
void DescribeRegionsRequest::setSecurityToken(const std::string& securityToken)
|
||||
{
|
||||
securityToken_ = securityToken;
|
||||
setParameter("SecurityToken", securityToken);
|
||||
}
|
||||
|
||||
std::string DescribeRegionsRequest::getResourceOwnerAccount()const
|
||||
{
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void DescribeRegionsRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
|
||||
{
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string DescribeRegionsRequest::getOwnerAccount()const
|
||||
{
|
||||
return ownerAccount_;
|
||||
}
|
||||
|
||||
void DescribeRegionsRequest::setOwnerAccount(const std::string& ownerAccount)
|
||||
{
|
||||
ownerAccount_ = ownerAccount;
|
||||
setParameter("OwnerAccount", ownerAccount);
|
||||
}
|
||||
|
||||
long DescribeRegionsRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void DescribeRegionsRequest::setOwnerId(long ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setParameter("OwnerId", std::to_string(ownerId));
|
||||
}
|
||||
|
||||
std::string DescribeRegionsRequest::getAcceptLanguage()const
|
||||
{
|
||||
return acceptLanguage_;
|
||||
}
|
||||
|
||||
void DescribeRegionsRequest::setAcceptLanguage(const std::string& acceptLanguage)
|
||||
{
|
||||
acceptLanguage_ = acceptLanguage;
|
||||
setParameter("AcceptLanguage", acceptLanguage);
|
||||
}
|
||||
|
||||
61
hitsdb/src/model/DescribeRegionsResult.cc
Normal file
61
hitsdb/src/model/DescribeRegionsResult.cc
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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/hitsdb/model/DescribeRegionsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Hitsdb;
|
||||
using namespace AlibabaCloud::Hitsdb::Model;
|
||||
|
||||
DescribeRegionsResult::DescribeRegionsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DescribeRegionsResult::DescribeRegionsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DescribeRegionsResult::~DescribeRegionsResult()
|
||||
{}
|
||||
|
||||
void DescribeRegionsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allRegionsNode = value["Regions"]["Region"];
|
||||
for (auto valueRegionsRegion : allRegionsNode)
|
||||
{
|
||||
Region regionsObject;
|
||||
if(!valueRegionsRegion["RegionId"].isNull())
|
||||
regionsObject.regionId = valueRegionsRegion["RegionId"].asString();
|
||||
if(!valueRegionsRegion["LocalName"].isNull())
|
||||
regionsObject.localName = valueRegionsRegion["LocalName"].asString();
|
||||
if(!valueRegionsRegion["RegionEndpoint"].isNull())
|
||||
regionsObject.regionEndpoint = valueRegionsRegion["RegionEndpoint"].asString();
|
||||
regions_.push_back(regionsObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::vector<DescribeRegionsResult::Region> DescribeRegionsResult::getRegions()const
|
||||
{
|
||||
return regions_;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,17 @@ void GetLindormInstanceEngineListRequest::setSecurityToken(const std::string& se
|
||||
setParameter("SecurityToken", securityToken);
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceEngineListRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceEngineListRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceEngineListRequest::getResourceOwnerAccount()const
|
||||
{
|
||||
return resourceOwnerAccount_;
|
||||
|
||||
@@ -82,6 +82,17 @@ void GetLindormInstanceListRequest::setSecurityToken(const std::string& security
|
||||
setParameter("SecurityToken", securityToken);
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceListRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceListRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
int GetLindormInstanceListRequest::getPageSize()const
|
||||
{
|
||||
return pageSize_;
|
||||
|
||||
117
hitsdb/src/model/GetLindormInstanceRequest.cc
Normal file
117
hitsdb/src/model/GetLindormInstanceRequest.cc
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* 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/hitsdb/model/GetLindormInstanceRequest.h>
|
||||
|
||||
using AlibabaCloud::Hitsdb::Model::GetLindormInstanceRequest;
|
||||
|
||||
GetLindormInstanceRequest::GetLindormInstanceRequest() :
|
||||
RpcServiceRequest("hitsdb", "2020-06-15", "GetLindormInstance")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetLindormInstanceRequest::~GetLindormInstanceRequest()
|
||||
{}
|
||||
|
||||
long GetLindormInstanceRequest::getResourceOwnerId()const
|
||||
{
|
||||
return resourceOwnerId_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setResourceOwnerId(long resourceOwnerId)
|
||||
{
|
||||
resourceOwnerId_ = resourceOwnerId;
|
||||
setParameter("ResourceOwnerId", std::to_string(resourceOwnerId));
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceRequest::getAccessKeyId()const
|
||||
{
|
||||
return accessKeyId_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setAccessKeyId(const std::string& accessKeyId)
|
||||
{
|
||||
accessKeyId_ = accessKeyId;
|
||||
setParameter("AccessKeyId", accessKeyId);
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceRequest::getSecurityToken()const
|
||||
{
|
||||
return securityToken_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setSecurityToken(const std::string& securityToken)
|
||||
{
|
||||
securityToken_ = securityToken;
|
||||
setParameter("SecurityToken", securityToken);
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceRequest::getResourceOwnerAccount()const
|
||||
{
|
||||
return resourceOwnerAccount_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setResourceOwnerAccount(const std::string& resourceOwnerAccount)
|
||||
{
|
||||
resourceOwnerAccount_ = resourceOwnerAccount;
|
||||
setParameter("ResourceOwnerAccount", resourceOwnerAccount);
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceRequest::getOwnerAccount()const
|
||||
{
|
||||
return ownerAccount_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setOwnerAccount(const std::string& ownerAccount)
|
||||
{
|
||||
ownerAccount_ = ownerAccount;
|
||||
setParameter("OwnerAccount", ownerAccount);
|
||||
}
|
||||
|
||||
long GetLindormInstanceRequest::getOwnerId()const
|
||||
{
|
||||
return ownerId_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setOwnerId(long ownerId)
|
||||
{
|
||||
ownerId_ = ownerId;
|
||||
setParameter("OwnerId", std::to_string(ownerId));
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceRequest::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
void GetLindormInstanceRequest::setInstanceId(const std::string& instanceId)
|
||||
{
|
||||
instanceId_ = instanceId;
|
||||
setParameter("InstanceId", instanceId);
|
||||
}
|
||||
|
||||
221
hitsdb/src/model/GetLindormInstanceResult.cc
Normal file
221
hitsdb/src/model/GetLindormInstanceResult.cc
Normal file
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
* 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/hitsdb/model/GetLindormInstanceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Hitsdb;
|
||||
using namespace AlibabaCloud::Hitsdb::Model;
|
||||
|
||||
GetLindormInstanceResult::GetLindormInstanceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetLindormInstanceResult::GetLindormInstanceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetLindormInstanceResult::~GetLindormInstanceResult()
|
||||
{}
|
||||
|
||||
void GetLindormInstanceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allEngineListNode = value["EngineList"]["Engine"];
|
||||
for (auto valueEngineListEngine : allEngineListNode)
|
||||
{
|
||||
Engine engineListObject;
|
||||
if(!valueEngineListEngine["Engine"].isNull())
|
||||
engineListObject.engine = valueEngineListEngine["Engine"].asString();
|
||||
if(!valueEngineListEngine["Version"].isNull())
|
||||
engineListObject.version = valueEngineListEngine["Version"].asString();
|
||||
if(!valueEngineListEngine["CpuCount"].isNull())
|
||||
engineListObject.cpuCount = valueEngineListEngine["CpuCount"].asString();
|
||||
if(!valueEngineListEngine["MemorySize"].isNull())
|
||||
engineListObject.memorySize = valueEngineListEngine["MemorySize"].asString();
|
||||
if(!valueEngineListEngine["CoreCount"].isNull())
|
||||
engineListObject.coreCount = valueEngineListEngine["CoreCount"].asString();
|
||||
if(!valueEngineListEngine["IsLastVersion"].isNull())
|
||||
engineListObject.isLastVersion = valueEngineListEngine["IsLastVersion"].asString() == "true";
|
||||
engineList_.push_back(engineListObject);
|
||||
}
|
||||
if(!value["InstanceId"].isNull())
|
||||
instanceId_ = value["InstanceId"].asString();
|
||||
if(!value["InstanceAlias"].isNull())
|
||||
instanceAlias_ = value["InstanceAlias"].asString();
|
||||
if(!value["RegionId"].isNull())
|
||||
regionId_ = value["RegionId"].asString();
|
||||
if(!value["ZoneId"].isNull())
|
||||
zoneId_ = value["ZoneId"].asString();
|
||||
if(!value["InstanceStatus"].isNull())
|
||||
instanceStatus_ = value["InstanceStatus"].asString();
|
||||
if(!value["PayType"].isNull())
|
||||
payType_ = value["PayType"].asString();
|
||||
if(!value["NetworkType"].isNull())
|
||||
networkType_ = value["NetworkType"].asString();
|
||||
if(!value["CreateTime"].isNull())
|
||||
createTime_ = value["CreateTime"].asString();
|
||||
if(!value["ExpireTime"].isNull())
|
||||
expireTime_ = value["ExpireTime"].asString();
|
||||
if(!value["InstanceStorage"].isNull())
|
||||
instanceStorage_ = value["InstanceStorage"].asString();
|
||||
if(!value["VpcId"].isNull())
|
||||
vpcId_ = value["VpcId"].asString();
|
||||
if(!value["VswitchId"].isNull())
|
||||
vswitchId_ = value["VswitchId"].asString();
|
||||
if(!value["AutoRenew"].isNull())
|
||||
autoRenew_ = value["AutoRenew"].asString() == "true";
|
||||
if(!value["EngineType"].isNull())
|
||||
engineType_ = std::stoi(value["EngineType"].asString());
|
||||
if(!value["ServiceType"].isNull())
|
||||
serviceType_ = value["ServiceType"].asString();
|
||||
if(!value["DeletionProtection"].isNull())
|
||||
deletionProtection_ = value["DeletionProtection"].asString();
|
||||
if(!value["DiskCategory"].isNull())
|
||||
diskCategory_ = value["DiskCategory"].asString();
|
||||
if(!value["ColdStorage"].isNull())
|
||||
coldStorage_ = std::stoi(value["ColdStorage"].asString());
|
||||
if(!value["EnableBDS"].isNull())
|
||||
enableBDS_ = value["EnableBDS"].asString() == "true";
|
||||
if(!value["AliUid"].isNull())
|
||||
aliUid_ = std::stol(value["AliUid"].asString());
|
||||
if(!value["EnableFS"].isNull())
|
||||
enableFS_ = value["EnableFS"].asString() == "true";
|
||||
if(!value["EnablePhoenix"].isNull())
|
||||
enablePhoenix_ = value["EnablePhoenix"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::vector<GetLindormInstanceResult::Engine> GetLindormInstanceResult::getEngineList()const
|
||||
{
|
||||
return engineList_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getInstanceStorage()const
|
||||
{
|
||||
return instanceStorage_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getZoneId()const
|
||||
{
|
||||
return zoneId_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getInstanceId()const
|
||||
{
|
||||
return instanceId_;
|
||||
}
|
||||
|
||||
bool GetLindormInstanceResult::getEnableBDS()const
|
||||
{
|
||||
return enableBDS_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getCreateTime()const
|
||||
{
|
||||
return createTime_;
|
||||
}
|
||||
|
||||
bool GetLindormInstanceResult::getAutoRenew()const
|
||||
{
|
||||
return autoRenew_;
|
||||
}
|
||||
|
||||
int GetLindormInstanceResult::getColdStorage()const
|
||||
{
|
||||
return coldStorage_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getDiskCategory()const
|
||||
{
|
||||
return diskCategory_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getPayType()const
|
||||
{
|
||||
return payType_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getDeletionProtection()const
|
||||
{
|
||||
return deletionProtection_;
|
||||
}
|
||||
|
||||
bool GetLindormInstanceResult::getEnableFS()const
|
||||
{
|
||||
return enableFS_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getVswitchId()const
|
||||
{
|
||||
return vswitchId_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getVpcId()const
|
||||
{
|
||||
return vpcId_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getInstanceAlias()const
|
||||
{
|
||||
return instanceAlias_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getInstanceStatus()const
|
||||
{
|
||||
return instanceStatus_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getNetworkType()const
|
||||
{
|
||||
return networkType_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getServiceType()const
|
||||
{
|
||||
return serviceType_;
|
||||
}
|
||||
|
||||
int GetLindormInstanceResult::getEngineType()const
|
||||
{
|
||||
return engineType_;
|
||||
}
|
||||
|
||||
bool GetLindormInstanceResult::getEnablePhoenix()const
|
||||
{
|
||||
return enablePhoenix_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
std::string GetLindormInstanceResult::getExpireTime()const
|
||||
{
|
||||
return expireTime_;
|
||||
}
|
||||
|
||||
long GetLindormInstanceResult::getAliUid()const
|
||||
{
|
||||
return aliUid_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user