voxel-hapi 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README +32 -0
  2. data/lib/hapi.rb +4 -0
  3. metadata +5 -4
data/README ADDED
@@ -0,0 +1,32 @@
1
+ voxel-hapi - Ruby Class interface to Voxel dot Net's hAPI (http://api.voxel.net/docs)
2
+
3
+ Command line tool, rhapi:
4
+
5
+ Usage: rhapi [OPTIONS] [METHOD PARAM]
6
+
7
+ -U, --username USERNAME hAPI Username
8
+ -P, --password PASSWORD hAPI Password
9
+ -H, --hostname HOSTNAME hAPI Server Hostname
10
+ -V, --version VERSION hAPI Version
11
+ --[no-]useauthkey Are username and password actually key and secret?
12
+ -m, --method METHOD hAPI Method Name
13
+ -y, --yaml-param PARAMFILE hAPI Method Paramaters in YAML Format (FILENAME)
14
+ -r, --repeat INTERVAL Should the method be repeated (loop time in seconds)
15
+ -o, --output-format FORMAT Output format (Defaults to Ruby Array/Hash)
16
+ -x, --[no-]debug Enable Debugging Output
17
+ -h, --help Displays help message
18
+
19
+ Examples:
20
+
21
+ rhapi -m voxel.images.list
22
+ rhapi -m voxel.voxservers.status device_id=12345 verbosity=extended
23
+
24
+ Class Library:
25
+
26
+ api = HAPI.new :username => 'jwb', :password => 'abc123'
27
+ api = HAPI.new :username => '0232432434234234234324324', :password => '342342341GH0030423234324', :useauthkey => true
28
+
29
+ devices = api.voxel_devices_list( :verbosity => 'extended' )
30
+ images_xml = api.voxel_images_list( { :verbosity => 'normal' }, { :format => :xml } )
31
+
32
+
data/lib/hapi.rb CHANGED
@@ -101,6 +101,10 @@ class HAPI
101
101
  voxcloud = voxel_voxcloud_status['devices']
102
102
  voxservers = voxel_voxservers_status['devices']
103
103
 
104
+ if voxservers['device'].is_a?(Hash)
105
+ voxservers['device'] = [ voxservers['device'] ]
106
+ end
107
+
104
108
  statuses = voxcloud['device'] unless voxcloud.empty?
105
109
  statuses += voxservers['device'] unless voxservers.empty?
106
110
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voxel-hapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-30 00:00:00.000000000Z
12
+ date: 2011-10-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xml-simple
16
- requirement: &14379380 !ruby/object:Gem::Requirement
16
+ requirement: &13591400 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.0.12
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *14379380
24
+ version_requirements: *13591400
25
25
  description:
26
26
  email: jwb@voxel.net
27
27
  executables:
@@ -32,6 +32,7 @@ files:
32
32
  - lib/hapi.rb
33
33
  - bin/rhapi
34
34
  - examples/hapirc.example
35
+ - README
35
36
  homepage: http://voxel.net/
36
37
  licenses: []
37
38
  post_install_message: