knife-joyent 0.0.10 → 0.1.0
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.
- data/README.md +3 -3
- data/knife-joyent.gemspec +3 -3
- data/lib/chef/knife/joyent_base.rb +60 -0
- data/lib/chef/knife/joyent_flavor_list.rb +20 -19
- data/lib/chef/knife/joyent_image_list.rb +23 -21
- data/lib/chef/knife/joyent_key_add.rb +39 -38
- data/lib/chef/knife/joyent_key_delete.rb +23 -22
- data/lib/chef/knife/joyent_key_list.rb +17 -16
- data/lib/chef/knife/joyent_server_create.rb +238 -151
- data/lib/chef/knife/joyent_server_delete.rb +58 -56
- data/lib/chef/knife/joyent_server_list.rb +47 -44
- data/lib/chef/knife/joyent_server_reboot.rb +24 -23
- data/lib/chef/knife/joyent_server_resize.rb +41 -40
- data/lib/chef/knife/joyent_server_start.rb +29 -27
- data/lib/chef/knife/joyent_server_stop.rb +28 -27
- data/lib/chef/knife/joyent_snapshot_create.rb +16 -15
- data/lib/chef/knife/joyent_snapshot_delete.rb +30 -29
- data/lib/chef/knife/joyent_snapshot_list.rb +34 -33
- data/lib/chef/knife/joyent_tag_create.rb +29 -27
- data/lib/chef/knife/joyent_tag_delete.rb +45 -43
- data/lib/chef/knife/joyent_tag_list.rb +26 -24
- data/lib/knife-joyent/version.rb +1 -1
- metadata +9 -9
- data/lib/chef/knife/base.rb +0 -58
@@ -1,35 +1,37 @@
|
|
1
|
-
require
|
1
|
+
require 'chef/knife/joyent_base'
|
2
2
|
|
3
|
-
|
4
|
-
class
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class JoyentTagList < Knife
|
5
6
|
|
6
|
-
|
7
|
+
include Knife::JoyentBase
|
7
8
|
|
8
|
-
|
9
|
+
banner "knife joyent tag list <server>"
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
def run
|
12
|
+
server = name_args.first
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
unless server
|
15
|
+
show_usage
|
16
|
+
exit 1
|
17
|
+
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
tags = [
|
20
|
+
ui.color('Name', :bold),
|
21
|
+
ui.color('Value', :bold),
|
22
|
+
]
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
self.connection.servers.get(server).tags.each do |k, v|
|
25
|
+
tags << k
|
26
|
+
tags << v
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
puts ui.list(tags, :uneven_columns_across, 2)
|
30
|
+
exit 0
|
31
|
+
rescue Excon::Errors::NotFound => e
|
32
|
+
puts ui.error("Server #{server} not found")
|
33
|
+
exit 1
|
34
|
+
end
|
33
35
|
end
|
34
36
|
end
|
35
37
|
end
|
data/lib/knife-joyent/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-joyent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '1.
|
21
|
+
version: '1.6'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,23 +26,23 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
29
|
+
version: '1.6'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: chef
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ! '>='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 0.10.10
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: 0.10.10
|
46
46
|
description: Joyent CloudAPI Support for Chef's Knife Command
|
47
47
|
email:
|
48
48
|
- kevin@joyent.com
|
@@ -58,7 +58,7 @@ files:
|
|
58
58
|
- README.md
|
59
59
|
- Rakefile
|
60
60
|
- knife-joyent.gemspec
|
61
|
-
- lib/chef/knife/
|
61
|
+
- lib/chef/knife/joyent_base.rb
|
62
62
|
- lib/chef/knife/joyent_flavor_list.rb
|
63
63
|
- lib/chef/knife/joyent_image_list.rb
|
64
64
|
- lib/chef/knife/joyent_key_add.rb
|
data/lib/chef/knife/base.rb
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
require 'chef/knife'
|
2
|
-
|
3
|
-
module KnifeJoyent
|
4
|
-
module Base
|
5
|
-
|
6
|
-
def self.included(includer)
|
7
|
-
includer.class_eval do
|
8
|
-
deps do
|
9
|
-
require 'fog'
|
10
|
-
require 'net/ssh/multi'
|
11
|
-
require 'readline'
|
12
|
-
require 'chef/json_compat'
|
13
|
-
end
|
14
|
-
|
15
|
-
option :joyent_username,
|
16
|
-
:short => '-U USERNAME',
|
17
|
-
:long => '--joyent-username USERNAME',
|
18
|
-
:description => 'Your Joyent username',
|
19
|
-
:proc => Proc.new {|key| Chef::Config[:knife][:joyent_username] = key}
|
20
|
-
|
21
|
-
option :joyent_password,
|
22
|
-
:short => '-P PASSWORD',
|
23
|
-
:long => '--joyent-password PASSOWRD',
|
24
|
-
:description => 'Your Joyent password',
|
25
|
-
:proc => Proc.new {|key| Chef::Config[:knife][:joyent_password] = key }
|
26
|
-
|
27
|
-
option :joyent_keyname,
|
28
|
-
:long => '--joyent-keyname name of ssh key for signature auth',
|
29
|
-
:description => 'name of ssh key for signature auth',
|
30
|
-
:proc => Proc.new {|key| Chef::Config[:knife][:joyent_keyname] = key }
|
31
|
-
|
32
|
-
option :joyent_keyfile,
|
33
|
-
:long => '--joyent-keyfile path to ssh private key for signature auth',
|
34
|
-
:description => 'path to ssh private key for signature auth',
|
35
|
-
:proc => Proc.new {|key| Chef::Config[:knife][:joyent_keyfile] = key }
|
36
|
-
|
37
|
-
option :joyent_api_url,
|
38
|
-
:short => "-L JOYENT_API_URL",
|
39
|
-
:long => "--joyent-api-url JOYENT_API_URL",
|
40
|
-
:description => "Joyent API URL",
|
41
|
-
:proc => Proc.new {|key| Chef::Config[:knife][:joyent_api_url] = key }
|
42
|
-
end
|
43
|
-
|
44
|
-
def connection
|
45
|
-
@connection ||= begin
|
46
|
-
connection = Fog::Compute.new(
|
47
|
-
:provider => 'Joyent',
|
48
|
-
:joyent_username => Chef::Config[:knife][:joyent_username],
|
49
|
-
:joyent_password => Chef::Config[:knife][:joyent_password],
|
50
|
-
:joyent_keyname => Chef::Config[:knife][:joyent_keyname],
|
51
|
-
:joyent_keyfile => Chef::Config[:knife][:joyent_keyfile],
|
52
|
-
:joyent_url => Chef::Config[:knife][:joyent_api_url]
|
53
|
-
)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|