foreman_api 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,11 @@ module ForemanApi
2
2
  module Resources
3
3
  class Architecture < ForemanApi::Base
4
4
 
5
- def index(headers = {})
5
+ def index(params = {}, headers = {})
6
6
  call(:get, "/api/architectures", :headers => headers)
7
7
  end
8
8
 
9
- def show(id, headers = {})
9
+ def show(id, params = {}, headers = {})
10
10
  call(:get, "/api/architectures/#{id}", :headers => headers)
11
11
  end
12
12
 
@@ -20,7 +20,7 @@ module ForemanApi
20
20
  call(:put, "/api/architectures/#{id}", :payload => params, :headers => headers)
21
21
  end
22
22
 
23
- def destroy(id, headers = {})
23
+ def destroy(id, params = {}, headers = {})
24
24
  call(:delete, "/api/architectures/#{id}", :headers => headers)
25
25
  end
26
26
 
@@ -2,11 +2,11 @@ module ForemanApi
2
2
  module Resources
3
3
  class Bookmark < ForemanApi::Base
4
4
 
5
- def index(headers = {})
5
+ def index(params = {}, headers = {})
6
6
  call(:get, "/api/bookmarks", :headers => headers)
7
7
  end
8
8
 
9
- def show(id, headers = {})
9
+ def show(id, params = {}, headers = {})
10
10
  call(:get, "/api/bookmarks/#{id}", :headers => headers)
11
11
  end
12
12
 
@@ -20,7 +20,7 @@ module ForemanApi
20
20
  call(:put, "/api/bookmarks/#{id}", :payload => params, :headers => headers)
21
21
  end
22
22
 
23
- def destroy(id, headers = {})
23
+ def destroy(id, params = {}, headers = {})
24
24
  call(:delete, "/api/bookmarks/#{id}", :headers => headers)
25
25
  end
26
26
 
@@ -0,0 +1,39 @@
1
+ module ForemanApi
2
+ module Resources
3
+ class ConfigTemplate < ForemanApi::Base
4
+
5
+ def index(params = {}, headers = {})
6
+ validate_params!(params, ["search", "order"])
7
+ call(:get, "/api/config_templates", :params => params, :headers => headers)
8
+ end
9
+
10
+ def show(id, params = {}, headers = {})
11
+ call(:get, "/api/config_templates/#{id}", :headers => headers)
12
+ end
13
+
14
+ def create(params = {}, headers = {})
15
+ validate_params!(params, {"config_template"=>["name", "template", "snippet", "audit_comment", "template_kind_id", "template_combinations_attributes"]})
16
+ call(:post, "/api/config_templates", :payload => params, :headers => headers)
17
+ end
18
+
19
+ def update(id, params = {}, headers = {})
20
+ validate_params!(params, {"config_template"=>["name", "template", "snippet", "audit_comment", "template_kind_id", "template_combinations_attributes"]})
21
+ call(:put, "/api/config_templates/#{id}", :payload => params, :headers => headers)
22
+ end
23
+
24
+ def revision(params = {}, headers = {})
25
+ validate_params!(params, ["version"])
26
+ call(:get, "/api/config_templates/revision", :params => params, :headers => headers)
27
+ end
28
+
29
+ def destroy(id, params = {}, headers = {})
30
+ call(:delete, "/api/config_templates/#{id}", :headers => headers)
31
+ end
32
+
33
+ def build_pxe_default(params = {}, headers = {})
34
+ call(:get, "/api/config_templates/build_pxe_default", :headers => headers)
35
+ end
36
+
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,30 @@
1
+ module ForemanApi
2
+ module Resources
3
+ class Domain < ForemanApi::Base
4
+
5
+ def index(params = {}, headers = {})
6
+ validate_params!(params, ["search", "order"])
7
+ call(:get, "/api/domains", :params => params, :headers => headers)
8
+ end
9
+
10
+ def show(id, params = {}, headers = {})
11
+ call(:get, "/api/domains/#{id}", :headers => headers)
12
+ end
13
+
14
+ def create(params = {}, headers = {})
15
+ validate_params!(params, {"domain"=>["name", "fullname", "dns_id", "domain_parameters_attributes"]})
16
+ call(:post, "/api/domains", :payload => params, :headers => headers)
17
+ end
18
+
19
+ def update(id, params = {}, headers = {})
20
+ validate_params!(params, {"domain"=>["name", "fullname", "dns_id", "domain_parameters_attributes"]})
21
+ call(:put, "/api/domains/#{id}", :payload => params, :headers => headers)
22
+ end
23
+
24
+ def destroy(id, params = {}, headers = {})
25
+ call(:delete, "/api/domains/#{id}", :headers => headers)
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -2,11 +2,11 @@ module ForemanApi
2
2
  module Resources
3
3
  class Home < ForemanApi::Base
4
4
 
5
- def index(headers = {})
5
+ def index(params = {}, headers = {})
6
6
  call(:get, "/api", :headers => headers)
7
7
  end
8
8
 
9
- def status(headers = {})
9
+ def status(params = {}, headers = {})
10
10
  call(:get, "/api/status", :headers => headers)
11
11
  end
12
12
 
@@ -2,11 +2,11 @@ module ForemanApi
2
2
  module Resources
3
3
  class OperatingSystem < ForemanApi::Base
4
4
 
5
- def index(headers = {})
5
+ def index(params = {}, headers = {})
6
6
  call(:get, "/api/operatingsystems", :headers => headers)
7
7
  end
8
8
 
9
- def show(id, headers = {})
9
+ def show(id, params = {}, headers = {})
10
10
  call(:get, "/api/operatingsystems/#{id}", :headers => headers)
11
11
  end
12
12
 
@@ -20,7 +20,7 @@ module ForemanApi
20
20
  call(:put, "/api/operatingsystems/#{id}", :payload => params, :headers => headers)
21
21
  end
22
22
 
23
- def destroy(id, headers = {})
23
+ def destroy(id, params = {}, headers = {})
24
24
  call(:delete, "/api/operatingsystems/#{id}", :headers => headers)
25
25
  end
26
26
 
@@ -2,11 +2,11 @@ module ForemanApi
2
2
  module Resources
3
3
  class User < ForemanApi::Base
4
4
 
5
- def index(headers = {})
5
+ def index(params = {}, headers = {})
6
6
  call(:get, "/api/users", :headers => headers)
7
7
  end
8
8
 
9
- def show(id, headers = {})
9
+ def show(id, params = {}, headers = {})
10
10
  call(:get, "/api/users/#{id}", :headers => headers)
11
11
  end
12
12
 
@@ -20,7 +20,7 @@ module ForemanApi
20
20
  call(:put, "/api/users/#{id}", :payload => params, :headers => headers)
21
21
  end
22
22
 
23
- def destroy(id, headers = {})
23
+ def destroy(id, params = {}, headers = {})
24
24
  call(:delete, "/api/users/#{id}", :headers => headers)
25
25
  end
26
26
 
@@ -1,3 +1,3 @@
1
1
  module ForemanApi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,102 @@
1
+ %global gem_name foreman_api
2
+
3
+ %if 0%{?rhel} == 6 || 0%{?fedora} < 17
4
+ %define rubyabi 1.8
5
+ %else
6
+ %define rubyabi 1.9.1
7
+ %endif
8
+
9
+ %if 0%{?rhel} == 6
10
+ %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
11
+ %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}
12
+ %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem
13
+ %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec
14
+ %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}
15
+ %endif
16
+
17
+ Summary: Ruby bindings for Forman's rest API
18
+ Name: rubygem-%{gem_name}
19
+ Version: 0.0.3
20
+ Release: 1%{?dist}
21
+ Group: Development/Languages
22
+ License: MIT
23
+ URL: http://github.com/theforeman/foreman_api
24
+ Source0: http://rubygems.org/downloads/%{gem_name}-%{version}.gem
25
+ Requires: ruby(abi) = %{rubyabi}
26
+ Requires: ruby(rubygems)
27
+ Requires: rubygem(json)
28
+ Requires: rubygem(rest-client) >= 1.6.1
29
+ Requires: rubygem(oauth)
30
+ BuildRequires: ruby(abi) = %{rubyabi}
31
+ BuildRequires: ruby(rubygems)
32
+
33
+ %if 0%{?fedora}
34
+ BuildRequires: rubygems-devel
35
+ %endif
36
+
37
+ BuildArch: noarch
38
+ Provides: rubygem(%{gem_name}) = %{version}
39
+
40
+ %description
41
+ Helps you to use Foreman's API calls from your app.
42
+
43
+ %package doc
44
+ BuildArch: noarch
45
+ Requires: %{name} = %{version}-%{release}
46
+ Summary: Documentation for rubygem-%{gem_name}
47
+
48
+ %description doc
49
+ This package contains documentation for rubygem-%{gem_name}.
50
+
51
+ %prep
52
+ gem unpack %{SOURCE0}
53
+ %setup -q -D -T -n %{gem_name}-%{version}
54
+
55
+ gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
56
+
57
+
58
+ %build
59
+ mkdir -p .%{gem_dir}
60
+ gem install --local --install-dir .%{gem_dir} \
61
+ --force --rdoc --no-ri %{SOURCE0}
62
+
63
+ %install
64
+ mkdir -p %{buildroot}%{gem_dir}
65
+ cp -a .%{gem_dir}/* \
66
+ %{buildroot}%{gem_dir}/
67
+ mv %{buildroot}%{gem_instdir}/{MIT-LICENSE,README.rdoc} ./
68
+ rm -f %{buildroot}%{gem_instdir}/%{gem_name}.gemspec
69
+
70
+ %files
71
+ %dir %{gem_instdir}
72
+ %{gem_instdir}/lib
73
+ %{gem_cache}
74
+ %{gem_spec}
75
+
76
+ %doc MIT-LICENSE README.rdoc
77
+
78
+ %files doc
79
+ %{gem_docdir}
80
+ %{gem_instdir}/Gemfile
81
+ %{gem_instdir}/Rakefile
82
+
83
+
84
+ %changelog
85
+ * Tue Aug 14 2012 Martin Bacovsky <mbacovsk@redhat.com> 0.0.3-1
86
+ - Updated to 0.0.3
87
+ - added domains and config_templates
88
+
89
+ * Tue Aug 14 2012 Martin Bačovský <mbacovsk@redhat.com> 0.0.2-1
90
+ - Updated gem to 0.0.2 (mbacovsk@redhat.com)
91
+
92
+ * Mon Aug 13 2012 Miroslav Suchý <msuchy@redhat.com> 0.0.1-4
93
+ - for rubyabi do s/1.9/1.9.1/ (msuchy@redhat.com)
94
+
95
+ * Mon Aug 13 2012 Martin Bačovský <mbacovsk@redhat.com> 0.0.1-3
96
+ - Fixed failing spec removal (mbacovsk@redhat.com)
97
+
98
+ * Mon Aug 13 2012 Martin Bačovský <mbacovsk@redhat.com> 0.0.1-2
99
+ - new package built with tito
100
+
101
+ * Wed Aug 08 2012 Martin Bacovsky <mbacovsk@redhat.com> - 0.0.1-1
102
+ - Initial package
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Martin Ba\xC4\x8Dovsk\xC3\xBD"
@@ -80,11 +80,14 @@ files:
80
80
  - lib/foreman_api/base.rb
81
81
  - lib/foreman_api/resources/architecture.rb
82
82
  - lib/foreman_api/resources/bookmark.rb
83
+ - lib/foreman_api/resources/config_template.rb
84
+ - lib/foreman_api/resources/domain.rb
83
85
  - lib/foreman_api/resources/home.rb
84
86
  - lib/foreman_api/resources/operating_system.rb
85
87
  - lib/foreman_api/resources/user.rb
86
88
  - lib/foreman_api/rest_client_oauth.rb
87
89
  - lib/foreman_api/version.rb
90
+ - rubygem-foreman_api.spec
88
91
  homepage: http://github.com/mbacovsky/foreman_api
89
92
  licenses: []
90
93