Skip to content

Commit

Permalink
Support create_term and get_vnc API for Node itself
Browse files Browse the repository at this point in the history
  • Loading branch information
davispuh committed Oct 15, 2024
1 parent 756d123 commit 178bb0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/fog/proxmox/compute/requests/create_term.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ def create_term(path_params, body_params)
node = path_params[:node]
type = path_params[:type]
vmid = path_params[:vmid]
if type.nil? && vmid.nil?
path = "nodes/#{node}/termproxy"
else
path = "nodes/#{node}/#{type}/#{vmid}/termproxy"
end
request(
expects: [200],
method: 'POST',
path: "nodes/#{node}/#{type}/#{vmid}/termproxy",
path: path,
body: URI.encode_www_form(body_params)
)
end
Expand Down
7 changes: 6 additions & 1 deletion lib/fog/proxmox/compute/requests/get_vnc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ def get_vnc(path_params, query_params)
node = path_params[:node]
type = path_params[:type]
vmid = path_params[:vmid]
if type.nil? && vmid.nil?
path = "nodes/#{node}/vncwebsocket"
else
path = "nodes/#{node}/#{type}/#{vmid}/vncwebsocket"
end
request(
expects: [101, 200],
method: 'GET',
path: "nodes/#{node}/#{type}/#{vmid}/vncwebsocket",
path: path,
query: URI.encode_www_form(query_params)
)
end
Expand Down

0 comments on commit 178bb0e

Please sign in to comment.