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_id ⇒ Object
(also: #project, #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 end |
#create_zone(zone_name, zone_dns, description: nil, name_server_set: nil) ⇒ Google::Cloud::Dns::Zone
Creates a new zone.
211 212 213 214 215 216 217 218 |
# File 'lib/google/cloud/dns/project.rb', line 211 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 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 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_id ⇒ Object Also known as: project, id
The unique ID string for the current project.
72 73 74 |
# File 'lib/google/cloud/dns/project.rb', line 72 def project_id 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 end |
#reload! ⇒ Object Also known as: refresh!
Reloads the change with updated status from the DNS service.
222 223 224 225 |
# File 'lib/google/cloud/dns/project.rb', line 222 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 end |
#zone(zone_id) ⇒ Google::Cloud::Dns::Zone? Also known as: find_zone, get_zone
Retrieves an existing zone by name or id.
142 143 144 145 146 147 148 |
# File 'lib/google/cloud/dns/project.rb', line 142 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.
180 181 182 183 184 |
# File 'lib/google/cloud/dns/project.rb', line 180 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 end |