Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refines zone identifiers and handling of zones with the same name #350

Merged
merged 1 commit into from
Mar 24, 2015

Conversation

codefromthecrypt
Copy link
Contributor

Before this change, Zone.id() implied that the provider supported
multiple zones with the same name. This turned out to be false, as for
example both CloudDNS and Designate use ids, but enforce zone names
must be unique.

This change introduces a series of changes to support both determining
how zones are identified, as well if the provider supports zones that
have the same name.

One goal was to not add complexity. The overall approach to this is to
only add a concept while removing one.

Zone.qualifier() is added to disambiguate zones with the same name.
This is paid for by deprecating Zone.idOrName().

Provider.zoneIdentification() is added to that callers can understand
if zone names can be substituted for ids or if qualifiers are supported.
This is paid for by deprecating Provider.supportsDuplicateZoneNames().

Here are the details of this change:

  • Adds Zone.qualifier() in support duplicate zones
  • Deprecates supportsDuplicateZoneNames() in favor of Provider.zoneIdentification() in NAME, OPAQUE and QUALIFIED
  • Deprecates Zone.idOrName() as Zone.id() cannot be null
  • Adds ZoneApi.iterateByName() to support lookups
  • Adds -n parameter to CLI zone list

See https://groups.google.com/forum/#!topic/denominator-dev/X_yjoykCReU

Live tests succeeded on all providers. CLI manually tested on all providers.

$ build/denominator providers
provider   url                                                 zoneIds   credentialType credentialArgs
clouddns   https://identity.api.rackspacecloud.com/v2.0        opaque    password       username password
clouddns   https://identity.api.rackspacecloud.com/v2.0        opaque    apiKey         username apiKey
designate  http://localhost:5000/v2.0                          opaque    password       tenantId username password
dynect     https://api2.dynect.net/REST                        name      password       customer username password
mock       mem:mock                                            name           
route53    https://route53.amazonaws.com                       qualified accessKey      accessKey secretKey
route53    https://route53.amazonaws.com                       qualified session        accessKey secretKey sessionToken
ultradns   https://ultra-api.ultradns.com:8443/UltraDNS_WS/v01 name      password       username password

