lib/cloudstack-cli/commands/volume.rb in cloudstack-cli-0.13.0 vs lib/cloudstack-cli/commands/volume.rb in cloudstack-cli-0.13.1
- old
+ new
@@ -26,6 +26,24 @@
print_table(table)
say "Total number of volumes: #{volumes.size}"
end
end
-end
\ No newline at end of file
+ desc "show NAME", "show volume details"
+ option :project, desc: 'project of volume'
+ def show(name)
+ options[:name] = name
+ options[:project_id] = find_project['id'] if options[:project]
+ volumes = client.list_volumes(options)
+ if volumes.size < 1
+ say "No volume with name \"#{name}\" found."
+ else
+ volume = volumes.first
+ table = volume.map do |key, value|
+ [ set_color("#{key}:", :yellow), "#{value}" ]
+ end
+ print_table table
+ end
+ end
+
+
+end