Search in sources :

Example 41 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel in project tencentcloud-sdk-java-intl-en by TencentCloud.

the class EmrClient method InquiryPriceScaleOutInstance.

/**
 *This API is used to query price of scale-out.
 * @param req InquiryPriceScaleOutInstanceRequest
 * @return InquiryPriceScaleOutInstanceResponse
 * @throws TencentCloudSDKException
 */
public InquiryPriceScaleOutInstanceResponse InquiryPriceScaleOutInstance(InquiryPriceScaleOutInstanceRequest req) throws TencentCloudSDKException {
    JsonResponseModel<InquiryPriceScaleOutInstanceResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<InquiryPriceScaleOutInstanceResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "InquiryPriceScaleOutInstance");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 42 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel in project tencentcloud-sdk-java-intl-en by TencentCloud.

the class AsClient method UpgradeLaunchConfiguration.

/**
 *This API (UpgradeLaunchConfiguration) is used to upgrade a launch configuration.
 *
 * This API is used to upgrade a launch configuration in a "completely overriding" manner, i.e., it uniformly sets a new configuration according to the API parameters regardless of the original parameters. If optional fields are left empty, their default values will be used.
 * After the launch configuration is upgraded, the existing instances that have been created by it will not be changed, but new instances will be created according to the new configuration.
 * @param req UpgradeLaunchConfigurationRequest
 * @return UpgradeLaunchConfigurationResponse
 * @throws TencentCloudSDKException
 */
public UpgradeLaunchConfigurationResponse UpgradeLaunchConfiguration(UpgradeLaunchConfigurationRequest req) throws TencentCloudSDKException {
    JsonResponseModel<UpgradeLaunchConfigurationResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<UpgradeLaunchConfigurationResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "UpgradeLaunchConfiguration");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 43 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel in project tencentcloud-sdk-java-intl-en by TencentCloud.

the class AsClient method ScaleOutInstances.

/**
 *This API is used to add the specified number of instances to the scaling group, which returns the scaling activity ID `ActivityId`.
 * The scaling group is not active.
 * The desired capacity will be increased accordingly. The new desired capacity should be no more than the maximum capacity.
 * If the scale-out activity failed or partially succeeded, the final desired capacity only includes the instances that have been added successfully.
 * @param req ScaleOutInstancesRequest
 * @return ScaleOutInstancesResponse
 * @throws TencentCloudSDKException
 */
public ScaleOutInstancesResponse ScaleOutInstances(ScaleOutInstancesRequest req) throws TencentCloudSDKException {
    JsonResponseModel<ScaleOutInstancesResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<ScaleOutInstancesResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "ScaleOutInstances");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 44 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel in project tencentcloud-sdk-java-intl-en by TencentCloud.

the class AsClient method CreateLaunchConfiguration.

/**
 *This API (CreateLaunchConfiguration) is used to create a launch configuration.
 *
 * A few fields of a launch configuration can be modified through `ModifyLaunchConfigurationAttributes`. To use a new launch configuration, it is recommended to create it from scratch.
 *
 * You can create up to 20 launch configurations for each project. For more information, see [Usage Limits](https://intl.cloud.tencent.com/document/product/377/3120?from_cn_redirect=1).
 *
 * @param req CreateLaunchConfigurationRequest
 * @return CreateLaunchConfigurationResponse
 * @throws TencentCloudSDKException
 */
public CreateLaunchConfigurationResponse CreateLaunchConfiguration(CreateLaunchConfigurationRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CreateLaunchConfigurationResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CreateLaunchConfigurationResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CreateLaunchConfiguration");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 45 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel in project tencentcloud-sdk-java-intl-en by TencentCloud.

the class DcdbClient method DescribeProjects.

/**
 *This API is used to query the project list.
 * @param req DescribeProjectsRequest
 * @return DescribeProjectsResponse
 * @throws TencentCloudSDKException
 */
public DescribeProjectsResponse DescribeProjects(DescribeProjectsRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeProjectsResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeProjectsResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeProjects");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Aggregations

JsonSyntaxException (com.google.gson.JsonSyntaxException)10373 JsonResponseModel (com.tencentcloudapi.common.JsonResponseModel)10373 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)10373 Type (java.lang.reflect.Type)10373