$ build/denominator -p route53 -c ACCESS_KEY -c SECRET_KEY zone list -n denominator.io.
[Route53#listHostedZonesByName] ---> GET https://route53.amazonaws.com/2013-04-01/hostedzonesbyname?dnsname=denominator.io. HTTP/1.1
[Route53#listHostedZonesByName] <--- HTTP/1.1 200 OK (678ms)
denominator.io.                      63CEB242-9E3E-327D-9351-2EFD02493E18 Z2ZEEJCUZCVG56
denominator.io.                      022DFF2F-2E0B-F0A2-A581-19339A7BA1F1 Z3OQLQGABCU3T

$ build/denominator -u https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/ -p designate -c TENANT -c USER -c PASSWORD zone list -n denominator.io.
[KeystoneV2#passwordAuth] ---> POST https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0//tokens HTTP/1.1
[KeystoneV2#passwordAuth] <--- HTTP/1.1 200 OK (565ms)
[Designate#domains] ---> GET https://region-a.geo-1.dns.hpcloudsvc.com/v1/domains HTTP/1.1
[Designate#domains] <--- HTTP/1.1 200 OK (4349ms)
denominator.io.                      a19879ba-6e03-4fff-a07a-36f07326a8cf

$ build/denominator -p ultradns -c USER -c PASSWORD zone list -n denominator.io.
[UltraDNS#getZoneInfo] ---> POST https://ultra-api.ultradns.com:8443/UltraDNS_WS/v01 HTTP/1.1
[UltraDNS#getZoneInfo] <--- HTTP/1.1 200 OK (641ms)
[UltraDNS#getAccountsListOfUser] ---> POST https://ultra-api.ultradns.com:8443/UltraDNS_WS/v01 HTTP/1.1
[UltraDNS#getAccountsListOfUser] <--- HTTP/1.1 200 OK (55ms)
denominator.io.

$ build/denominator -p dynect -c CUSTOMER -c USER -c PASSWORD zone list -n denominator2.io
[Session#login] ---> POST https://api2.dynect.net/REST/Session HTTP/1.1
[Session#login] <--- HTTP/1.1 200 OK (587ms)
[DynECT#getZone] ---> GET https://api2.dynect.net/REST/Zone/denominator2.io HTTP/1.1
[DynECT#getZone] <--- HTTP/1.1 200 OK (99ms)
denominator2.io

$ build/denominator -p clouddns -c USER -c API_KEY zone list -n denominator.com
[CloudIdentity#apiKeyAuth] ---> POST https://identity.api.rackspacecloud.com/v2.0/tokens HTTP/1.1
[CloudIdentity#apiKeyAuth] <--- HTTP/1.1 200 OK (1127ms)
[CloudDNS#domainsByName] ---> GET https://dns.api.rackspacecloud.com/v1.0/829000/domains?name=denominator.com HTTP/1.1
[CloudDNS#domainsByName] <--- HTTP/1.1 200 OK (558ms)
denominator.com                      4599547

@codefromthecrypt codefromthecrypt changed the title Adds Provider.zoneIdentification() and Zone.qualifier() to support duplicate zones Refines zone identifiers and handling of zones with the same name Mar 23, 2015
@codefromthecrypt codefromthecrypt force-pushed the adrian.zone-qualifiers branch 3 times, most recently from 6ad96a4 to 52700cf Compare March 24, 2015 04:51
@codefromthecrypt
Copy link
Contributor Author

polished and added live test for contract of Zone.Identification

@cloudbees-pull-request-builder

NetflixOSS » denominator » denominator-pull-requests #98 SUCCESS
This pull request looks good

Before this change, `Zone.id()` implied that the provider supported
multiple zones with the same name. This turned out to be false, as for
example both CloudDNS and Designate use ids, but enforce zone names
must be unique.

This change introduces a series of changes to support both determining
how zones are identified, as well if the provider supports zones that
have the same name.

One goal was to not add complexity. The overall approach to this is to
only add a concept while removing one.

`Zone.qualifier()` is added to disambiguate zones with the same name.
This is paid for by deprecating `Zone.idOrName()`.

`Provider.zoneIdentification()` is added to that callers can understand
if zone names can be substituted for ids or if qualifiers are supported.
This is paid for by deprecating `Provider.supportsDuplicateZoneNames()`.
@cloudbees-pull-request-builder

NetflixOSS » denominator » denominator-pull-requests #99 SUCCESS
This pull request looks good

codefromthecrypt pushed a commit that referenced this pull request Mar 24, 2015
Refines zone identifiers and handling of zones with the same name
@codefromthecrypt codefromthecrypt merged commit d435178 into master Mar 24, 2015
@codefromthecrypt codefromthecrypt deleted the adrian.zone-qualifiers branch March 24, 2015 15:14
codefromthecrypt pushed a commit that referenced this pull request Mar 28, 2015
`Zone.Identifier` doesn't pull its weight. The only thing it adds beyond
`Provider.supportsDuplicateZones`, is that it can indicate a zone id is
the same as its name. This isn't enough to warrant the added complexity.

see #350
codefromthecrypt pushed a commit that referenced this pull request Mar 28, 2015
`Zone.Identifier` doesn't pull its weight. The only thing it adds beyond
`Provider.supportsDuplicateZones`, is that it can indicate a zone id is
the same as its name. This isn't enough to warrant the added complexity.

see #350
codefromthecrypt pushed a commit that referenced this pull request Mar 29, 2015
`Zone.Identifier` doesn't pull its weight. The only thing it adds beyond
`Provider.supportsDuplicateZones`, is that it can indicate a zone id is
the same as its name. This isn't enough to warrant the added complexity.

see #350
codefromthecrypt pushed a commit that referenced this pull request Mar 29, 2015
`Zone.Identifier` doesn't pull its weight. The only thing it adds beyond
`Provider.supportsDuplicateZones`, is that it can indicate a zone id is
the same as its name. This isn't enough to warrant the added complexity.

see #350
codefromthecrypt pushed a commit that referenced this pull request Mar 29, 2015
Zone.qualifier was only introduced to support creation of Route53 hosted
zones. We were using this for the caller reference. Turns out that
caller references can never be reused. This means that if you delete a
zone, you can never create a new one with the same caller reference. As
such, we shouldn't expose this to users.

see #350
codefromthecrypt pushed a commit that referenced this pull request Mar 30, 2015
Zone.qualifier was only introduced to support creation of Route53 hosted
zones. We were using this for the caller reference. Turns out that
caller references can never be reused. This means that if you delete a
zone, you can never create a new one with the same caller reference. As
such, we shouldn't expose this to users.

see #350
MisterK pushed a commit to MisterK/denominator that referenced this pull request Apr 26, 2015
`Zone.Identifier` doesn't pull its weight. The only thing it adds beyond
`Provider.supportsDuplicateZones`, is that it can indicate a zone id is
the same as its name. This isn't enough to warrant the added complexity.

see Netflix#350
MisterK pushed a commit to MisterK/denominator that referenced this pull request Apr 26, 2015
Zone.qualifier was only introduced to support creation of Route53 hosted
zones. We were using this for the caller reference. Turns out that
caller references can never be reused. This means that if you delete a
zone, you can never create a new one with the same caller reference. As
such, we shouldn't expose this to users.

see Netflix#350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants