knife-voxel 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,16 +1,15 @@
1
1
  = Introduction =
2
2
 
3
- knife-voxel is a plugin for the tool 'knife', part of the configuration
4
- management system 'chef'. http://www.opscode.com/. It allows you to
5
- provision Voxel dot Net (www.voxel.net) cloud instances (physical as
6
- well as virtual) and then bootstrap them as chef clients.
3
+ knife-voxel is a plugin for the tool 'knife', part of the configuration management system 'chef'. http://www.opscode.com/. It allows you to provision Voxel dot Net (www.voxel.net) cloud instances (physical as well as virtual) and then bootstrap them as chef clients.
7
4
 
8
- This plugin is currently a work in progress, although all major
9
- functions should work as expected. The command set models Voxel's API
10
- hAPI (http://api.voxel.net/docs/) . We depend on the voxel-hapi
11
- library for access to this API. This will be replaced with a fog provider
12
- based backend in the future.
5
+ This plugin is currently a work in progress, although all major functions should work as expected. The command set models Voxel's API hAPI (http://api.voxel.net/docs/) . We depend on the voxel-hapi library for access to this API. This will be replaced with a fog provider based backend in the future.
13
6
 
7
+ = Authentication =
8
+
9
+ Authentication can be handled in a few different ways. For each command you can pass --voxel-api-key and --voxel-api-secret with your corresponding hAPI key/secret pair. Or if you prefer, you can utilize your username and password via the --voxel-api-username and --voxel-api-password parameters. Both of these parameter sets can be specified in a knife.rb file, saving you the trouble of entering them each time at the command line. We suggest using a stored authkey/secret pair rather than a username and password when placing these options in knife.rb. The syntax is:
10
+
11
+ knife[:voxel_api_key] = '01234567890'
12
+ knife[:voxel_api_secret] = '09876543210'
14
13
 
15
14
  = Usage =
16
15
 
@@ -22,7 +21,8 @@ knife voxel voxcloud create (options)
22
21
  knife voxel devices list (options)
23
22
  knife voxel voxservers delete DEVICE_ID (options)
24
23
  knife voxel voxservers create (options)
25
-
24
+ knife voxel voxcloud facilities list
25
+ knife voxel voxservers facilities list
26
26
 
27
27
  = Examples =
28
28
 
@@ -11,7 +11,7 @@ class Chef
11
11
  end
12
12
 
13
13
  def run
14
- devices = [ ui.color('ID', :bold), ui.color('Name', :bold), ui.color('Type', :bold), ui.color('Status', :bold), ui.color('IP', :bold) ]
14
+ devices = [ ui.color('ID', :bold), ui.color('Name', :bold), ui.color('Type', :bold), ui.color('Status', :bold), ui.color('Facility', :bold), ui.color('IP', :bold) ]
15
15
  statuses = hapi.helper_devices_status
16
16
 
17
17
  devices_list = hapi.voxel_devices_list['devices']
@@ -33,6 +33,8 @@ class Chef
33
33
 
34
34
  devices << (statuses.has_key?(device['id']) ? statuses[device['id']] : "N/A")
35
35
 
36
+ devices << ( device.has_key?('location') ? device['location']['facility']['code'] : "N/A")
37
+
36
38
  if device.has_key?('ipassignments')
37
39
  ips = device['ipassignments']['ipassignment']
38
40
 
@@ -49,7 +51,7 @@ class Chef
49
51
  end
50
52
  end
51
53
 
52
- puts ui.list(devices, :columns_across, 5)
54
+ puts ui.list(devices, :columns_across, 6)
53
55
  end
54
56
  end
55
57
  end
@@ -180,8 +180,17 @@ class Chef
180
180
 
181
181
  bootstrap_for_node(device).run
182
182
 
183
- puts "#{ui.color("Environment", :cyan)}: #{config[:environment] || '_default'}"
184
183
  puts "#{ui.color("Run List", :cyan)}: #{config[:run_list].join(', ')}"
184
+ puts "#{ui.color("Node Name", :cyan)}: #{config[:node_name] || 'd' + device['id']}"
185
+ puts "#{ui.color("Environment", :cyan)}: #{config[:environment] || '_default'}"
186
+ puts "#{ui.color("Device ID", :cyan)}: #{device['id']}"
187
+ puts "#{ui.color("Name", :cyan)}: #{device['label']}"
188
+ puts "#{ui.color("Image Id", :cyan)}: #{config[:image_id]}"
189
+ puts "#{ui.color("Facility", :cyan)}: #{device['location']['facility']['code']}"
190
+ puts "#{ui.color("Public IP Address", :cyan)}: #{device['ipassignments']['ipassignment'].select { |i| i['type'] == 'frontend' }.first['content']}"
191
+ puts "#{ui.color("Private IP Address", :cyan)}: #{device['ipassignments']['ipassignment'].select { |i| i['type'] == 'backend' }.first['content']}"
192
+ puts "#{ui.color("Root Password", :cyan)}: #{device['accessmethods']['accessmethod'].select { |a| a['type'] == 'admin' }.first['password']}"
193
+
185
194
  end
186
195
  end
187
196
  end
@@ -0,0 +1,23 @@
1
+ require 'chef/knife/voxel_base'
2
+
3
+ class Chef
4
+ class Knife
5
+ class VoxelVoxcloudFacilitiesList < Knife
6
+ include Knife::VoxelBase
7
+
8
+ banner "knife voxel voxcloud facilities list"
9
+
10
+ def run
11
+ facilities = hapi.voxel_voxcloud_facilities_list
12
+
13
+ unless facilities['facilities'].empty?
14
+ facilities['facilities']['facility'].each do |facility|
15
+ puts ui.color("#{facility['label']} (#{facility['description']})\n", :bold)
16
+ end
17
+ end
18
+
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ require 'chef/knife/voxel_base'
2
+
3
+ class Chef
4
+ class Knife
5
+ class VoxelVoxserversFacilitiesList < Knife
6
+ include Knife::VoxelBase
7
+
8
+ banner "knife voxel voxservers facilities list"
9
+
10
+ def run
11
+
12
+ facilities = hapi.voxel_voxservers_facilities_list
13
+
14
+ unless facilities['facilities'].empty?
15
+ facilities['facilities']['facility'].each do |facility|
16
+ puts ui.color("#{facility['label']} (#{facility['description']})\n", :bold)
17
+ end
18
+ end
19
+
20
+ end
21
+
22
+ end
23
+ end
24
+ end
@@ -170,8 +170,16 @@ class Chef
170
170
 
171
171
  bootstrap_for_node(device).run
172
172
 
173
- puts "#{ui.color("Environment", :cyan)}: #{config[:environment] || '_default'}"
174
173
  puts "#{ui.color("Run List", :cyan)}: #{config[:run_list].join(', ')}"
174
+ puts "#{ui.color("Node Name", :cyan)}: #{config[:node_name] || 'd' + device['id']}"
175
+ puts "#{ui.color("Environment", :cyan)}: #{config[:environment] || '_default'}"
176
+ puts "#{ui.color("Device ID", :cyan)}: #{device['id']}"
177
+ puts "#{ui.color("Name", :cyan)}: #{device['label']}"
178
+ puts "#{ui.color("Image Id", :cyan)}: #{config[:image_id]}"
179
+ puts "#{ui.color("Facility", :cyan)}: #{device['location']['facility']['code']}"
180
+ puts "#{ui.color("Public IP Address", :cyan)}: #{device['ipassignments']['ipassignment'].select { |i| i['type'] == 'frontend' }.first['content']}"
181
+ puts "#{ui.color("Private IP Address", :cyan)}: #{device['ipassignments']['ipassignment'].select { |i| i['type'] == 'backend' }.first['content']}"
182
+ puts "#{ui.color("Root Password", :cyan)}: #{device['accessmethods']['accessmethod'].select { |a| a['type'] == 'admin' }.first['password']}"
175
183
  end
176
184
  end
177
185
  else
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Voxel
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-voxel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.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-10-17 00:00:00.000000000Z
12
+ date: 2011-11-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: voxel-hapi
16
- requirement: &19478320 !ruby/object:Gem::Requirement
16
+ requirement: &12330100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 1.1.10
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *19478320
24
+ version_requirements: *12330100
25
25
  description: Voxel hAPI Support for Chef's knife command
26
26
  email:
27
27
  - jwb@voxel.net
@@ -39,8 +39,10 @@ files:
39
39
  - lib/chef/knife/voxel_images_list.rb
40
40
  - lib/chef/knife/voxel_voxcloud_create.rb
41
41
  - lib/chef/knife/voxel_voxcloud_delete.rb
42
+ - lib/chef/knife/voxel_voxcloud_facilities_list.rb
42
43
  - lib/chef/knife/voxel_voxservers_create.rb
43
44
  - lib/chef/knife/voxel_voxservers_delete.rb
45
+ - lib/chef/knife/voxel_voxservers_facilities_list.rb
44
46
  - lib/chef/knife/voxel_voxservers_inventory_list.rb
45
47
  - lib/chef/knife/voxel_voxservers_reimage.rb
46
48
  - lib/knife-voxel/version.rb