diff --git a/README.md b/README.md index 7afad3d..2ff70a1 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,14 @@ proxmoxbackupgo.exe Certificate fingerprint for SSL connection, example: ea:7d:06:f9... -datastore string Datastore name - -pxarout string (optional) - Output PXAR archive for debug purposes + -namespace string + Namespace (optional) + -pxarout string + Output PXAR archive for debug purposes (optional) + -secret string + Secret for authentication + + ``` Known Issues diff --git a/main.go b/main.go index ae56a97..5affc90 100644 --- a/main.go +++ b/main.go @@ -58,6 +58,7 @@ func main() { authIDFlag := flag.String("authid", "", "Authentication ID (PBS Api token)") secretFlag := flag.String("secret", "", "Secret for authentication") datastoreFlag := flag.String("datastore", "", "Datastore name") + namespaceFlag := flag.String("namespace", "", "Namespace (optional)") backupSourceDirFlag := flag.String("backupdir", "", "Backup source directory, must not be symlink") pxarOut := flag.String("pxarout", "", "Output PXAR archive for debug purposes (optional)") @@ -99,6 +100,7 @@ func main() { authid: *authIDFlag, secret: *secretFlag, datastore: *datastoreFlag, + namespace: *namespaceFlag, } backupdir := *backupSourceDirFlag diff --git a/pbsapi.go b/pbsapi.go index 0fceb9a..2ba7afe 100644 --- a/pbsapi.go +++ b/pbsapi.go @@ -82,6 +82,7 @@ type PBSClient struct { authid string datastore string + namespace string manifest BackupManifest client http.Client @@ -366,6 +367,9 @@ func (pbs *PBSClient) Connect(reader bool) { q.Add("backup-time", fmt.Sprintf("%d", pbs.manifest.BackupTime)) q.Add("backup-type", pbs.manifest.BackupType) q.Add("store", pbs.datastore) + if pbs.namespace != "" { + q.Add("ns", pbs.namespace) + } q.Add("backup-id", pbs.manifest.BackupID) q.Add("debug", "1")