Make sharepoint cli public (#2787)

Unhide sharepoint CLI commands, and do not
mark them as pre-release.  Hides the --data flag
since we only currently support libraries.

---

#### Does this PR need a docs update or release note?

- [x]  Yes, it's included

#### Type of change

- [x] 🌻 Feature

#### Issue(s)

* #2757

#### Test Plan

- [x]  Unit test
This commit is contained in:
Keepers 2023-03-13 23:59:24 -06:00 committed by GitHub
parent 921542c0f5
commit d9e9e89cca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 7 deletions

View File

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] (beta) ## [Unreleased] (beta)
### Added
- Sharepoint library (document files) support: backup, list, details, and restore.
### Fixed ### Fixed
- Fix repo connect not working without a config file - Fix repo connect not working without a config file

View File

@ -62,6 +62,7 @@ corso backup delete sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd`
corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd --web-url https://example.com corso backup details sharepoint --backup 1234abcd-12ab-cd34-56de-1234abcd --web-url https://example.com
# Find all site 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 --web-url https://example.com --file-created-before 2015-01-01T00:00:00
` `
@ -76,7 +77,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
switch cmd.Use { switch cmd.Use {
case createCommand: case createCommand:
c, fs = utils.AddCommand(cmd, sharePointCreateCmd(), utils.MarkPreReleaseCommand()) c, fs = utils.AddCommand(cmd, sharePointCreateCmd())
c.Use = c.Use + " " + sharePointServiceCommandCreateUseSuffix c.Use = c.Use + " " + sharePointServiceCommandCreateUseSuffix
c.Example = sharePointServiceCommandCreateExamples c.Example = sharePointServiceCommandCreateExamples
@ -95,17 +96,19 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
&sharepointData, &sharepointData,
utils.DataFN, nil, utils.DataFN, nil,
"Select one or more types of data to backup: "+dataLibraries+" or "+dataPages+".") "Select one or more types of data to backup: "+dataLibraries+" or "+dataPages+".")
cobra.CheckErr(fs.MarkHidden(utils.DataFN))
options.AddOperationFlags(c) options.AddOperationFlags(c)
case listCommand: case listCommand:
c, fs = utils.AddCommand(cmd, sharePointListCmd(), utils.MarkPreReleaseCommand()) c, fs = utils.AddCommand(cmd, sharePointListCmd())
fs.StringVar(&backupID, fs.StringVar(&backupID,
utils.BackupFN, "", utils.BackupFN, "",
"ID of the backup to retrieve.") "ID of the backup to retrieve.")
case detailsCommand: case detailsCommand:
c, fs = utils.AddCommand(cmd, sharePointDetailsCmd(), utils.MarkPreReleaseCommand()) c, fs = utils.AddCommand(cmd, sharePointDetailsCmd())
c.Use = c.Use + " " + sharePointServiceCommandDetailsUseSuffix c.Use = c.Use + " " + sharePointServiceCommandDetailsUseSuffix
c.Example = sharePointServiceCommandDetailsExamples c.Example = sharePointServiceCommandDetailsExamples
@ -122,7 +125,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
fs.StringVar( fs.StringVar(
&utils.Library, &utils.Library,
utils.LibraryFN, "", utils.LibraryFN, "",
"Select backup details within a library. Defaults includes all libraries.") "Select backup details within a library. Defaults includes all libraries.")
fs.StringSliceVar( fs.StringSliceVar(
&utils.FolderPaths, &utils.FolderPaths,
@ -148,11 +151,13 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
&pageFolders, &pageFolders,
utils.PageFolderFN, nil, utils.PageFolderFN, nil,
"Select backup data by folder name; accepts '"+utils.Wildcard+"' to select all folders.") "Select backup data by folder name; accepts '"+utils.Wildcard+"' to select all folders.")
cobra.CheckErr(fs.MarkHidden(utils.PageFolderFN))
fs.StringSliceVar( fs.StringSliceVar(
&page, &page,
utils.PagesFN, nil, utils.PagesFN, nil,
"Select backup data by file name; accepts '"+utils.Wildcard+"' to select all pages within the site.") "Select backup data by file name; accepts '"+utils.Wildcard+"' to select all pages within the site.")
cobra.CheckErr(fs.MarkHidden(utils.PagesFN))
// sharepoint info flags // sharepoint info flags
@ -176,7 +181,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
"Select backup details modified before this datetime.") "Select backup details modified before this datetime.")
case deleteCommand: case deleteCommand:
c, fs = utils.AddCommand(cmd, sharePointDeleteCmd(), utils.MarkPreReleaseCommand()) c, fs = utils.AddCommand(cmd, sharePointDeleteCmd())
c.Use = c.Use + " " + sharePointServiceCommandDeleteUseSuffix c.Use = c.Use + " " + sharePointServiceCommandDeleteUseSuffix
c.Example = sharePointServiceCommandDeleteExamples c.Example = sharePointServiceCommandDeleteExamples

View File

@ -31,7 +31,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
switch cmd.Use { switch cmd.Use {
case restoreCommand: case restoreCommand:
c, fs = utils.AddCommand(cmd, sharePointRestoreCmd(), utils.MarkPreReleaseCommand()) c, fs = utils.AddCommand(cmd, sharePointRestoreCmd())
c.Use = c.Use + " " + sharePointServiceCommandUseSuffix c.Use = c.Use + " " + sharePointServiceCommandUseSuffix
@ -60,7 +60,7 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
fs.StringVar( fs.StringVar(
&utils.Library, &utils.Library,
utils.LibraryFN, "", utils.LibraryFN, "",
"Restore files within a library. Default includes all libraries.") "Restore files within a library. Default includes all libraries.")
fs.StringSliceVar( fs.StringSliceVar(
&utils.FolderPaths, &utils.FolderPaths,
@ -76,21 +76,25 @@ func addSharePointCommands(cmd *cobra.Command) *cobra.Command {
&listPaths, &listPaths,
utils.ListFN, nil, utils.ListFN, nil,
"Restore list items by SharePoint list ID") "Restore list items by SharePoint list ID")
cobra.CheckErr(fs.MarkHidden(utils.ListFN))
fs.StringSliceVar( fs.StringSliceVar(
&listItems, &listItems,
utils.ListItemFN, nil, utils.ListItemFN, nil,
"Restore list items by ID") "Restore list items by ID")
cobra.CheckErr(fs.MarkHidden(utils.ListItemFN))
fs.StringSliceVar( fs.StringSliceVar(
&pageFolders, &pageFolders,
utils.PageFolderFN, nil, utils.PageFolderFN, nil,
"Restore Site pages by page folder name") "Restore Site pages by page folder name")
cobra.CheckErr(fs.MarkHidden(utils.PageFolderFN))
fs.StringSliceVar( fs.StringSliceVar(
&pages, &pages,
utils.PagesFN, nil, utils.PagesFN, nil,
"Restore site pages by file name(s)") "Restore site pages by file name(s)")
cobra.CheckErr(fs.MarkHidden(utils.PagesFN))
// sharepoint info flags // sharepoint info flags

View File

@ -0,0 +1,7 @@
package observe
// Display holds display-only configuration. Primarily for passing along
// aliased values when we have a pair of more-and-less user friendly
type Display struct {
ResourceOwner string
}