-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
The Ript DSL is pretty much just a nested set of method invocations:
partition "bar" do
label "www.bar.com", :address => "172.23.0.95"
label "barprod-web-01", :address => "192.168.19.2"
label "barprod-web-02", :address => "192.168.19.4"
rewrite "bar.com public website" do
ports 80
dnat "www.bar.com" => "barprod-web-01"
end
rewrite "bar.com public website" do
ports 22
dnat "www.bar.com" => "barprod-web-02"
end
endWe could in theory represent this as JSON:
{
"partition": {
"name": "bar",
"labels": {
"www.bar.com.au": {
"address": "172.23.0.95"
},
"barprod-web-01": {
"address": "192.168.19.2"
},
"barprod-web-02": {
"address": "192.168.19.4"
}
},
"rules": [
{
"rewrite": {
"ports": 80,
"dnat": {
"www.bar.com": "barprod-web-01"
}
}
},
{
"rewrite": {
"ports": 22,
"dnat": {
"www.bar.com": "barprod-web-02"
}
}
}
]
}
}This would allow other systems to generate JSON that Ript could consume, and allow for dynamic rule generation through configuration management or customer portals.