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
@@ -0,0 +1,112 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Top Level Namespace
8
+
9
+ &mdash; Documentation by YARD 0.8.3
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!" + escape(window.location.href);
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+
36
+
37
+ <span class="title">Top Level Namespace</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Top Level Namespace
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ </dl>
82
+ <div class="clear"></div>
83
+
84
+ <h2>Defined Under Namespace</h2>
85
+ <p class="children">
86
+
87
+
88
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="ForemanApi.html" title="ForemanApi (module)">ForemanApi</a></span>
89
+
90
+
91
+
92
+
93
+ </p>
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+ </div>
104
+
105
+ <div id="footer">
106
+ Generated on Mon Jan 21 15:44:34 2013 by
107
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
108
+ 0.8.3 (ruby-1.9.3).
109
+ </div>
110
+
111
+ </body>
112
+ </html>
data/foreman_api.gemspec CHANGED
@@ -10,12 +10,15 @@ Gem::Specification.new do |gem|
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
13
- gem.files.reject! { |fn| fn == 'rubygem-foreman_api.spec' }
13
+ gem.files.reject! do |fn|
14
+ fn.start_with?("lib/foreman_api/generator") ||
15
+ fn == 'bin/generate.rb' ||
16
+ fn == 'rubygem-foreman_api.spec'
17
+ end
14
18
  gem.name = "foreman_api"
15
19
  gem.require_paths = ["lib"]
16
20
  gem.version = ForemanApi::VERSION
17
21
 
18
- gem.add_dependency 'apipie-rails', '~> 0.0.12'
19
22
  gem.add_dependency 'json'
20
23
  gem.add_dependency 'rest-client', '>= 1.6.1'
21
24
  gem.add_dependency 'oauth'
@@ -0,0 +1,129 @@
1
+ require 'rest_client'
2
+ require 'oauth'
3
+ require 'json'
4
+ require 'foreman_api/rest_client_oauth'
5
+
6
+ module ForemanApi
7
+ class Base
8
+ attr_reader :client, :config
9
+
10
+ def initialize(config, options = { })
11
+ @client = RestClient::Resource.new config[:base_url],
12
+ :user => config[:username],
13
+ :password => config[:password],
14
+ :oauth => config[:oauth],
15
+ :headers => { :content_type => 'application/json',
16
+ :accept => 'application/json' }
17
+ @config = config
18
+ end
19
+
20
+ def call(method, path, params = { }, headers = { })
21
+ headers ||= { }
22
+
23
+ args = [method]
24
+ if [:post, :put].include?(method)
25
+ args << params.to_json
26
+ else
27
+ headers[:params] = params if params
28
+ end
29
+
30
+ args << headers if headers
31
+ process_data client[path].send(*args)
32
+ end
33
+
34
+ def self.doc
35
+ raise NotImplementedError
36
+ end
37
+
38
+ def self.validation_hash(method)
39
+ validation_hashes[method.to_s]
40
+ end
41
+
42
+ def self.method_doc(method)
43
+ method_docs[method.to_s]
44
+ end
45
+
46
+ def validate_params!(params, rules)
47
+ return unless params.is_a?(Hash)
48
+
49
+ invalid_keys = params.keys.map(&:to_s) - (rules.is_a?(Hash) ? rules.keys : rules)
50
+ raise ArgumentError, "Invalid keys: #{invalid_keys.join(", ")}" unless invalid_keys.empty?
51
+
52
+ if rules.is_a? Hash
53
+ rules.each do |key, sub_keys|
54
+ validate_params!(params[key], sub_keys) if params[key]
55
+ end
56
+ end
57
+ end
58
+
59
+ protected
60
+
61
+ def process_data(response)
62
+ data = begin
63
+ JSON.parse(response.body)
64
+ rescue JSON::ParserError
65
+ response.body
66
+ end
67
+ return data, response
68
+ end
69
+
70
+ def check_params(params, options = { })
71
+ raise ArgumentError unless (method = options[:method])
72
+ return unless config[:enable_validations]
73
+
74
+ case options[:allowed]
75
+ when true
76
+ validate_params!(params, self.class.validation_hash(method))
77
+ when false
78
+ raise ArgumentError, "this method '#{method}' does not support params" if params && !params.empty?
79
+ else
80
+ raise ArgumentError, "options :allowed should be true or false, it was #{options[:allowed]}"
81
+ end
82
+ end
83
+
84
+ # @return url and rest of the params
85
+ def fill_params_in_url(url, params)
86
+ params ||= { }
87
+ # insert param values
88
+ url_param_names = params_in_path(url)
89
+ url = params_in_path(url).inject(url) do |url, param_name|
90
+ param_value = params[param_name] or
91
+ raise ArgumentError, "missing param '#{param_name}' in parameters"
92
+ url.sub(":#{param_name}", param_value.to_s)
93
+ end
94
+
95
+ return url, params.reject { |param_name, _| url_param_names.include? param_name }
96
+ end
97
+
98
+ private
99
+
100
+ def self.method_docs
101
+ @method_docs ||= doc['methods'].inject({ }) do |hash, method|
102
+ hash[method['name']] = method
103
+ hash
104
+ end
105
+ end
106
+
107
+ def self.validation_hashes
108
+ @validation_hashes ||= method_docs.inject({ }) do |hash, pair|
109
+ name, method_doc = pair
110
+ hash[name] = construct_validation_hash method_doc
111
+ hash
112
+ end
113
+ end
114
+
115
+ def self.construct_validation_hash(method)
116
+ if method['params'].any? { |p| p['params'] }
117
+ method['params'].reduce({ }) do |h, p|
118
+ h.update(p['name'] => (p['params'] ? p['params'].map { |pp| pp['name'] } : nil))
119
+ end
120
+ else
121
+ method['params'].map { |p| p['name'] }
122
+ end
123
+ end
124
+
125
+ def params_in_path(url)
126
+ url.scan(/:([^\/]*)/).map { |m| m.first }
127
+ end
128
+ end
129
+ end
@@ -1,12 +1,15 @@
1
1
  module ForemanApi
