foreman_api 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/.yardopts +4 -0
  2. data/Gemfile +5 -0
  3. data/README.rdoc +23 -4
  4. data/doc/ForemanApi/Resources/Architecture.html +902 -0
  5. data/doc/ForemanApi/Resources/Audit.html +500 -0
  6. data/doc/ForemanApi/Resources/AuthSourceLdap.html +916 -0
  7. data/doc/ForemanApi/Resources/Bookmark.html +884 -0
  8. data/doc/ForemanApi/Resources/CommonParameter.html +902 -0
  9. data/doc/ForemanApi/Resources/ComputeResource.html +940 -0
  10. data/doc/ForemanApi/Resources/ConfigTemplate.html +1160 -0
  11. data/doc/ForemanApi/Resources/Dashboard.html +336 -0
  12. data/doc/ForemanApi/Resources/Domain.html +914 -0
  13. data/doc/ForemanApi/Resources/Environment.html +898 -0
  14. data/doc/ForemanApi/Resources/FactValue.html +375 -0
  15. data/doc/ForemanApi/Resources/Home.html +417 -0
  16. data/doc/ForemanApi/Resources/Host.html +1091 -0
  17. data/doc/ForemanApi/Resources/Hostgroup.html +934 -0
  18. data/doc/ForemanApi/Resources/Image.html +963 -0
  19. data/doc/ForemanApi/Resources/LookupKey.html +918 -0
  20. data/doc/ForemanApi/Resources/Medium.html +920 -0
  21. data/doc/ForemanApi/Resources/Model.html +910 -0
  22. data/doc/ForemanApi/Resources/OperatingSystem.html +1057 -0
  23. data/doc/ForemanApi/Resources/Ptable.html +906 -0
  24. data/doc/ForemanApi/Resources/Puppetclass.html +898 -0
  25. data/doc/ForemanApi/Resources/Report.html +625 -0
  26. data/doc/ForemanApi/Resources/Role.html +872 -0
  27. data/doc/ForemanApi/Resources/Setting.html +641 -0
  28. data/doc/ForemanApi/Resources/SmartProxy.html +889 -0
  29. data/doc/ForemanApi/Resources/Subnet.html +954 -0
  30. data/doc/ForemanApi/Resources/TemplateKind.html +349 -0
  31. data/doc/ForemanApi/Resources/User.html +920 -0
  32. data/doc/ForemanApi/Resources/Usergroup.html +872 -0
  33. data/doc/ForemanApi/Resources.html +117 -0
  34. data/doc/ForemanApi.html +117 -0
  35. data/doc/_index.html +449 -0
  36. data/doc/class_list.html +53 -0
  37. data/doc/css/common.css +1 -0
  38. data/doc/css/full_list.css +57 -0
  39. data/doc/css/style.css +328 -0
  40. data/doc/file.MIT-LICENSE.html +93 -0
  41. data/doc/file.README.html +129 -0
  42. data/doc/file_list.html +58 -0
  43. data/doc/frames.html +28 -0
  44. data/doc/index.html +129 -0
  45. data/doc/js/app.js +214 -0
  46. data/doc/js/full_list.js +173 -0
  47. data/doc/js/jquery.js +4 -0
  48. data/doc/method_list.html +1300 -0
  49. data/doc/top-level-namespace.html +112 -0
  50. data/foreman_api.gemspec +5 -2
  51. data/lib/foreman_api/base.rb +129 -0
  52. data/lib/foreman_api/resources/architecture.rb +17 -7
  53. data/lib/foreman_api/resources/audit.rb +7 -4
  54. data/lib/foreman_api/resources/auth_source_ldap.rb +35 -7
  55. data/lib/foreman_api/resources/bookmark.rb +19 -7
  56. data/lib/foreman_api/resources/common_parameter.rb +17 -7
  57. data/lib/foreman_api/resources/compute_resource.rb +33 -7
  58. data/lib/foreman_api/resources/config_template.rb +28 -9
  59. data/lib/foreman_api/resources/dashboard.rb +3 -3
  60. data/lib/foreman_api/resources/domain.rb +21 -7
  61. data/lib/foreman_api/resources/environment.rb +15 -7
  62. data/lib/foreman_api/resources/fact_value.rb +6 -3
  63. data/lib/foreman_api/resources/home.rb +2 -4
  64. data/lib/foreman_api/resources/host.rb +50 -8
  65. data/lib/foreman_api/resources/hostgroup.rb +33 -7
  66. data/lib/foreman_api/resources/image.rb +30 -7
  67. data/lib/foreman_api/resources/lookup_key.rb +25 -7
  68. data/lib/foreman_api/resources/medium.rb +19 -7
  69. data/lib/foreman_api/resources/model.rb +21 -7
  70. data/lib/foreman_api/resources/operating_system.rb +26 -8
  71. data/lib/foreman_api/resources/ptable.rb +19 -7
  72. data/lib/foreman_api/resources/puppetclass.rb +15 -7
  73. data/lib/foreman_api/resources/report.rb +8 -5
  74. data/lib/foreman_api/resources/role.rb +13 -7
  75. data/lib/foreman_api/resources/setting.rb +11 -5
  76. data/lib/foreman_api/resources/smart_proxy.rb +16 -7
  77. data/lib/foreman_api/resources/subnet.rb +39 -7
  78. data/lib/foreman_api/resources/template_kind.rb +4 -3
  79. data/lib/foreman_api/resources/user.rb +26 -7
  80. data/lib/foreman_api/resources/usergroup.rb +13 -7
  81. data/lib/foreman_api/rest_client_oauth.rb +19 -0
  82. data/lib/foreman_api/version.rb +1 -1
  83. data/lib/foreman_api.rb +6 -10
  84. metadata +51 -18
@@ -1,12 +1,13 @@
1
1
  module ForemanApi
2
2
  module Resources
3
- class Usergroup < Apipie::Client::Base
3
+ class Usergroup < ForemanApi::Base
4
4
  def self.doc
5
5
  @doc ||= ForemanApi.doc['resources']["usergroups"]
6
6
  end
7
-
7
+
8
8
  # @param [Hash] params a hash of params to be passed to the service
9
- # allowed keys are: ["page", "per_page"]
9
+ # @option params [String] page Paginate results
10
+ # @option params [String] per_page Number of entries per request
10
11
  #
11
12
  # @param [Hash] headers additional http headers
12
13
  def index(params = { }, headers = { })
@@ -16,7 +17,7 @@ module ForemanApi
16
17
  end
17
18
 
18
19
  # @param [Hash] params a hash of params to be passed to the service
19
- # allowed keys are: ["id"]
20
+ # @option params [String] id
20
21
  #
21
22
  # @param [Hash] headers additional http headers
22
23
  def show(params = { }, headers = { })
@@ -26,7 +27,9 @@ module ForemanApi
26
27
  end
27
28
 
28
29
  # @param [Hash] params a hash of params to be passed to the service
29
- # allowed keys are: {"usergroup"=>["name"]}
30
+ # @option params [Hash] usergroup
31
+ # allowed keys are:
32
+ # * name [String],
30
33
  #
31
34
  # @param [Hash] headers additional http headers
32
35
  def create(params = { }, headers = { })
@@ -36,7 +39,10 @@ module ForemanApi
36
39
  end
37
40
 
38
41
  # @param [Hash] params a hash of params to be passed to the service
39
- # allowed keys are: {"usergroup"=>["name"], "id"=>nil}
42
+ # @option params [String] id
43
+ # @option params [Hash] usergroup
44
+ # allowed keys are:
45
+ # * name [String],
40
46
  #
41
47
  # @param [Hash] headers additional http headers
42
48
  def update(params = { }, headers = { })
@@ -46,7 +52,7 @@ module ForemanApi
46
52
  end
47
53
 
48
54
  # @param [Hash] params a hash of params to be passed to the service
49
- # allowed keys are: ["id"]
55
+ # @option params [String] id
50
56
  #
51
57
  # @param [Hash] headers additional http headers
52
58
  def destroy(params = { }, headers = { })
@@ -0,0 +1,19 @@
1
+ unless RestClient.const_defined? :OAUTH_EXTENSION
2
+ RestClient::OAUTH_EXTENSION = lambda do |request, args|
3
+ if args[:oauth]
4
+ uri = URI.parse args[:url]
5
+ default_options = { :site => "#{uri.scheme}://#{uri.host}:#{uri.port.to_s}",
6
+ :request_token_path => "",
7
+ :authorize_path => "",
8
+ :access_token_path => "" }
9
+ options = default_options.merge args[:oauth][:options] || { }
10
+ consumer = OAuth::Consumer.new(args[:oauth][:consumer_key], args[:oauth][:consumer_secret], options)
11
+
12
+ consumer.sign!(request)
13
+ end
14
+ end
15
+ end
16
+
17
+ unless RestClient.before_execution_procs.include? RestClient::OAUTH_EXTENSION
18
+ RestClient.add_before_execution_proc &RestClient::OAUTH_EXTENSION
19
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanApi
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
data/lib/foreman_api.rb CHANGED
@@ -1,27 +1,23 @@
1
- require 'apipie/client/base'
2
1
  require 'json'
3
2
  require 'yaml'
4
3
 
