Class: Cyclid::API::Plugins::Transport

Inherits:
Base
  • Object
show all
Defined in:
app/cyclid/plugins/transport.rb

Overview

Base class for Transport plugins

Direct Known Subclasses

DockerApi, Ssh

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

config?, config_schema, default_config, get_config, register_plugin, set_config, update_config

Constructor Details

#initialize(args = {}) ⇒ Transport

Returns a new instance of Transport.



24
25
# File 'app/cyclid/plugins/transport.rb', line 24

def initialize(args = {})
end

Class Method Details

.human_nameObject

Return the ‘human’ name for the plugin type



28
29
30
# File 'app/cyclid/plugins/transport.rb', line 28

def self.human_name
  'transport'
end

Instance Method Details

#closeObject

Disconnect the transport



56
57
# File 'app/cyclid/plugins/transport.rb', line 56

def close
end

#download(_io, _path) ⇒ Object

Copy a data from remote file to a local IO object



51
52
53
# File 'app/cyclid/plugins/transport.rb', line 51

def download(_io, _path)
  false
end

#exec(_cmd, _path = nil) ⇒ Object

Run a command on the remote host.



41
42
43
# File 'app/cyclid/plugins/transport.rb', line 41

def exec(_cmd, _path = nil)
  false
end

#export_env(env = {}) ⇒ Object

If possible, export each of the variables in env as a shell environment variables. The default is simply to remember the environment variables, which will be exported each time when a command is run.



36
37
38
# File 'app/cyclid/plugins/transport.rb', line 36

def export_env(env = {})
  @env = env
end

#upload(_io, _path) ⇒ Object

Copy data from a local IO object to a remote file.



46
47
48
# File 'app/cyclid/plugins/transport.rb', line 46

def upload(_io, _path)
  false
end