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

Method extractUPID

pkg/api/vm_lifecycle.go:85–94  ·  view source on GitHub ↗

extractUPID extracts the UPID from a Proxmox API response.

(response map[string]interface{})

Source from the content-addressed store, hash-verified

83
84// extractUPID extracts the UPID from a Proxmox API response.
85func (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//

Callers 7

StartVMMethod · 0.95
StopVMMethod · 0.95
ShutdownVMMethod · 0.95
RestartVMMethod · 0.95
ResetVMMethod · 0.95
MigrateVMMethod · 0.95
DeleteVMWithOptionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected