extractUPID extracts the UPID from a Proxmox API response.
(response map[string]interface{})
| 83 | |
| 84 | // extractUPID extracts the UPID from a Proxmox API response. |
| 85 | func (c *Client) extractUPID(response map[string]interface{}) (string, error) { |
| 86 | if dataField, ok := response["data"]; ok { |
| 87 | if upidStr, ok := dataField.(string); ok && strings.HasPrefix(upidStr, "UPID:") { |
| 88 | return upidStr, nil |
| 89 | } |
| 90 | } |
| 91 | // Some operations might not return a UPID (sync ops), or return it differently |
| 92 | // But most async ops return UPID. If missing, return empty string but no error if the call was successful. |
| 93 | return "", nil |
| 94 | } |
| 95 | |
| 96 | // MigrationOptions contains configuration options for migrating a VM or container. |
| 97 | // |
no outgoing calls
no test coverage detected