# File lib/rhc-rest/domain.rb, line 17
      def add_application(name, options)
        logger.debug "Adding application #{name} to domain #{self.id}" if @mydebug
        url = @links['ADD_APPLICATION']['href']
        method =  @links['ADD_APPLICATION']['method']
        payload = {:name => name}
        options.each do |key, value|
          payload[key] = value
        end
        timeout = nil
        if options[:scale]
          timeout = 180 # 3 minute timeout for scalable app
        end
        request = RestClient::Request.new(:url => url, :method => method, :headers => @@headers, :payload => payload, :timeout => timeout)
        return send(request)
      end