Skip to content

Commit 178bb0e

Browse files
committed
Support create_term and get_vnc API for Node itself
1 parent 756d123 commit 178bb0e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

lib/fog/proxmox/compute/requests/create_term.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ def create_term(path_params, body_params)
2626
node = path_params[:node]
2727
type = path_params[:type]
2828
vmid = path_params[:vmid]
29+
if type.nil? && vmid.nil?
30+
path = "nodes/#{node}/termproxy"
31+
else
32+
path = "nodes/#{node}/#{type}/#{vmid}/termproxy"
33+
end
2934
request(
3035
expects: [200],
3136
method: 'POST',
32-
path: "nodes/#{node}/#{type}/#{vmid}/termproxy",
37+
path: path,
3338
body: URI.encode_www_form(body_params)
3439
)
3540
end

lib/fog/proxmox/compute/requests/get_vnc.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ def get_vnc(path_params, query_params)
2626
node = path_params[:node]
2727
type = path_params[:type]
2828
vmid = path_params[:vmid]
29+
if type.nil? && vmid.nil?
30+
path = "nodes/#{node}/vncwebsocket"
31+
else
32+
path = "nodes/#{node}/#{type}/#{vmid}/vncwebsocket"
33+
end
2934
request(
3035
expects: [101, 200],
3136
method: 'GET',
32-
path: "nodes/#{node}/#{type}/#{vmid}/vncwebsocket",
37+
path: path,
3338
query: URI.encode_www_form(query_params)
3439
)
3540
end

0 commit comments

Comments
 (0)