更新时间:2024-09-06 GMT+08:00
分享

新增用户自定义URL关键字

功能介绍

新增用户自定义URL关键字

URI

POST /v1/{project_id}/basic-aw

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,固定长度32位字符(字母和数字)。

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

用户Token。

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

表3 请求Body参数

参数

是否必选

参数类型

描述

body_param_type

String

body请求体的类型:text(包含JSON,参数内部区分)、form

description

String

描述

dft_check_point_list

Array of CheckPoint objects

默认检查点List

dft_custom_header

Array of AwParam objects

默认请求头参数对象

dft_variable_list

Array of AwVariable objects

定义的变量信息

extra_info

ExtraInfo object

补充信息

group_name

String

组名

name

String

名称

param_type_and_dft_value

Array of AwParam objects

参数类型和参数默认值对应List

表4 CheckPoint

参数

是否必选

参数类型

描述

comparison

String

运算符

description

String

描述信息

function_arg

String

响应提取时要使用什么方法处理参数

function_type

String

响应提取时要使用什么方法处理参数

property

String

属性名称

value

String

表5 ExtraInfo

参数

是否必选

参数类型

描述

childImportPackage

Array of strings

子级导入的包

document_link

String

文档链接

http_method

String

http请求方法

http_url

String

HTTP请求的URL

importPackage

Array of strings

导入的包

mock

MockInfo object

awInstance中的mock信息

outputParam

Array of AwVariable objects

输出参数

param_dependent

String

参数依赖

summary

String

摘要

表6 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

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

name

String

参数名称

node_id

String

节点id

node_type

Integer

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

oldName

String

旧名称

parent_node_id

String

父节点id

property

String

属性

regex

String

内置函数枚举

sensitiveInfoSetterTime

String

敏感参数设置时间

sensitiveInfoSetterUser

String

敏感参数设置者名称

type

String

类型

variableType

Integer

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

表7 AwParam

参数

是否必选

参数类型

描述

basic_value

AwParamBasicValue object

aw参数基本类型取值类

basic_value_list

Array of AwParamBasicValue objects

valueType为1时该值有效

custom_body

String

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

defaultValue

String

默认值

description

String

aw参数描述

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

是否是契约AW 0-否;1-yes

is_sensitive

Boolean

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

item

ItemParam object

item param

maxItems

Integer

Array类型最大元素数

maxLength

Long

String类型最大长度

maximum

Object

Number类型最大值

minItems

Integer

Array类型最小元素数

minLength

Long

String类型最小长度

minimum

Object

Number类型最小值

mock

MockInfo object

awInstance中的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

validate rule

value_type

Integer

参数值类型

xChoiceValue

String

choice选择关系

表8 AwParamBasicValue

参数

是否必选

参数类型

描述

value

String

参数默认值,用例有效

value_range

String

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

表9 ItemParam

参数

是否必选

参数类型

描述

basic_value

AwParamBasicValue object

aw参数基本类型取值类

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

validate rule

value_type

Integer

参数值类型

xChoiceValue

String

choice选择关系

表10 MockInfo

参数

是否必选

参数类型

描述

mock_id

String

mock id

mock_switch

Boolean

mock开关

mock_url

String

mock url

表11 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

示例

表12 ConditionInstance

参数

是否必选

参数类型

描述

conditionIndex

Integer

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

conditionMap

Map<String,Array<String>>

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

depParamMap

Map<String,DepParamInstance>

依赖参数实例的映射

statementIndex

Integer

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

表13 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

值列表

响应参数

状态码: 200

表14 响应Body参数

参数

参数类型

描述

code

String

错误码

error

CommonResponseErrorObject object

统一错误返回

reason

String

失败原因

result

Object

结果

status

String

状态

表15 CommonResponseErrorObject

参数

参数类型

描述

code

String

错误码

reason

String

错误原因

请求示例

post https://{endpoint}/v1/09645c1f3f954a8d9ab29174857cffc5/basic-aw

{
  "name" : "baidu2",
  "group_name" : "dfaba6a51f024c1f95229c1059ca34e0",
  "description" : "自定义URL请求",
  "extra_info" : {
    "http_url" : "http://www.baidu.com",
    "http_method" : "get"
  },
  "param_type_and_dft_value" : [ ],
  "dft_check_point_list" : [ ],
  "dft_variable_list" : [ ]
}

响应示例

状态码: 200

OK

{
  "status" : "success",
  "result" : {
    "id" : "37df588351464f45944580b288556d37",
    "warningMsg" : null,
    "name" : "baidu1",
    "source" : null,
    "method" : "getwww_baidu_com",
    "description" : "自定义URL请求",
    "nameView" : null,
    "tmssCaseNumber" : null,
    "region" : "cn-north-7",
    "yamlName" : null,
    "create_time_string" : "2024-06-21 15:46:18 GMT+08:00",
    "update_time_string" : "2024-06-21 15:46:18 GMT+08:00",
    "create_time_stamp" : 1718955978000,
    "update_time_stamp" : 1718955978000,
    "create_user" : "devcloud_devcloud_s00314720_01",
    "create_time" : "2024-06-21T03:46:18+0800",
    "update_user" : "devcloud_devcloud_s00314720_01",
    "update_time" : "2024-06-21T03:46:18+0800",
    "param_type_and_dft_value" : [ ],
    "dft_custom_header" : null,
    "dft_check_point_list" : [ ],
    "dft_variable_list" : [ ],
    "keyword_variable_value" : null,
    "dft_retry_times" : null,
    "dft_retry_interval" : null,
    "return_type" : "[{\"returnCode\":200}]",
    "aw_type" : 1,
    "aw_ins_list" : null,
    "project_id" : "09645c1f3f954a8d9ab29174857cffc5",
    "public_aw_lib_id" : null,
    "special_type" : 90,
    "has_code" : 1,
    "aw_code" : "",
    "group_name" : "dfaba6a51f024c1f95229c1059ca34e0",
    "protocol_type" : "http/https",
    "by_order" : 1,
    "aw_mark" : 1,
    "output_param_list" : null,
    "is_favorite" : null,
    "tmss_case_id" : null,
    "create_user_id" : null,
    "aw_description" : null,
    "origin_project" : null,
    "aw_uniqueid" : null,
    "aw_tags" : null,
    "aw_operationid" : null,
    "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_method" : "get",
      "http_url" : "http://www.baidu.com"
    }
  },
  "reason" : null,
  "error" : null,
  "code" : null
}

状态码

状态码

描述

200

OK

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

错误码

请参见错误码

相关文档