2
2
  module Resources
3
- class Architecture < Apipie::Client::Base
3
+ class Architecture < ForemanApi::Base
4
4
  def self.doc
5
5
  @doc ||= ForemanApi.doc['resources']["architectures"]
6
6
  end
7
-
7
+
8
8
  # @param [Hash] params a hash of params to be passed to the service
9
- # allowed keys are: ["search", "order", "page", "per_page"]
9
+ # @option params [String] order Sort results
10
+ # @option params [String] page Paginate results
11
+ # @option params [String] per_page Number of entries per request
12
+ # @option params [String] search Filter results
10
13
  #
11
14
  # @param [Hash] headers additional http headers
12
15
  def index(params = { }, headers = { })
@@ -16,7 +19,7 @@ module ForemanApi
16
19
  end
17
20
 
18
21
  # @param [Hash] params a hash of params to be passed to the service
19
- # allowed keys are: ["id"]
22
+ # @option params [String] id
20
23
  #
21
24
  # @param [Hash] headers additional http headers
22
25
  def show(params = { }, headers = { })
@@ -26,7 +29,10 @@ module ForemanApi
26
29
  end
27
30
 
28
31
  # @param [Hash] params a hash of params to be passed to the service
29
- # allowed keys are: {"architecture"=>["name", "operatingsystem_ids"]}
32
+ # @option params [Hash] architecture
33
+ # allowed keys are:
34
+ # * name [String],
35
+ # * operatingsystem_ids [String] Operatingsystem id&#39;s ,
30
36
  #
31
37
  # @param [Hash] headers additional http headers
32
38
  def create(params = { }, headers = { })
@@ -36,7 +42,11 @@ module ForemanApi
36
42
  end
37
43
 
38
44
  # @param [Hash] params a hash of params to be passed to the service
39
- # allowed keys are: {"id"=>nil, "architecture"=>["name", "operatingsystem_ids"]}
45
+ # @option params [String] id
46
+ # @option params [Hash] architecture
47
+ # allowed keys are:
48
+ # * name [String],
49
+ # * operatingsystem_ids [String] Operatingsystem id&#39;s ,
40
50
  #
41
51
  # @param [Hash] headers additional http headers
42
52
  def update(params = { }, headers = { })
@@ -46,7 +56,7 @@ module ForemanApi
46
56
  end
47
57
 
48
58
  # @param [Hash] params a hash of params to be passed to the service
49
- # allowed keys are: ["id"]
59
+ # @option params [String] id
50
60
  #
51
61
  # @param [Hash] headers additional http headers
52
62
  def destroy(params = { }, headers = { })
@@ -1,12 +1,15 @@
1
1
  module ForemanApi
2
2
  module Resources
3
- class Audit < Apipie::Client::Base
3
+ class Audit < ForemanApi::Base
4
4
  def self.doc
5
5
  @doc ||= ForemanApi.doc['resources']["audits"]
6
6
  end
7
-
7
+
8
8
  # @param [Hash] params a hash of params to be passed to the service
9
- # allowed keys are: ["search", "order", "page", "per_page"]
9
+ # @option params [String] order Sort results
10
+ # @option params [String] page Paginate results
11
+ # @option params [String] per_page Number of entries per request
12
+ # @option params [String] search Filter results
10
13
  #
11
14
  # @param [Hash] headers additional http headers
12
15
  def index(params = { }, headers = { })
@@ -16,7 +19,7 @@ module ForemanApi
16
19
  end
17
20
 
18
21
  # @param [Hash] params a hash of params to be passed to the service
19
- # allowed keys are: ["id"]
22
+ # @option params [String] id
20
23
  #
21
24
  # @param [Hash] headers additional http headers
22
25
  def show(params = { }, headers = { })
@@ -1,12 +1,13 @@
1
1
  module ForemanApi
2
2
  module Resources
3
- class AuthSourceLdap < Apipie::Client::Base
3
+ class AuthSourceLdap < ForemanApi::Base
4
4
  def self.doc
5
5
  @doc ||= ForemanApi.doc['resources']["auth_source_ldaps"]
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,20 @@ 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: {"auth_source_ldap"=>["name", "host", "port", "account", "base_dn", "account_password", "attr_login", "attr_firstname", "attr_lastname", "attr_mail", "onthefly_register", "tls"]}
30
+ # @option params [Hash] auth_source_ldap
31
+ # allowed keys are:
32
+ # * account [String],
33
+ # * account_password [String] Required if onthefly_register is true ,
34
+ # * attr_firstname [String] Required if onthefly_register is true ,
35
+ # * attr_lastname [String] Required if onthefly_register is true ,
36
+ # * attr_login [String] Required if onthefly_register is true ,
37
+ # * attr_mail [String] Required if onthefly_register is true ,
38
+ # * base_dn [String],
39
+ # * host [String],
40
+ # * name [String],
41
+ # * onthefly_register [String],
42
+ # * port [String] Defaults to 389 ,
43
+ # * tls [String],
30
44
  #
31
45
  # @param [Hash] headers additional http headers
32
46
  def create(params = { }, headers = { })
@@ -36,7 +50,21 @@ module ForemanApi
36
50
  end
37
51
 
38
52
  # @param [Hash] params a hash of params to be passed to the service
39
- # allowed keys are: {"id"=>nil, "auth_source_ldap"=>["name", "host", "port", "account", "base_dn", "account_password", "attr_login", "attr_firstname", "attr_lastname", "attr_mail", "onthefly_register", "tls"]}
53
+ # @option params [String] id
54
+ # @option params [Hash] auth_source_ldap
55
+ # allowed keys are:
56
+ # * account [String],
57
+ # * account_password [String] Required if onthefly_register is true ,
58
+ # * attr_firstname [String] Required if onthefly_register is true ,
59
+ # * attr_lastname [String] Required if onthefly_register is true ,
60
+ # * attr_login [String] Required if onthefly_register is true ,
61
+ # * attr_mail [String] Required if onthefly_register is true ,
62
+ # * base_dn [String],
63
+ # * host [String],
64
+ # * name [String],
65
+ # * onthefly_register [String],
66
+ # * port [String] Defaults to 389 ,
67
+ # * tls [String],
40
68
  #
41
69
  # @param [Hash] headers additional http headers
42
70
  def update(params = { }, headers = { })
@@ -46,7 +74,7 @@ module ForemanApi
46
74
  end
47
75
 
48
76
  # @param [Hash] params a hash of params to be passed to the service
49
- # allowed keys are: ["id"]
77
+ # @option params [String] id
50
78
  #
51
79
  # @param [Hash] headers additional http headers
52
80
  def destroy(params = { }, headers = { })
@@ -1,12 +1,13 @@
1
1
  module ForemanApi
2
2
  module Resources
3
- class Bookmark < Apipie::Client::Base
3
+ class Bookmark < ForemanApi::Base
4
4
  def self.doc
5
5
  @doc ||= ForemanApi.doc['resources']["bookmarks"]
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,12 @@ 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: {"bookmark"=>["name", "controller", "query", "public"]}
30
+ # @option params [Hash] bookmark
31
+ # allowed keys are:
32
+ # * controller [String],
33
+ # * name [String],
34
+ # * public [String],
35
+ # * query [String],
30
36
  #
31
37
  # @param [Hash] headers additional http headers
32
38
  def create(params = { }, headers = { })
@@ -36,7 +42,13 @@ module ForemanApi
36
42
  end
37
43
 
38
44
  # @param [Hash] params a hash of params to be passed to the service
39
- # allowed keys are: {"id"=>nil, "bookmark"=>["name", "controller", "query", "public"]}
45
+ # @option params [String] id
46
+ # @option params [Hash] bookmark
47
+ # allowed keys are:
48
+ # * controller [String],
49
+ # * name [String],
50
+ # * public [String],
51
+ # * query [String],
40
52
  #
41
53
  # @param [Hash] headers additional http headers
42
54
  def update(params = { }, headers = { })
@@ -46,7 +58,7 @@ module ForemanApi
46
58
  end
47
59
 
48
60
  # @param [Hash] params a hash of params to be passed to the service
49
- # allowed keys are: ["id"]
61
+ # @option params [String] id
50
62
  #
51
63
  # @param [Hash] headers additional http headers
52
64
  def destroy(params = { }, headers = { })
@@ -1,12 +1,15 @@
1
1
  module ForemanApi
2
2
  module Resources
3
- class CommonParameter < Apipie::Client::Base
3
+ class CommonParameter < ForemanApi::Base
4
4
  def self.doc
5
5
  @doc ||= ForemanApi.doc['resources']["common_parameters"]
6
6
  end
7
-
7
+
8
8
  # @param [Hash] params a hash of params to be passed to the service
9
- # allowed keys are: ["search", "order", "page", "per_page"]
9
+ # @option params [String] order Sort results
10
+ # @option params [String] page Paginate results
11
+ # @option params [String] per_page Number of entries per request
12
+ # @option params [String] search Filter results
10
13
  #
11
14
  # @param [Hash] headers additional http headers
12
15
  def index(params = { }, headers = { })
@@ -16,7 +19,7 @@ module ForemanApi
16
19
  end
17
20
 
18
21
  # @param [Hash] params a hash of params to be passed to the service
19
- # allowed keys are: ["id"]
22
+ # @option params [String] id
20
23
  #
21
24
  # @param [Hash] headers additional http headers
22
25
  def show(params = { }, headers = { })
@@ -26,7 +29,10 @@ module ForemanApi
26
29
  end
27
30
 
28
31
  # @param [Hash] params a hash of params to be passed to the service
29
- # allowed keys are: {"common_parameter"=>["name", "value"]}
32
+ # @option params [Hash] common_parameter
33
+ # allowed keys are:
34
+ # * name [String],
35
+ # * value [String],
30
36
  #
31
37
  # @param [Hash] headers additional http headers
32
38
  def create(params = { }, headers = { })
@@ -36,7 +42,11 @@ module ForemanApi
36
42
  end
37
43
 
38
44
  # @param [Hash] params a hash of params to be passed to the service
39
- # allowed keys are: {"id"=>nil, "common_parameter"=>["name", "value"]}
45
+ # @option params [String] id
46
+ # @option params [Hash] common_parameter
47
+ # allowed keys are:
48
+ # * name [String],
49
+ # * value [String],
40
50
  #
41
51
  # @param [Hash] headers additional http headers
42
52
  def update(params = { }, headers = { })
@@ -46,7 +56,7 @@ module ForemanApi
46
56
  end
47
57
 
48
58
  # @param [Hash] params a hash of params to be passed to the service
49
- # allowed keys are: ["id"]
59
+ # @option params [String] id
50
60
  #
51
61
  # @param [Hash] headers additional http headers
52
62
  def destroy(params = { }, headers = { })
@@ -1,12 +1,15 @@
1
1
  module ForemanApi
2
2
  module Resources
3
- class ComputeResource < Apipie::Client::Base
3
+ class ComputeResource < ForemanApi::Base
4
4
  def self.doc
5
5
  @doc ||= ForemanApi.doc['resources']["compute_resources"]
6
6
  end
7
-
7
+
8
8
  # @param [Hash] params a hash of params to be passed to the service
9
- # allowed keys are: ["search", "order", "page", "per_page"]
9
+ # @option params [String] order Sort results
10
+ # @option params [String] page Paginate results
11
+ # @option params [String] per_page Number of entries per request
12
+ # @option params [String] search Filter results
10
13
  #
11
14
  # @param [Hash] headers additional http headers
12
15
  def index(params = { }, headers = { })
@@ -16,7 +19,7 @@ module ForemanApi
16
19
  end
17
20
 
18
21
  # @param [Hash] params a hash of params to be passed to the service
19
- # allowed keys are: ["id"]
22
+ # @option params [String] id
20
23
  #
21
24
  # @param [Hash] headers additional http headers
22
25
  def show(params = { }, headers = { })
@@ -26,7 +29,18 @@ module ForemanApi
26
29
  end
27
30
 
28
31
  # @param [Hash] params a hash of params to be passed to the service
29
- # allowed keys are: {"compute_resource"=>["name", "provider", "url", "description", "user", "password", "uuid", "region", "tenant", "server"]}
32
+ # @option params [Hash] compute_resource
33
+ # allowed keys are:
34
+ # * description [String],
35
+ # * name [String],
36
+ # * password [String] Password for ovirt, ec2, vmware, openstack. secret key for ec2 ,
37
+ # * provider [String] Providers include libvirt, ovirt, ec2, vmware, openstack, rackspace ,
38
+ # * region [String] For ec2 only ,
39
+ # * server [String] For vmware ,
40
+ # * tenant [String] For openstack only ,
41
+ # * url [String] Url for libvirt, ovirt, and openstack ,
42
+ # * user [String] Username for ovirt, ec2, vmware, openstack. access key for ec2. ,
43
+ # * uuid [String] For ovirt, vmware datacenter ,
30
44
  #
31
45
  # @param [Hash] headers additional http headers
32
46
  def create(params = { }, headers = { })
@@ -36,7 +50,19 @@ module ForemanApi
36
50
  end
37
51
 
38
52
  # @param [Hash] params a hash of params to be passed to the service
39
- # allowed keys are: {"id"=>nil, "compute_resource"=>["name", "provider", "url", "description", "user", "password", "uuid", "region", "tenant", "server"]}
53
+ # @option params [String] id
54
+ # @option params [Hash] compute_resource
55
+ # allowed keys are:
56
+ # * description [String],
57
+ # * name [String],
58
+ # * password [String] Password for ovirt, ec2, vmware, openstack. secret key for ec2 ,
59
+ # * provider [String] Providers include libvirt, ovirt, ec2, vmware, openstack, rackspace ,
60
+ # * region [String] For ec2 only ,
61
+ # * server [String] For vmware ,
62
+ # * tenant [String] For openstack only ,
63
+ # * url [String] Url for libvirt, ovirt, and openstack ,
64
+ # * user [String] Username for ovirt, ec2, vmware, openstack. access key for ec2. ,
65
+ # * uuid [String] For ovirt, vmware datacenter ,
40
66
  #
41
67
  # @param [Hash] headers additional http headers
42
68
  def update(params = { }, headers = { })
@@ -46,7 +72,7 @@ module ForemanApi
46
72
  end
47
73
 
48
74
  # @param [Hash] params a hash of params to be passed to the service
49
- # allowed keys are: ["id"]
75
+ # @option params [String] id
50
76
  #
51
77
  # @param [Hash] headers additional http headers
52
78
  def destroy(params = { }, headers = { })