/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. 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. */ namespace TencentCloud.Mongodb.V20190725 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Mongodb.V20190725.Models; public class MongodbClient : AbstractClient{ private const string endpoint = "mongodb.tencentcloudapi.com"; private const string version = "2019-07-25"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public MongodbClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public MongodbClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 本接口(AssignProject)用于指定云数据库实例的所属项目。 /// /// /// public async Task AssignProject(AssignProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AssignProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(AssignProject)用于指定云数据库实例的所属项目。 /// /// /// public AssignProjectResponse AssignProjectSync(AssignProjectRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AssignProject"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(CreateDBInstance)用于创建包年包月的MongoDB云数据库实例。接口支持的售卖规格,可从查询云数据库的售卖规格(DescribeSpecInfo)获取。 /// /// /// public async Task CreateDBInstance(CreateDBInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateDBInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(CreateDBInstance)用于创建包年包月的MongoDB云数据库实例。接口支持的售卖规格,可从查询云数据库的售卖规格(DescribeSpecInfo)获取。 /// /// /// public CreateDBInstanceResponse CreateDBInstanceSync(CreateDBInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateDBInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(CreateDBInstanceHour)用于创建按量计费的MongoDB云数据库实例。 /// /// /// public async Task CreateDBInstanceHour(CreateDBInstanceHourRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateDBInstanceHour"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(CreateDBInstanceHour)用于创建按量计费的MongoDB云数据库实例。 /// /// /// public CreateDBInstanceHourResponse CreateDBInstanceHourSync(CreateDBInstanceHourRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateDBInstanceHour"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeBackupAccess)用于获取备份文件的下载授权,具体的备份文件信息可通过查询实例备份列表(DescribeDBBackups)接口获取 /// /// /// public async Task DescribeBackupAccess(DescribeBackupAccessRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeBackupAccess"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeBackupAccess)用于获取备份文件的下载授权,具体的备份文件信息可通过查询实例备份列表(DescribeDBBackups)接口获取 /// /// /// public DescribeBackupAccessResponse DescribeBackupAccessSync(DescribeBackupAccessRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeBackupAccess"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeClientConnections)用于查询实例客户端连接信息,包括连接IP和连接数量。 /// /// /// public async Task DescribeClientConnections(DescribeClientConnectionsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeClientConnections"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeClientConnections)用于查询实例客户端连接信息,包括连接IP和连接数量。 /// /// /// public DescribeClientConnectionsResponse DescribeClientConnectionsSync(DescribeClientConnectionsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeClientConnections"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeDBBackups)用于查询实例备份列表,目前只支持7天内的备份查询。 /// /// /// public async Task DescribeDBBackups(DescribeDBBackupsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeDBBackups"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeDBBackups)用于查询实例备份列表,目前只支持7天内的备份查询。 /// /// /// public DescribeDBBackupsResponse DescribeDBBackupsSync(DescribeDBBackupsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeDBBackups"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeDBInstanceDeal)用于获取MongoDB购买、续费及变配订单详细。 /// /// /// public async Task DescribeDBInstanceDeal(DescribeDBInstanceDealRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeDBInstanceDeal"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeDBInstanceDeal)用于获取MongoDB购买、续费及变配订单详细。 /// /// /// public DescribeDBInstanceDealResponse DescribeDBInstanceDealSync(DescribeDBInstanceDealRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeDBInstanceDeal"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeDBInstances)用于查询云数据库实例列表,支持通过项目ID、实例ID、实例状态等过滤条件来筛选实例。支持查询主实例、灾备实例和只读实例信息列表。 /// /// /// public async Task DescribeDBInstances(DescribeDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeDBInstances)用于查询云数据库实例列表,支持通过项目ID、实例ID、实例状态等过滤条件来筛选实例。支持查询主实例、灾备实例和只读实例信息列表。 /// /// /// public DescribeDBInstancesResponse DescribeDBInstancesSync(DescribeDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeSlowLogPatterns)用于获取数据库实例慢日志的统计信息。 /// /// /// public async Task DescribeSlowLogPatterns(DescribeSlowLogPatternsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeSlowLogPatterns"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeSlowLogPatterns)用于获取数据库实例慢日志的统计信息。 /// /// /// public DescribeSlowLogPatternsResponse DescribeSlowLogPatternsSync(DescribeSlowLogPatternsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeSlowLogPatterns"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeSlowLogs)用于获取云数据库慢日志信息。接口只支持查询最近7天内慢日志。 /// /// /// public async Task DescribeSlowLogs(DescribeSlowLogsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeSlowLogs"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeSlowLogs)用于获取云数据库慢日志信息。接口只支持查询最近7天内慢日志。 /// /// /// public DescribeSlowLogsResponse DescribeSlowLogsSync(DescribeSlowLogsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeSlowLogs"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeSpecInfo)用于查询实例的售卖规格。 /// /// /// public async Task DescribeSpecInfo(DescribeSpecInfoRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeSpecInfo"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeSpecInfo)用于查询实例的售卖规格。 /// /// /// public DescribeSpecInfoResponse DescribeSpecInfoSync(DescribeSpecInfoRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeSpecInfo"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于创建数据库实例询价。本接口参数中必须传入region参数,否则无法通过校验。本接口仅允许针对购买限制范围内的实例配置进行询价。 /// /// /// public async Task InquirePriceCreateDBInstances(InquirePriceCreateDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "InquirePriceCreateDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于创建数据库实例询价。本接口参数中必须传入region参数,否则无法通过校验。本接口仅允许针对购买限制范围内的实例配置进行询价。 /// /// /// public InquirePriceCreateDBInstancesResponse InquirePriceCreateDBInstancesSync(InquirePriceCreateDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "InquirePriceCreateDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口 (InquirePriceModifyDBInstanceSpec) 用于调整实例的配置询价。 /// /// /// public async Task InquirePriceModifyDBInstanceSpec(InquirePriceModifyDBInstanceSpecRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "InquirePriceModifyDBInstanceSpec"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口 (InquirePriceModifyDBInstanceSpec) 用于调整实例的配置询价。 /// /// /// public InquirePriceModifyDBInstanceSpecResponse InquirePriceModifyDBInstanceSpecSync(InquirePriceModifyDBInstanceSpecRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "InquirePriceModifyDBInstanceSpec"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口 (InquiryPriceRenewDBInstances) 用于续费包年包月实例询价。 /// /// /// public async Task InquirePriceRenewDBInstances(InquirePriceRenewDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "InquirePriceRenewDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口 (InquiryPriceRenewDBInstances) 用于续费包年包月实例询价。 /// /// /// public InquirePriceRenewDBInstancesResponse InquirePriceRenewDBInstancesSync(InquirePriceRenewDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "InquirePriceRenewDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(IsolateDBInstance)用于隔离MongoDB云数据库按量计费实例。隔离后实例保留在回收站中,不能再写入数据。隔离一定时间后,实例会彻底删除,回收站保存时间请参考按量计费的服务条款。在隔离中的按量计费实例无法恢复,请谨慎操作。 /// /// /// public async Task IsolateDBInstance(IsolateDBInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "IsolateDBInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(IsolateDBInstance)用于隔离MongoDB云数据库按量计费实例。隔离后实例保留在回收站中,不能再写入数据。隔离一定时间后,实例会彻底删除,回收站保存时间请参考按量计费的服务条款。在隔离中的按量计费实例无法恢复,请谨慎操作。 /// /// /// public IsolateDBInstanceResponse IsolateDBInstanceSync(IsolateDBInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "IsolateDBInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(ModifyDBInstanceSpec)用于调整MongoDB云数据库实例配置。接口支持的售卖规格,可从查询云数据库的售卖规格(DescribeSpecInfo)获取。 /// /// /// public async Task ModifyDBInstanceSpec(ModifyDBInstanceSpecRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyDBInstanceSpec"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(ModifyDBInstanceSpec)用于调整MongoDB云数据库实例配置。接口支持的售卖规格,可从查询云数据库的售卖规格(DescribeSpecInfo)获取。 /// /// /// public ModifyDBInstanceSpecResponse ModifyDBInstanceSpecSync(ModifyDBInstanceSpecRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyDBInstanceSpec"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(OfflineIsolatedInstances)用于立即下线隔离状态的云数据库实例。进行操作的实例状态必须为隔离状态。 /// /// /// public async Task OfflineIsolatedDBInstance(OfflineIsolatedDBInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "OfflineIsolatedDBInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(OfflineIsolatedInstances)用于立即下线隔离状态的云数据库实例。进行操作的实例状态必须为隔离状态。 /// /// /// public OfflineIsolatedDBInstanceResponse OfflineIsolatedDBInstanceSync(OfflineIsolatedDBInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "OfflineIsolatedDBInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(RenameInstance)用于修改云数据库实例的名称。 /// /// /// public async Task RenameInstance(RenameInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "RenameInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(RenameInstance)用于修改云数据库实例的名称。 /// /// /// public RenameInstanceResponse RenameInstanceSync(RenameInstanceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "RenameInstance"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(RenewDBInstance)用于续费云数据库实例,仅支持付费模式为包年包月的实例。按量计费实例不需要续费。 /// /// /// public async Task RenewDBInstances(RenewDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "RenewDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(RenewDBInstance)用于续费云数据库实例,仅支持付费模式为包年包月的实例。按量计费实例不需要续费。 /// /// /// public RenewDBInstancesResponse RenewDBInstancesSync(RenewDBInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "RenewDBInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }