Sha256: 37749a738ee2cde14b22b88c018e63f5f6400f50f30d603d57c5affd05ac5928

Contents?: true

Size: 715 Bytes

Versions: 15

Compression:

Stored size: 715 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentTagList < Knife

      include Knife::JoyentBase

      banner "knife joyent tag list <server>"

      def run
        server = name_args.first

        unless server
          show_usage
          exit 1
        end

        tags = [
          ui.color('Name', :bold),
          ui.color('Value', :bold),
        ]

        self.connection.servers.get(server).tags.each do |k, v|
          tags << k
          tags << v
        end

        puts ui.list(tags, :uneven_columns_across, 2)
        exit 0
      rescue Excon::Errors::NotFound => e
        puts ui.error("Server #{server} not found")
        exit 1
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
knife-joyent-0.4.0 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.3.6 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.3.5 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.3.4 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.3.3 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.3.2 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.3.1 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.3.0 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.2.2 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.2.1 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.2.0 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.1.4 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.1.3 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.1.1 lib/chef/knife/joyent_tag_list.rb
knife-joyent-0.1.0 lib/chef/knife/joyent_tag_list.rb