Method: Morpheus::DeploymentsInterface#destroy_file
- Defined in:
- lib/morpheus/api/deployments_interface.rb
#destroy_file(deployment_id, id, destination, params = {}) ⇒ Object
upload a file without multipart local_file is the full absolute local filename destination should be the full remote file path, including the file name.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/morpheus/api/deployments_interface.rb', line 64 def destroy_file(deployment_id, id, destination, params={}) if destination.empty? || destination == "/" || destination == "." || destination.include?("../") raise "#{self.class}.upload_file() passed a bad destination: '#{destination}'" end # url = "#{@base_url}/#{base_path}/#{deployment_id}/versions/#{id}/files" url = "#{base_path}/#{deployment_id}/versions/#{id}/files" if !destination.to_s.empty? url += "/#{destination}" end # use URI to escape path uri = URI.parse(url) url = uri.path execute(method: :delete, url: url, params: params) end |