Skip to content

Commit

Permalink
Implement list_appliances and download_appliance
Browse files Browse the repository at this point in the history
  • Loading branch information
davispuh committed Oct 17, 2024
1 parent e56336d commit e11268b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/fog/proxmox/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class Storage < Fog::Service
request_path 'fog/proxmox/storage/requests'

request :upload
request :list_appliances
request :download_appliance

# Mock class
class Mock
Expand Down
24 changes: 24 additions & 0 deletions lib/fog/proxmox/storage/requests/download_appliance.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

module Fog
module Proxmox
class Storage
# class Real download_appliance
class Real
def download_appliance(path_params, body_params)
node = path_params[:node]
request(
expects: [200],
method: 'POST',
path: "nodes/#{node}/aplinfo",
body: URI.encode_www_form(body_params)
)
end
end

# class Mock download_appliance
class Mock
end
end
end
end
23 changes: 23 additions & 0 deletions lib/fog/proxmox/storage/requests/list_appliances.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module Fog
module Proxmox
class Storage
# class Real list_appliances
class Real
def list_appliances(options)
node = options[:node]
request(
expects: [200],
method: 'GET',
path: "nodes/#{node}/aplinfo"
)
end
end

# class Mock list_appliances
class Mock
end
end
end
end

0 comments on commit e11268b

Please sign in to comment.