Sha256: 903fea125df1058da67f6ad1c95adbe2578312446d9b1c58e52b7b099ba3100d

Contents?: true

Size: 698 Bytes

Versions: 10

Compression:

Stored size: 698 Bytes

Contents

require 'fog/core/model'

module Fog
  module Compute
    class Server < Fog::Model

      def scp(local_path, remote_path, upload_options = {})
        require 'net/scp'
        requires :public_ip_address, :username

        scp_options = {}
        scp_options[:key_data] = [private_key] if private_key
        Fog::SCP.new(public_ip_address, username, scp_options).upload(local_path, remote_path, upload_options)
      end

      def ssh(commands, options={})
        require 'net/ssh'
        requires :public_ip_address, :username

        options[:key_data] = [private_key] if private_key
        Fog::SSH.new(public_ip_address, username, options).run(commands)
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
fog-1.1.2 lib/fog/compute/models/server.rb
fog_tractical-1.1.4 lib/fog/compute/models/server.rb
fog_tractical-1.1.3 lib/fog/compute/models/server.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
fog-1.1.1 lib/fog/compute/models/server.rb
fog-1.1.0 lib/fog/compute/models/server.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
tag-fog-1.0.1 lib/fog/compute/models/server.rb