Class: Google::Cloud::Dns::Project
- Inherits:
-
Object
- Object
- Google::Cloud::Dns::Project
- Defined in:
- lib/google/cloud/dns/project.rb
Overview
Project
The project is a top level container for resources including Cloud DNS ManagedZones. Projects can be created only in the Google Developers Console.
Instance Method Summary collapse
-
#additions_per_change ⇒ Object
Maximum allowed number of records to add per change.
-
#create_zone(zone_name, zone_dns, description: nil, name_server_set: nil) ⇒ Google::Cloud::Dns::Zone
Creates a new zone.
-
#data_per_record ⇒ Object
Maximum allowed number of data entries per record.
-
#deletions_per_change ⇒ Object
Maximum allowed number of records to delete per change.
-
#number ⇒ Object
The project number.
-
#project ⇒ Object
(also: #id)
The unique ID string for the current project.
-
#records_per_zone ⇒ Object
Maximum allowed number of records per zone in the project.
-
#reload! ⇒ Object
(also: #refresh!)
Reloads the change with updated status from the DNS service.
-
#total_data_per_change ⇒ Object
Maximum allowed total bytes size for all the data in one change.
-
#zone(zone_id) ⇒ Google::Cloud::Dns::Zone?
(also: #find_zone, #get_zone)
Retrieves an existing zone by name or id.
-
#zones(token: nil, max: nil) ⇒ Array<Google::Cloud::Dns::Zone>
(also: #find_zones)
Retrieves the list of zones belonging to the project.
-
#zones_quota ⇒ Object
Maximum allowed number of zones in the project.
Instance Method Details
#additions_per_change ⇒ Object
Maximum allowed number of records to add per change.
102 103 104 105 |
# File 'lib/google/cloud/dns/project.rb', line 102 def additions_per_change reload! if @gapi.nil? @gapi.quota.rrset_additions_per_change if @gapi.quota end |
#create_zone(zone_name, zone_dns, description: nil, name_server_set: nil) ⇒ Google::Cloud::Dns::Zone
Creates a new zone.
221 222 223 224 225 226 227 228 |
# File 'lib/google/cloud/dns/project.rb', line 221 def create_zone zone_name, zone_dns, description: nil, name_server_set: nil ensure_service! gapi = service.create_zone zone_name, zone_dns, description: description, name_server_set: name_server_set Zone.from_gapi gapi, service end |
#data_per_record ⇒ Object
Maximum allowed number of data entries per record.
95 96 97 98 |
# File 'lib/google/cloud/dns/project.rb', line 95 def data_per_record reload! if @gapi.nil? @gapi.quota.resource_records_per_rrset if @gapi.quota end |
#deletions_per_change ⇒ Object
Maximum allowed number of records to delete per change.
109 110 111 112 |
# File 'lib/google/cloud/dns/project.rb', line 109 def deletions_per_change reload! if @gapi.nil? @gapi.quota.rrset_deletions_per_change if @gapi.quota end |
#number ⇒ Object
The project number.
81 82 83 84 |
# File 'lib/google/cloud/dns/project.rb', line 81 def number reload! if @gapi.nil? @gapi.number end |
#project ⇒ Object Also known as: id
The unique ID string for the current project.
74 75 76 |
# File 'lib/google/cloud/dns/project.rb', line 74 def project service.project end |
#records_per_zone ⇒ Object
Maximum allowed number of records per zone in the project.
116 117 118 119 |
# File 'lib/google/cloud/dns/project.rb', line 116 def records_per_zone reload! if @gapi.nil? @gapi.quota.rrsets_per_managed_zone if @gapi.quota end |
#reload! ⇒ Object Also known as: refresh!
Reloads the change with updated status from the DNS service.
232 233 234 235 |
# File 'lib/google/cloud/dns/project.rb', line 232 def reload! ensure_service! @gapi = service.get_project end |
#total_data_per_change ⇒ Object
Maximum allowed total bytes size for all the data in one change.
123 124 125 126 |
# File 'lib/google/cloud/dns/project.rb', line 123 def total_data_per_change reload! if @gapi.nil? @gapi.quota.total_rrdata_size_per_change if @gapi.quota end |
#zone(zone_id) ⇒ Google::Cloud::Dns::Zone? Also known as: find_zone, get_zone
Retrieves an existing zone by name or id.
152 153 154 155 156 157 158 |
# File 'lib/google/cloud/dns/project.rb', line 152 def zone zone_id ensure_service! gapi = service.get_zone zone_id Zone.from_gapi gapi, service rescue Google::Cloud::NotFoundError nil end |
#zones(token: nil, max: nil) ⇒ Array<Google::Cloud::Dns::Zone> Also known as: find_zones
Retrieves the list of zones belonging to the project.
190 191 192 193 194 |
# File 'lib/google/cloud/dns/project.rb', line 190 def zones token: nil, max: nil ensure_service! gapi = service.list_zones token: token, max: max Zone::List.from_gapi gapi, service, max end |
#zones_quota ⇒ Object
Maximum allowed number of zones in the project.
88 89 90 91 |
# File 'lib/google/cloud/dns/project.rb', line 88 def zones_quota reload! if @gapi.nil? @gapi.quota.managed_zones if @gapi.quota end |