5
- Object.const_set("ForemanApi", client_module = Module.new do
4
+ module ForemanApi
6
5
  def self.client_config
7
- @client_config ||= YAML.load_file("#{root}/#{name}/config.yml")
6
+ @client_config ||= YAML.load_file("#{root}/foreman_api/config.yml")
8
7
  end
9
8
 
10
9
  def self.root
11
10
  @root ||= File.expand_path(File.dirname(__FILE__))
12
11
  end
13
12
 
14
- def self.name
15
- "foreman_api"
16
- end
17
-
18
13
  def self.doc
19
- @doc ||= File.open("#{root}/#{name}/documentation.json", 'r') do |f|
14
+ @doc ||= File.open("#{root}/foreman_api/documentation.json", 'r') do |f|
20
15
  JSON.load(f.read)['docs']
21
16
  end
22
17
  end
23
- end)
18
+ end
24
19
 
20
+ require 'foreman_api/base'
25
21
  require 'foreman_api/version'
26
- resource_files = Dir[File.expand_path("#{client_module.root}/#{client_module.name}/resources/*.rb", __FILE__)]
22
+ resource_files = Dir[File.expand_path("#{ForemanApi.root}/foreman_api/resources/*.rb", __FILE__)]
27
23
  resource_files.each { |f| require f }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-15 00:00:00.000000000 Z
12
+ date: 2013-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: apipie-rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 0.0.12
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ~>
28
- - !ruby/object:Gem::Version
29
- version: 0.0.12
30
14
  - !ruby/object:Gem::Dependency
31
15
  name: json
32
16
  requirement: !ruby/object:Gem::Requirement
@@ -82,12 +66,60 @@ executables: []
82
66
  extensions: []
83
67
  extra_rdoc_files: []
84
68
  files:
69
+ - .yardopts
85
70
  - Gemfile
86
71
  - MIT-LICENSE
87
72
  - README.rdoc
88
73
  - Rakefile
74
+ - doc/ForemanApi.html
75
+ - doc/ForemanApi/Resources.html
76
+ - doc/ForemanApi/Resources/Architecture.html
77
+ - doc/ForemanApi/Resources/Audit.html
78
+ - doc/ForemanApi/Resources/AuthSourceLdap.html
79
+ - doc/ForemanApi/Resources/Bookmark.html
80
+ - doc/ForemanApi/Resources/CommonParameter.html
81
+ - doc/ForemanApi/Resources/ComputeResource.html
82
+ - doc/ForemanApi/Resources/ConfigTemplate.html
83
+ - doc/ForemanApi/Resources/Dashboard.html
84
+ - doc/ForemanApi/Resources/Domain.html
85
+ - doc/ForemanApi/Resources/Environment.html
86
+ - doc/ForemanApi/Resources/FactValue.html
87
+ - doc/ForemanApi/Resources/Home.html
88
+ - doc/ForemanApi/Resources/Host.html
89
+ - doc/ForemanApi/Resources/Hostgroup.html
90
+ - doc/ForemanApi/Resources/Image.html
91
+ - doc/ForemanApi/Resources/LookupKey.html
92
+ - doc/ForemanApi/Resources/Medium.html
93
+ - doc/ForemanApi/Resources/Model.html
94
+ - doc/ForemanApi/Resources/OperatingSystem.html
95
+ - doc/ForemanApi/Resources/Ptable.html
96
+ - doc/ForemanApi/Resources/Puppetclass.html
97
+ - doc/ForemanApi/Resources/Report.html
98
+ - doc/ForemanApi/Resources/Role.html
99
+ - doc/ForemanApi/Resources/Setting.html
100
+ - doc/ForemanApi/Resources/SmartProxy.html
101
+ - doc/ForemanApi/Resources/Subnet.html
102
+ - doc/ForemanApi/Resources/TemplateKind.html
103
+ - doc/ForemanApi/Resources/User.html
104
+ - doc/ForemanApi/Resources/Usergroup.html
105
+ - doc/_index.html
106
+ - doc/class_list.html
107
+ - doc/css/common.css
108
+ - doc/css/full_list.css
109
+ - doc/css/style.css
110
+ - doc/file.MIT-LICENSE.html
111
+ - doc/file.README.html
112
+ - doc/file_list.html
113
+ - doc/frames.html
114
+ - doc/index.html
115
+ - doc/js/app.js
116
+ - doc/js/full_list.js
117
+ - doc/js/jquery.js
118
+ - doc/method_list.html
119
+ - doc/top-level-namespace.html
89
120
  - foreman_api.gemspec
90
121
  - lib/foreman_api.rb
122
+ - lib/foreman_api/base.rb
91
123
  - lib/foreman_api/config.yml
92
124
  - lib/foreman_api/documentation.json
93
125
  - lib/foreman_api/resources/architecture.rb
@@ -119,6 +151,7 @@ files:
119
151
  - lib/foreman_api/resources/template_kind.rb
120
152
  - lib/foreman_api/resources/user.rb
121
153
  - lib/foreman_api/resources/usergroup.rb
154
+ - lib/foreman_api/rest_client_oauth.rb
122
155
  - lib/foreman_api/version.rb
123
156
  homepage: http://github.com/mbacovsky/foreman_api
124
157
  licenses: []