{"id":13552986,"url":"https://github.com/Netflix/denominator","last_synced_at":"2025-04-03T04:31:34.580Z","repository":{"id":6565678,"uuid":"7807584","full_name":"Netflix/denominator","owner":"Netflix","description":"Portably control DNS clouds using java or bash","archived":false,"fork":false,"pushed_at":"2023-04-10T11:04:51.000Z","size":4178,"stargazers_count":580,"open_issues_count":29,"forks_count":110,"subscribers_count":470,"default_branch":"master","last_synced_at":"2024-10-02T02:42:43.613Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Netflix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-01-24T21:28:25.000Z","updated_at":"2024-09-10T07:48:06.000Z","dependencies_parsed_at":"2022-09-14T04:31:10.636Z","dependency_job_id":"ac3bc4f2-3a0b-49fd-9fbf-674ec0344a8b","html_url":"https://github.com/Netflix/denominator","commit_stats":{"total_commits":460,"total_committers":21,"mean_commits":"21.904761904761905","dds":"0.19130434782608696","last_synced_commit":"c565e3b8c6043051252e0947029511f9ac5d306f"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2Fdenominator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2Fdenominator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2Fdenominator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Netflix%2Fdenominator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Netflix","download_url":"https://codeload.github.com/Netflix/denominator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222920968,"owners_count":17058103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:02:14.856Z","updated_at":"2024-11-04T00:31:11.427Z","avatar_url":"https://github.com/Netflix.png","language":"Java","funding_links":[],"categories":["Java","others","Infrastructure","Capabilities","网络编程"],"sub_categories":["Configuration and Discovery","Configuration \u0026 Discovery"],"readme":"\u003cimg src=\"https://raw.github.com/Netflix/denominator/master/denominator.jpg\" alt=\"Denominator\"\u003e\n\n# Portable control of DNS clouds\n\nDenominator is a portable Java library for manipulating DNS clouds. Denominator has pluggable back-ends, including AWS Route53, Neustar Ultra, DynECT, Rackspace Cloud DNS, OpenStack Designate, and a mock for testing. We also ship a command line version so it's easy for anyone to try it out. Denominator currently supports basic zone and record features, as well GEO (aka Directional) profiles. See [Netflix Tech Blog](http://techblog.netflix.com/2013/03/denominator-multi-vendor-interface-for.html) for an introduction.\n\n[![Build Status](https://netflixoss.ci.cloudbees.com/job/denominator-master/badge/icon)](https://netflixoss.ci.cloudbees.com/job/denominator-master/)\n\n## Command line\nFor your convenience, the denominator cli is a [single executable file](http://skife.org/java/unix/2011/06/20/really_executable_jars.html). Under the hood, the cli uses [airline](https://github.com/airlift/airline) to look and feel like dig or git.\n\n## Android\nThere's no official android client, yet. However, we do have an [Android Example](https://github.com/Netflix/denominator/tree/master/example-android) you can try out.\n\n### Binaries\nIf you are using OSX, [Homebrew](http://mxcl.github.io/homebrew/) has a built-in installer for denominator.\n\nHere's how to get denominator-cli `4.6.0` from [bintray](https://bintray.com/pkg/show/general/netflixoss/denominator/denominator-cli)\n\n1. [Download denominator](https://bintray.com/artifact/download/netflixoss/maven/com/netflix/denominator/denominator-cli/4.6.0/denominator-cli-4.6.0-fat.jar)\n2. Place it on your `$PATH`. (ex. `~/bin`)\n3. Set it to be executable. (`chmod 755 ~/bin/denominator`)\n\n### Getting Started\n\nAdvanced usage, including ec2 hooks are covered in the [readme](https://github.com/Netflix/denominator/tree/master/cli). Here's a quick start for the impatient.\n\nIf you just want to fool around, you can use the `mock` provider.\n```bash\n# first column is the zone id, which isn't always its name!\n$ denominator -p mock zone list\ndenominator.io.          denominator.io.                                          admin.denominator.io.                86400\n$ denominator -p mock record -z denominator.io. list\ndenominator.io.                                    SOA   3600   ns1.denominator.io. admin.denominator.io. 1 3600 600 604800 60\ndenominator.io.                                    NS    86400  ns1.denominator.io.\n```\n\nDifferent providers connect to different urls and need different credentials. First step is to run `./denominator providers` to see how many `-c` args you need and what values they should have:\n\n```bash\n$ denominator providers\nprovider   url                                                 duplicateZones credentialType credentialArgs\nmock       mem:mock                                            false\nclouddns   https://identity.api.rackspacecloud.com/v2.0/       true           apiKey         username apiKey\ndesignate  http://localhost:5000/v2.0                          true           password       tenantId username password\ndynect     https://api2.dynect.net/REST                        false          password       customer username password\nroute53    https://route53.amazonaws.com                       true           accessKey      accessKey secretKey\nroute53    https://route53.amazonaws.com                       true           session        accessKey secretKey sessionToken\nultradns   https://ultra-api.ultradns.com:8443/UltraDNS_WS/v01 false          password       username password\n```\n\nNow, you can list your zones or records.\n\n```bash\n$ denominator -p ultradns -c my_user -c my_password zone list\n--snip--\nnetflix.com.\n--snip--\n$ denominator -p ultradns -c my_user -c my_password record --zone netflix.com. list\n--snip--\nemail.netflix.com.                                 A     3600   192.0.2.1\n--snip--\n```\n\n## Code\n\nDenominator exposes a portable [model](https://github.com/Netflix/denominator/wiki/Models) implemented by pluggable `Provider`s such as `route53`, `ultradns`, `dynect`, `clouddns`, or `mock`. Under the covers, providers are [Dagger](http://square.github.com/dagger/) modules. Except for the mock, all current providers bind to http requests via [feign](https://github.com/Netflix/feign), which keeps the distribution light.\n\n### Binaries\n\nThe current version of denominator is `4.6.0`\n\nDenominator can be resolved as maven dependencies, or equivalent in lein, gradle, etc. Here are the coordinates, noting you only need to list the providers you use.\n```xml\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.netflix.denominator\u003c/groupId\u003e\n    \u003cartifactId\u003edenominator-core\u003c/artifactId\u003e\n    \u003cversion\u003e${denominator.version}\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.netflix.denominator\u003c/groupId\u003e\n    \u003cartifactId\u003edenominator-clouddns\u003c/artifactId\u003e\n    \u003cversion\u003e${denominator.version}\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.netflix.denominator\u003c/groupId\u003e\n    \u003cartifactId\u003edenominator-dynect\u003c/artifactId\u003e\n    \u003cversion\u003e${denominator.version}\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.netflix.denominator\u003c/groupId\u003e\n    \u003cartifactId\u003edenominator-route53\u003c/artifactId\u003e\n    \u003cversion\u003e${denominator.version}\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.netflix.denominator\u003c/groupId\u003e\n    \u003cartifactId\u003edenominator-ultradns\u003c/artifactId\u003e\n    \u003cversion\u003e${denominator.version}\u003c/version\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Getting Started\n\nCreating a connection to a provider requires that you have access to two things: the name of the provider, and as necessary, credentials for it.\n```java\nimport static denominator.CredentialsConfiguration.credentials;\n...\nDNSApiManager manager = Denominator.create(\"ultradns\", credentials(username, password)); // manager is closeable, so please close it!\n```\nThe credentials are variable length, as certain providers require more that 2 parts. The above returns an instance of `DNSApiManager` where apis such as `ZoneApis` are found. Here's how to list zones: \n```java\nfor (Zone zone : manager.api().zones()) {\n  for (ResourceRecordSet\u003c?\u003e rrs : manager.api().recordSetsInZone(zone.id())) {\n    processRRS(rrs);\n  }\n}\n```\n\nIf you are running unit tests, or don't have a cloud account yet, you can use mock, and skip the credentials part.\n```java\nDNSApiManager manager = Denominator.create(\"mock\");\n```\n\nThe Denominator [model](https://github.com/Netflix/denominator/wiki/Model) is based on the `ResourceRecordSet` concept. A `ResourceRecordSet` is simply a group of records who share the same name and type. For example all address (`A`) records for the name `www.netflix.com.` are aggregated into the same `ResourceRecordSet`. The values of each record in a set are type-specific. These data types are implemented as map-backed interfaces. This affords both the strong typing of java and extensibility and versatility of maps.\n\nFor example, the following are identical:\n```java\nmxData.getPreference();\nmxData.get(\"preference\");\n```\n\nResource record sets live in a Zone, which is roughly analogous to a domain. Zones can be created on-demand and deleted.\n\n### Use via Dagger\nSome users may wish to use Denominator as a Dagger library. Here's one way to achieve that:\n```java\nimport static denominator.CredentialsConfiguration.credentials;\nimport static denominator.Dagger.provider;\n...\n// this shows how to facilitate runtime url updates\nProvider fromDiscovery = new UltraDNSProvider() {\n  public String url() {\n    return discovery.urlFor(\"ultradns\");\n  }\n};\n// this shows how to facilitate runtime credential updates\nSupplier\u003cCredentials\u003e fromEncryptedStore = new Supplier\u003cCredentials\u003e() {\n  public Credentials get() {\n    return encryptedStore.getCredentialsFor(\"ultradns\");\n  }\n}\nDNSApiManager manager = ObjectGraph.create(provider(fromDiscovery), new UltraDNSProvider.Module(), credentials(fromEncryptedStore))\n                                   .get(DNSApiManager.java);\n```\n\n## Third-Party Providers\nDenominator also operates with third-party DNS providers such as [DiscoveryDNS](https://github.com/discoverydns/denominator-discoverydns).\n\nProviders are looked up by name using [ServiceLoader](https://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html). Given the provider is in the classpath, normal lookups should work.\n\n```java\n// Given the discoverydns jar is in the classpath\nDNSApiManager manager = Denominator.create(\"discoverydns\");\n```\n\nThird-party support is also explained in the [CLI readme](https://github.com/Netflix/denominator/tree/master/cli).\n\n## Build\n\nTo build:\n\n```bash\n$ git clone git@github.com:Netflix/denominator.git\n$ cd denominator/\n$ ./gradlew clean test install\n```\n\n## Intellij Idea IDE\n\nGenerate the Idea project files:\n\n```bash\n$ ./gradlew idea\n```\n\nImport the project:\n\n1. File \u003e Import Project...\n2. Preferences \u003e Compiler \u003e Annotation Processors \u003e Check \"Enable annotation processing\"\n\nRun the live tests:\n\n1. Choose a live test (e.g. ```CloudDNSCheckConnectionLiveTest```)\n2. Right click and select \"Create CloudDNSCheckConnectionLiveTest\"\n3. VM options: ```-ea -Dclouddns.username=\u003cusername\u003e -Dclouddns.password=\u003cpassword\u003e```\n4. Working directory: ```/path/to/denominator/clouddns```\n\n## Feedback and Collaboration\n\n* For high-level updates, follow [denominatorOSS](https://twitter.com/denominatorOSS) on Twitter.\n* For questions, please tag `denominator` in [StackOverflow](http://stackoverflow.com).\n* For bugs and enhancements, please use [Github Issues](https://github.com/Netflix/denominator/issues).\n* For email discussions, please post to the [user forum](https://groups.google.com/forum/?fromgroups#!forum/denominator-user)\n* For discussions on design and internals, please join #denominator on irc freenode or post to the [dev forum](https://groups.google.com/forum/?fromgroups#!forum/denominator-dev)\n \n## LICENSE\n\nCopyright 2013 Netflix, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetflix%2Fdenominator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNetflix%2Fdenominator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNetflix%2Fdenominator/lists"}