Module: Google::Cloud::Dns
- Defined in:
- lib/google/cloud/dns.rb,
lib/google/cloud/dns/zone.rb,
lib/google/cloud/dns/change.rb,
lib/google/cloud/dns/record.rb,
lib/google/cloud/dns/project.rb,
lib/google/cloud/dns/service.rb,
lib/google/cloud/dns/version.rb,
lib/google/cloud/dns/importer.rb,
lib/google/cloud/dns/zone/list.rb,
lib/google/cloud/dns/change/list.rb,
lib/google/cloud/dns/credentials.rb,
lib/google/cloud/dns/record/list.rb,
lib/google/cloud/dns/zone/transaction.rb
Overview
Google Cloud DNS
Google Cloud DNS is a high-performance, resilient, global DNS service that provides a cost-effective way to make your applications and services available to your users. This programmable, authoritative DNS service can be used to easily publish and manage DNS records using the same infrastructure relied upon by Google. To learn more, read What is Google Cloud DNS?.
Defined Under Namespace
Classes: Change, Credentials, Project, Record, Zone
Constant Summary collapse
- VERSION =
"0.29.1".freeze
Class Method Summary collapse
-
.configure {|Google::Cloud.configure.dns| ... } ⇒ Google::Cloud::Config
Configure the Google Cloud DNS library.
-
.new(project_id: nil, credentials: nil, scope: nil, retries: nil, timeout: nil, project: nil, keyfile: nil) ⇒ Google::Cloud::Dns::Project
Creates a new
Project
instance connected to the DNS service.
Class Method Details
.configure {|Google::Cloud.configure.dns| ... } ⇒ Google::Cloud::Config
Configure the Google Cloud DNS library.
The following DNS configuration parameters are supported:
project_id
- (String) Identifier for a DNS project. (The parameterproject
is considered deprecated, but may also be used.)credentials
- (String, Hash, Google::Auth::Credentials) The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object. (See Credentials) (The parameterkeyfile
is considered deprecated, but may also be used.)scope
- (String, Array) The OAuth 2.0 scopes controlling the set of resources and operations that the connection can access. retries
- (Integer) Number of times to retry requests on server error.timeout
- (Integer) Default timeout to use in requests.
118 119 120 121 122 |
# File 'lib/google/cloud/dns.rb', line 118 def self.configure yield Google::Cloud.configure.dns if block_given? Google::Cloud.configure.dns end |
.new(project_id: nil, credentials: nil, scope: nil, retries: nil, timeout: nil, project: nil, keyfile: nil) ⇒ Google::Cloud::Dns::Project
Creates a new Project
instance connected to the DNS service.
Each call creates a new connection.
For more information on connecting to Google Cloud see the Authentication Guide.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/google/cloud/dns.rb', line 76 def self.new project_id: nil, credentials: nil, scope: nil, retries: nil, timeout: nil, project: nil, keyfile: nil project_id ||= (project || default_project_id) project_id = project_id.to_s # Always cast to a string raise ArgumentError, "project_id is missing" if project_id.empty? scope ||= configure.scope retries ||= configure.retries timeout ||= configure.timeout credentials ||= (keyfile || default_credentials(scope: scope)) unless credentials.is_a? Google::Auth::Credentials credentials = Dns::Credentials.new credentials, scope: scope end Dns::Project.new( Dns::Service.new( project_id, credentials, retries: retries, timeout: timeout ) ) end |