Search in sources :

Example 1 with DescribeZonesResponse

use of com.tencentcloudapi.cvm.v20170312.models.DescribeZonesResponse in project tencentcloud-sdk-java by TencentCloud.

the class DescribeZones method main.

public static void main(String[] args) {
    try {
        // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey
        Credential cred = new Credential("secretId", "secretKey");
        // 实例化要请求产品(以cvm为例)的client对象
        CvmClient client = new CvmClient(cred, "ap-guangzhou");
        // 实例化一个请求对象
        DescribeZonesRequest req = new DescribeZonesRequest();
        // 通过client对象调用想要访问的接口,需要传入请求对象
        DescribeZonesResponse resp = client.DescribeZones(req);
        // 输出json格式的字符串回包
        System.out.println(DescribeZonesRequest.toJsonString(resp));
    } catch (TencentCloudSDKException e) {
        System.out.println(e.toString());
    }
}
Also used : Credential(com.tencentcloudapi.common.Credential) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) DescribeZonesRequest(com.tencentcloudapi.cvm.v20170312.models.DescribeZonesRequest) DescribeZonesResponse(com.tencentcloudapi.cvm.v20170312.models.DescribeZonesResponse) CvmClient(com.tencentcloudapi.cvm.v20170312.CvmClient)

Example 2 with DescribeZonesResponse

use of com.tencentcloudapi.cvm.v20170312.models.DescribeZonesResponse in project tencentcloud-sdk-java-intl-en by TencentCloud.

the class DescribeZones method main.

public static void main(String[] args) {
    try {
        Credential cred = new Credential("secretId", "secretKey");
        CvmClient client = new CvmClient(cred, "ap-guangzhou");
        DescribeZonesRequest req = new DescribeZonesRequest();
        DescribeZonesResponse resp = client.DescribeZones(req);
        System.out.println(DescribeZonesRequest.toJsonString(resp));
    } catch (TencentCloudSDKException e) {
        System.out.println(e.toString());
    }
}
Also used : Credential(com.tencentcloudapi.common.Credential) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) DescribeZonesRequest(com.tencentcloudapi.cvm.v20170312.models.DescribeZonesRequest) DescribeZonesResponse(com.tencentcloudapi.cvm.v20170312.models.DescribeZonesResponse) CvmClient(com.tencentcloudapi.cvm.v20170312.CvmClient)

Aggregations

Credential (com.tencentcloudapi.common.Credential)2 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)2 CvmClient (com.tencentcloudapi.cvm.v20170312.CvmClient)2 DescribeZonesRequest (com.tencentcloudapi.cvm.v20170312.models.DescribeZonesRequest)2 DescribeZonesResponse (com.tencentcloudapi.cvm.v20170312.models.DescribeZonesResponse)2