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

Make Zone compatible with ManagedZone API resource #11407

Open
ccobham opened this issue Jan 27, 2025 · 2 comments
Open

Make Zone compatible with ManagedZone API resource #11407

ccobham opened this issue Jan 27, 2025 · 2 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@ccobham
Copy link

ccobham commented Jan 27, 2025

When creating a google-cloud-dns Zone object, this library maps properties from an underlying google-api-services-dns ManagedZone response. Not all properties exposed in the REST API / google-api-services-dns library are mapped as would be expected.

I happened to need the visibility field, but at a glance there are a number of additional missing properties (serviceDirectoryConfig, reverseLookupConfig, ...).

Ideally, the google-cloud-dns Zone would expose all of the same properties available in the API or it would provide a handle to the google-api-services-dns ManagedZone.

Were these properties omitted intentionally? If so, is there a recommended way to retrieve them using this library?

Thanks!

@lqiu96 lqiu96 added type: question Request for information or clarification. Not an issue. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 29, 2025
@lqiu96
Copy link
Contributor

lqiu96 commented Jan 29, 2025

Hi @ccobham, thanks for the question.

Providing some context regarding DNS:

The Java SDK has two DNS libraries available.

  1. google-cloud-java/dns: https://github.com/googleapis/google-cloud-java/tree/main/java-dns
  2. google-api-java-client-services/dns: https://github.com/googleapis/google-api-java-client-services/tree/main/clients/google-api-services-dns/v1/2.0.0/com/google/api/services/dns

See https://cloud.google.com/apis/docs/client-libraries-explained which hopefully can provide a bit more insight.

Were these properties omitted intentionally? If so, is there a recommended way to retrieve them using this library?

These weren't omitted intentionally. The google-cloud-java/dns is handwritten and hasn't been updated in a while with the changes.

I believe the google-api-java-client-services is being kept up to date with the latest changes. Is possible, would you be able to only use the google-api-java-client-services/dns library? Do you have any need/ requirements to use google-cloud-java/dns?

I know having to re-write and change libraries may be a non-starter and just wanted to see if there are possible workarounds (i.e. using google-api-java-client-services/dns).

@ccobham
Copy link
Author

ccobham commented Jan 30, 2025

@lqiu96 Thank you for the summary.

As a workaround, I cast the result of DnsOptions::getRpc to DnsRpc and directly retrieved the ManagedZone.

I don't have a hard requirement to use google-cloud-java/dns. I think the interface easier to work with than google-api-java-client-services/dns. It isn't clear to me how a DnsRpc object should be instantiated using google-api-java-client-services/dns directly (this could be user error). There's a lot of logic in google-cloud-java/dns that I think is worth keeping (e.g. retry logic, simpler pagination) and that I'd prefer not to write myself.

Are there any plans to either (a) deprecate google-cloud-java/dns in favor of google-api-java-client-services/dns or (b) update google-cloud-java/dns with the latest API changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants