Module: PuppetRestClient::PE
- Extended by:
- Config
- Defined in:
- lib/puppet-rest.rb,
lib/puppet-rest/pe/client.rb,
lib/puppet-rest/pe/config.rb,
lib/puppet-rest/pe/request.rb,
lib/puppet-rest/pe/connection.rb,
lib/puppet-rest/pe/entities/base.rb,
lib/puppet-rest/pe/entities/node.rb,
lib/puppet-rest/pe/connection/node.rb,
lib/puppet-rest/pe/entities/catalog.rb,
lib/puppet-rest/pe/connection/ca_cert.rb,
lib/puppet-rest/pe/connection/catalog.rb
Defined Under Namespace
Modules: Config, Request Classes: Base, Catalog, Connection, Node
Constant Summary
Constants included from Config
Config::DEFAULT_ACCEPT, Config::DEFAULT_API_VERSION, Config::DEFAULT_CLIENT_KEY, Config::DEFAULT_CLIENT_NAME, Config::DEFAULT_CONNECTION_OPTIONS, Config::DEFAULT_ENVIRONMENT, Config::DEFAULT_MIDDLEWARE, Config::DEFAULT_SERVER_URL, Config::DEFAULT_USER_AGENT, Config::VALID_OPTIONS_KEYS
Class Method Summary collapse
-
.method_missing(method, *args, &block) ⇒ Object
Delegate methods to PuppetRestClient::Connection.
-
.new(options = Mash.new) ⇒ Object
Convenience alias for PuppetRestClient::DbConnection.new.
- .read_key_file(path) ⇒ Object
- .respond_to?(method, include_private = false) ⇒ Boolean
Methods included from Config
extended, options, reset, setup
Class Method Details
.method_missing(method, *args, &block) ⇒ Object
Delegate methods to PuppetRestClient::Connection
13 14 15 16 |
# File 'lib/puppet-rest/pe/client.rb', line 13 def method_missing(method, *args, &block) return super unless new.respond_to?(method) new.send(method, *args, &block) end |
.new(options = Mash.new) ⇒ Object
Convenience alias for PuppetRestClient::DbConnection.new
return [PuppetRestClient::DbConnection]
8 9 10 |
# File 'lib/puppet-rest/pe/client.rb', line 8 def new(=Mash.new) PuppetRestClient::PE::Connection.new() end |
.read_key_file(path) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/puppet-rest/pe/client.rb', line 22 def read_key_file(path) key_file_path = File.(path) begin raw_key = File.read(key_file_path).strip rescue SystemCallError, IOError => e raise IOError, "Unable to read #{key_file_path}" end begin_rsa = '-----BEGIN RSA PRIVATE KEY-----' end_rsa = '-----END RSA PRIVATE KEY-----' unless (raw_key =~ /\A#{begin_rsa}$/) && (raw_key =~ /^#{end_rsa}\Z/) msg = "The file #{key_file_path} is not a properly formatted private key.\n" msg << "It must contain '#{begin_rsa}' and '#{end_rsa}'" raise ArgumentError, msg end return OpenSSL::PKey::RSA.new(raw_key) end |
.respond_to?(method, include_private = false) ⇒ Boolean
18 19 20 |
# File 'lib/puppet-rest/pe/client.rb', line 18 def respond_to?(method, include_private=false) new.respond_to?(method, include_private) || super(method, include_private) end |