创建网关策略

基本信息

该接口主要用于创建网关策略

请求路径

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

Body 请求体示例

  1. {
  2. "protocol": "string",
  3. "tcp": {
  4. "container_port": 3,
  5. "service_id": "string",
  6. "end_point": "string",
  7. "rule_extensions": [
  8. {
  9. "key": "string",
  10. "value": "string"
  11. }
  12. ],
  13. "default_port": 3,
  14. "default_ip": "string"
  15. },
  16. "http": {
  17. "service_id": "string",
  18. "container_port": 3,
  19. "certificate_id": 0,
  20. "domain_name": "string",
  21. "domain_cookie": "string",
  22. "domain_header": "string",
  23. "the_weight": 3,
  24. "domain_path": "/",
  25. "rule_extensions": [
  26. "string"
  27. ],
  28. "whether_open": false,
  29. "auto_ssl": false,
  30. "auto_ssl_config": "string",
  31. "configuration": {
  32. "proxy_body_size": 0,
  33. "proxy_buffer_numbers": 4,
  34. "proxy_buffer_size": 4,
  35. "proxy_buffering": "off",
  36. "proxy_connect_timeout": 75,
  37. "proxy_read_timeout": 60,
  38. "proxy_send_timeout": 60,
  39. "set_headers": [
  40. {
  41. "key": "string",
  42. "value": "string"
  43. }
  44. ]
  45. }
  46. }
  47. }

请求参数

名称位置类型必选中文名说明
team_idpathstringnone
region_namepathstringnone
app_idpathstringnone
bodybodyPostGatewayRulenone

返回结果

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

返回数据结构

响应示例

  1. {
  2. "http": [
  3. {
  4. "ID": 3,
  5. "rule_extensions": [
  6. "string"
  7. ],
  8. "http_rule_id": "string",
  9. "region_id": "string",
  10. "tenant_id": "string",
  11. "service_id": "string",
  12. "service_name": "string",
  13. "domain_name": "string",
  14. "container_port": 3,
  15. "protocol": "string",
  16. "certificate_id": 3,
  17. "domain_type": "string",
  18. "service_alias": "string",
  19. "is_senior": true,
  20. "domain_path": "string",
  21. "domain_cookie": "string",
  22. "domain_heander": "string",
  23. "type": 3,
  24. "the_weight": 3,
  25. "is_outer_service": true,
  26. "auto_ssl": true,
  27. "auto_ssl_config": "string",
  28. "path_rewrite": true,
  29. "rewrites": "string"
  30. }
  31. ],
  32. "tcp": [
  33. {
  34. "ID": 3,
  35. "tcp_rule_id": "string",
  36. "region_id": "string",
  37. "tenant_id": "string",
  38. "service_id": "string",
  39. "service_name": "string",
  40. "end_point": "string",
  41. "protocol": "string",
  42. "container_port": 3,
  43. "service_alias": "string",
  44. "type": 3,
  45. "rule_extensions": "string",
  46. "is_outer_service": true
  47. }
  48. ]
  49. }

模型

PostGatewayRule

  1. {
  2. "protocol": "string",
  3. "tcp": {
  4. "container_port": 0,
  5. "service_id": "string",
  6. "end_point": "string",
  7. "rule_extensions": [
  8. {
  9. "key": "string",
  10. "value": "string"
  11. }
  12. ],
  13. "default_port": 0,
  14. "default_ip": "string"
  15. },
  16. "http": {
  17. "service_id": "string",
  18. "container_port": 0,
  19. "certificate_id": 0,
  20. "domain_name": "string",
  21. "domain_cookie": "string",
  22. "domain_header": "string",
  23. "the_weight": 0,
  24. "domain_path": "/",
  25. "rule_extensions": [],
  26. "whether_open": false,
  27. "auto_ssl": false,
  28. "auto_ssl_config": "string",
  29. "configuration": {
  30. "proxy_body_size": 0,
  31. "proxy_buffer_numbers": 4,
  32. "proxy_buffer_size": 4,
  33. "proxy_buffering": "off",
  34. "proxy_connect_timeout": 75,
  35. "proxy_read_timeout": 60,
  36. "proxy_send_timeout": 60,
  37. "set_headers": [
  38. {
  39. "key": "string",
  40. "value": "string"
  41. }
  42. ]
  43. }
  44. }
  45. }

属性

名称类型必选约束中文名说明
protocolstringtruenoneProtocol协议
tcpTcpfalsenonenone
httpHttpfalsenonenone

Tcp

  1. {
  2. "container_port": 0,
  3. "service_id": "string",
  4. "end_point": "string",
  5. "rule_extensions": [
  6. {
  7. "key": "string",
  8. "value": "string"
  9. }
  10. ],
  11. "default_port": 0,
  12. "default_ip": "string"
  13. }

属性

名称类型必选约束中文名说明
container_portintegertruenoneContainer port组件端口
service_idstringtruenoneService id组件id
end_pointstringtruenoneEnd pointip地址:端口
rule_extensions[PostTCPGatewayRuleExtensions]falsenone规则扩展
default_portintegertruenoneDefault port映射端口
default_ipstringtruenoneDefault ip映射id地址

PostTCPGatewayRuleExtensions

  1. {
  2. "key": "string",
  3. "value": "string"
  4. }

属性

名称类型必选约束中文名说明
keystringtruenoneKeynone
valuestringtruenoneValuenone

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高级参数配置

Configuration

  1. {
  2. "proxy_body_size": 0,
  3. "proxy_buffer_numbers": 4,
  4. "proxy_buffer_size": 4,
  5. "proxy_buffering": "off",
  6. "proxy_connect_timeout": 75,
  7. "proxy_read_timeout": 60,
  8. "proxy_send_timeout": 60,
  9. "set_headers": [
  10. {
  11. "key": "string",
  12. "value": "string"
  13. }
  14. ]
  15. }

属性

名称类型必选约束中文名说明
proxy_body_sizeintegerfalsenoneProxy body size请求主体大小
proxy_buffer_numbersintegerfalsenoneProxy buffer numbers缓冲区数量
proxy_buffer_sizeintegerfalsenoneProxy buffer size缓冲区大小
proxy_bufferingstringfalsenoneProxy buffering是否开启ProxyBuffer
proxy_connect_timeoutintegerfalsenoneProxy connect timeout连接超时时间
proxy_read_timeoutintegerfalsenoneProxy read timeout读超时时间
proxy_send_timeoutintegerfalsenoneProxy send timeout发送超时时间
set_headers[HTTPHeader]truenonenone

HTTPHeader

  1. {
  2. "key": "string",
  3. "value": "string"
  4. }

属性

名称类型必选约束中文名说明
keystringtruenoneKey请求头Key
valuestringtruenoneValue请求头Value