Class: Fog::DNS::Google::Real

Inherits:
Object
  • Object
show all
Includes:
Google::Shared
Defined in:
lib/fog/dns/google/requests/get_change.rb,
lib/fog/dns/google/real.rb,
lib/fog/dns/google/requests/get_project.rb,
lib/fog/dns/google/requests/list_changes.rb,
lib/fog/dns/google/requests/create_change.rb,
lib/fog/dns/google/requests/get_managed_zone.rb,
lib/fog/dns/google/requests/list_managed_zones.rb,
lib/fog/dns/google/requests/create_managed_zone.rb,
lib/fog/dns/google/requests/delete_managed_zone.rb,
lib/fog/dns/google/requests/list_resource_record_sets.rb

Overview

Enumerates Resource Record Sets that have been created but not yet deleted.

Instance Attribute Summary collapse

Attributes included from Google::Shared

#api_url, #api_version, #project

Instance Method Summary collapse

Methods included from Google::Shared

#apply_client_options, #build_excon_response, #initialize_google_client, #request, #shared_initialize

Constructor Details

#initialize(options) ⇒ Real

Returns a new instance of Real.


9
10
11
12
13
14
15
# File 'lib/fog/dns/google/real.rb', line 9

def initialize(options)
  shared_initialize(options[:google_project], GOOGLE_DNS_API_VERSION, GOOGLE_DNS_BASE_URL)
  options[:google_api_scope_url] = GOOGLE_DNS_API_SCOPE_URLS.join(" ")
  initialize_google_client(options)
  @dns = ::Google::Apis::DnsV1::DnsService.new
  apply_client_options(@dns, options)
end

Instance Attribute Details

#dnsObject (readonly)

Returns the value of attribute dns


7
8
9
# File 'lib/fog/dns/google/real.rb', line 7

def dns
  @dns
end

Instance Method Details

#create_change(zone_name_or_id, additions = [], deletions = []) ⇒ Object


9
10
11
12
13
14
15
16
17
# File 'lib/fog/dns/google/requests/create_change.rb', line 9

def create_change(zone_name_or_id, additions = [], deletions = [])
  @dns.create_change(
    @project, zone_name_or_id,
    ::Google::Apis::DnsV1::Change.new(
      :additions => additions,
      :deletions => deletions
    )
  )
end

#create_managed_zone(name, dns_name, description) ⇒ Object


10
11
12
13
14
15
16
17
# File 'lib/fog/dns/google/requests/create_managed_zone.rb', line 10

def create_managed_zone(name, dns_name, description)
  mngd_zone = ::Google::Apis::DnsV1::ManagedZone.new
  mngd_zone.name = name
  mngd_zone.dns_name = dns_name
  mngd_zone.description = description

  @dns.create_managed_zone(@project, mngd_zone)
end

#delete_managed_zone(name_or_id) ⇒ Object


9
10
11
# File 'lib/fog/dns/google/requests/delete_managed_zone.rb', line 9

def delete_managed_zone(name_or_id)
  @dns.delete_managed_zone(@project, name_or_id)
end

#get_change(zone_name_or_id, identity) ⇒ Object


9
10
11
# File 'lib/fog/dns/google/requests/get_change.rb', line 9

def get_change(zone_name_or_id, identity)
  @dns.get_change(@project, zone_name_or_id, identity)
end

#get_managed_zone(name_or_id) ⇒ Object


9
10
11
# File 'lib/fog/dns/google/requests/get_managed_zone.rb', line 9

def get_managed_zone(name_or_id)
  @dns.get_managed_zone(@project, name_or_id)
end

#get_project(identity) ⇒ Object


10
11
12
# File 'lib/fog/dns/google/requests/get_project.rb', line 10

def get_project(identity)
  @dns.get_project(identity)
end

#list_changes(zone_name_or_id, max_results: nil, page_token: nil, sort_by: nil, sort_order: nil) ⇒ Object


9
10
11
12
13
14
15
16
17
18
# File 'lib/fog/dns/google/requests/list_changes.rb', line 9

def list_changes(zone_name_or_id, max_results: nil, page_token: nil,
                 sort_by: nil, sort_order: nil)
  @dns.list_changes(
    @project, zone_name_or_id,
    :max_results => max_results,
    :page_token => page_token,
    :sort_by => sort_by,
    :sort_order => sort_order
  )
end

#list_managed_zones(dns_name: nil, max_results: nil, page_token: nil) ⇒ Object


9
10
11
12
13
14
# File 'lib/fog/dns/google/requests/list_managed_zones.rb', line 9

def list_managed_zones(dns_name: nil, max_results: nil, page_token: nil)
  @dns.list_managed_zones(@project,
                          :dns_name => dns_name,
                          :max_results => max_results,
                          :page_token => page_token)
end

#list_resource_record_sets(zone_name_or_id, max_results: nil, name: nil, page_token: nil, type: nil) ⇒ Object


9
10
11
12
13
14
15
16
17
18
# File 'lib/fog/dns/google/requests/list_resource_record_sets.rb', line 9

def list_resource_record_sets(zone_name_or_id, max_results: nil,
                              name: nil, page_token: nil, type: nil)
  @dns.list_resource_record_sets(
    @project, zone_name_or_id,
    :max_results => max_results,
    :name => name,
    :page_token => page_token,
    :type => type
  )
end