Closed codefromthecrypt closed 9 years ago
rebased to latest versions of things. next step, port to rxnetty. @NiteshKant which version should we target? (note this is just an example, so drift is ok)
actually, looks like rxnetty 0.5 is quite a ways off. Also, there's quite a bit of handiness in undertow I'm not sure how to translate, yet. I'm inclined to stick with undertow for now, and leave a future port as a fun exercise for later.
actually I have a better idea. since denominator isn't yet async anyway, I'll strip this down to a mock web server. When we do real async, we can make a new proxy example to show it off instead of mixing.
Updated to use MockWebServer. all good now, and very small (1.2MB).
NetflixOSS » denominator » denominator-pull-requests #80 SUCCESS This pull request looks good
NetflixOSS » denominator » denominator-pull-requests #81 SUCCESS This pull request looks good
DenominatorD Example
DenominatorD is an example HTTP server that proxies a connection to your DNS provider. Technically, it is a MockWebServer. Once built, denominatord is a really executable jar, weighing in at 1.25MB, and starting up in <200ms on a modern laptop.
Building
To build the daemon, execute
gradle clean build
. The binary will end up at./build/denominatord
. If you don't have gradle, install it.Running
The syntax is simple. First arg is the name of the provider. For example, clouddns, dynect, mock, route53, or ultradns. The remaining args are any credentials to that provider.
Ex. If you have no account, you can use mock.
Ex. To connect to a real cloud, you'll specify your credentials. You'll notice status messages for each outbound request.
By default, denominatord listens on port 8080. Export
DENOMINATORD_PORT
to use a different port.API
The api is read-only, and based on OpenStack Designate V2.
Output is always json, and there's really only a few error cases.
Here are the resources exposed.
HealthCheck
GET /healthcheck
Returns 200 when the dns provider is healthy, 503 if not.
Ex. you might want to put a guard in a shell script to fail when health is bad.
Zones
GET /zones
Returns a possibly empty array of your zones.
Ex. for clouds like ultradns, you'll only see the zone name.
Ex. for clouds like route53, zones are not unique by name, so you'll see an
id
.Record Sets
All record set commands require the zone specified as a path parameter. This is either the id of the zone, or when there is no id, it is the name.
Pay attention to trailing dots!
Ex. for clouds like ultradns, the zone parameter is the zone name.
Where for clouds like route53, you'd use the id.
GET /zones/{zoneIdOrName}/recordsets?name={name}&type={type}&qualifier={qualifier}
Returns a possibly empty array of your record sets.
Supported Query params:
www.domain.com.
A
US-West
Ex. for route53, where the zone has an id
Ex. refining results by name, type, and qualifier.
PUT /zones/{zoneIdOrName}/recordsets
Adds or replaces a record set and returns
204
.Ex. to add or replace an MX record.
DELETE /zones/{zoneIdOrName}/recordsets?name={name}&type={type}&qualifier={qualifier}
Deletes a record set if present and returns
204
.Supported Query params:
www.domain.com.
A
US-West
Ex. to delete a normal MX record