Class: Puppet::HTTP::Resolver::SRV Private
- Inherits:
-
Puppet::HTTP::Resolver
- Object
- Puppet::HTTP::Resolver
- Puppet::HTTP::Resolver::SRV
- Defined in:
- lib/puppet/http/resolver/srv.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Resolve a service using SRV
Instance Method Summary collapse
-
#initialize(client, domain:, dns: Resolv::DNS.new) ⇒ SRV
constructor
private
A new instance of SRV.
-
#resolve(session, name, ssl_context: nil, canceled_handler: nil) ⇒ Puppet::HTTP::Service
private
Walk the available srv records and return the first that successfully connects.
Methods inherited from Puppet::HTTP::Resolver
Constructor Details
#initialize(client, domain:, dns: Resolv::DNS.new) ⇒ SRV
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SRV.
14 15 16 17 18 |
# File 'lib/puppet/http/resolver/srv.rb', line 14 def initialize(client, domain:, dns: Resolv::DNS.new) @client = client @srv_domain = domain @delegate = Puppet::Network::Resolver.new(dns) end |
Instance Method Details
#resolve(session, name, ssl_context: nil, canceled_handler: nil) ⇒ Puppet::HTTP::Service
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Walk the available srv records and return the first that successfully connects
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/puppet/http/resolver/srv.rb', line 34 def resolve(session, name, ssl_context: nil, canceled_handler: nil) # Here we pass our HTTP service name as the DNS SRV service name # This is fine for :ca, but note that :puppet and :file are handled # specially in `each_srv_record`. @delegate.each_srv_record(@srv_domain, name) do |server, port| service = Puppet::HTTP::Service.create_service(@client, session, name, server, port) return service if check_connection?(session, service, ssl_context: ssl_context) end nil end |