class Crowbar::Client::Request::Backup::Upload

Implementation for the backup upload request

Public Instance Methods

content() click to toggle source
Calls superclass method
# File lib/crowbar/client/request/backup/upload.rb, line 38
def content
  super.easy_merge!(
    backup: {
      file: attrs.file
    }
  )
end
headers() click to toggle source

Override the request headers

@return [Hash] the headers for the request

Calls superclass method
# File lib/crowbar/client/request/backup/upload.rb, line 32
def headers
  super.easy_merge!(
    Crowbar::Client::Util::ApiVersion.new(Config.apiversion).headers
  )
end
method() click to toggle source

HTTP method that gets used by the request

@return [Symbol] the method for the request

# File lib/crowbar/client/request/backup/upload.rb, line 51
def method
  :post
end
url() click to toggle source

Path to the API endpoint for the request

@return [String] path to the API endpoint

# File lib/crowbar/client/request/backup/upload.rb, line 60
def url
  case Config.apiversion
  when 1.0
    [
      "utils",
      "backups",
      "upload"
    ]
  when 2.0
    [
      "api",
      "crowbar",
      "backups",
      "upload"
    ]
  end.join("/")
end