mirror of
https://github.com/google/nomulus.git
synced 2025-05-15 08:57:12 +02:00
Add config parameters to point at us to use cloud-dns staging
Add cloudDns.{rootUrl, servicePath} to allow us to point an environment at the Cloud DNS staging API for testing. Make sandbox and alpha point to staging. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=170340859
This commit is contained in:
parent
d4ab6fe90b
commit
d09bd89629
4 changed files with 43 additions and 4 deletions
|
@ -20,6 +20,7 @@ import com.google.api.client.json.JsonFactory;
|
|||
import com.google.api.services.dns.Dns;
|
||||
import com.google.api.services.dns.DnsScopes;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.util.concurrent.RateLimiter;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
|
@ -40,10 +41,20 @@ public final class CloudDnsWriterModule {
|
|||
HttpTransport transport,
|
||||
JsonFactory jsonFactory,
|
||||
Function<Set<String>, ? extends HttpRequestInitializer> credential,
|
||||
@Config("projectId") String projectId) {
|
||||
return new Dns.Builder(transport, jsonFactory, credential.apply(DnsScopes.all()))
|
||||
.setApplicationName(projectId)
|
||||
.build();
|
||||
@Config("projectId") String projectId,
|
||||
@Config("cloudDnsRootUrl") Optional<String> rootUrl,
|
||||
@Config("cloudDnsServicePath") Optional<String> servicePath) {
|
||||
Dns.Builder builder = new Dns.Builder(transport, jsonFactory, credential.apply(DnsScopes.all()))
|
||||
.setApplicationName(projectId);
|
||||
|
||||
if (rootUrl.isPresent()) {
|
||||
builder.setRootUrl(rootUrl.get());
|
||||
}
|
||||
if (servicePath.isPresent()) {
|
||||
builder.setServicePath(servicePath.get());
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue