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 +4 -4
- data/README.md +28 -12
- data/lib/abiquo-api.rb +1 -3
- data/lib/abiquo-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '081649fb6f2d19e5513bf3b9882819c30d16bbd1'
|
4
|
+
data.tar.gz: 63a0c58e1add09477c713902fa2d635469ddf599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
32
|
-
|
33
|
-
|
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
|
-
|
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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
:
|
48
|
-
|
49
|
-
|
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:
|
data/lib/abiquo-api.rb
CHANGED
@@ -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
|
244
|
+
:body => data,
|
247
245
|
:query => options
|
248
246
|
}
|
249
247
|
|
data/lib/abiquo-api/version.rb
CHANGED
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
|
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-
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|