Sha256: de826a80e6558f5261d85f4ad22841d491ed98a06a3a3b59867c4c58cbea074f

Contents?: true

Size: 797 Bytes

Versions: 15

Compression:

Stored size: 797 Bytes

Contents

require 'chef/knife/joyent_base'

class Chef
  class Knife
    class JoyentServerStart < Knife

      include Knife::JoyentBase

      banner 'knife joyent server start <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("Unable to locate server: #{id}")
          exit 1
        end

        if server.ready?
          puts ui.error("Server is already started")
          exit 1
        end

        if server.start
          puts ui.color("Started server: #{id}", :cyan)
          exit 0
        else
          puts ui.error("Start server failed")
          exit 1
        end
      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_server_start.rb
knife-joyent-0.3.6 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.3.5 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.3.4 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.3.3 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.3.2 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.3.1 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.3.0 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.2.2 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.2.1 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.2.0 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.1.4 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.1.3 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.1.1 lib/chef/knife/joyent_server_start.rb
knife-joyent-0.1.0 lib/chef/knife/joyent_server_start.rb