Sha256: efd1ad315dfb3b3b92c6092658e2fae8e5855c9d3f889a944ab5d88341e83aa6

Contents?: true

Size: 619 Bytes

Versions: 11

Compression:

Stored size: 619 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentSnapshotDelete < Knife

      include Knife::JoyentBase

      banner 'knife joyent snapshot delete <server> <snapshot_name>'

      def run
        unless name_args.size == 2
          show_usage
          exit 1
        end

        server = name_args[0]
        ssname = name_args[1]

        snapshot = self.connection.snapshots.get(server, ssname)
        snapshot.destroy
        puts ui.color("Deleted snapshot #{snapshot.name}", :cyan)
        exit 0
      rescue => e
        output_error(e)
        exit 1
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
knife-joyent-0.4.14 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.12 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.11 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.10 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.9 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.8 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.5 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.4 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.3 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.2 lib/chef/knife/joyent_snapshot_delete.rb
knife-joyent-0.4.1 lib/chef/knife/joyent_snapshot_delete.rb