foreman_api 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,32 @@
1
+ module ForemanApi
2
+ module Resources
3
+ class Subnet < ForemanApi::Base
4
+
5
+ def index(params = {}, headers = {})
6
+ validate_params!(params, ["search", "order"])
7
+ call(:get, "/api/subnets", :params => params, :headers => headers)
8
+ end
9
+
10
+ def create(params = {}, headers = {})
11
+ validate_params!(params, {"subnet"=>["name", "network", "mask", "gateway", "dns_primary", "dns_secondary", "from", "to", "vlanid", "domain_ids", "dhcp_id", "tftp_id", "dns_id"]})
12
+ call(:post, "/api/subnets", :payload => params, :headers => headers)
13
+ end
14
+
15
+ def update(id, params = {}, headers = {})
16
+ validate_params!(params, {"subnet"=>["name", "network", "mask", "gateway", "dns_primary", "dns_secondary", "from", "to", "vlanid", "domain_ids", "dhcp_id", "tftp_id", "dns_id"], "id"=>nil})
17
+ call(:put, "/api/subnets/#{id}", :payload => params, :headers => headers)
18
+ end
19
+
20
+ def destroy(id, params = {}, headers = {})
21
+ validate_params!(params, ["id"])
22
+ call(:delete, "/api/subnets/#{id}", :payload => params, :headers => headers)
23
+ end
24
+
25
+ def freeip(params = {}, headers = {})
26
+ validate_params!(params, ["subnet_id", "host_mac"])
27
+ call(:post, "/api/subnets/freeip", :payload => params, :headers => headers)
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module ForemanApi
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
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: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
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-28 00:00:00 Z
18
+ date: 2012-09-11 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json
@@ -87,6 +87,7 @@ files:
87
87
  - lib/foreman_api/resources/home.rb
88
88
  - lib/foreman_api/resources/medium.rb
89
89
  - lib/foreman_api/resources/operating_system.rb
90
+ - lib/foreman_api/resources/subnet.rb
90
91
  - lib/foreman_api/resources/user.rb
91
92
  - lib/foreman_api/rest_client_oauth.rb
92
93
  - lib/foreman_api/version.rb