Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ShowCmd = &cobra.Command{ Use: "show", Short: "shows the versioning configuration for the target bucket", SilenceUsage: false, SilenceErrors: true, Example: `# show the current versioning configuration for bucket s3-manager versioning show `, RunE: func(cmd *cobra.Command, args []string) (err error) { var rootOpts *rootopts.RootOptions svc, rootOpts, logger, _ = utils.PrepareConstants(cmd) versioningOpts.RootOptions = rootOpts if err := utils.CheckArgs(args, 0); err != nil { logger.Error().Msg(err.Error()) return err } versioning, err := aws.GetBucketVersioning(svc, versioningOpts.RootOptions) if err != nil { return err } switch *versioning.Status { case "Enabled": versioningOpts.ActualState = "enabled" case "Suspended": versioningOpts.ActualState = "disabled" default: err := fmt.Errorf("unknown versioning status %s returned from S3 SDK", *versioning.Status) logger.Error().Msg(err.Error()) return err } logger.Info().Msgf("current versioning configuration is %s", versioningOpts.ActualState) return nil }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.