Sha256: 8c5c090ea24d9d4b949cd47d7fac06a5cde6eca23531213d765fa5d5ddb72e14

Contents?: true

Size: 735 Bytes

Versions: 11

Compression:

Stored size: 735 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentServerReboot < Knife

      include Knife::JoyentBase

      banner 'knife joyent server reboot <server_id>'

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

        id = name_args.first

        server = self.connection.servers.get(id)
        unless server
          puts ui.error("Server with id: #{id} not found")
          exit 1
        end

        if server.reboot
          puts ui.color("Rebooted Server #{id}", :cyan)
          exit 0
        else
          puts ui.error("Reboot server failed")
          exit 1
        end

      rescue => e
        output_error(e)
      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_server_reboot.rb
knife-joyent-0.4.12 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.11 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.10 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.9 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.8 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.5 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.4 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.3 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.2 lib/chef/knife/joyent_server_reboot.rb
knife-joyent-0.4.1 lib/chef/knife/joyent_server_reboot.rb