{"modulePath":"github.com/hostinger/api-cli","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package backups\n\n## Variables\n\n```go\nvar GroupCmd = \u0026cobra.Command{\n\tUse:   \"backups\",\n\tShort: \"Backups commands\",\n}\n```\n\n```go\nvar ListCmd = \u0026cobra.Command{\n\tUse:   \"list \u003cvirtual-machine-id\u003e\",\n\tShort: \"Get backups\",\n\tLong:  \"Retrieve backups for a specified virtual machine.\\n\\nUse this endpoint to view available backup points for VPS data recovery.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(1)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().VPSGetBackupsV1WithResponse(context.TODO(), utils.StringToInt(args[0]), listParams(cmd))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\toutput.Format(cmd, r.Body, r.StatusCode())\n\t},\n}\n```\n\n```go\nvar RestoreCmd = \u0026cobra.Command{\n\tUse:   \"restore \u003cvirtual-machine-id\u003e \u003cbackup-id\u003e\",\n\tShort: \"Restore backup\",\n\tLong:  \"Restore a backup for a specified virtual machine.\\n\\nThe system will then initiate the restore process, which may take some time depending on the size of the backup.\\n\\n**All data on the virtual machine will be overwritten with the data from the backup.**\\n\\nUse this endpoint to recover VPS data from backup points.\",\n\tArgs:  cobra.MatchAll(cobra.ExactArgs(2)),\n\tRun: func(cmd *cobra.Command, args []string) {\n\t\tr, err := api.Request().VPSRestoreBackupV1WithResponse(context.TODO(), utils.StringToInt(args[0]), utils.StringToInt(args[1]))\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\toutput.Format(cmd, r.Body, r.StatusCode())\n\t},\n}\n```\n\n","path":"github.com/hostinger/api-cli/cmd/vps/backups","name":"backups","synopsis":"","isRedistributable":true}
