Skip to main content

Create a gateway policy

Basic Information

This interface is mainly used to create gateway policies

请求路径
POST /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/domains
Body 请求体示例
{
"protocol": "string",
"tcp": {
"container_port": 3,
"service_id": "string",
"end_point": "string",
"rule_extensions": [
{
"key": "string",
"value": "string"
}
],
"default_port": 3,
"default_ip": "string"
},
"http": {
"service_id": "string",
"container_port": 3,
"certificate_id": 0,
"domain_name": "string",
"domain_cookie": "string",
"domain_header": "string",
"the_weight": 3,
"domain_path": "/",
"rule_extensions": [
"string"
],
"whether_open": false,
"auto_ssl": false,
"auto_ssl_config": "string",
"configuration ": {
"proxy_body_size": 0,
"proxy_buffer_numbers": 4,
"proxy_buffer_size": 4,
"proxy_buffering": "off",
"proxy_connect_timeout": 75,
"proxy_read_timeout": 60,
"proxy_send_timeout" ": 60,
"set_headers": [
{
"key": "string",
"value": "string"
}
]
}
}
}

request parameters

nameLocationtyperequiredChinese nameillustrate
team_idpathstringYesnone
region_namepathstringYesnone
app_idpathstringYesnone
bodybodyPostGatewayRulenonone

return result

status codeStatus code meaningillustratedata model
200OKsuccessGatewayRule

return data structure

响应示例
{
"http": [
{
"ID": 3,
"rule_extensions": [
"string"
],
"http_rule_id": "string",
"region_id": "string",
"tenant_id ": "string",
"service_id": "string",
"service_name": "string",
"domain_name": "string",
"container_port": 3,
"protocol": "string",
"certificate_id": 3,
"domain_type": "string",
"service_alias": "string",
"is_senior": true,
"domain_path": "string",
"domain_cookie": "string",
"domain_heander": "string",
"type": 3,
"the_weight": 3,
"is_outer_service": true,
"auto_ssl": true,
"auto_ssl_config": "string",
"path_rewrite": true,
"rewrites": "string"
}
],
"tcp": [
{
"ID": 3,
"tcp_rule_id": "string",
"region_id": "string",
" tenant_id": "string",
"service_id": "string",
"service_name": "string",
"end_point": "string",
"protocol": "string",
"container_port": 3,
"service_alias": "string",
"type": 3,
"rule_extensions": "string",
"is_outer_service": true
}
]
}

Model

PostGatewayRule

{
"protocol": "string",
"tcp": {
"container_port": 0,
"service_id": "string",
"end_point": "string",
"rule_extensions": [
{
"key": "string",
"value": "string"
}
],
"default_port": 0,
"default_ip": "string"
},
"http": {
"service_id": "string",
"container_port": 0,
"certificate_id": 0,
"domain_name": "string",
"domain_cookie": "string",
"domain_header": "string",
"the_weight": 0,
"domain_path": "/",
"rule_extensions": [],
"whether_open": false,
"auto_ssl": false,
"auto_ssl_config": "string",
"configuration": {
" proxy_body_size": 0,
"proxy_buffer_numbers": 4,
"proxy_buffer_size": 4,
"proxy_buffering": "off",
"proxy_connect_timeout": 75,
"proxy_read_timeout": 60,
"proxy_send_timeout": 60,
"set_headers": [
{
"key": "string",
"value": "string"
}
]
}
}
}

Attributes

nametyperequiredconstraintChinese nameillustrate
protocolstringtruenoneProtocolprotocol
tcptcpfalsenonenone
httpHttpfalsenonenone

tcp

{
"container_port": 0,
"service_id": "string",
"end_point": "string",
"rule_extensions": [
{
"key": "string",
"value": "string "
}
],
"default_port": 0,
"default_ip": "string"
}

Attributes

nametyperequiredconstraintChinese nameillustrate
container_portintegertruenoneContainer portcomponent port
service_idstringtruenoneService idcomponent id
end_pointstringtruenoneEnd pointip address: port
rule_extensions[PostTCPGatewayRuleExtensions]falsenonerule extension
default_portintegertruenoneDefault portmap port
default_ipstringtruenoneDefault ipmap id address

PostTCPGatewayRuleExtensions

{
"key": "string",
"value": "string"
}

Attributes

nametyperequiredconstraintChinese nameillustrate
keystringtruenoneKeynone
valuestringtruenoneValuenone

Http

{
"service_id": "string",
"container_port": 0,
"certificate_id": 0,
"domain_name": "string",
"domain_cookie": "string",
"domain_header": "string" ,
"the_weight": 0,
"domain_path": "/",
"rule_extensions": [],
"whether_open": false,
"auto_ssl": false,
"auto_ssl_config": "string",
" configuration": {
"proxy_body_size": 0,
"proxy_buffer_numbers": 4,
"proxy_buffer_size": 4,
"proxy_buffering": "off",
"proxy_connect_timeout": 75,
"proxy_read_timeout": 60,
" proxy_send_timeout": 60,
"set_headers": [
{
"key": "string",
"value": "string"
}
]
}
}

Attributes

nametyperequiredconstraintChinese nameillustrate
service_idstringtruenoneService idapplication component id
container_portintegertruenoneContainer portbind port
certificate_idintegerfalsenoneCertificate idcertificate id
domain_namestringtruenoneDomain namedomain name
domain_cookiestringfalsenoneDomain cookiesdomain cookie
domain_headerstringfalsenoneDomain headerdomain header
the_weightintegerfalsenoneThe weightnone
domain_pathstringfalsenoneDomain pathdomain name path
rule_extensions[string]falsenonerule extension
whether_openbooleanfalsenoneWhether openIs it open
auto_sslbooleanfalsenoneAuto sslWhether to automatically match the certificate and upgrade to https, if enabled, the upgrade will be completed by an external service
auto_ssl_configstringfalsenoneAuto ssl configAutomatic distribution certificate configuration
configurationConfigurationfalsenoneAdvanced parameter configuration

Configuration

{
"proxy_body_size": 0,
"proxy_buffer_numbers": 4,
"proxy_buffer_size": 4,
"proxy_buffering": "off",
"proxy_connect_timeout": 75,
"proxy_read_timeout": 60,
"proxy_send_timeout": 60,
"set_headers": [
{
"key": "string",
"value": "string"
}
]
}

Attributes

nametyperequiredconstraintChinese nameillustrate
proxy_body_sizeintegerfalsenoneProxy body sizerequest body size
proxy_buffer_numbersintegerfalsenoneProxy buffer numbersnumber of buffers
proxy_buffer_sizeintegerfalsenoneProxy buffer sizebuffer size
proxy_bufferingstringfalsenoneProxy bufferingWhether to enable ProxyBuffer
proxy_connect_timeoutintegerfalsenoneProxy connect timeoutconnection timeout
proxy_read_timeoutintegerfalsenoneProxy read timeoutread timeout
proxy_send_timeoutintegerfalsenoneProxy send timeoutsend timeout
set_headers[HTTPHeader]truenonenone

HTTPHeader

{
"key": "string",
"value": "string"
}

Attributes

nametyperequiredconstraintChinese nameillustrate
keystringtruenoneKeyRequest header Key
valuestringtruenoneValueRequest header Value