跳转到主要内容
POST
POST /admin/api/rules

授权

gproxy_session
string
cookie
必填

请求头

x-gproxy-admin-scope
string

Administrative scope selected by the caller.

请求体

application/json
pattern
string
必填
replacement
string
必填
action
string | null
enabled
boolean | null
filterBody
any
filterEventPattern
string | null
filterHeader
any
filterHeaderPattern
string | null
filterModelPattern
string | null
filterOperationKeys
any
id
string | null
paths
any
phase
string | null
ruleSetId
string | null

Ignored by replace_rules, which owns the set it is replacing.

sortOrder
integer<int64> | null
target
string | null
targetName
string | null

响应

Success

One ordered replacement. Every write compiles the rule with core's own compiler first, so a rule that would be skipped at assembly is refused here instead of silently doing nothing.

action
string
默认值:replace
必填
createdAtMs
integer<int64>
必填
enabled
boolean
必填
filterBody
any
必填
filterEventPattern
string | null
必填
filterHeader
any
必填
filterHeaderPattern
string | null
必填
filterModelPattern
string | null
必填
filterOperationKeys
any
必填

JSON array of {"operation": …, "dialect": …}.

id
string
必填
paths
any
必填

JSON array of dot paths; body target only.

pattern
string
必填
phase
string
必填

request, response or both.

replacement
string
必填
ruleSetId
string
必填
sortOrder
integer<int64>
必填
target
string
必填

body, header or query.

targetName
string | null
必填
updatedAtMs
integer<int64>
必填