foreman_api 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,12 +12,12 @@ module ForemanApi
12
12
  end
13
13
 
14
14
  def create(params = {}, headers = {})
15
- validate_params!(params, {"config_template"=>["name", "template", "snippet", "audit_comment", "template_kind_id", "template_combinations_attributes"]})
15
+ validate_params!(params, {"config_template"=>["name", "template", "snippet", "audit_comment", "template_kind_id", "template_combinations_attributes", "operatingsystem_ids"]})
16
16
  call(:post, "/api/config_templates", :payload => params, :headers => headers)
17
17
  end
18
18
 
19
19
  def update(id, params = {}, headers = {})
20
- validate_params!(params, {"config_template"=>["name", "template", "snippet", "audit_comment", "template_kind_id", "template_combinations_attributes"]})
20
+ validate_params!(params, {"config_template"=>["name", "template", "snippet", "audit_comment", "template_kind_id", "template_combinations_attributes", "operatingsystem_ids"]})
21
21
  call(:put, "/api/config_templates/#{id}", :payload => params, :headers => headers)
22
22
  end
23
23
 
@@ -0,0 +1,12 @@
1
+ module ForemanApi
2
+ module Resources
3
+ class Dashboard < ForemanApi::Base
4
+
5
+ def index(params = {}, headers = {})
6
+ validate_params!(params, ["search"])
7
+ call(:get, "/api/dashboard", :params => params, :headers => headers)
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,30 @@
1
+ module ForemanApi
2
+ module Resources
3
+ class Environment < ForemanApi::Base
4
+
5
+ def index(params = {}, headers = {})
6
+ validate_params!(params, ["search", "order"])
7
+ call(:get, "/api/environments", :params => params, :headers => headers)
8
+ end
9
+
10
+ def show(id, params = {}, headers = {})
11
+ call(:get, "/api/environments/#{id}", :headers => headers)
12
+ end
13
+
14
+ def create(params = {}, headers = {})
15
+ validate_params!(params, {"environment"=>["name"]})
16
+ call(:post, "/api/environments", :payload => params, :headers => headers)
17
+ end
18
+
19
+ def update(id, params = {}, headers = {})
20
+ validate_params!(params, {"environment"=>["name"]})
21
+ call(:put, "/api/environments/#{id}", :payload => params, :headers => headers)
22
+ end
23
+
24
+ def destroy(id, params = {}, headers = {})
25
+ call(:delete, "/api/environments/#{id}", :headers => headers)
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,30 @@
1
+ module ForemanApi
2
+ module Resources
3
+ class Medium < ForemanApi::Base
4
+
5
+ def index(params = {}, headers = {})
6
+ validate_params!(params, ["search", "order"])
7
+ call(:get, "/api/media", :params => params, :headers => headers)
8
+ end
9
+
10
+ def show(id, params = {}, headers = {})
11
+ call(:get, "/api/media/#{id}", :headers => headers)
12
+ end
13
+
14
+ def create(params = {}, headers = {})
15
+ validate_params!(params, {"medium"=>["name", "path", "os_family"]})
16
+ call(:post, "/api/medium", :payload => params, :headers => headers)
17
+ end
18
+
19
+ def update(id, params = {}, headers = {})
20
+ validate_params!(params, {"medium"=>["name", "path", "os_family"]})
21
+ call(:put, "/api/media/#{id}", :payload => params, :headers => headers)
22
+ end
23
+
24
+ def destroy(id, params = {}, headers = {})
25
+ call(:delete, "/api/media/#{id}", :headers => headers)
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -11,12 +11,12 @@ module ForemanApi
11
11
  end
12
12
 
13
13
  def create(params = {}, headers = {})
14
- validate_params!(params, {"user"=>["login", "firstname", "lastname", "mail", "admin", "password", "auth_source_id"]})
14
+ validate_params!(params, {"user"=>["login", "firstname", "lastname", "mail", "admin"]})
15
15
  call(:post, "/api/users", :payload => params, :headers => headers)
16
16
  end
17
17
 
18
18
  def update(id, params = {}, headers = {})
19
- validate_params!(params, {"user"=>["login", "firstname", "lastname", "mail", "admin", "password"]})
19
+ validate_params!(params, {"user"=>["login", "firstname", "lastname", "mail", "admin"]})
20
20
  call(:put, "/api/users/#{id}", :payload => params, :headers => headers)
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module ForemanApi
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Martin Ba\xC4\x8Dovsk\xC3\xBD"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-08-14 00:00:00 Z
18
+ date: 2012-08-28 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json
@@ -81,8 +81,11 @@ files:
81
81
  - lib/foreman_api/resources/architecture.rb
82
82
  - lib/foreman_api/resources/bookmark.rb
83
83
  - lib/foreman_api/resources/config_template.rb
84
+ - lib/foreman_api/resources/dashboard.rb
84
85
  - lib/foreman_api/resources/domain.rb
86
+ - lib/foreman_api/resources/environment.rb
85
87
  - lib/foreman_api/resources/home.rb
88
+ - lib/foreman_api/resources/medium.rb
86
89
  - lib/foreman_api/resources/operating_system.rb
87
90
  - lib/foreman_api/resources/user.rb
88
91
  - lib/foreman_api/rest_client_oauth.rb