Reference documentation and code samples for the Cloud DNS API class Google::Cloud::Dns::Project.
Project
The project is a top level container for resources including Cloud DNS ManagedZones. Projects can be created only in the Google Developers Console.
Inherits
- Object
Example
require "google/cloud/dns" dns = Google::Cloud::Dns.new zone = dns.zone "example-com" zone.records.each do |record| puts record.name end
Methods
#additions_per_change
def additions_per_change()
Maximum allowed number of records to add per change.
#create_zone
def create_zone(zone_name, zone_dns, description: nil, name_server_set: nil) -> Google::Cloud::Dns::Zone
Creates a new zone.
- zone_name (String) — User assigned name for this resource. Must be unique within the project. The name must be 1-32 characters long, must begin with a letter, end with a letter or digit, and only contain lowercase letters, digits or dashes.
- zone_dns (String) — The DNS name of this managed zone, for instance "example.com.".
- description (String) (defaults to: nil) — A string of at most 1024 characters associated with this resource for the user's convenience. Has no effect on the managed zone's function.
- name_server_set (String) (defaults to: nil) — A NameServerSet is a set of DNS name servers that all host the same ManagedZones. Most users will leave this field unset.
require "google/cloud/dns" dns = Google::Cloud::Dns.new zone = dns.create_zone "example-com", "example.com."
#data_per_record
def data_per_record()
Maximum allowed number of data entries per record.
#deletions_per_change
def deletions_per_change()
Maximum allowed number of records to delete per change.
#find_zone
def find_zone(zone_id) -> Google::Cloud::Dns::Zone, nil
Retrieves an existing zone by name or id.
- zone_id (String, Integer) — The name or id of a zone.
-
(Google::Cloud::Dns::Zone, nil) — Returns
nil
if the zone does not exist.
require "google/cloud/dns" dns = Google::Cloud::Dns.new zone = dns.zone "example-com" puts zone.name
#find_zones
def find_zones(token: nil, max: nil) -> Array<Google::Cloud::Dns::Zone>
- token (String) (defaults to: nil) — A previously-returned page token representing part of the larger set of results to view.
- max (Integer) (defaults to: nil) — Maximum number of zones to return.
- (Array<Google::Cloud::Dns::Zone>) — (See
require "google/cloud/dns" dns = Google::Cloud::Dns.new zones = dns.zones zones.each do |zone| puts zone.name end
Retrieve all zones: (See Zone::List#all)
require "google/cloud/dns" dns = Google::Cloud::Dns.new zones = dns.zones zones.all do |zone| puts zone.name end
#get_zone
def get_zone(zone_id) -> Google::Cloud::Dns::Zone, nil
Retrieves an existing zone by name or id.
- zone_id (String, Integer) — The name or id of a zone.
-
(Google::Cloud::Dns::Zone, nil) — Returns
nil
if the zone does not exist.
require "google/cloud/dns" dns = Google::Cloud::Dns.new zone = dns.zone "example-com" puts zone.name
#id
def id()
The unique ID string for the current project.
require "google/cloud/dns" dns = Google::Cloud::Dns.new( project_id: "my-project", credentials: "/path/to/keyfile.json" ) dns.project_id #=> "my-project"
#number
def number()
The project number.
#project
def project()
The unique ID string for the current project.
require "google/cloud/dns" dns = Google::Cloud::Dns.new( project_id: "my-project", credentials: "/path/to/keyfile.json" ) dns.project_id #=> "my-project"
#project_id
def project_id()
The unique ID string for the current project.
require "google/cloud/dns" dns = Google::Cloud::Dns.new( project_id: "my-project", credentials: "/path/to/keyfile.json" ) dns.project_id #=> "my-project"
#records_per_zone
def records_per_zone()
Maximum allowed number of records per zone in the project.
#refresh!
def refresh!()
Reloads the change with updated status from the DNS service.
#reload!
def reload!()
Reloads the change with updated status from the DNS service.
#total_data_per_change
def total_data_per_change()
Maximum allowed total bytes size for all the data in one change.
#zone
def zone(zone_id) -> Google::Cloud::Dns::Zone, nil
Retrieves an existing zone by name or id.
- zone_id (String, Integer) — The name or id of a zone.
-
(Google::Cloud::Dns::Zone, nil) — Returns
nil
if the zone does not exist.
require "google/cloud/dns" dns = Google::Cloud::Dns.new zone = dns.zone "example-com" puts zone.name
#zones
def zones(token: nil, max: nil) -> Array<Google::Cloud::Dns::Zone>
- token (String) (defaults to: nil) — A previously-returned page token representing part of the larger set of results to view.
- max (Integer) (defaults to: nil) — Maximum number of zones to return.
- (Array<Google::Cloud::Dns::Zone>) — (See
require "google/cloud/dns" dns = Google::Cloud::Dns.new zones = dns.zones zones.each do |zone| puts zone.name end
Retrieve all zones: (See Zone::List#all)
require "google/cloud/dns" dns = Google::Cloud::Dns.new zones = dns.zones zones.all do |zone| puts zone.name end
#zones_quota
def zones_quota()
Maximum allowed number of zones in the project.