| #!/usr/bin/env python3 | |
| import yaml | |
| PRIVATE_IP = "100.100.100.100" | |
| WEB_PORT = 9000 | |
| API_PORT = 9001 | |
| services = [{'service_name': "mytestservice", | |
| 'service_host': "0.0.0.0", | |
| 'service_port': 80, | |
| 'service_options': ["mode http", "acl api path_beg -i /api", "use_backend api if api"], | |
| 'servers': [["mytestservice", PRIVATE_IP, WEB_PORT, "option httpchk GET / HTTP/1.0"]], | |
| 'backends': {'backend_name': "api", | |
| 'servers': [["mytestservice-api", PRIVATE_IP, API_PORT, "option httpchk GET /api HTTP/1.0"]]}}] | |
| print(yaml.dump(services)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment