创建HTTP网关策略

基本信息

创建HTTP网关策略

请求路径

  1. POST /openapi/v1/teams/{team_id}/regions/{region_name}/apps/{app_id}/httpdomains

Body请求参数

  1. {
  2. "service_id": "string",
  3. "container_port": 0,
  4. "certificate_id": 0,
  5. "domain_name": "string",
  6. "domain_cookie": "string",
  7. "domain_header": "string",
  8. "the_weight": 0,
  9. "domain_path": "/",
  10. "rule_extensions": [],
  11. "whether_open": false,
  12. "auto_ssl": false,
  13. "auto_ssl_config": "string",
  14. "configuration": {
  15. "proxy_body_size": 0,
  16. "proxy_buffer_numbers": 4,
  17. "proxy_buffer_size": 4,
  18. "proxy_buffering": "off",
  19. "proxy_connect_timeout": 75,
  20. "proxy_read_timeout": 60,
  21. "proxy_send_timeout": 60,
  22. "set_headers": [
  23. {
  24. "key": "string",
  25. "value": "string"
  26. }
  27. ]
  28. }
  29. }

请求参数

名称位置类型必选中文名说明
app_idpathinteger应用ID
team_idpathstringnone
region_namepathstringnone
bodybodyHttpHttpnone

返回示例

返回结果

状态码状态码含义说明数据模型
200OK成功HTTPGatewayRule

模型

Http

  1. {
  2. "service_id": "string",
  3. "container_port": 0,
  4. "certificate_id": 0,
  5. "domain_name": "string",
  6. "domain_cookie": "string",
  7. "domain_header": "string",
  8. "the_weight": 0,
  9. "domain_path": "/",
  10. "rule_extensions": [],
  11. "whether_open": false,
  12. "auto_ssl": false,
  13. "auto_ssl_config": "string",
  14. "configuration": {
  15. "proxy_body_size": 0,
  16. "proxy_buffer_numbers": 4,
  17. "proxy_buffer_size": 4,
  18. "proxy_buffering": "off",
  19. "proxy_connect_timeout": 75,
  20. "proxy_read_timeout": 60,
  21. "proxy_send_timeout": 60,
  22. "set_headers": [
  23. {
  24. "key": "string",
  25. "value": "string"
  26. }
  27. ]
  28. }
  29. }

属性

名称类型必选约束中文名说明
service_idstringtruenoneService id应用组件id
container_portintegertruenoneContainer port绑定端口
certificate_idintegerfalsenoneCertificate id证书id
domain_namestringtruenoneDomain name域名
domain_cookiestringfalsenoneDomain cookie域名cookie
domain_headerstringfalsenoneDomain header域名header
the_weightintegerfalsenoneThe weightnone
domain_pathstringfalsenoneDomain path域名路径
rule_extensions[string]falsenone规则扩展
whether_openbooleanfalsenoneWhether open是否开放
auto_sslbooleanfalsenoneAuto ssl是否自动匹配证书,升级为https,如果开启,由外部服务完成升级
auto_ssl_configstringfalsenoneAuto ssl config自动分发证书配置
configurationConfigurationfalsenone高级参数配置

HTTPGatewayRule

  1. {
  2. "ID": 0,
  3. "rule_extensions": [
  4. "string"
  5. ],
  6. "http_rule_id": "string",
  7. "region_id": "string",
  8. "tenant_id": "string",
  9. "service_id": "string",
  10. "service_name": "string",
  11. "domain_name": "string",
  12. "container_port": -2147483648,
  13. "protocol": "string",
  14. "certificate_id": -2147483648,
  15. "domain_type": "string",
  16. "service_alias": "string",
  17. "is_senior": true,
  18. "domain_path": "string",
  19. "domain_cookie": "string",
  20. "domain_heander": "string",
  21. "type": -2147483648,
  22. "the_weight": -2147483648,
  23. "is_outer_service": true,
  24. "auto_ssl": true,
  25. "auto_ssl_config": "string",
  26. "path_rewrite": true,
  27. "rewrites": "string"
  28. }

属性

名称类型必选约束中文名说明
IDintegerfalseread-onlyIDnone
rule_extensions[string]falseread-onlynone
http_rule_idstringtruenoneHttp rule idhttp_rule_id
region_idstringtruenoneRegion idregion id
tenant_idstringtruenoneTenant id租户id
service_idstringtruenoneService id组件id
service_namestringtruenoneService name组件名
domain_namestringtruenoneDomain name域名
container_portintegerfalsenoneContainer port容器端口
protocolstringfalsenoneProtocol域名类型 http https httptphttps httpandhttps
certificate_idintegerfalsenoneCertificate id证书ID
domain_typestringfalsenoneDomain type组件域名类型
service_aliasstringfalsenoneService alias组件别名
is_seniorbooleanfalsenoneIs senior是否有高级路由
domain_pathstringfalsenoneDomain path域名path
domain_cookiestringfalsenoneDomain cookie域名cookie
domain_heanderstringfalsenoneDomain heander域名heander
typeintegerfalsenoneType类型(默认:0, 自定义:1)
the_weightintegerfalsenoneThe weight权重
is_outer_servicebooleanfalsenoneIs outer service是否已开启对外端口
auto_sslbooleanfalsenoneAuto ssl是否自动匹配证书,升级为https,如果开启,由外部服务完成升级
auto_ssl_configstring¦nullfalsenoneAuto ssl config自动分发证书配置
path_rewritebooleanfalsenonePath rewrite是否开启简单路由重写
rewritesstringfalsenoneRewrites复杂路由重写配置