Search in sources :

Example 46 with JsonResponseModel

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

the class CamClient method DescribeSafeAuthFlag.

/**
 *This API is used to query security settings.
 * @param req DescribeSafeAuthFlagRequest
 * @return DescribeSafeAuthFlagResponse
 * @throws TencentCloudSDKException
 */
public DescribeSafeAuthFlagResponse DescribeSafeAuthFlag(DescribeSafeAuthFlagRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeSafeAuthFlagResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeSafeAuthFlagResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeSafeAuthFlag");
        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 47 with JsonResponseModel

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

the class CvmClient method DescribeInstanceVncUrl.

/**
 *This API is used to query the Virtual Network Console (VNC) URL of an instance for its login to the VNC.
 *
 * It does not support `STOPPED` CVMs.
 * A VNC URL is only valid for 15 seconds. If you do not access the URL within 15 seconds, it will become invalid and you have to query a URL again.
 * Once the VNC URL is accessed, it will become invalid and you have to query a URL again if needed.
 * If the connection is interrupted, you can make up to 30 reconnection attempts per minute.
 * After getting the value `InstanceVncUrl`, you need to append `InstanceVncUrl=xxxx` to the end of the link <https://img.qcloud.com/qcloud/app/active_vnc/index.html?>.
 *
 *  - `InstanceVncUrl`: its value will be returned after the API is successfully called.
 *
 *    The final URL is in the following format:
 *
 *```
 *https://img.qcloud.com/qcloud/app/active_vnc/index.html?InstanceVncUrl=wss%3A%2F%2Fbjvnc.qcloud.com%3A26789%2Fvnc%3Fs%3DaHpjWnRVMFNhYmxKdDM5MjRHNlVTSVQwajNUSW0wb2tBbmFtREFCTmFrcy8vUUNPMG0wSHZNOUUxRm5PMmUzWmFDcWlOdDJIbUJxSTZDL0RXcHZxYnZZMmRkWWZWcEZia2lyb09XMzdKNmM9
 *```
 *
 * @param req DescribeInstanceVncUrlRequest
 * @return DescribeInstanceVncUrlResponse
 * @throws TencentCloudSDKException
 */
public DescribeInstanceVncUrlResponse DescribeInstanceVncUrl(DescribeInstanceVncUrlRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeInstanceVncUrlResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeInstanceVncUrlResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeInstanceVncUrl");
        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 48 with JsonResponseModel

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

the class CvmClient method DescribeInstanceTypeConfigs.

/**
 *This API is used to query the model configuration of an instance.
 *
 * You can filter the query results with `zone` or `instance-family`. For more information on filtering conditions, see [`Filter`](https://intl.cloud.tencent.com/document/api/213/15753?from_cn_redirect=1#Filter).
 * If no parameter is defined, the model configuration of all the instances in the specified region will be returned.
 * @param req DescribeInstanceTypeConfigsRequest
 * @return DescribeInstanceTypeConfigsResponse
 * @throws TencentCloudSDKException
 */
public DescribeInstanceTypeConfigsResponse DescribeInstanceTypeConfigs(DescribeInstanceTypeConfigsRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeInstanceTypeConfigsResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeInstanceTypeConfigsResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeInstanceTypeConfigs");
        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 49 with JsonResponseModel

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

the class CvmClient method InquiryPriceRunInstances.

/**
 *This API is used to query the price of creating instances. You can only use this API for instances whose configuration is within the purchase limit. For more information, see [RunInstances](https://intl.cloud.tencent.com/document/api/213/15730?from_cn_redirect=1).
 * @param req InquiryPriceRunInstancesRequest
 * @return InquiryPriceRunInstancesResponse
 * @throws TencentCloudSDKException
 */
public InquiryPriceRunInstancesResponse InquiryPriceRunInstances(InquiryPriceRunInstancesRequest req) throws TencentCloudSDKException {
    JsonResponseModel<InquiryPriceRunInstancesResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<InquiryPriceRunInstancesResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "InquiryPriceRunInstances");
        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 50 with JsonResponseModel

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

the class MariadbClient method ModifyDBParameters.

/**
 *This API is used to modify database parameters.
 * @param req ModifyDBParametersRequest
 * @return ModifyDBParametersResponse
 * @throws TencentCloudSDKException
 */
public ModifyDBParametersResponse ModifyDBParameters(ModifyDBParametersRequest req) throws TencentCloudSDKException {
    JsonResponseModel<ModifyDBParametersResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<ModifyDBParametersResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "ModifyDBParameters");
        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