update sharepoint cli examples
Updates the sharepoint cli examples to better reflect the current support and utilities.
This commit is contained in:
parent
91328d9898
commit
f80c5575b4
@ -50,7 +50,7 @@ const (
|
|||||||
corso backup create sharepoint --web-url <siteURL>
|
corso backup create sharepoint --web-url <siteURL>
|
||||||
|
|
||||||
# Backup SharePoint for two sites: HR and Team
|
# Backup SharePoint for two sites: HR and Team
|
||||||
corso backup create sharepoint --site https://example.com/hr,https://example.com/team
|
corso backup create sharepoint --web-url https://example.com/hr,https://example.com/team
|
||||||
|
|
||||||
# Backup all SharePoint data for all Sites
|
# Backup all SharePoint data for all Sites
|
||||||
corso backup create sharepoint --web-url '*'`
|
corso backup create sharepoint --web-url '*'`
|
||||||
@ -59,13 +59,15 @@ corso backup create sharepoint --web-url '*'`
|
|||||||
corso backup delete sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd`
|
corso backup delete sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd`
|
||||||
|
|
||||||
sharePointServiceCommandDetailsExamples = `# Explore a site's files from backup 1234abcd-12ab-cd34-56de-1234abcd
|
sharePointServiceCommandDetailsExamples = `# Explore a site's files from backup 1234abcd-12ab-cd34-56de-1234abcd
|
||||||
|
corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd
|
||||||
|
|
||||||
corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd --web-url https://example.com
|
# Find all files that were created before a certain date.
|
||||||
|
|
||||||
# Find all site files that were created before a certain date.
|
|
||||||
|
|
||||||
corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
||||||
--web-url https://example.com --file-created-before 2015-01-01T00:00:00
|
--file-created-before 2015-01-01T00:00:00 --folder "Display Templates/Style Sheets"
|
||||||
|
|
||||||
|
# Find all files within a specific library.
|
||||||
|
corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
||||||
|
--library documents --folder "Display Templates/Style Sheets"
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -104,8 +106,9 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
case listCommand:
|
case listCommand:
|
||||||
c, fs = utils.AddCommand(cmd, sharePointListCmd())
|
c, fs = utils.AddCommand(cmd, sharePointListCmd())
|
||||||
|
|
||||||
fs.StringVar(&backupID,
|
fs.StringVar(
|
||||||
"backup", "",
|
&backupID,
|
||||||
|
utils.BackupFN, "",
|
||||||
"Display a specific backup, including the items that failed or were skipped during processing.")
|
"Display a specific backup, including the items that failed or were skipped during processing.")
|
||||||
|
|
||||||
addFailedItemsFN(c)
|
addFailedItemsFN(c)
|
||||||
@ -120,7 +123,8 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
|
|
||||||
options.AddSkipReduceFlag(c)
|
options.AddSkipReduceFlag(c)
|
||||||
|
|
||||||
fs.StringVar(&backupID,
|
fs.StringVar(
|
||||||
|
&backupID,
|
||||||
utils.BackupFN, "",
|
utils.BackupFN, "",
|
||||||
"ID of the backup to retrieve.")
|
"ID of the backup to retrieve.")
|
||||||
cobra.CheckErr(c.MarkFlagRequired(utils.BackupFN))
|
cobra.CheckErr(c.MarkFlagRequired(utils.BackupFN))
|
||||||
@ -142,16 +146,6 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
utils.FileFN, nil,
|
utils.FileFN, nil,
|
||||||
"Select backup details by file name.")
|
"Select backup details by file name.")
|
||||||
|
|
||||||
fs.StringArrayVar(
|
|
||||||
&utils.Site,
|
|
||||||
utils.SiteFN, nil,
|
|
||||||
"Select backup details by site ID; accepts '"+utils.Wildcard+"' to select all sites.")
|
|
||||||
|
|
||||||
fs.StringSliceVar(
|
|
||||||
&utils.WebURL,
|
|
||||||
utils.WebURLFN, nil,
|
|
||||||
"Select backup data by site webURL; accepts '"+utils.Wildcard+"' to select all sites.")
|
|
||||||
|
|
||||||
fs.StringSliceVar(
|
fs.StringSliceVar(
|
||||||
&pageFolders,
|
&pageFolders,
|
||||||
utils.PageFolderFN, nil,
|
utils.PageFolderFN, nil,
|
||||||
@ -191,7 +185,8 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
c.Use = c.Use + " " + sharePointServiceCommandDeleteUseSuffix
|
c.Use = c.Use + " " + sharePointServiceCommandDeleteUseSuffix
|
||||||
c.Example = sharePointServiceCommandDeleteExamples
|
c.Example = sharePointServiceCommandDeleteExamples
|
||||||
|
|
||||||
fs.StringVar(&backupID,
|
fs.StringVar(
|
||||||
|
&backupID,
|
||||||
utils.BackupFN, "",
|
utils.BackupFN, "",
|
||||||
"ID of the backup to delete. (required)")
|
"ID of the backup to delete. (required)")
|
||||||
cobra.CheckErr(c.MarkFlagRequired(utils.BackupFN))
|
cobra.CheckErr(c.MarkFlagRequired(utils.BackupFN))
|
||||||
|
|||||||
@ -45,16 +45,6 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
|
|||||||
"ID of the backup to restore. (required)")
|
"ID of the backup to restore. (required)")
|
||||||
cobra.CheckErr(c.MarkFlagRequired(utils.BackupFN))
|
cobra.CheckErr(c.MarkFlagRequired(utils.BackupFN))
|
||||||
|
|
||||||
fs.StringSliceVar(
|
|
||||||
&utils.Site,
|
|
||||||
utils.SiteFN, nil,
|
|
||||||
"Restore data by site ID; accepts '"+utils.Wildcard+"' to select all sites.")
|
|
||||||
|
|
||||||
fs.StringSliceVar(
|
|
||||||
&utils.WebURL,
|
|
||||||
utils.WebURLFN, nil,
|
|
||||||
"Restore data by site webURL; accepts '"+utils.Wildcard+"' to select all sites.")
|
|
||||||
|
|
||||||
// sharepoint hierarchy (path/name) flags
|
// sharepoint hierarchy (path/name) flags
|
||||||
|
|
||||||
fs.StringVar(
|
fs.StringVar(
|
||||||
@ -132,13 +122,17 @@ const (
|
|||||||
sharePointServiceCommandRestoreExamples = `# Restore file with ID 98765abcdef
|
sharePointServiceCommandRestoreExamples = `# Restore file with ID 98765abcdef
|
||||||
corso restore sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd --file 98765abcdef
|
corso restore sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd --file 98765abcdef
|
||||||
|
|
||||||
# Restore a Site's file named "ServerRenderTemplate.xsl in "Display Templates/Style Sheets" from a specific backup
|
# Restore a file named "ServerRenderTemplate.xsl in "Display Templates/Style Sheets".
|
||||||
corso restore sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
corso restore sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd \
|
||||||
--web-url https://example.com --file "ServerRenderTemplate.xsl" --folder "Display Templates/Style Sheets"
|
--file "ServerRenderTemplate.xsl" --folder "Display Templates/Style Sheets"
|
||||||
|
|
||||||
# Restore all files from a Site that were created before 2020 when captured in a specific backup
|
# Restore all files that were created before 2020.
|
||||||
corso restore sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd
|
corso restore sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd
|
||||||
--web-url https://example.com --folder "Display Templates/Style Sheets" --file-created-before 2020-01-01T00:00:00`
|
--file-created-before 2020-01-01T00:00:00 --folder "Display Templates/Style Sheets"
|
||||||
|
|
||||||
|
# Restore all files in a certain library.
|
||||||
|
corso restore sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd
|
||||||
|
--library documents --folder "Display Templates/Style Sheets" `
|
||||||
)
|
)
|
||||||
|
|
||||||
// `corso restore sharepoint [<flag>...]`
|
// `corso restore sharepoint [<flag>...]`
|
||||||
|
|||||||
@ -15,15 +15,19 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type SharePointOpts struct {
|
type SharePointOpts struct {
|
||||||
FileNames []string // for libraries, to duplicate onedrive interface
|
Library string
|
||||||
FolderPaths []string // for libraries, to duplicate onedrive interface
|
FileNames []string // for libraries, to duplicate onedrive interface
|
||||||
Library string
|
FolderPaths []string // for libraries, to duplicate onedrive interface
|
||||||
ListItems []string
|
|
||||||
ListPaths []string
|
ListItems []string
|
||||||
PageFolders []string
|
ListPaths []string
|
||||||
Pages []string
|
|
||||||
Sites []string
|
PageFolders []string
|
||||||
WebURLs []string
|
Pages []string
|
||||||
|
|
||||||
|
Sites []string
|
||||||
|
WebURLs []string
|
||||||
|
|
||||||
FileCreatedAfter string
|
FileCreatedAfter string
|
||||||
FileCreatedBefore string
|
FileCreatedBefore string
|
||||||
FileModifiedAfter string
|
FileModifiedAfter string
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user