You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/vmfloaty.rb
+44-17
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,6 @@ def run
52
52
c.option'--filter STRING',String,'A filter to apply to the list'
53
53
c.option'--url STRING',String,'URL of vmpooler'
54
54
c.actiondo |args,options|
55
-
# Do something or c.when_called Floaty::Commands::Query
56
55
filter=options.filter
57
56
url=options.url ||= config['url']
58
57
@@ -62,23 +61,37 @@ def run
62
61
63
62
command:querydo |c|
64
63
c.syntax='floaty query [options]'
65
-
c.summary=''
64
+
c.summary='Get information about a given vm'
66
65
c.description=''
67
-
c.example'description','command example'
68
-
c.option'--some-switch','Some switch that does something'
66
+
c.example'Get information about a sample host','floaty query --url http://vmpooler.example.com --host myvmhost.example.com'
67
+
c.option'--url STRING',String,'URL of vmpooler'
68
+
c.option'--host STRING',String,'Hostname to query'
69
69
c.actiondo |args,options|
70
-
# Do something or c.when_called Floaty::Commands::Query
70
+
url=options.url ||= config['url']
71
+
hostname=options.hostname
72
+
73
+
Pooler.query(url,hostname)
71
74
end
72
75
end
73
76
74
77
command:modifydo |c|
75
78
c.syntax='floaty modify [options]'
76
-
c.summary=''
79
+
c.summary='Modify a vms tags and TTL'
77
80
c.description=''
78
81
c.example'description','command example'
79
-
c.option'--some-switch','Some switch that does something'
82
+
c.option'--url STRING',String,'URL of vmpooler'
83
+
c.option'--token STRING',String,'Token for vmpooler'
84
+
c.option'--host STRING',String,'Hostname to modify'
85
+
c.option'--lifetime INT',Integer,'VM TTL (Integer, in hours)'
86
+
c.option'--tags HASH',Hash,'free-form VM tagging'
80
87
c.actiondo |args,options|
81
-
# Do something or c.when_called Floaty::Commands::Modify
88
+
url=options.url ||= config['url']
89
+
hostname=options.hostname
90
+
lifetime=options.lifetime
91
+
tags=options.tags
92
+
token=options.token
93
+
94
+
Pooler.modify(url,hostname,token,lifetime,tags)
82
95
end
83
96
end
84
97
@@ -93,29 +106,43 @@ def run
93
106
hosts=options.hosts
94
107
url=options.url ||= config['url']
95
108
96
-
Pool.delete(hosts,url)
109
+
Pool.delete(url,hosts)
97
110
end
98
111
end
99
112
100
113
command:snapshotdo |c|
101
114
c.syntax='floaty snapshot [options]'
102
-
c.summary=''
115
+
c.summary='Takes a snapshot of a given vm'
103
116
c.description=''
104
-
c.example'description','command example'
105
-
c.option'--some-switch','Some switch that does something'
117
+
c.example'Takes a snapshot for a given host','floaty snapshot --url http://vmpooler.example.com --host myvm.example.com --token a9znth9dn01t416hrguu56ze37t790bl'
118
+
c.option'--url STRING',String,'URL of vmpooler'
119
+
c.option'--host STRING',String,'Hostname to modify'
120
+
c.option'--token STRING',String,'Token for vmpooler'
106
121
c.actiondo |args,options|
107
-
# Do something or c.when_called Floaty::Commands::Snapshot
122
+
url=options.url ||= config['url']
123
+
hostname=options.hostname
124
+
token=options.token
125
+
126
+
Pooler.snapshot(url,hostname,token)
108
127
end
109
128
end
110
129
111
130
command:revertdo |c|
112
131
c.syntax='floaty revert [options]'
113
-
c.summary=''
132
+
c.summary='Reverts a vm to a specified snapshot'
114
133
c.description=''
115
-
c.example'description','command example'
116
-
c.option'--some-switch','Some switch that does something'
134
+
c.example'Reverts to a snapshot for a given host','floaty revert --url http://vmpooler.example.com --host myvm.example.com --token a9znth9dn01t416hrguu56ze37t790bl --snapshot n4eb4kdtp7rwv4x158366vd9jhac8btq'
135
+
c.option'--url STRING',String,'URL of vmpooler'
136
+
c.option'--host STRING',String,'Hostname to modify'
137
+
c.option'--token STRING',String,'Token for vmpooler'
138
+
c.option'--snapshot STRING',String,'SHA of snapshot'
117
139
c.actiondo |args,options|
118
-
# Do something or c.when_called Floaty::Commands::Revert
0 commit comments