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.
101 102 103 104 |
# File 'lib/google/cloud/dns/project.rb', line 101 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.
224 225 226 227 228 229 230 231 |
# File 'lib/google/cloud/dns/project.rb', line 224 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.
94 95 96 97 |
# File 'lib/google/cloud/dns/project.rb', line 94 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.
108 109 110 111 |
# File 'lib/google/cloud/dns/project.rb', line 108 def deletions_per_change reload! if @gapi.nil? @gapi.quota.rrset_deletions_per_change if @gapi.quota end |
#number ⇒ Object
The project number.
80 81 82 83 |
# File 'lib/google/cloud/dns/project.rb', line 80 def number reload! if @gapi.nil? @gapi.number end |
#project ⇒ Object Also known as: id
The unique ID string for the current project.
73 74 75 |
# File 'lib/google/cloud/dns/project.rb', line 73 def project service.project end |
#records_per_zone ⇒ Object
Maximum allowed number of records per zone in the project.
115 116 117 118 |
# File 'lib/google/cloud/dns/project.rb', line 115 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.
235 236 237 238 |
# File 'lib/google/cloud/dns/project.rb', line 235 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.
122 123 124 125 |
# File 'lib/google/cloud/dns/project.rb', line 122 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.
192 193 194 195 196 |
# File 'lib/google/cloud/dns/project.rb', line 192 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.
87 88 89 90 |
# File 'lib/google/cloud/dns/project.rb', line 87 def zones_quota reload! if @gapi.nil? @gapi.quota.managed_zones if @gapi.quota end |