Class Rudy::CLI::Metadata

  1. lib/rudy/cli/metadata.rb

Public instance methods

metadata ()
[show source]
    # File lib/rudy/cli/metadata.rb, line 13
13:       def metadata
14:         unless @argv.empty?
15:           h = Rudy::Metadata.get(@argv.first)
16:           return if h.nil?
17:           @metaobj = Rudy::Metadata.get_rclass h['rtype'].first
18:           objlist = Hash[@argv.first => @metaobj.from_hash(h)]
19:         else
20:           more, less = {}, []
21:           less = [:environment, :role, :zone, :region, :position] if @option.all
22:           objlist = @metaobj.list_as_hash(more, less) || {}
23:         end
24:         
25:         objlist.each_pair do |k,o|
26:           li "#{k}: " << o.inspect
27:         end
28:       end
metadata_delete ()
[show source]
    # File lib/rudy/cli/metadata.rb, line 36
36:       def metadata_delete
37: 
38:         unless @@global.quiet
39:           msg = "NOTE: This will delete only the metadata and "
40:           msg << "not the EC2 object (volume, instance, etc...)"
41:           li msg
42:         end
43:         
44:         execute_check(:medium)
45:         
46:         Rudy::Metadata.destroy @argv.oid
47:       end
metadata_delete_valid? ()
[show source]
    # File lib/rudy/cli/metadata.rb, line 30
30:       def metadata_delete_valid?
31:         raise "Must supply object ID" unless @argv.oid
32:         raise Rudy::Metadata::UnknownObject, @argv.oid unless Rudy::Metadata.exists? @argv.oid
33:         true
34:       end
metadata_valid? ()
[show source]
    # File lib/rudy/cli/metadata.rb, line 7
 7:       def metadata_valid?
 8:         @option.rtype ||= 'm'
 9:         @metaobj = Rudy::Metadata.get_rclass @option.rtype
10:         true
11:       end