foreman_api 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/README.rdoc +35 -18
  2. data/doc/ForemanApi/Resources/Architecture.html +93 -136
  3. data/doc/ForemanApi/Resources/Audit.html +42 -60
  4. data/doc/ForemanApi/Resources/AuthSourceLdap.html +129 -190
  5. data/doc/ForemanApi/Resources/Bookmark.html +97 -142
  6. data/doc/ForemanApi/Resources/CommonParameter.html +93 -136
  7. data/doc/ForemanApi/Resources/ComputeResource.html +131 -190
  8. data/doc/ForemanApi/Resources/ConfigTemplate.html +145 -211
  9. data/doc/ForemanApi/Resources/Dashboard.html +21 -29
  10. data/doc/ForemanApi/Resources/Domain.html +103 -151
  11. data/doc/ForemanApi/Resources/Environment.html +89 -130
  12. data/doc/ForemanApi/Resources/FactValue.html +29 -41
  13. data/doc/ForemanApi/Resources/Home.html +32 -45
  14. data/doc/ForemanApi/Resources/Host.html +317 -251
  15. data/doc/ForemanApi/Resources/HostClass.html +55 -79
  16. data/doc/ForemanApi/Resources/Hostgroup.html +125 -184
  17. data/doc/ForemanApi/Resources/HostgroupClass.html +57 -82
  18. data/doc/ForemanApi/Resources/Image.html +109 -160
  19. data/doc/ForemanApi/Resources/Location.html +937 -0
  20. data/doc/ForemanApi/Resources/LookupKey.html +111 -163
  21. data/doc/ForemanApi/Resources/Medium.html +113 -154
  22. data/doc/ForemanApi/Resources/Model.html +101 -148
  23. data/doc/ForemanApi/Resources/OperatingSystem.html +118 -173
  24. data/doc/ForemanApi/Resources/Organization.html +937 -0
  25. data/doc/ForemanApi/Resources/Parameter.html +158 -233
  26. data/doc/ForemanApi/Resources/Ptable.html +97 -142
  27. data/doc/ForemanApi/Resources/Puppetclass.html +95 -139
  28. data/doc/ForemanApi/Resources/Report.html +68 -98
  29. data/doc/ForemanApi/Resources/Role.html +85 -124
  30. data/doc/ForemanApi/Resources/Setting.html +58 -84
  31. data/doc/ForemanApi/Resources/SmartProxy.html +91 -133
  32. data/doc/ForemanApi/Resources/Subnet.html +141 -208
  33. data/doc/ForemanApi/Resources/TemplateCombination.html +65 -94
  34. data/doc/ForemanApi/Resources/TemplateKind.html +23 -32
  35. data/doc/ForemanApi/Resources/User.html +111 -163
  36. data/doc/ForemanApi/Resources/Usergroup.html +89 -130
  37. data/doc/ForemanApi/Resources.html +6 -6
  38. data/doc/ForemanApi.html +5 -5
  39. data/doc/_index.html +18 -4
  40. data/doc/class_list.html +1 -1
  41. data/doc/css/style.css +0 -10
  42. data/doc/file.MIT-LICENSE.html +24 -29
  43. data/doc/file.README.html +81 -60
  44. data/doc/frames.html +1 -1
  45. data/doc/index.html +81 -60
  46. data/doc/method_list.html +416 -312
  47. data/doc/top-level-namespace.html +3 -3
  48. data/lib/foreman_api/base.rb +16 -8
  49. data/lib/foreman_api/documentation.json +1 -1
  50. data/lib/foreman_api/resources/host.rb +9 -0
  51. data/lib/foreman_api/resources/location.rb +59 -0
  52. data/lib/foreman_api/resources/medium.rb +2 -2
  53. data/lib/foreman_api/resources/organization.rb +59 -0
  54. data/lib/foreman_api/version.rb +1 -1
  55. metadata +7 -3
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Top Level Namespace
8
8
 
9
- &mdash; Documentation by YARD 0.8.5.2
9
+ &mdash; Documentation by YARD 0.8.3
10
10
 
11
11
  </title>
12
12
 
@@ -103,9 +103,9 @@
103
103
  </div>
104
104
 
105
105
  <div id="footer">
106
- Generated on Tue Mar 19 09:50:22 2013 by
106
+ Generated on Thu Jun 20 12:05:19 2013 by
107
107
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
- 0.8.5.2 (ruby-1.8.7).
108
+ 0.8.3 (ruby-1.9.3).
109
109
  </div>
110
110
 
111
111
  </body>
@@ -32,14 +32,22 @@ module ForemanApi
32
32
  def initialize(config, options = {})
33
33
  config = config.dup
34
34
  self.logger = config.delete(:logger)
35
- @client = RestClient::Resource.new(
36
- config[:base_url],
37
- { :user => config[:username],
38
- :password => config[:password],
39
- :oauth => config[:oauth],
40
- :headers => { :content_type => 'application/json',
41
- :accept => "application/json;version=#{API_VERSION}" }
42
- }.merge(options))
35
+
36
+ headers = {
37
+ :content_type => 'application/json',
38
+ :accept => "application/json;version=#{API_VERSION}"
39
+ }
40
+ headers.merge!(config[:headers]) unless config[:headers].nil?
41
+ headers.merge!(options.delete(:headers)) unless options[:headers].nil?
42
+
43
+ resource_config = {
44
+ :user => config[:username],
45
+ :password => config[:password],
46
+ :oauth => config[:oauth],
47
+ :headers => headers
48
+ }.merge(options)
49
+
50
+ @client = RestClient::Resource.new(config[:base_url], resource_config)
43
51
  @config = config
44
52
  end
45
53