Sha256: a41cc567640f7d0d14d3b440dc8978b6cd6d3defb32cb7b2db7c4b6a25597650

Contents?: true

Size: 769 Bytes

Versions: 11

Compression:

Stored size: 769 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentSnapshotCreate < Knife

      include Knife::JoyentBase

      banner 'knife joyent snapshot create <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.create(server, ssname)
        puts ui.color("Created snapshot", :cyan)
        puts ui.output({
          :server => snapshot.machine_id,
          :name => snapshot.name,
          :state => snapshot.state,
          :created => snapshot.created
          })
        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_create.rb
knife-joyent-0.4.12 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.11 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.10 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.9 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.8 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.5 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.4 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.3 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.2 lib/chef/knife/joyent_snapshot_create.rb
knife-joyent-0.4.1 lib/chef/knife/joyent_snapshot_create.rb