代码拉取完成,页面将自动刷新
/*
* 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.V20180408
{
using Newtonsoft.Json;
using System.Threading.Tasks;
using TencentCloud.Common;
using TencentCloud.Common.Profile;
using TencentCloud.Mongodb.V20180408.Models;
public class MongodbClient : AbstractClient{
private const string endpoint = "mongodb.tencentcloudapi.com";
private const string version = "2018-04-08";
private const string sdkVersion = "SDK_NET_3.0.1120";
/// <summary>
/// Client constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
public MongodbClient(Credential credential, string region)
: this(credential, region, new ClientProfile { Language = Language.ZH_CN })
{
}
/// <summary>
/// Client Constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
/// <param name="profile">Client profiles.</param>
public MongodbClient(Credential credential, string region, ClientProfile profile)
: base(endpoint, version, credential, region, profile)
{
SdkVersion = sdkVersion;
}
/// <summary>
/// 本接口(AssignProject)用于指定云数据库实例的所属项目。
/// </summary>
/// <param name="req"><see cref="AssignProjectRequest"/></param>
/// <returns><see cref="AssignProjectResponse"/></returns>
public Task<AssignProjectResponse> AssignProject(AssignProjectRequest req)
{
return InternalRequestAsync<AssignProjectResponse>(req, "AssignProject");
}
/// <summary>
/// 本接口(AssignProject)用于指定云数据库实例的所属项目。
/// </summary>
/// <param name="req"><see cref="AssignProjectRequest"/></param>
/// <returns><see cref="AssignProjectResponse"/></returns>
public AssignProjectResponse AssignProjectSync(AssignProjectRequest req)
{
return InternalRequestAsync<AssignProjectResponse>(req, "AssignProject")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(CreateDBInstance)用于创建包年包月的MongoDB云数据库实例。
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceRequest"/></param>
/// <returns><see cref="CreateDBInstanceResponse"/></returns>
public Task<CreateDBInstanceResponse> CreateDBInstance(CreateDBInstanceRequest req)
{
return InternalRequestAsync<CreateDBInstanceResponse>(req, "CreateDBInstance");
}
/// <summary>
/// 本接口(CreateDBInstance)用于创建包年包月的MongoDB云数据库实例。
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceRequest"/></param>
/// <returns><see cref="CreateDBInstanceResponse"/></returns>
public CreateDBInstanceResponse CreateDBInstanceSync(CreateDBInstanceRequest req)
{
return InternalRequestAsync<CreateDBInstanceResponse>(req, "CreateDBInstance")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(CreateDBInstanceHour)用于创建按量计费的MongoDB云数据库实例(包括主实例、灾备实例和只读实例),可通过传入实例规格、实例类型、MongoDB版本、购买时长和数量等信息创建云数据库实例。
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceHourRequest"/></param>
/// <returns><see cref="CreateDBInstanceHourResponse"/></returns>
public Task<CreateDBInstanceHourResponse> CreateDBInstanceHour(CreateDBInstanceHourRequest req)
{
return InternalRequestAsync<CreateDBInstanceHourResponse>(req, "CreateDBInstanceHour");
}
/// <summary>
/// 本接口(CreateDBInstanceHour)用于创建按量计费的MongoDB云数据库实例(包括主实例、灾备实例和只读实例),可通过传入实例规格、实例类型、MongoDB版本、购买时长和数量等信息创建云数据库实例。
/// </summary>
/// <param name="req"><see cref="CreateDBInstanceHourRequest"/></param>
/// <returns><see cref="CreateDBInstanceHourResponse"/></returns>
public CreateDBInstanceHourResponse CreateDBInstanceHourSync(CreateDBInstanceHourRequest req)
{
return InternalRequestAsync<CreateDBInstanceHourResponse>(req, "CreateDBInstanceHour")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(DescribeClientConnections)用于查询实例客户端连接信息,包括连接IP和连接数量。目前只支持3.2版本的MongoDB实例。
/// </summary>
/// <param name="req"><see cref="DescribeClientConnectionsRequest"/></param>
/// <returns><see cref="DescribeClientConnectionsResponse"/></returns>
public Task<DescribeClientConnectionsResponse> DescribeClientConnections(DescribeClientConnectionsRequest req)
{
return InternalRequestAsync<DescribeClientConnectionsResponse>(req, "DescribeClientConnections");
}
/// <summary>
/// 本接口(DescribeClientConnections)用于查询实例客户端连接信息,包括连接IP和连接数量。目前只支持3.2版本的MongoDB实例。
/// </summary>
/// <param name="req"><see cref="DescribeClientConnectionsRequest"/></param>
/// <returns><see cref="DescribeClientConnectionsResponse"/></returns>
public DescribeClientConnectionsResponse DescribeClientConnectionsSync(DescribeClientConnectionsRequest req)
{
return InternalRequestAsync<DescribeClientConnectionsResponse>(req, "DescribeClientConnections")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(DescribeDBInstances)用于查询云数据库实例列表,支持通过项目ID、实例ID、实例状态等过滤条件来筛选实例。支持查询主实例、灾备实例和只读实例信息列表。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstancesRequest"/></param>
/// <returns><see cref="DescribeDBInstancesResponse"/></returns>
public Task<DescribeDBInstancesResponse> DescribeDBInstances(DescribeDBInstancesRequest req)
{
return InternalRequestAsync<DescribeDBInstancesResponse>(req, "DescribeDBInstances");
}
/// <summary>
/// 本接口(DescribeDBInstances)用于查询云数据库实例列表,支持通过项目ID、实例ID、实例状态等过滤条件来筛选实例。支持查询主实例、灾备实例和只读实例信息列表。
/// </summary>
/// <param name="req"><see cref="DescribeDBInstancesRequest"/></param>
/// <returns><see cref="DescribeDBInstancesResponse"/></returns>
public DescribeDBInstancesResponse DescribeDBInstancesSync(DescribeDBInstancesRequest req)
{
return InternalRequestAsync<DescribeDBInstancesResponse>(req, "DescribeDBInstances")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(DescribeSlowLogs)用于获取云数据库实例的慢查询日志。
/// </summary>
/// <param name="req"><see cref="DescribeSlowLogRequest"/></param>
/// <returns><see cref="DescribeSlowLogResponse"/></returns>
public Task<DescribeSlowLogResponse> DescribeSlowLog(DescribeSlowLogRequest req)
{
return InternalRequestAsync<DescribeSlowLogResponse>(req, "DescribeSlowLog");
}
/// <summary>
/// 本接口(DescribeSlowLogs)用于获取云数据库实例的慢查询日志。
/// </summary>
/// <param name="req"><see cref="DescribeSlowLogRequest"/></param>
/// <returns><see cref="DescribeSlowLogResponse"/></returns>
public DescribeSlowLogResponse DescribeSlowLogSync(DescribeSlowLogRequest req)
{
return InternalRequestAsync<DescribeSlowLogResponse>(req, "DescribeSlowLog")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(DescribeSpecInfo)用于查询实例的售卖规格。
/// </summary>
/// <param name="req"><see cref="DescribeSpecInfoRequest"/></param>
/// <returns><see cref="DescribeSpecInfoResponse"/></returns>
public Task<DescribeSpecInfoResponse> DescribeSpecInfo(DescribeSpecInfoRequest req)
{
return InternalRequestAsync<DescribeSpecInfoResponse>(req, "DescribeSpecInfo");
}
/// <summary>
/// 本接口(DescribeSpecInfo)用于查询实例的售卖规格。
/// </summary>
/// <param name="req"><see cref="DescribeSpecInfoRequest"/></param>
/// <returns><see cref="DescribeSpecInfoResponse"/></returns>
public DescribeSpecInfoResponse DescribeSpecInfoSync(DescribeSpecInfoRequest req)
{
return InternalRequestAsync<DescribeSpecInfoResponse>(req, "DescribeSpecInfo")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(RenameInstance)用于修改云数据库实例的名称。
/// </summary>
/// <param name="req"><see cref="RenameInstanceRequest"/></param>
/// <returns><see cref="RenameInstanceResponse"/></returns>
public Task<RenameInstanceResponse> RenameInstance(RenameInstanceRequest req)
{
return InternalRequestAsync<RenameInstanceResponse>(req, "RenameInstance");
}
/// <summary>
/// 本接口(RenameInstance)用于修改云数据库实例的名称。
/// </summary>
/// <param name="req"><see cref="RenameInstanceRequest"/></param>
/// <returns><see cref="RenameInstanceResponse"/></returns>
public RenameInstanceResponse RenameInstanceSync(RenameInstanceRequest req)
{
return InternalRequestAsync<RenameInstanceResponse>(req, "RenameInstance")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(SetAutoRenew)用于设置包年包月云数据库实例的续费选项。
/// </summary>
/// <param name="req"><see cref="SetAutoRenewRequest"/></param>
/// <returns><see cref="SetAutoRenewResponse"/></returns>
public Task<SetAutoRenewResponse> SetAutoRenew(SetAutoRenewRequest req)
{
return InternalRequestAsync<SetAutoRenewResponse>(req, "SetAutoRenew");
}
/// <summary>
/// 本接口(SetAutoRenew)用于设置包年包月云数据库实例的续费选项。
/// </summary>
/// <param name="req"><see cref="SetAutoRenewRequest"/></param>
/// <returns><see cref="SetAutoRenewResponse"/></returns>
public SetAutoRenewResponse SetAutoRenewSync(SetAutoRenewRequest req)
{
return InternalRequestAsync<SetAutoRenewResponse>(req, "SetAutoRenew")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(SetPassword)用于设置(初始化)MongoDB云数据库实例账户密码。
///
/// </summary>
/// <param name="req"><see cref="SetPasswordRequest"/></param>
/// <returns><see cref="SetPasswordResponse"/></returns>
public Task<SetPasswordResponse> SetPassword(SetPasswordRequest req)
{
return InternalRequestAsync<SetPasswordResponse>(req, "SetPassword");
}
/// <summary>
/// 本接口(SetPassword)用于设置(初始化)MongoDB云数据库实例账户密码。
///
/// </summary>
/// <param name="req"><see cref="SetPasswordRequest"/></param>
/// <returns><see cref="SetPasswordResponse"/></returns>
public SetPasswordResponse SetPasswordSync(SetPasswordRequest req)
{
return InternalRequestAsync<SetPasswordResponse>(req, "SetPassword")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(TerminateDBInstance)用于销毁按量计费的MongoDB云数据库实例。
/// </summary>
/// <param name="req"><see cref="TerminateDBInstanceRequest"/></param>
/// <returns><see cref="TerminateDBInstanceResponse"/></returns>
public Task<TerminateDBInstanceResponse> TerminateDBInstance(TerminateDBInstanceRequest req)
{
return InternalRequestAsync<TerminateDBInstanceResponse>(req, "TerminateDBInstance");
}
/// <summary>
/// 本接口(TerminateDBInstance)用于销毁按量计费的MongoDB云数据库实例。
/// </summary>
/// <param name="req"><see cref="TerminateDBInstanceRequest"/></param>
/// <returns><see cref="TerminateDBInstanceResponse"/></returns>
public TerminateDBInstanceResponse TerminateDBInstanceSync(TerminateDBInstanceRequest req)
{
return InternalRequestAsync<TerminateDBInstanceResponse>(req, "TerminateDBInstance")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(UpgradeDBInstance)用于升级包年包月的MongoDB云数据库实例,可以扩容内存、存储以及Oplog
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceResponse"/></returns>
public Task<UpgradeDBInstanceResponse> UpgradeDBInstance(UpgradeDBInstanceRequest req)
{
return InternalRequestAsync<UpgradeDBInstanceResponse>(req, "UpgradeDBInstance");
}
/// <summary>
/// 本接口(UpgradeDBInstance)用于升级包年包月的MongoDB云数据库实例,可以扩容内存、存储以及Oplog
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceResponse"/></returns>
public UpgradeDBInstanceResponse UpgradeDBInstanceSync(UpgradeDBInstanceRequest req)
{
return InternalRequestAsync<UpgradeDBInstanceResponse>(req, "UpgradeDBInstance")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
/// <summary>
/// 本接口(UpgradeDBInstanceHour)用于升级按量计费的MongoDB云数据库实例,可以扩容内存、存储以及oplog
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceHourRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceHourResponse"/></returns>
public Task<UpgradeDBInstanceHourResponse> UpgradeDBInstanceHour(UpgradeDBInstanceHourRequest req)
{
return InternalRequestAsync<UpgradeDBInstanceHourResponse>(req, "UpgradeDBInstanceHour");
}
/// <summary>
/// 本接口(UpgradeDBInstanceHour)用于升级按量计费的MongoDB云数据库实例,可以扩容内存、存储以及oplog
/// </summary>
/// <param name="req"><see cref="UpgradeDBInstanceHourRequest"/></param>
/// <returns><see cref="UpgradeDBInstanceHourResponse"/></returns>
public UpgradeDBInstanceHourResponse UpgradeDBInstanceHourSync(UpgradeDBInstanceHourRequest req)
{
return InternalRequestAsync<UpgradeDBInstanceHourResponse>(req, "UpgradeDBInstanceHour")
.ConfigureAwait(false).GetAwaiter().GetResult();
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。