Create a gateway policy

Basic Information

This interface is mainly used to create gateway policies

请求路径

  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. }

request parameters

nameLocationtyperequiredChinese nameillustrate
team_idpathstringYesnone
region_namepathstringYesnone
app_idpathstringYesnone
bodybodyPostGatewayRulenonone

return result

status codeStatus code meaningillustratedata model
200OKsuccessGatewayRule

return data structure

响应示例

  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. }

Model

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. }

Attributes

nametyperequiredconstraintChinese nameillustrate
protocolstringtruenoneProtocolprotocol
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. }

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

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

Attributes

nametyperequiredconstraintChinese nameillustrate
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. }

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

  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. }

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

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

Attributes

nametyperequiredconstraintChinese nameillustrate
keystringtruenoneKeyRequest header Key
valuestringtruenoneValueRequest header Value