/* * 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.Cloudhsm.V20191112 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Cloudhsm.V20191112.Models; public class CloudhsmClient : AbstractClient{ private const string endpoint = "cloudhsm.tencentcloudapi.com"; private const string version = "2019-11-12"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public CloudhsmClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public CloudhsmClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 通过SubnetId获取Hsm资源数 /// /// /// public async Task DescribeHSMBySubnetId(DescribeHSMBySubnetIdRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeHSMBySubnetId"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 通过SubnetId获取Hsm资源数 /// /// /// public DescribeHSMBySubnetIdResponse DescribeHSMBySubnetIdSync(DescribeHSMBySubnetIdRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeHSMBySubnetId"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 通过VpcId获取Hsm资源数 /// /// /// public async Task DescribeHSMByVpcId(DescribeHSMByVpcIdRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeHSMByVpcId"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 通过VpcId获取Hsm资源数 /// /// /// public DescribeHSMByVpcIdResponse DescribeHSMByVpcIdSync(DescribeHSMByVpcIdRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeHSMByVpcId"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询子网列表 /// /// /// public async Task DescribeSubnet(DescribeSubnetRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeSubnet"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询子网列表 /// /// /// public DescribeSubnetResponse DescribeSubnetSync(DescribeSubnetRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeSubnet"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据用户的AppId获取用户安全组列表 /// /// /// public async Task DescribeUsg(DescribeUsgRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeUsg"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据用户的AppId获取用户安全组列表 /// /// /// public DescribeUsgResponse DescribeUsgSync(DescribeUsgRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeUsg"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取安全组详情 /// /// /// public async Task DescribeUsgRule(DescribeUsgRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeUsgRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取安全组详情 /// /// /// public DescribeUsgRuleResponse DescribeUsgRuleSync(DescribeUsgRuleRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeUsgRule"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户的私有网络列表 /// /// /// public async Task DescribeVpc(DescribeVpcRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeVpc"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户的私有网络列表 /// /// /// public DescribeVpcResponse DescribeVpcSync(DescribeVpcRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeVpc"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取VSM属性 /// /// /// public async Task DescribeVsmAttributes(DescribeVsmAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeVsmAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取VSM属性 /// /// /// public DescribeVsmAttributesResponse DescribeVsmAttributesSync(DescribeVsmAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeVsmAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户VSM列表 /// /// /// public async Task DescribeVsms(DescribeVsmsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeVsms"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取用户VSM列表 /// /// /// public DescribeVsmsResponse DescribeVsmsSync(DescribeVsmsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeVsms"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 购买询价接口 /// /// /// public async Task InquiryPriceBuyVsm(InquiryPriceBuyVsmRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "InquiryPriceBuyVsm"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 购买询价接口 /// /// /// public InquiryPriceBuyVsmResponse InquiryPriceBuyVsmSync(InquiryPriceBuyVsmRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "InquiryPriceBuyVsm"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改VSM属性 /// /// /// public async Task ModifyVsmAttributes(ModifyVsmAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyVsmAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改VSM属性 /// /// /// public ModifyVsmAttributesResponse ModifyVsmAttributesSync(ModifyVsmAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyVsmAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }