MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / GetNodeConfig

Method GetNodeConfig

pkg/api/node.go:179–191  ·  view source on GitHub ↗

GetNodeConfig retrieves configuration for a given node with caching.

(nodeName string)

Source from the content-addressed store, hash-verified

177
178// GetNodeConfig retrieves configuration for a given node with caching.
179func (c *Client) GetNodeConfig(nodeName string) (map[string]interface{}, error) {
180 var res map[string]interface{}
181 if err := c.GetWithCache(fmt.Sprintf("/nodes/%s/config", nodeName), &res, NodeDataTTL); err != nil {
182 return nil, fmt.Errorf("failed to get node config: %w", err)
183 }
184
185 data, ok := res["data"].(map[string]interface{})
186 if !ok {
187 return nil, fmt.Errorf("unexpected format for node config")
188 }
189
190 return data, nil
191}
192
193// GetNodeVNCShell creates a VNC shell connection for a node and returns connection details.
194func (c *Client) GetNodeVNCShell(nodeName string) (*VNCProxyResponse, error) {

Callers

nothing calls this directly

Calls 1

GetWithCacheMethod · 0.95

Tested by

no test coverage detected