Sha256: 1ec016330e7a10cd9df9c93a4d5ea4e7fc66dd5167169a900dac963e2a0389ea

Contents?: true

Size: 1.07 KB

Versions: 12

Compression:

Stored size: 1.07 KB

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

      alias_method :scp_upload, :scp

      def scp_download(remote_path, local_path, download_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).download(remote_path, local_path, download_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

12 entries across 12 versions & 5 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
michiels-fog-1.3.1 lib/fog/compute/models/server.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/compute/models/server.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
fog-1.3.1 lib/fog/compute/models/server.rb
fog-1.3.0 lib/fog/compute/models/server.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
fog-1.2.0 lib/fog/compute/models/server.rb
ktheory-fog-1.1.2 lib/fog/compute/models/server.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/server.rb