Netflix/denominator — pull request #132 by adriancole (2013-04-29 23:20:34+00:00)
Title: add GeoResourceRecordSetApi.applyRegionsToNameTypeAndGroup

per issue #127: implement `GeoResourceRecordSetApi.applyRegionsToNameTypeAndGroup` currently only supported on ultradns and mock.

ex. the following will remove Utah from the regions
```
import static com.google.common.base.Predicates.equalTo;
import static com.google.common.base.Predicates.not;
import static com.google.common.collect.Multimaps.filterValues
import static denominator.model.ResourceRecordSets.toProfile;
...
existing = geoApi.getByNameTypeAndGroup("srv.denominator.io.", "CNAME", "US-West");
Geo existingGeo = toProfile(Geo.class).apply(existing);
Multimap update = filterValues(existingGeo.getRegions(), not(equalTo("Utah")));

// note you should always check your updates
// they must be a filtered view of geoApi.getSupportedRegions()

geoApi.applyRegionsToNameTypeAndGroup(update, "srv.denominator.io.", "CNAME", "US-West");
```
or the equiv cli syntax
```
denominator -p mock geo -z denominator.io. remove-from-region -n srv.denominator.io. -t CNAME -g US-West -r 'United States (US)' Utah
```

## Testing
In order to run tests, you'll need to pass an additional parameter describing the rrset which is ok to affect to `./gradlew clean test install`

Ex. to affect the europe CNAME of allen.geo.denominator.io., the following will work.
```
-Dultradns.rrset-geo=zone=geo.denominator.io.,name=allen.geo.denominator.io.,type=CNAME,group=europe
```