def Args(parser):
        # TODO(b/33690890): add required=True for this group
        bucket_group = parser.add_mutually_exclusive_group()
        bucket_group.add_argument(
            '--no-bucket',
            action='store_true',
            help='Unsets the bucket. This disables usage report storage.')
        bucket_group.add_argument(
            '--bucket',
            nargs='?',
            action=arg_parsers.HandleNoArgAction(
                'no_bucket',
                'Use of --bucket without an argument is deprecated and will stop '
                'working in the future. To unset the bucket, please use '
                '--no-bucket'),
            help="""\
        The URI of a Google Cloud Storage bucket where the usage
        report object should be stored. The Google Service Account for
        performing usage reporting is granted write access to this bucket.
        The user running this command must be an owner of the bucket.

        To clear the usage bucket, use --no-bucket.
        """)

        parser.add_argument('--prefix',
                            help="""\
        An optional prefix for the name of the usage report object stored in
        the bucket. If not supplied, then this defaults to ``usage''. The
        report is stored as a CSV file named PREFIX_gce_YYYYMMDD.csv where
        YYYYMMDD is the day of the usage according to Pacific Time. The prefix
        should conform to Google Cloud Storage object naming conventions.
        This flag must not be provided when clearing the usage bucket.
        """)
예제 #2
0
  def Args(cls, parser):
    cls.BACKUP_POOL_ARG = flags.BackupPoolArgument()
    cls.TARGET_POOL_ARG = flags.TargetPoolArgument(
        help_suffix=' for which to set the backup pool.')
    cls.TARGET_POOL_ARG.AddArgument(
        parser, operation_type='set a backup pool for')

    # TODO(b/33690890): add required=True to group after deprecation.
    backup_pool_group = parser.add_mutually_exclusive_group()
    backup_pool_group.add_argument(
        '--no-backup-pool', action='store_true',
        help='Unsets the backup pool. This disables failover.')
    backup_pool_group.add_argument(
        '--backup-pool',
        nargs='?',
        action=arg_parsers.HandleNoArgAction(
            'no_backup_pool',
            'Use of --backup-pool without an argument is deprecated and will '
            'stop working in the future. Please use --no-backup-pool to disable'
            ' the backup pool.'),
        completion_resource='targetPools',
        help='Name of the target pool that will serve as backup.')

    parser.add_argument(
        '--failover-ratio',
        type=float,
        help=('The new failover ratio value for the target pool. '
              'This must be a float in the range of [0, 1].'))
예제 #3
0
    def Args(parser):
        # TODO(b/33690890): add required=True for this group
        bucket_group = parser.add_mutually_exclusive_group()
        bucket_group.add_argument(
            '--no-bucket',
            action='store_true',
            help='Unsets the bucket. This disables usage report storage.')
        bucket = bucket_group.add_argument(
            '--bucket',
            nargs='?',
            action=arg_parsers.HandleNoArgAction(
                'no_bucket',
                'Use of --bucket without an argument is deprecated and will stop '
                'working in the future. To unset the bucket, please use '
                '--no-bucket'),
            help=
            ('The URI of a Google Cloud Storage bucket where the usage report '
             'object should be stored'))
        bucket.detailed_help = """\
        The URI of a Google Cloud Storage bucket where the usage
        report object should be stored. The Google Service Account for
        performing usage reporting is granted write access to this bucket.
        The user running this command must be an owner of the bucket.

        To clear the usage bucket, use --no-bucket.
        """

        prefix = parser.add_argument(
            '--prefix',
            help='An optional prefix for the name of the usage report object.')
        prefix.detailed_help = """\