Class: NexusSW::LXD::Transport
- Inherits:
-
Object
- Object
- NexusSW::LXD::Transport
show all
- Defined in:
- lib/nexussw/lxd/transport.rb,
lib/nexussw/lxd/transport/cli.rb,
lib/nexussw/lxd/transport/rest.rb,
lib/nexussw/lxd/transport/local.rb,
lib/nexussw/lxd/transport/mixins/cli.rb,
lib/nexussw/lxd/transport/mixins/rest.rb,
lib/nexussw/lxd/transport/mixins/local.rb,
lib/nexussw/lxd/transport/mixins/helpers/users.rb,
lib/nexussw/lxd/transport/mixins/helpers/execute.rb,
lib/nexussw/lxd/transport/mixins/helpers/folder_txfr.rb
Defined Under Namespace
Modules: Mixins
Classes: CLI, Local, Rest
Class Method Summary
collapse
Instance Method Summary
collapse
-
#download_file(_path, _local_path) ⇒ Object
-
#download_folder(_path, _local_path, _options = {}) ⇒ Object
-
#execute(_command, _options = {}) ⇒ Object
-
#read_file(_path) ⇒ Object
-
#upload_file(_local_path, _path, _options = {}) ⇒ Object
-
#upload_folder(_local_path, _path, _options = {}) ⇒ Object
-
#user(_user, _options = {}) ⇒ Object
-
#write_file(_path, _content, _options = {}) ⇒ Object
Class Method Details
.chdir_mutex ⇒ Object
54
55
56
|
# File 'lib/nexussw/lxd/transport.rb', line 54
def self.chdir_mutex
@chdir_mutex ||= Mutex.new
end
|
.local_tempdir ⇒ Object
47
48
49
50
51
52
|
# File 'lib/nexussw/lxd/transport.rb', line 47
def self.local_tempdir
return ENV["TEMP"] unless !ENV["TEMP"] || ENV["TEMP"].empty?
return ENV["TMP"] unless !ENV["TMP"] || ENV["TMP"].empty?
return ENV["TMPDIR"] unless !ENV["TMPDIR"] || ENV["TMPDIR"].empty?
"/tmp"
end
|
.remote_tempname(basename) ⇒ Object
kludge for windows environment
40
41
42
43
44
45
|
# File 'lib/nexussw/lxd/transport.rb', line 40
def self.remote_tempname(basename)
tfile = Tempfile.new(basename)
"/tmp/#{File.basename tfile.path}"
ensure
tfile.unlink
end
|
Instance Method Details
#download_file(_path, _local_path) ⇒ Object
23
24
25
|
# File 'lib/nexussw/lxd/transport.rb', line 23
def download_file(_path, _local_path)
raise "#{self.class}#download_file not implemented"
end
|
#download_folder(_path, _local_path, _options = {}) ⇒ Object
27
28
29
|
# File 'lib/nexussw/lxd/transport.rb', line 27
def download_folder(_path, _local_path, _options = {})
raise "#{self.class}#download_folder not implemented"
end
|
#execute(_command, _options = {}) ⇒ Object
7
8
9
|
# File 'lib/nexussw/lxd/transport.rb', line 7
def execute(_command, _options = {})
raise "#{self.class}#execute not implemented"
end
|
#read_file(_path) ⇒ Object
15
16
17
|
# File 'lib/nexussw/lxd/transport.rb', line 15
def read_file(_path)
raise "#{self.class}#read_file not implemented"
end
|
#upload_file(_local_path, _path, _options = {}) ⇒ Object
31
32
33
|
# File 'lib/nexussw/lxd/transport.rb', line 31
def upload_file(_local_path, _path, _options = {})
raise "#{self.class}#upload_file not implemented"
end
|
#upload_folder(_local_path, _path, _options = {}) ⇒ Object
35
36
37
|
# File 'lib/nexussw/lxd/transport.rb', line 35
def upload_folder(_local_path, _path, _options = {})
raise "#{self.class}#upload_folder not implemented"
end
|
#user(_user, _options = {}) ⇒ Object
11
12
13
|
# File 'lib/nexussw/lxd/transport.rb', line 11
def user(_user, _options = {})
raise "#{self.class}#user not implemented"
end
|
#write_file(_path, _content, _options = {}) ⇒ Object
19
20
21
|
# File 'lib/nexussw/lxd/transport.rb', line 19
def write_file(_path, _content, _options = {})
raise "#{self.class}#write_file not implemented"
end
|