云服务器内容精选
-
响应示例 状态码: 200 List AvailableZone Info Success { "availability_zone" : [ { "region_id" : "cn-north-4", "id" : "cn-north-4a", "type" : "Core", "display_name" : "可用区1", "status" : "Running" }, { "region_id" : "cn-north-4", "id" : "cn-north-4b", "type" : "Core", "display_name" : "可用区2", "status" : "Running" }, { "region_id" : "cn-north-4", "id" : "cn-north-4c", "type" : "Core", "display_name" : "可用区3", "status" : "Running" } ] }
-
响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 availability_zone Array of AvailabilityZones objects 可用区信息 表4 AvailabilityZones 参数 参数类型 描述 region_id String 可用区ID。 id String 可用分区ID。 display_name String 可用分区显示名称。 status String 可用分区状态。 Running:运行中 type String 可用分区类型。 Core:核心可用区 Dedicated:专属可用区,只对内部客户开放 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 请求参数错误。 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 校验TOKEN失败。 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 租户无权限操作。 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 没有找到CBH资源。
-
响应示例 状态码: 200 可用分区的信息。 { "availabilityZoneInfo" : [ { "zoneState" : { "available" : true }, "zoneName" : "az-dc-1" } ] } 状态码: 400 Bad Request { "error" : { "message" : "XXXX", "code" : "XXX" } }
-
响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 availabilityZoneInfo Array of AzInfo objects 查询请求返回的可用分区列表。 表4 AzInfo 参数 参数类型 描述 zoneName String 可用分区的名字。 zoneState ZoneState object 可用分区的状态。 表5 ZoneState 参数 参数类型 描述 available Boolean 可用分区是否可用。 状态码: 400 表6 响应Body参数 参数 参数类型 描述 error Error object 出现错误时,返回的错误信息。 表7 Error 参数 参数类型 描述 code String 出现错误时,返回的错误码。 错误码和其对应的含义请参考错误码说明。 message String 出现错误时,返回的错误消息。
-
响应示例 状态码: 200 List AvailableZone Info Success { "availability_zone" : [ { "region_id" : "cn-north-4", "id" : "cn-north-4a", "type" : "Core", "display_name" : "可用区1", "status" : "Running" }, { "region_id" : "cn-north-4", "id" : "cn-north-4b", "type" : "Core", "display_name" : "可用区2", "status" : "Running" }, { "region_id" : "cn-north-4", "id" : "cn-north-4c", "type" : "Core", "display_name" : "可用区3", "status" : "Running" } ] }
-
响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 availability_zone Array of AvailabilityZones objects 可用区信息 表4 AvailabilityZones 参数 参数类型 描述 region_id String 可用区ID。 id String 可用分区ID。 display_name String 可用分区显示名称。 status String 可用分区状态。 Running:运行中 type String 可用分区类型。 Core:核心可用区 Dedicated:专属可用区,只对内部客户开放 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 请求参数错误。 状态码: 401 表6 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 校验TOKEN失败。 状态码: 403 表7 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 租户无权限操作。 状态码: 404 表8 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_description String 没有找到CBH资源。
-
Python 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkevs.v2.region.evs_region import EvsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkevs.v2 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.getenv("CLOUD_SDK_AK") sk = os.getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = EvsClient.new_builder() \ .with_credentials(credentials) \ .with_region(EvsRegion.value_of("cn-north-4")) \ .build() try: request = CinderListAvailabilityZonesRequest() response = client.cinder_list_availability_zones(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
-
Go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" evs "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/evs/v2/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := evs.NewEvsClient( evs.EvsClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.CinderListAvailabilityZonesRequest{} response, err := client.CinderListAvailabilityZones(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
-
Java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.evs.v2.region.EvsRegion; import com.huaweicloud.sdk.evs.v2.*; import com.huaweicloud.sdk.evs.v2.model.*; public class CinderListAvailabilityZonesSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); EvsClient client = EvsClient.newBuilder() .withCredential(auth) .withRegion(EvsRegion.valueOf("cn-north-4")) .build(); CinderListAvailabilityZonesRequest request = new CinderListAvailabilityZonesRequest(); try { CinderListAvailabilityZonesResponse response = client.cinderListAvailabilityZones(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
更多精彩内容
CDN加速
GaussDB
文字转换成语音
免费的服务器
如何创建网站
域名网站购买
私有云桌面
云主机哪个好
域名怎么备案
手机云电脑
SSL证书申请
云点播服务器
免费OCR是什么
电脑云桌面
域名备案怎么弄
语音转文字
文字图片识别
云桌面是什么
网址安全检测
网站建设搭建
国外CDN加速
SSL免费证书申请
短信批量发送
图片OCR识别
云数据库MySQL
个人域名购买
录音转文字
扫描图片识别文字
OCR图片识别
行驶证识别
虚拟电话号码
电话呼叫中心软件
怎么制作一个网站
Email注册网站
华为VNC
图像文字识别
企业网站制作
个人网站搭建
华为云计算
免费租用云托管
云桌面云服务器
ocr文字识别免费版
HTTPS证书申请
图片文字识别转换
国外域名注册商
使用免费虚拟主机
云电脑主机多少钱
鲲鹏云手机
短信验证码平台
OCR图片文字识别
SSL证书是什么
申请企业邮箱步骤
免费的企业用邮箱
云免流搭建教程
域名价格