更新时间:2025-07-25 GMT+08:00
分享

根据id获取单个关键字信息

功能介绍

根据id获取单个关键字信息

调用方法

请参见如何调用API

URI

GET /v3/{project_id}/basic-aw/{aw_id}

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

参数解释

项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目唯一标识

约束限制

不涉及

取值范围

32个字符组成的字符串

默认取值

不涉及

aw_id

String

参数解释

关键字id

约束限制

不涉及

取值范围

32个字符组成的字符串

默认取值

不涉及

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释:

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

约束限制:

必传。

取值范围:

字符串长度不少于1,不超过10万。

默认取值:

不涉及。

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

code

String

参数解释

错误码

error

CommonResponseErrorOfAPITest object

参数解释

统一错误返回

reason

String

参数解释

失败原因

result

BasicAwRes object

参数解释

结果

status

String

参数解释

状态

costTimeResult

String

参数解释

提交耗时

表4 CommonResponseErrorOfAPITest

参数

参数类型

描述

code

String

参数解释

接口调用失败错误码

取值范围

不超过256个字符组成的字符串

reason

String

参数解释

接口调用失败原因

取值范围

不超过1000个字符组成的字符串

表5 BasicAwRes

参数

参数类型

描述

aw_code

String

参数解释

关键字代码, hascode字段为1时有效

aw_description

String

参数解释

关键字描述

aw_mark

Integer

参数解释

关键字标记

aw_operationid

String

参数解释

关键字操作编号

aw_tags

String

参数解释

关键字标签

aw_type

Integer

参数解释

关键字类型

aw_uniqueid

String

参数解释

关键字来源

by_order

Integer

参数解释

关键字顺序

create_time

String

参数解释

关键字创建时间

create_time_stamp

Long

参数解释

关键字创建时间戳

create_time_string

String

参数解释

关键字创建时间戳(字符串格式)

create_user

String

参数解释

关键字创建者

create_user_id

String

参数解释

关键字创建者ID

delete_time

String

参数解释

关键字删除时间

delete_user

String

参数解释

关键字删除者

description

String

参数解释

关键字描述

dft_check_point_list

Array of objects

参数解释

默认检查点列表

dft_custom_header

Array of objects

参数解释

默认请求头参数对象

dft_retry_interval

String

参数解释

重试间隔时间 (ms) ,为空表示不等待

dft_retry_times

String

参数解释

重试次数

keyword_variable_value

Array of AwVariable objects

参数解释

变量值

dft_variable_list

Array of objects

参数解释

默认变量信息列表

aw_ins_list

Array of AwInstance objects

组合关键字包含的关键字实例信息,关键字类型为2时该字段有效

output_param_list

Array of AwVariable objects

参数解释

组合关键字的输出参数信息,该字段不存数据库,实时获取

custom_aw_libs

Array of UploadFile objects

关键字库的文件列表

extra_info

Object

参数解释

补充信息

group_name

String

参数解释

分组名

has_code

Integer

参数解释

是否存在代码, 0-不存在代;1-存在代码

id

String

参数解释

关键字编号

import_package

Array of strings

参数解释

导入的包名

interface_label

String

参数解释

接口的x-extend字段说明

is_favorite

Integer

参数解释

是否收藏

method

String

参数解释

关键字方法名

name

String

参数解释

关键字名

nameView

String

参数解释

在页面上显示的名字

origin_project

String

参数解释

源工程信息

param_type_and_dft_value

Array of objects

参数解释

参数类型和参数默认值

project_id

String

参数解释

工程编号

protocol_type

String

参数解释

协议类型

public_aw_lib

Object

参数解释

公共关键字信息

public_aw_lib_id

String

参数解释

公共关键字唯一标识

region

String

参数解释

region信息

return_type

String

参数解释

返回值类型

root_id

String

参数解释

根节点编号

source

String

参数解释

关键字依赖的类源

special_type

Integer

参数解释

特殊关键字类型

tmssCaseNumber

String

参数解释

关键字编号(来自测试管理服务)

tmss_case_id

