GetNodeConfig retrieves configuration for a given node with caching.
(nodeName string)
| 177 | |
| 178 | // GetNodeConfig retrieves configuration for a given node with caching. |
| 179 | func (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. |
| 194 | func (c *Client) GetNodeVNCShell(nodeName string) (*VNCProxyResponse, error) { |
nothing calls this directly
no test coverage detected