knife-clodo 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore
CHANGED
data/knife-clodo.gemspec
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerIpAdd < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
deps do
|
10
|
+
require 'fog'
|
11
|
+
end
|
12
|
+
|
13
|
+
banner "knife clodo server ip add <ServerID> (options)"
|
14
|
+
|
15
|
+
def run
|
16
|
+
unless @name_args[0]
|
17
|
+
ui.error("You have not provided server ID.");
|
18
|
+
exit 1;
|
19
|
+
end
|
20
|
+
|
21
|
+
connection.add_ip_address(@name_args[0]);
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerIpDelete < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
deps do
|
10
|
+
require 'fog'
|
11
|
+
end
|
12
|
+
|
13
|
+
banner "knife clodo server ip delete <ServerID> <IP> (options)"
|
14
|
+
|
15
|
+
def run
|
16
|
+
unless @name_args[0] && @name_args[1]
|
17
|
+
ui.error("You have not provided server ID, and IP-address.");
|
18
|
+
exit 1;
|
19
|
+
end
|
20
|
+
|
21
|
+
connection.delete_ip_address(@name_args[0], @name_args[1]);
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerIpMove < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
deps do
|
10
|
+
require 'fog'
|
11
|
+
end
|
12
|
+
|
13
|
+
banner "knife clodo server ip move <ServerID> <IP> (options)"
|
14
|
+
|
15
|
+
def run
|
16
|
+
unless @name_args[0] && @name_args[1]
|
17
|
+
ui.error("You have not provided server ID and IP-address to move.");
|
18
|
+
exit 1;
|
19
|
+
end
|
20
|
+
|
21
|
+
connection.move_ip_address(@name_args[0], @name_args[1]);
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'chef/knife/clodo_base'
|
2
|
+
|
3
|
+
class Chef
|
4
|
+
class Knife
|
5
|
+
class ClodoServerShow < Knife
|
6
|
+
|
7
|
+
include Knife::ClodoBase
|
8
|
+
|
9
|
+
deps do
|
10
|
+
require 'fog'
|
11
|
+
end
|
12
|
+
|
13
|
+
banner "knife clodo server show <ServerID> (options)"
|
14
|
+
|
15
|
+
def run
|
16
|
+
unless @name_args[0]
|
17
|
+
ui.error("You have not provided server ID, or it is not an integer.");
|
18
|
+
exit 1;
|
19
|
+
end
|
20
|
+
|
21
|
+
$stdout.sync = true
|
22
|
+
|
23
|
+
server = connection.servers.get(@name_args[0]);
|
24
|
+
|
25
|
+
server_data = []
|
26
|
+
|
27
|
+
[
|
28
|
+
:name,
|
29
|
+
:image_id,
|
30
|
+
:type,
|
31
|
+
:state,
|
32
|
+
:type,
|
33
|
+
:vps_memory,
|
34
|
+
:vps_memory_max,
|
35
|
+
:vps_os_title,
|
36
|
+
:vps_os_bits,
|
37
|
+
:vps_os_type,
|
38
|
+
:vps_vnc,
|
39
|
+
:vps_cpu_load,
|
40
|
+
:vps_cpu_max,
|
41
|
+
:vps_cpu_1h_min,
|
42
|
+
:vps_cpu_1h_max,
|
43
|
+
:vps_mem_load,
|
44
|
+
:vps_mem_max,
|
45
|
+
:vps_mem_1h_min,
|
46
|
+
:vps_mem_1h_max,
|
47
|
+
:vps_hdd_load,
|
48
|
+
:vps_hdd_max,
|
49
|
+
:vps_traf_rx,
|
50
|
+
:vps_traf_tx,
|
51
|
+
:vps_createdate,
|
52
|
+
:vps_billingdate,
|
53
|
+
:vps_update,
|
54
|
+
:vps_update_days,
|
55
|
+
:vps_root_pass,
|
56
|
+
:vps_user_pass,
|
57
|
+
:vps_vnc_pass
|
58
|
+
].each do |parameter|
|
59
|
+
|
60
|
+
val = server.send(parameter)
|
61
|
+
if val
|
62
|
+
server_data << ui.color("#{parameter.to_s}:", :bold);
|
63
|
+
server_data << val
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
server.addresses['public'].each do |address|
|
69
|
+
server_data << ui.color('IP:', :bold);
|
70
|
+
server_data << address['ip']
|
71
|
+
end
|
72
|
+
|
73
|
+
puts ui.list(server_data, :columns_across, 2)
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-clodo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 9
|
10
|
+
version: 0.1.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stepan G. Fedorov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-12-
|
18
|
+
date: 2011-12-26 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: fog
|
@@ -50,8 +50,12 @@ files:
|
|
50
50
|
- lib/chef/knife/clodo_image_list.rb
|
51
51
|
- lib/chef/knife/clodo_server_create.rb
|
52
52
|
- lib/chef/knife/clodo_server_delete.rb
|
53
|
+
- lib/chef/knife/clodo_server_ip_add.rb
|
54
|
+
- lib/chef/knife/clodo_server_ip_delete.rb
|
55
|
+
- lib/chef/knife/clodo_server_ip_move.rb
|
53
56
|
- lib/chef/knife/clodo_server_list.rb
|
54
57
|
- lib/chef/knife/clodo_server_reboot.rb
|
58
|
+
- lib/chef/knife/clodo_server_show.rb
|
55
59
|
- lib/chef/knife/clodo_server_start.rb
|
56
60
|
- lib/chef/knife/clodo_server_stop.rb
|
57
61
|
homepage: http://clodo.ru/
|