String

参数解释

测试用例唯一标识

update_time

String

参数解释

关键字更新时间

update_time_stamp

Long

参数解释

关键字更新时间戳

update_time_string

String

参数解释

关键字更新时间戳(字符串格式)

update_user

String

参数解释

关键字更新者

warningMsg

String

参数解释

警告信息

yamlName

String

参数解释

yaml名称

表6 AwInstance

参数

参数类型

描述

alias_runaw

String

关键字内容描述字段

authentication_info

AuthInfo object

认证信息

authentication_type

String

认证类型,0-无认证;1-aksk认证

aw_description

String

脚本模板描述信息,在用例更新时添加

aw_id

String

关键字唯一标识

aw_type

Integer

关键字类型 0-setup;1-test;2-teardown

basic_aw

BasicAw object

关键字

body_param_type

String

关键字实例的参数body体类型:form/text

by_order

Integer

顺序

changeSign

Integer

变化标志

check_point_list

Array of CheckPoint objects

检查点集合

children

Array of AwInstance objects

关键字实例

condition_statement

String

条件语句

condition_type

Integer

条件类型 0-not condition;1-if begin;2-if

create_time

String

创建时间

create_time_stamp

Long

创建时间戳

create_time_string

String

创建时间字符串

create_user

String

创建人

custom_header

Array of AwParam objects

测试步骤自定义请求头集合;后续自定义URL请求头不再使用该字段

description

String

描述

error_info

ErrorInfo object

执行的错误日志内容列表

extra_info

ExtraInfo object

补充信息

from_outside

Integer

该关键字是否来自外部工程 0-no;1-yes

hasLevel

Integer

层级

header_array

Object

请求头列表

his_script

String

值不为null表示老的IF判断语句;值为null表示新的IF判断语句

id

String

唯一标识

is_basic

Integer

是否模板类型测试步骤 0:自定义URL配置类型;1:模板类型测试步骤

is_contract_aw

Integer

是否是契约关键字 0-否;1-yes

is_disabled

Integer

是否被禁用 0-否;1-yes

is_sectest_aw

Integer

是否是安全测试关键字

level

Integer

用例级别

name

String

名称

param_dependent

String

参数依赖

param_dependent_enabled

Integer

是否启用参数依赖

param_type_and_value

Array of AwParam objects

参数类型和参数值对应集合

projectId

String

工程唯一标识

region

String

区域名称

relation

String

关键字唯一标识层级关系

relation_id

String

层级关系唯一标识

relation_type

Integer

映射类型 1-反向删除映射;2-用例自动添加的方向删除步骤

retry_interval

String

重试间隔时间 (ms) 为空表示不等待

retry_times

String

重试次数

scriptName

String

获取脚本生成时,要使用的步骤名称

service_and_stage

String

关键字所来自工程的服务名和阶段名 fromOutside为1时该值有效

special_type

Integer

测试步骤来源

update_time

String

更新时间

update_time_stamp

Long

更新时间戳

update_time_string

String

更新时间字符串

update_user

String

更新人

user_id

String

用户唯一标识

variable_list

Array of AwVariable objects

用例局部变量

表7 AuthInfo

参数

参数类型

描述

access_key

String

访问密钥

secret_key

String

私钥

表8 BasicAw

参数

参数类型

描述

aw_code

String

关键字代码, hasCode为1时有效

aw_description

String

脚本模板描述信息,在用例更新时添加

aw_ins_list

Array of AwInstance objects

组合关键字包含的关键字实例信息,关键字类型为2时该字段有效

aw_mark

Integer

关键字标记 0-normal;1-new;2-update 3-delete

aw_operationid

String

接口的唯一标识

aw_tags

String

接口的标签

aw_type

Integer

关键字类型1-普通关键字,2-组合关键字,3-导入关键字

aw_uniqueid

String

关键字唯一标识和标签的拼接

by_order

Integer

顺序

create_time

String

创建时间

create_time_stamp

Long

创建时间戳

create_time_string

String

创建时间字符串

create_user

String

创建人

create_user_id

String

创建人唯一标识

custom_aw_libs

Array of UploadFile objects

关键字库的文件列表

delete_time

String

删除时间

delete_user

String

删除人

description

String

描述

dft_check_point_list

Array of CheckPoint objects

默认检查点集合

dft_custom_header

Array of AwParam objects

默认请求头参数对象

dft_retry_interval

String

重试间隔时间 (ms) 为空表示不等待

dft_retry_times

String

重试次数

dft_variable_list

Array of AwVariable objects

定义的变量信息

extra_info

Object

补充信息

group_name

String

组名

has_code

Integer

是否自带代码 0-不自带代码,该关键字依赖source字段中的源;1-自带代码

id

String

唯一标识

import_package

Array of strings

导入的包

interface_label

String

接口的x-extend

is_favorite

Integer

是否是当前工程的收藏关键字,该字段不存数据库,每次获取时实时判断

keyword_variable_value

Array of AwVariable objects

关键字局部变量

method

String

方法

name

String

名称

nameView

String

关键字在页面上显示的名字

origin_project

String

源工程信息,如果该关键字是从其他工程过来的(继承或者copy to local)

output_param_list

Array of AwVariable objects

组合关键字的输出参数信息,该字段不存数据库,实时获取

param_type_and_dft_value

Array of AwParam objects

参数类型和参数默认值对应集合

project_id

String

工程唯一标识

protocol_type

String

协议类型 (http/dsf/other)

public_aw_lib

PublicAwLib object

公共关键字信息

public_aw_lib_id

String

所属公共关键字库唯一标识

region

String

区域名称

return_type

String

返回类型

root_id

String

root唯一标识

source

String

来源

special_type

Integer

测试步骤来源

tmssCaseNumber

String

关键字管理的用例编号

tmss_case_id

String

关键字管理的用例唯一标识

update_time

String

更新时间

update_time_stamp

Long

更新时间戳

update_time_string

String

更新时间字符串

update_user

String

更新人

warningMsg

String

警告信息

yamlName

String

所属yaml文件名称,该字段不存库,用来记录从哪个yaml文件导入

表9 PublicAwLib

参数

参数类型

描述

create_time

String

创建时间

create_time_stamp

Long

创建时间戳

create_time_string

String

创建时间字符串

create_user

String

创建人

document_link

String

文档链接

id

String

唯一标识

name

String

名称

net_area

Array of strings

蓝区:Blue,绿区:Green,黄区:Yellow

obs_temp_url

String

obs临时url

product_line

String

产品线

repo_branch

String

仓库分支

repo_lib_path

String

存公共关键字依赖jar包的目录

repo_password

String

仓库密码

repo_private_key

String

仓库秘钥

repo_url

String

仓库地址

repo_username

String

仓库用户名

update_time

String

更新时间

update_time_stamp

Long

更新时间戳

update_time_string

String

更新时间字符串

update_user

String

更新人

表10 CheckPoint

参数

参数类型

描述

comparison

String

参数解释

比较符

description

String

参数解释

描述信息

function_arg

String

参数解释

类型值

function_type

String

参数解释

高级提取类型

property

String

参数解释

属性名称

value

String

参数解释

目标值

表11 ErrorInfo

参数

参数类型

描述

error_content

String

错误内容的描述

error_index

String

错误索引的描述

error_point

String

错误点的描述

high_light

Boolean

是否高亮标识

表12 ExtraInfo

参数

参数类型

描述

childImportPackage

Array of strings

子级导入的包

document_link

String

文档链接

http_method

String

http请求方法

http_url

String

HTTP请求的URL

importPackage

Array of strings

导入的包

mock

MockInfo object

关键字实例中的mock信息

outputParam

Array of AwVariable objects

输出参数

param_dependent

String

参数依赖

summary

String

摘要

表13 AwParam

参数

参数类型

描述

basic_value

AwParamBasicValue object

参数解释

关键字参数基本类型取值类

basic_value_list

Array of AwParamBasicValue objects

参数解释

关键字参数, valueType为1时该值有效

custom_body

String

参数解释

自定义requestBody内容,inType为2且isBodyCustom为1时有效

defaultValue

String

参数解释

默认值

description

String

参数解释

关键字参数描述

disabled

Boolean

参数解释

是否禁用,只有非必需参数才能被禁用

drop_down_value

String

参数解释

用于存储下拉菜单的值

enum_type

String

参数解释

枚举类型

enum_type_selected

String

参数解释

当前选中的枚举类型

format

String

参数解释

num和String有效

in_type

Integer

参数解释

rest接口输入参数类型: 0-query 1-path 2-body 3-header 4-formdata 5-config

isChecked

Boolean

参数解释

是否是被选中参数

is_big_field

Boolean

参数解释

是否是大字段参数

is_body_custom

Integer

参数解释

requestBody是否自定义,inType为2时有效。0-非自定义,用原有逻辑;1-自定义body,requestBody直接使用字段customBody

is_contract_param

Integer

参数解释

是否是契约关键字 0-否;1-yes

is_sensitive

Boolean

参数解释

是否敏感参数,0 是, 1 不是

item

ItemParam object

参数解释

关键字基本参数

maxItems

Integer

参数解释

Array类型最大元素数

maxLength

Long

参数解释

String类型最大长度

maximum

Object

参数解释

Number类型最大值

minItems

Integer

参数解释

Array类型最小元素数

minLength

Long

参数解释

String类型最小长度

minimum

Object

参数解释

Number类型最小值

mock

MockInfo object

参数解释

关键字实例中的mock信息

name

String

参数解释

参数名

object_value

Array of AwParam objects

参数解释

valueType为2时该值有效。valueType为3时,该值用来表示数组中单个结构体

object_value_list

Array<Array<AwParam>>

参数解释

valueType为3时该值有效

pattern

String

参数解释

num和String有效

required

Boolean

参数解释

是否必需参数

type

String

参数解释

参数类型

validate_rule

ValidateRule object

参数解释

校验规则

value_type

Integer

参数解释

参数值类型

xChoiceValue

String

参数解释

choice选择关系

表14 AwParamBasicValue

参数

参数类型

描述

value

String

参数解释

参数默认值,用例有效

value_range

String

参数解释

参数值范围,逻辑用例有效

表15 ItemParam

参数

参数类型

描述

basic_value

AwParamBasicValue object

参数解释

关键字参数基本类型取值类

defaultValue

String

参数解释

默认值

enum_type

String

参数解释

枚举类型

enum_type_selected

String

参数解释

当前选中的枚举类型

format

String

参数解释

num和String有效

is_big_field

Boolean

参数解释

是否是大字段参数

maxItems

Integer

参数解释

Array类型最大元素数

maxLength

Long

参数解释

String类型最大长度

maximum

Object

Number类型最大值

minItems

Integer

参数解释

Array类型最小元素数

minLength

Long

参数解释

String类型最小长度

minimum

Object

参数解释

Number类型最小值

pattern

String

参数解释

num和String有效

type

String

参数解释

参数类型

validate_rule

ValidateRule object

参数解释

校验规则

value_type

Integer

参数解释

参数值类型

xChoiceValue

String

参数解释

choice选择关系

表16 MockInfo

参数

参数类型

描述

mock_id

String

参数解释

mock唯一标识

mock_switch

Boolean

参数解释

mock开关

mock_url

String

参数解释

mock地址

表17 ValidateRule

参数

参数类型

描述

dependent_info

Array of ConditionInstance objects

参数解释

依赖信息列表

enabled

Boolean

参数解释

是否启用的标识符

is_configDep

Boolean

参数解释

配置依赖的标识符

is_dependent

Boolean

参数解释

是否依赖的标识符

message

String

参数解释

消息

result

String

参数解释

结果

special_char

String

参数解释

特殊字符

special_char_valid

String

参数解释

特殊字符的有效性

x_example

String

参数解释

示例

表18 ConditionInstance

参数

参数类型

描述

conditionIndex

Integer

参数解释

