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

add resourcePolicy property support to ResourceRecordSet #192

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davemcphee
Copy link

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #191 🦕

Adds support for resourcePolicy property on ResourceRecordSets.

Creating a new ResourceRecordSet() now requires setting the resource_policy param, although an empty dict can be used if not required.

# no resourcePolicy required
rrs = ResourceRecordSet("foo.example.com.", "A", 3600, ["10.1.2.3"], {}, zone=zone)

# no resourcePolicy required
rrs_w_routing_policy = ResourceRecordSet("foo.example.com.", "A", 3600, [], {"geo": {...}}, zone=zone)

When creating a ResourceRecordSet with a routingPolicy, rrdatas needs to be empty, and vice-versa. Changes._build_resource() now calls a new helper method _routing_policy_cleaner to remove either key if empty.

version bumped to 0.35.0 in setup.py, but CHANGELOG appears to be auto generated, so didn't touch. docstrings and unit tests updated.

@davemcphee davemcphee requested a review from a team as a code owner May 2, 2023 14:52
@google-cla
Copy link

google-cla bot commented May 2, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: dns Issues related to the googleapis/python-dns API. labels May 2, 2023
Adds ability to read & write resourcePolicy property to / from cloud-dns
API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dns Issues related to the googleapis/python-dns API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for resourcePolicy property to ResourceRecordSet
2 participants