abiquo-api 0.0.8 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a054271ccda4d0b19b097c712b29ec4f3a401463
4
- data.tar.gz: 135e931e30cac682eae1ee09633fcb0743ab28fc
3
+ metadata.gz: '081649fb6f2d19e5513bf3b9882819c30d16bbd1'
4
+ data.tar.gz: 63a0c58e1add09477c713902fa2d635469ddf599
5
5
  SHA512:
6
- metadata.gz: 6c0ebbb960493f8a4aca567a0ae736298b08b48226f6636f2f423ba287b6a76d1ecb49c90ad27e50ad11fa9aaa908c4001d4a0687e1bc8d4807fc82397251ae8
7
- data.tar.gz: 07e6edd5d3bdeda4bea005c98f57fcb3cc44a86426b574e593fd2be6c002e30d7945d32e3b79a2087115af4cde4cfd49364cc6e8f342dc194138b54e08188edf
6
+ metadata.gz: abe73a4ea3d1aa60337299cd9b956f0033e63cdf2c7118319180b5e93d93946d41624a3ac6e8b3087f1d09422034c542d2b285c39508bd5dc2353f399f05175f
7
+ data.tar.gz: 76853b77d605f04a5fbe0f48b934944ba4492a4934d2df7b4194d34c1b86005467a5ca7f5a318c3b68773549841a158509f893d486015457fe64e4a8fe0ca455
data/README.md CHANGED
@@ -28,25 +28,41 @@ Or, if you want to force a specific API version:
28
28
  require 'abiquo-api'
29
29
 
30
30
  abq = AbiquoAPI.new(:abiquo_api_url => 'https://10.60.13.40/api',
31
- :abiquo_username => "admin",
32
- :abiquo_password => "xabiquo",
33
- :version => "2.9")
31
+ :abiquo_username => "admin",
32
+ :abiquo_password => "xabiquo",
33
+ :version => "2.9")
34
+ ```
35
+
36
+ You can also define some connection parameters that will be applied to the underlying Faraday HTTP connection:
37
+
38
+ ```ruby
39
+ require 'abiquo-api'
40
+
41
+ abq = AbiquoAPI.new(:abiquo_api_url => 'https://10.60.13.40/api',
42
+ :abiquo_username => "admin",
43
+ :abiquo_password => "xabiquo",
44
+ :connection_options => {
45
+ :ssl => {
46
+ :verify => false
47
+ }
48
+ })
34
49
  ```
35
50
 
36
- You can also define some connection parameters that will be applied to HTTP connection:
51
+ Or, you can also use OAuth credentials:
37
52
 
38
53
  ```ruby
39
54
  require 'abiquo-api'
40
55
 
41
56
  abq = AbiquoAPI.new(:abiquo_api_url => 'https://10.60.13.40/api',
42
- :abiquo_username => "admin",
43
- :abiquo_password => "xabiquo",
44
- :connection_options => {
45
- :connect_timeout => 30,
46
- :read_timeout => 120,
47
- :write_timeout => 120,
48
- :ssl_verify_peer => true,
49
- :ssl_ca_path => "/etc/pki/tls/private/myCA.crt" })
57
+ :abiquo_api_key => "somekey",
58
+ :abiquo_api_secret => "somesecret",
59
+ :abiquo_token_key => "sometoken",
60
+ :abiquo_token_secret => "sometokensecret",
61
+ :connection_options => {
62
+ :ssl => {
63
+ :verify => false
64
+ }
65
+ })
50
66
  ```
51
67
 
52
68
  Then you can start browsing the API:
@@ -200,8 +200,6 @@ class AbiquoAPI
200
200
  ctype = options[:content].nil? ? link.type : options.delete(:content)
201
201
  accept = options[:accept].nil? ? link.type : options.delete(:accept)
202
202
 
203
- data = data.to_json if data.respond_to?('to_json')
204
-
205
203
  req_hash = {
206
204
  :expects => [200, 201, 202, 204],
207
205
  :method => 'POST',
@@ -243,7 +241,7 @@ class AbiquoAPI
243
241
  :expects => [200, 201, 202, 204],
244
242
  :method => 'PUT',
245
243
  :path => link.href,
246
- :body => data.to_json,
244
+ :body => data,
247
245
  :query => options
248
246
  }
249
247
 
@@ -1,3 +1,3 @@
1
1
  module AbiquoAPIClient
2
- VERSION = '0.0.8'
2
+ VERSION = '0.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: abiquo-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Cirauqui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-02 00:00:00.000000000 Z
11
+ date: 2017-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon