Method: RbVmomi::VIM::Datastore#upload
- Defined in:
- lib/rbvmomi/vim/Datastore.rb
#upload(remote_path, local_path) ⇒ void
This method returns an undefined value.
Upload a file to this datastore.
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/rbvmomi/vim/Datastore.rb', line 42 def upload remote_path, local_path url = "http#{@soap.http.use_ssl? ? 's' : ''}://#{@soap.http.address}:#{@soap.http.port}#{mkuripath(remote_path)}" pid = spawn CURLBIN, "-k", '--noproxy', '*', '-f', "-T", local_path, "-b", @soap., url, :out => '/dev/null' Process.waitpid(pid, 0) fail "upload failed" unless $?.success? end |