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.
- data/.yardopts +4 -0
- data/Gemfile +5 -0
- data/README.rdoc +23 -4
- data/doc/ForemanApi/Resources/Architecture.html +902 -0
- data/doc/ForemanApi/Resources/Audit.html +500 -0
- data/doc/ForemanApi/Resources/AuthSourceLdap.html +916 -0
- data/doc/ForemanApi/Resources/Bookmark.html +884 -0
- data/doc/ForemanApi/Resources/CommonParameter.html +902 -0
- data/doc/ForemanApi/Resources/ComputeResource.html +940 -0
- data/doc/ForemanApi/Resources/ConfigTemplate.html +1160 -0
- data/doc/ForemanApi/Resources/Dashboard.html +336 -0
- data/doc/ForemanApi/Resources/Domain.html +914 -0
- data/doc/ForemanApi/Resources/Environment.html +898 -0
- data/doc/ForemanApi/Resources/FactValue.html +375 -0
- data/doc/ForemanApi/Resources/Home.html +417 -0
- data/doc/ForemanApi/Resources/Host.html +1091 -0
- data/doc/ForemanApi/Resources/Hostgroup.html +934 -0
- data/doc/ForemanApi/Resources/Image.html +963 -0
- data/doc/ForemanApi/Resources/LookupKey.html +918 -0
- data/doc/ForemanApi/Resources/Medium.html +920 -0
- data/doc/ForemanApi/Resources/Model.html +910 -0
- data/doc/ForemanApi/Resources/OperatingSystem.html +1057 -0
- data/doc/ForemanApi/Resources/Ptable.html +906 -0
- data/doc/ForemanApi/Resources/Puppetclass.html +898 -0
- data/doc/ForemanApi/Resources/Report.html +625 -0
- data/doc/ForemanApi/Resources/Role.html +872 -0
- data/doc/ForemanApi/Resources/Setting.html +641 -0
- data/doc/ForemanApi/Resources/SmartProxy.html +889 -0
- data/doc/ForemanApi/Resources/Subnet.html +954 -0
- data/doc/ForemanApi/Resources/TemplateKind.html +349 -0
- data/doc/ForemanApi/Resources/User.html +920 -0
- data/doc/ForemanApi/Resources/Usergroup.html +872 -0
- data/doc/ForemanApi/Resources.html +117 -0
- data/doc/ForemanApi.html +117 -0
- data/doc/_index.html +449 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.MIT-LICENSE.html +93 -0
- data/doc/file.README.html +129 -0
- data/doc/file_list.html +58 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +129 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1300 -0
- data/doc/top-level-namespace.html +112 -0
- data/foreman_api.gemspec +5 -2
- data/lib/foreman_api/base.rb +129 -0
- data/lib/foreman_api/resources/architecture.rb +17 -7
- data/lib/foreman_api/resources/audit.rb +7 -4
- data/lib/foreman_api/resources/auth_source_ldap.rb +35 -7
- data/lib/foreman_api/resources/bookmark.rb +19 -7
- data/lib/foreman_api/resources/common_parameter.rb +17 -7
- data/lib/foreman_api/resources/compute_resource.rb +33 -7
- data/lib/foreman_api/resources/config_template.rb +28 -9
- data/lib/foreman_api/resources/dashboard.rb +3 -3
- data/lib/foreman_api/resources/domain.rb +21 -7
- data/lib/foreman_api/resources/environment.rb +15 -7
- data/lib/foreman_api/resources/fact_value.rb +6 -3
- data/lib/foreman_api/resources/home.rb +2 -4
- data/lib/foreman_api/resources/host.rb +50 -8
- data/lib/foreman_api/resources/hostgroup.rb +33 -7
- data/lib/foreman_api/resources/image.rb +30 -7
- data/lib/foreman_api/resources/lookup_key.rb +25 -7
- data/lib/foreman_api/resources/medium.rb +19 -7
- data/lib/foreman_api/resources/model.rb +21 -7
- data/lib/foreman_api/resources/operating_system.rb +26 -8
- data/lib/foreman_api/resources/ptable.rb +19 -7
- data/lib/foreman_api/resources/puppetclass.rb +15 -7
- data/lib/foreman_api/resources/report.rb +8 -5
- data/lib/foreman_api/resources/role.rb +13 -7
- data/lib/foreman_api/resources/setting.rb +11 -5
- data/lib/foreman_api/resources/smart_proxy.rb +16 -7
- data/lib/foreman_api/resources/subnet.rb +39 -7
- data/lib/foreman_api/resources/template_kind.rb +4 -3
- data/lib/foreman_api/resources/user.rb +26 -7
- data/lib/foreman_api/resources/usergroup.rb +13 -7
- data/lib/foreman_api/rest_client_oauth.rb +19 -0
- data/lib/foreman_api/version.rb +1 -1
- data/lib/foreman_api.rb +6 -10
- metadata +51 -18
@@ -1,12 +1,13 @@
|
|
1
1
|
module ForemanApi
|
2
2
|
module Resources
|
3
|
-
class Usergroup <
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
data/lib/foreman_api/version.rb
CHANGED
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
|
-
|
4
|
+
module ForemanApi
|
6
5
|
def self.client_config
|
7
|
-
@client_config ||= YAML.load_file("#{root}
|
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}
|
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("#{
|
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.
|
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-
|
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: []
|