华为云用户手册

  • enable_opfusion 参数说明:控制是否对简单增删改查进行优化。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 简单查询限制如下: 只支持indexscan和indexonlyscan,且全部WHERE语句的过滤条件都在索引上。 只支持单表增删改查,不支持join、using。 只支持行存表,不支持分区表,表不支持有触发器。 不支持active sql、QPS等信息统计特性。 不支持正在扩容和缩容的表。 不支持查询或者修改系统列。 只支持简单SELECT语句,例如: SELECT c3 FROM t1 WHERE c1 = ? and c2 =10; 仅可以查询目标表的列,c1和c2列为索引列,后边可以是常量或者参数,可以使用 for update。 只支持简单INSERT语句,例如: INSERT INTO t1 VALUES (?,10,?); 仅支持一个VALUES,VALUES里面的类型可以是常量和参数,不支持returning。 只支持简单DELETE语句,例如: DELETE FROM t1 WHERE c1 = ? and c2 = 10; c1和c2列为索引列,后边可以是常量或者参数。 只支持简单UPDATE语句,例如: UPDATE t1 SET c3 = c3+? WHERE c1 = ? and c2 = 10; c3列修改的值可以是常量和参数,也可以是一个简单的表达式,c1和c2列为索引列,后边可以是常量或者参数。 取值范围:布尔型 on表示使用。 off表示不使用。 默认值:on
  • default_statistics_target 参数说明:为没有用ALTER TABLE SET STATIS TICS 设置字段目标的表设置缺省统计目标。此参数设置为正数是代表统计信息的样本数量,为负数时,代表使用百分比的形式设置统计目标,负数转换为对应的百分比,即-5代表5%。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:整型,-100~10000。 比默认值大的正数数值增加了ANALYZE所需的时间,但是可能会改善优化器的估计质量。 调整此参数可能存在性能劣化的风险,如果某个查询劣化,可以考虑 恢复默认的统计信息。 使用plan hint来调整到之前的查询计划。(详细参见使用Plan Hint进行调优) 当此guc参数设置为负数时,如果计算的采样样本数大于等于总数据量的2%,且用户表的数据量小于1600000时,ANALYZE所需时间相比guc参数为默认值的时间会有所增加。 当此guc参数设置为负数时,则autoanalyze不生效。 默认值:100
  • enable_partition_opfusion 参数说明:在enable_opfusion参数打开的状态下,如果开启该参数,可以对分区表的简单查询进行查询优化,提升SQL执行性能。在开启enable_global_plancache参数时,此参数设置on时将不生效。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:布尔型 on表示使用。 off表示不使用。 默认值:off
  • cost_param 参数说明:该参数用于控制在特定的客户场景中,使用不同的估算方法使得估算值与真实值更接近。此参数可以同时控制多种方法,与某一方法对应的位做与操作,不为0表示该方法被选择。 当cost_param & 1 不为0,表示对于求不等值连接选择率时选择一种改良机制,此方法在自连接(两个相同的表之间连接)的估算中更加准确。目前,已弃用cost_param & 1 不为0时的路径,默认选择更优的估算公式; 当cost_param & 2 不为0,表示求多个过滤条件(Filter)的选择率时,选择最小的作为总的选择率,而非两者乘积,此方法在过滤条件的列之间关联性较强时估算更加准确; 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:整型,0~INT_MAX 默认值:0
  • rewrite_rule 参数说明:标识开启的可选查询重写规则。有部分查询重写规则是可选的,开启它们并不能总是对查询效率有提升效果。在特定的客户场景中,通过此GUC参数对查询重写规则进行设置,使得查询效率最优。 此参数可以控制查询重写规则的组合,比如有多个重写规则:rule1、rule2、rule3、rule4。可以设置: set rewrite_rule=rule1; --启用查询重写规则rule1 set rewrite_rule=rule2,rule3; --启用查询重写规则rule2和rule3 set rewrite_rule=none; --关闭所有可选查询重写规则 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:字符串 none:不使用任何可选查询重写规则。 lazyagg:使用Lazy Agg查询重写规则(消除子查询中的聚集运算)。 magicset:使用Magic Set查询重写规则(从主查询中下推条件到子查询)。 uniquecheck:使用Unique Check查询重写规则(提升目标列中无agg的子查询语句,在执行时检查返回行数是否为1行)。 intargetlist:使用In Target List查询重写规则(提升目标列中的子查询)。 predpushnormal:使用Predicate Push查询重写规则(下推谓词条件到子查询中)。 predpushforce:使用Predicate Push查询重写规则(下推谓词条件到子查询中,尽可能的利用索引加速)。 predpush:在predpushnormal和predpushforce中根据代价选择最优计划。 disable_pullup_expr_sublink:禁止优化器将expr_sublink类型的子连接提升,关于sublink的分类和提升原理详见子查询调优。 默认值:magicset
  • gpc_clean_timeout 参数说明:开启enable_global_plancache的情况下,如果共享计划列表里的计划超过gpc_clean_timeout的时间没有被使用,则会被清理掉。本参数用于控制没有使用的共享计划的保留时间。当前特性是实验室特性,使用时请联系华为工程师提供技术支持。 该参数属于SIGHUP类型参数,请参考表1中对应设置方法进行设置。 取值范围:整型,300~86400 单位为秒 默认值:1800,即30min
  • enable_global_stats 参数说明:标识当前统计信息模式,区别采用全局统计信息收集模式还是单节点统计信息收集模式,默认创建为采用全局统计信息模式。当关闭该参数时,则默认收集数据库第一个节点的统计信息,此时可能会影响生成查询计划的质量,但信息收集性能较优,建议谨慎设置。 该参数属于SUSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:布尔型 on/true表示全局统计信息。 off/false表示数据库节点统计信息。 默认值:on
  • explain_perf_mode 参数说明:此参数用来指定explain的显示格式。 该参数属于USERSET类型参数,请参考表1中对应设置方法进行设置。 取值范围:normal、pretty、summary、run normal:代表使用默认的打印格式。 pretty:代表使用 GaussDB 改进后的新显示格式。新的格式层次清晰,计划包含了plan node id,性能分析简单直接。 summary:是在pretty的基础上增加了对打印信息的分析。 run:在summary的基础上,将统计的信息输出到csv格式的文件中,以便于进一步分析。 默认值:pretty(当前版本参数取值仅normal生效,若设置为非normal,显示格式依然为normal)
  • 状态码 状态码 描述 200 OK 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 409 Conflict 410 Gone 412 Precondition Failed 429 Too Many Requests 500 Internal Server Error 501 Not Implemented 503 Service Unavailable
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 keys Array of strings 标签键列表 page_info PageInfoTagKeys object 分页信息 表4 PageInfoTagKeys 参数 参数类型 描述 next_marker String 分页位置标识(索引) current_count Integer 当前页标签键的数量 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表6 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表8 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 403 表9 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表10 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 404 表11 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表12 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 405 表13 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表14 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 406 表15 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表16 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 409 表17 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表18 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 410 表19 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表20 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 412 表21 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表22 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 429 表23 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表24 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 500 表25 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表26 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 501 表27 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表28 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 503 表29 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表30 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息
  • URI GET /v1.0/tag-keys 表1 Query参数 参数 是否必选 参数类型 描述 region_id 否 String 区域ID limit 否 Integer 查询记录数。 最小为1,最大为200,未输入时默认为200。 最小值:1 最大值:200 缺省值:200 marker 否 String 分页位置标识(索引)。从marker指定索引的下一条数据开始查询。说明:查询第一页数据时,不需要传入此参数,查询后续页码数据时,将查询前一页数据响应体中marker值配入此参数,当返回的next_marker为空时表示查询到最后一页。
  • 状态码 状态码 描述 200 Success 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 409 Conflict 410 Gone 412 Precondition Failed 429 Too Many Requests 500 Internal Server Error 501 Not Implemented 503 Service Unavailable
  • 响应示例 状态码: 200 Success { "failed_resources" : [ { "resource_id" : "e1eb7c40cbea4c8389cde527594a306d", "resource_type" : "disk", "error_code" : "TMS.0002", "error_msg" : "Bad request" } ] }
  • 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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/global" tms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1/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 := global.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := tms.NewTmsClient( tms.TmsClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.DeleteResourceTagRequest{} var listTagsbody = []model.DeleteTagRequest{ { Key: "ENV", }, } var listResourcesbody = []model.ResourceTagBody{ { ResourceId: "a28531fa-a8d5-468e-8417-86a80962ee5e", ResourceType: "disk", }, { ResourceId: "vpc-dc7d19b7", ResourceType: "vpc", }, } projectIdReqDeleteTag:= "xxxdcffffffff" request.Body = &model.ReqDeleteTag{ Tags: listTagsbody, Resources: listResourcesbody, ProjectId: &projectIdReqDeleteTag, } response, err := client.DeleteResourceTag(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 请求示例 批量删除标签。 POST https://{Endpoint}/v1.0/resource-tags/batch-delete { "project_id" : "xxxdcffffffff", "resources" : [ { "resource_id" : "a28531fa-a8d5-468e-8417-86a80962ee5e", "resource_type" : "disk" }, { "resource_id" : "vpc-dc7d19b7", "resource_type" : "vpc" } ], "tags" : [ { "key" : "ENV" } ] }
  • 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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import GlobalCredentials from huaweicloudsdktms.v1.region.tms_region import TmsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdktms.v1 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 = GlobalCredentials(ak, sk) \ client = TmsClient.new_builder() \ .with_credentials(credentials) \ .with_region(TmsRegion.value_of("cn-north-4")) \ .build() try: request = DeleteResourceTagRequest() listTagsbody = [ DeleteTagRequest( key="ENV" ) ] listResourcesbody = [ ResourceTagBody( resource_id="a28531fa-a8d5-468e-8417-86a80962ee5e", resource_type="disk" ), ResourceTagBody( resource_id="vpc-dc7d19b7", resource_type="vpc" ) ] request.body = ReqDeleteTag( tags=listTagsbody, resources=listResourcesbody, project_id="xxxdcffffffff" ) response = client.delete_resource_tag(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • 响应参数 状态码: 200 表5 响应Body参数 参数 参数类型 描述 failed_resources Array of TagDeleteResponseItem objects 删除标签失败的资源信息 表6 TagDeleteResponseItem 参数 参数类型 描述 resource_id String 资源ID resource_type String 资源类型 error_code String 错误码 error_msg String 错误描述 状态码: 400 表7 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表8 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 401 表9 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表10 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 403 表11 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表12 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 404 表13 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表14 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 405 表15 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表16 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 406 表17 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表18 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 409 表19 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表20 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 410 表21 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表22 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 412 表23 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表24 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 429 表25 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表26 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 500 表27 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表28 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 501 表29 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表30 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 503 表31 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表32 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息
  • 请求参数 表1 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token。说明:由于TMS是全局服务,因此调用 IAM 服务获取用户Token接口时需要注意作用域即scope字段应该设置为domain。响应消息头中X-Subject-Token的值即为用户Token。 表2 请求Body参数 参数 是否必选 参数类型 描述 project_id 否 String 项目ID,resource_type为region级别服务时为必选项。 resources 是 Array of ResourceTagBody objects 资源列表 tags 是 Array of DeleteTagRequest objects 标签列表 表3 ResourceTagBody 参数 是否必选 参数类型 描述 resource_id 是 String 资源ID resource_type 是 String 资源类型 表4 DeleteTagRequest 参数 是否必选 参数类型 描述 key 是 String 键。 最大长度36个字符。 字符集:A-Z,a-z , 0-9,‘-’,‘_’,UNICODE字符(\u4E00-\u9FFF)。
  • 状态码 状态码 描述 200 OK 400 Bad Request 404 Not Found 405 Method Not Allowed 406 Not Acceptable 409 Conflict 410 Gone 412 Precondition Failed 429 Too Many Requests 500 Internal Server Error 501 Not Implemented 503 Service Unavailable
  • 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/global" tms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1/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 := global.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := tms.NewTmsClient( tms.TmsClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.ListApiVersionsRequest{} response, err := client.ListApiVersions(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 响应示例 状态码: 200 OK { "versions" : [ { "id" : "v1.0", "links" : [ { "rel" : "self", "href" : "https://{Endpoint}/v1.0" } ], "version" : "", "status" : "CURRENT", "updated" : "2016-12-09T00:00:00Z", "min_version" : "" } ] }
  • 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.GlobalCredentials; 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.tms.v1.region.TmsRegion; import com.huaweicloud.sdk.tms.v1.*; import com.huaweicloud.sdk.tms.v1.model.*; public class ListApiVersionsSolution { 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 GlobalCredentials() .withAk(ak) .withSk(sk); TmsClient client = TmsClient.newBuilder() .withCredential(auth) .withRegion(TmsRegion.valueOf("cn-north-4")) .build(); ListApiVersionsRequest request = new ListApiVersionsRequest(); try { ListApiVersionsResponse response = client.listApiVersions(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()); } } }
  • 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 GlobalCredentials from huaweicloudsdktms.v1.region.tms_region import TmsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdktms.v1 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 = GlobalCredentials(ak, sk) \ client = TmsClient.new_builder() \ .with_credentials(credentials) \ .with_region(TmsRegion.value_of("cn-north-4")) \ .build() try: request = ListApiVersionsRequest() response = client.list_api_versions(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • 响应参数 状态码: 200 表1 响应Body参数 参数 参数类型 描述 versions Array of VersionDetail objects 版本列表 表2 VersionDetail 参数 参数类型 描述 id String 版本ID(版本号),如v1.0。 links Array of Link objects API的URL地址。 version String 若该版本API支持微版本,则返回支持的最新微版本号,如果不支持微版本,则返回空。 status String 版本状态,为如下3种: CURRENT:表示该版本为主推版本。 SUPPORTED:表示为老版本,但是现在还继续支持。 DEPRECATED:表示为废弃版本,存在后续删除的可能。 updated String 版本发布时间,采用UTC时间表示。如v1.0发布的时间2016-12-09T00:00:00Z。 min_version String 若该版本API 支持微版本,则返回支持的最早微版本号, 如果不支持微版本,则返回空。 表3 Link 参数 参数类型 描述 href String API的URL地址。 rel String self 状态码: 400 表4 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表5 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 404 表6 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表7 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 405 表8 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表9 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 406 表10 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表11 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 409 表12 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表13 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 410 表14 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表15 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 412 表16 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表17 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 429 表18 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表19 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 500 表20 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表21 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 501 表22 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表23 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 503 表24 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表25 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息
  • 状态码 状态码 描述 200 OK 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 406 Not Acceptable 409 Conflict 410 Gone 412 Precondition Failed 429 Too Many Requests 500 Internal Server Error 501 Not Implemented 503 Service Unavailable
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 values Array of strings 查询到的标签值列表 page_info PageInfoTagValues object 分页信息 表4 PageInfoTagValues 参数 参数类型 描述 next_marker String 分页位置标识(索引) current_count Integer 当前页标签值的数量 状态码: 400 表5 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表6 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 401 表7 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表8 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 403 表9 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表10 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 404 表11 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表12 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 405 表13 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表14 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 406 表15 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表16 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 409 表17 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表18 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 410 表19 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表20 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 412 表21 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表22 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 429 表23 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表24 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 500 表25 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表26 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 501 表27 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表28 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息 状态码: 503 表29 响应Body参数 参数 参数类型 描述 error RespErrorMessage object 响应错误信息 表30 RespErrorMessage 参数 参数类型 描述 error_code String 请求错误码 error_msg String 错误信息
  • URI GET /v1.0/tag-values 表1 Query参数 参数 是否必选 参数类型 描述 region_id 否 String 区域ID limit 否 Integer 查询记录数。 最小为1,最大为200,未输入时默认为200。 最小值:1 最大值:200 缺省值:200 marker 否 String 分页位置标识(索引)。从marker指定索引的下一条数据开始查询。说明:查询第一页数据时,不需要传入此参数,查询后续页码数据时,将查询前一页数据响应体中marker值配入此参数,当返回的next_marker为空时表示查询到最后一页。 key 是 String 标签键
  • 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 GlobalCredentials from huaweicloudsdktms.v1.region.tms_region import TmsRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdktms.v1 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 = GlobalCredentials(ak, sk) \ client = TmsClient.new_builder() \ .with_credentials(credentials) \ .with_region(TmsRegion.value_of("cn-north-4")) \ .build() try: request = ShowApiVersionRequest() response = client.show_api_version(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/global" tms "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/tms/v1/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 := global.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := tms.NewTmsClient( tms.TmsClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.ShowApiVersionRequest{} response, err := client.ShowApiVersion(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 状态码 状态码 描述 200 OK 400 Bad Request 404 Not Found 405 Method Not Allowed 406 Not Acceptable 408 Request Timeout 409 Conflict 410 Gone 412 Precondition Failed 429 Too Many Requests 500 Internal Server Error 501 Not Implemented 503 Service Unavailable
共100000条