use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java-intl-en by TencentCloud.
the class VpcClient method ModifyNatGatewayAttribute.
/**
*This API (ModifyNatGatewayAttribute) is used to modify the attributes of a NAT gateway.
* @param req ModifyNatGatewayAttributeRequest
* @return ModifyNatGatewayAttributeResponse
* @throws TencentCloudSDKException
*/
public ModifyNatGatewayAttributeResponse ModifyNatGatewayAttribute(ModifyNatGatewayAttributeRequest req) throws TencentCloudSDKException {
JsonResponseModel<ModifyNatGatewayAttributeResponse> rsp = null;
String rspStr = "";
try {
Type type = new TypeToken<JsonResponseModel<ModifyNatGatewayAttributeResponse>>() {
}.getType();
rspStr = this.internalRequest(req, "ModifyNatGatewayAttribute");
rsp = gson.fromJson(rspStr, type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
}
return rsp.response;
}
use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java-intl-en by TencentCloud.
the class VpcClient method WithdrawNotifyRoutes.
/**
*This API is used to withdraw a route from CCN. This can also be done by clicking the **Withdraw from CCN** button on the route table page.
* @param req WithdrawNotifyRoutesRequest
* @return WithdrawNotifyRoutesResponse
* @throws TencentCloudSDKException
*/
public WithdrawNotifyRoutesResponse WithdrawNotifyRoutes(WithdrawNotifyRoutesRequest req) throws TencentCloudSDKException {
JsonResponseModel<WithdrawNotifyRoutesResponse> rsp = null;
String rspStr = "";
try {
Type type = new TypeToken<JsonResponseModel<WithdrawNotifyRoutesResponse>>() {
}.getType();
rspStr = this.internalRequest(req, "WithdrawNotifyRoutes");
rsp = gson.fromJson(rspStr, type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
}
return rsp.response;
}
use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java-intl-en by TencentCloud.
the class VpcClient method CreateNatGateway.
/**
*This API is used to create a NAT Gateway.
*Before taking actions on a NAT Gateway, ensure that it has been successfully created, namely, the `State` field in the response of the `DescribeNatGateway` API is `AVAILABLE`.
* @param req CreateNatGatewayRequest
* @return CreateNatGatewayResponse
* @throws TencentCloudSDKException
*/
public CreateNatGatewayResponse CreateNatGateway(CreateNatGatewayRequest req) throws TencentCloudSDKException {
JsonResponseModel<CreateNatGatewayResponse> rsp = null;
String rspStr = "";
try {
Type type = new TypeToken<JsonResponseModel<CreateNatGatewayResponse>>() {
}.getType();
rspStr = this.internalRequest(req, "CreateNatGateway");
rsp = gson.fromJson(rspStr, type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
}
return rsp.response;
}
use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java-intl-en by TencentCloud.
the class VpcClient method DescribeNatGatewaySourceIpTranslationNatRules.
/**
*This API is used to query the object arrays of SNAT forwarding rules of the NAT Gateway.
* @param req DescribeNatGatewaySourceIpTranslationNatRulesRequest
* @return DescribeNatGatewaySourceIpTranslationNatRulesResponse
* @throws TencentCloudSDKException
*/
public DescribeNatGatewaySourceIpTranslationNatRulesResponse DescribeNatGatewaySourceIpTranslationNatRules(DescribeNatGatewaySourceIpTranslationNatRulesRequest req) throws TencentCloudSDKException {
JsonResponseModel<DescribeNatGatewaySourceIpTranslationNatRulesResponse> rsp = null;
String rspStr = "";
try {
Type type = new TypeToken<JsonResponseModel<DescribeNatGatewaySourceIpTranslationNatRulesResponse>>() {
}.getType();
rspStr = this.internalRequest(req, "DescribeNatGatewaySourceIpTranslationNatRules");
rsp = gson.fromJson(rspStr, type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
}
return rsp.response;
}
use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java-intl-en by TencentCloud.
the class VpcClient method CreateNatGatewayDestinationIpPortTranslationNatRule.
/**
*This API (CreateNatGatewayDestinationIpPortTranslationNatRule) is used to create a port forwarding rule for a NAT gateway.
* @param req CreateNatGatewayDestinationIpPortTranslationNatRuleRequest
* @return CreateNatGatewayDestinationIpPortTranslationNatRuleResponse
* @throws TencentCloudSDKException
*/
public CreateNatGatewayDestinationIpPortTranslationNatRuleResponse CreateNatGatewayDestinationIpPortTranslationNatRule(CreateNatGatewayDestinationIpPortTranslationNatRuleRequest req) throws TencentCloudSDKException {
JsonResponseModel<CreateNatGatewayDestinationIpPortTranslationNatRuleResponse> rsp = null;
String rspStr = "";
try {
Type type = new TypeToken<JsonResponseModel<CreateNatGatewayDestinationIpPortTranslationNatRuleResponse>>() {
}.getType();
rspStr = this.internalRequest(req, "CreateNatGatewayDestinationIpPortTranslationNatRule");
rsp = gson.fromJson(rspStr, type);
} catch (JsonSyntaxException e) {
throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
}
return rsp.response;
}
Aggregations