Skip to content

Commit

Permalink
Add flag namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
lookup82 committed Jan 19, 2024
1 parent 7f517a9 commit cb89a7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ proxmoxbackupgo.exe -authid string
Certificate fingerprint for SSL connection, example: ea:7d:06:f9...
-datastore string
Datastore name
-namespace string
Namespace (optional)
-pxarout string
Output PXAR archive for debug purposes (optional)
-secret string
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)")

Expand Down Expand Up @@ -99,6 +100,7 @@ func main() {
authid: *authIDFlag,
secret: *secretFlag,
datastore: *datastoreFlag,
namespace: *namespaceFlag,
}

backupdir := *backupSourceDirFlag
Expand Down
4 changes: 4 additions & 0 deletions pbsapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type PBSClient struct {
authid string

datastore string
namespace string
manifest BackupManifest

client http.Client
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit cb89a7a

Please sign in to comment.