条件索引,用于标识当前处理的是哪个条件

conditionMap

Map<String,Array<String>>

参数解释

条件映射,键为整数,值为字符串列表,用于存储各个条件的信息

depParamMap

Map<String,DepParamInstance>

参数解释

依赖参数实例的映射

statementIndex

Integer

参数解释

声明索引,用于标识当前处理的是哪个声明

表19 DepParamInstance

参数

参数类型

描述

compareValue

String

参数解释

比较值

comparison

String

参数解释

比较符

condition

Boolean

参数解释

条件

inValidValues

Array of strings

参数解释

无效值列表

name

String

参数解释

名称

nullInfo

String

参数解释

空值信息

relationMap

Map<String,String>

参数解释

关系映射,key为整数,value为字符串

relationNum

Integer

参数解释

关系数量

values

Array of strings

参数解释

值列表

表20 AwVariable

参数

参数类型

描述

by_order

Integer

参数解释

节点顺序

currentPermission

String

参数解释

当前人员权限

description

String

参数解释

参数描述

dynamicParam

String

参数解释

动态参数名称

dynamicParamFlag

Boolean

参数解释

动态参数标志,默认为false. true代表动态参数; false代表非动态参数

functionParams

String

参数解释

变量参数([]:空参、[a]:一参,[a,b]:两参)

function_arg

String

参数解释

提取类型的类型值

function_type

String

参数解释

高级提取类型,响应提取时要使用什么方法处理参数

isSensitiveInfo

Boolean

参数解释

是否是敏感字段

isSensitiveModified

Boolean

参数解释

敏感字段是否被修改,不敏感字段不关注此值

is_out_put

Boolean

参数解释

是否是组合关键字的输出参数,只有组合关键字下awInstance的关键字变量有该字段

name

String

参数解释

参数名称

node_id

String

参数解释

节点id

node_type

Integer

参数解释

0/null-变量节点; 1-目录节点

oldName

String

参数解释

旧名称

parent_node_id

String

参数解释

父节点唯一标识

property

String

参数解释

属性

regex

String

参数解释

内置函数枚举

sensitiveInfoSetterTime

String

参数解释

敏感参数设置时间

sensitiveInfoSetterUser

String

参数解释

敏感参数设置者名称

type

String

参数解释

类型

variableType

Integer

参数解释

变量类型(0:text,10-16:分别对应7个内置函数)

表21 UploadFile

参数

参数类型

描述

awInsId

String

所属的关键字实例的唯一标识

create_time

String

创建时间

create_time_stamp

Long

创建时间戳

create_time_string

String

创建时间字符串

create_user

String

创建人

current_size

Long

当前大小

filePath

String

文件路径

id

String

唯一标识

name

String

名称

originName

String

文件的原名

projectId

String

项目唯一标识

region

String

区域名称

testcase_id

String

测试用例的唯一标识符

update_time

String

更新时间

update_time_stamp

Long

更新时间戳

update_time_string

String

更新时间字符串

update_user

String

更新人

状态码:401

表22 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

12-18个字符组成的字符串

error_msg

String

参数解释

接口调用失败错误信息

取值范围

3-1000个字符组成的字符串

状态码:403

表23 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

12-18个字符组成的字符串

error_msg

String

参数解释

接口调用失败错误信息

取值范围

3-1000个字符组成的字符串

状态码:404

表24 响应Body参数

参数

参数类型

描述

error_code

String

参数解释

接口调用失败错误码

取值范围

12-18个字符组成的字符串

error_msg

String

参数解释

接口调用失败错误信息

取值范围

3-1000个字符组成的字符串

请求示例

get https://{endpoint}/v3/17dbf1f26078431fa9f4e09525befb2a/basic-aw/82042499e81f4f3796fa833553f5f25b

响应示例

状态码:200

SUCCESS

{
  "status" : "success",
  "result" : {
    "id" : "82042499e81f4f3796fa833553f5f25b",
    "warningMsg" : null,
    "name" : "getGroupConfigForPermissionUsingGET",
    "source" : null,
    "method" : "getGroupConfigForPermissionUsingGET",
    "description" : "查询群组配置",
    "nameView" : null,
    "tmssCaseNumber" : null,
    "region" : "cn-north-208",
    "yamlName" : null,
    "create_time_string" : "2023-09-28 15:43:51 GMT+08:00",
    "update_time_string" : "2023-09-28 15:43:51 GMT+08:00",
    "create_time_stamp" : 1695887031000,
    "update_time_stamp" : 1695887031000,
    "create_user" : "话痨+1",
    "create_time" : "2023-09-28T03:43:51+0800",
    "update_user" : "话痨+1",
    "update_time" : "2023-09-28T03:43:51+0800",
    "param_type_and_dft_value" : [ {
      "type" : "String",
      "name" : "hostURL",
      "required" : true,
      "disabled" : false,
      "description" : null,
      "mock" : null,
      "isChecked" : null,
      "is_big_field" : null,
      "value_type" : 0,
      "basic_value" : {
        "value" : "xxxx.cd-cloud-test.xxxx.tools.huawei.com",
        "value_range" : null
      },
      "enum_type" : null,
      "enum_type_selected" : null,
      "minLength" : -1001,
      "maxLength" : -1001,
      "minimum" : null,
      "maximum" : null,
      "format" : null,
      "pattern" : null,
      "xChoiceValue" : null,
      "maxItems" : null,
      "minItems" : null,
      "validate_rule" : null,
      "defaultValue" : null,
      "drop_down_value" : null,
      "in_type" : null,
      "is_body_custom" : null,
      "custom_body" : null,
      "basic_value_list" : null,
      "object_value" : null,
      "object_value_list" : null,
      "is_contract_param" : null,
      "item" : null,
      "is_sensitive" : null
    }, {
      "type" : "String",
      "name" : "group_id",
      "required" : true,
      "disabled" : false,
      "description" : "项目唯一标识",
      "mock" : null,
      "isChecked" : null,
      "is_big_field" : null,
      "value_type" : 0,
      "basic_value" : {
        "value" : null,
        "value_range" : null
      },
      "enum_type" : null,
      "enum_type_selected" : null,
      "minLength" : -1001,
      "maxLength" : -1001,
      "minimum" : -1001,
      "maximum" : -1001,
      "format" : null,
      "pattern" : null,
      "xChoiceValue" : null,
      "maxItems" : null,
      "minItems" : null,
      "validate_rule" : null,
      "defaultValue" : null,
      "drop_down_value" : null,
      "in_type" : 1,
      "is_body_custom" : null,
      "custom_body" : null,
      "basic_value_list" : null,
      "object_value" : null,
      "object_value_list" : null,
      "is_contract_param" : null,
      "item" : null,
      "is_sensitive" : null
    } ],
    "dft_custom_header" : [ {
      "type" : "String",
      "name" : "Accept",
      "required" : false,
      "disabled" : false,
      "description" : null,
      "mock" : null,
      "isChecked" : null,
      "is_big_field" : null,
      "value_type" : 0,
      "basic_value" : {
        "value" : "application/json;charset=utf-8",
        "value_range" : null
      },
      "enum_type" : null,
      "enum_type_selected" : null,
      "minLength" : null,
      "maxLength" : null,
      "minimum" : null,
      "maximum" : null,
      "format" : null,
      "pattern" : null,
      "xChoiceValue" : null,
      "maxItems" : null,
      "minItems" : null,
      "validate_rule" : null,
      "defaultValue" : null,
      "drop_down_value" : null,
      "in_type" : 3,
      "is_body_custom" : null,
      "custom_body" : null,
      "basic_value_list" : null,
      "object_value" : null,
      "object_value_list" : null,
      "is_contract_param" : null,
      "item" : null,
      "is_sensitive" : null
    } ],
    "dft_check_point_list" : [ {
      "property" : "$code",
      "comparison" : "==",
      "value" : "200",
      "description" : null,
      "function_type" : null,
      "function_arg" : null
    } ],
    "dft_variable_list" : [ {
      "type" : "String",
      "name" : "reason",
      "oldName" : "reason",
      "property" : "$body.test.bco",
      "description" : null,
      "isSensitiveInfo" : false,
      "isSensitiveModified" : false,
      "variableType" : null,
      "functionParams" : null,
      "dynamicParamFlag" : false,
      "dynamicParam" : null,
      "sensitiveInfoSetterTime" : null,
      "sensitiveInfoSetterUser" : null,
      "currentPermission" : null,
      "regex" : null,
      "function_type" : null,
      "function_arg" : "0-0",
      "is_out_put" : false,
      "node_type" : null,
      "node_id" : null,
      "parent_node_id" : null,
      "by_order" : null
    } ],
    "keyword_variable_value" : null,
    "dft_retry_times" : null,
    "dft_retry_interval" : null,
    "return_type" : "[{\"returnCode\":200,\"type\":\"basic\",\"body\":\"未被定义为引用\"},{\"returnCode\":401},{\"returnCode\":403},{\"returnCode\":404}]",
    "aw_type" : 1,
    "aw_ins_list" : null,
    "project_id" : "17dbf1f26078431fa9f4e09525befb2a",
    "public_aw_lib_id" : null,
    "special_type" : 0,
    "has_code" : 1,
    "aw_code" : "",
    "group_name" : "4281c04b40d44d1d8ce7bc34c503527e",
    "protocol_type" : "http/https",
    "by_order" : 0,
    "aw_mark" : 1,
    "output_param_list" : null,
    "is_favorite" : null,
    "tmss_case_id" : null,
    "create_user_id" : "efdb403066474ab08836b9eeaaa23bca",
    "aw_description" : null,
    "origin_project" : null,
    "aw_uniqueid" : "APITEST ATSERVICE API >> at-config-controller >> getGroupConfigForPermissionUsingGET",
    "aw_tags" : "at-config-controller",
    "aw_operationid" : "getGroupConfigForPermissionUsingGET",
    "interface_label" : null,
    "import_package" : null,
    "public_aw_lib" : null,
    "root_id" : null,
    "custom_aw_libs" : null,
    "delete_time" : null,
    "delete_user" : null,
    "extra_info" : {
      "http_url" : "https://{hostURL}/xxxx/v1/xxxx/{group_id}",
      "http_method" : "get",
      "is_manual_update" : "1"
    }
  },
  "reason" : null,
  "error" : null,
  "code" : null
}

SDK代码示例

SDK代码示例如下。

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
46
47
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.cloudtest.v1.region.CloudtestRegion;
import com.huaweicloud.sdk.cloudtest.v1.*;
import com.huaweicloud.sdk.cloudtest.v1.model.*;


public class ListBasicAwSolution {

    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);

        CloudtestClient client = CloudtestClient.newBuilder()
                .withCredential(auth)
                .withRegion(CloudtestRegion.valueOf("<YOUR REGION>"))
                .build();
        ListBasicAwRequest request = new ListBasicAwRequest();
        request.withAwId("{aw_id}");
        request.withProjectId("{project_id}");
        try {
            ListBasicAwResponse response = client.listBasicAw(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
30
31
32
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkcloudtest.v1.region.cloudtest_region import CloudtestRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcloudtest.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.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]

    credentials = BasicCredentials(ak, sk)

    client = CloudtestClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(CloudtestRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListBasicAwRequest()
        request.aw_id = "{aw_id}"
        request.project_id = "{project_id}"
        response = client.list_basic_aw(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
36
37
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    cloudtest "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cloudtest/v1"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cloudtest/v1/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cloudtest/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 := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        Build()

    client := cloudtest.NewCloudtestClient(
        cloudtest.CloudtestClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListBasicAwRequest{}
	request.AwId = "{aw_id}"
	request.ProjectId = "{project_id}"
	response, err := client.ListBasicAw(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

更多

更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。

状态码

状态码

描述

200

SUCCESS

401

Unauthorized

403

Forbidden

404

Not Found

错误码

请参见错误码

相关文档