add endpoint to manually trigger inventory collection
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -3,7 +3,6 @@ package vcenter
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"log/slog"
|
||||
"net/url"
|
||||
"path"
|
||||
@@ -58,10 +57,19 @@ func New(logger *slog.Logger, creds *VcenterLogin) *Vcenter {
|
||||
}
|
||||
|
||||
func (v *Vcenter) Login(vUrl string) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("vcenter is nil")
|
||||
}
|
||||
if strings.TrimSpace(vUrl) == "" {
|
||||
return fmt.Errorf("vcenter URL is empty")
|
||||
}
|
||||
if v.credentials == nil {
|
||||
return fmt.Errorf("vcenter credentials are nil")
|
||||
}
|
||||
// Connect to vCenter
|
||||
u, err := soap.ParseURL(vUrl)
|
||||
if err != nil {
|
||||
log.Fatalf("Error parsing vCenter URL: %s", err)
|
||||
return fmt.Errorf("error parsing vCenter URL: %w", err)
|
||||
}
|
||||
v.Vurl = vUrl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user