Example #1
0
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
    flags.AddConfigFlag(parser)
Example #2
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
        flags.AddConfigFlag(parser)
        base.ASYNC_FLAG.AddToParser(parser)

        timeout = parser.add_argument(
            '--timeout',
            help=('The amount of time to wait before failing with '
                  'DEADLINE_EXCEEDED.'),
            type=arg_parsers.Duration(lower_bound='1s',
                                      upper_bound='{0}s'.format(
                                          util.MAX_WAITER_TIMEOUT)),
            required=True)
        timeout.detailed_help = """\
        The amount of time to wait before failing with DEADLINE_EXCEEDED.
        Timeout values can be specified as seconds, minutes, or hours, using the
        's', 'm', and 'h' suffixes respectively. If no suffix is specified, the
        unit is assumed to be seconds.
        """

        parser.add_argument(
            '--success-cardinality-path',
            help='The path where success variables are written.',
            required=True)
        parser.add_argument(
            '--success-cardinality-number',
            help='The minimum required number of success variables.',
            type=arg_parsers.BoundedInt(lower_bound=1),
            default=1)

        parser.add_argument(
            '--failure-cardinality-path',
            help='The path where failure variables are written.')
        parser.add_argument(
            '--failure-cardinality-number',
            help='The minimum required number of failure variables.',
            type=arg_parsers.BoundedInt(lower_bound=1),
            default=1)

        parser.add_argument('name', help='The waiter name.')
Example #3
0
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
    flags.AddConfigFlag(parser)

    parser.add_argument(
        '--fail-if-absent',
        help='Fail if a variable with the specified name does not exist.',
        action='store_true')

    parser.add_argument(
        '--recursive',
        help='Delete a parent node and all of its children.',
        action='store_true')

    parser.add_argument('name', help='The variable name.')
Example #4
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
        flags.AddConfigFlag(parser)

        parser.add_argument('--newer-than',
                            help='''Return immediately if the stored
                        variable is newer than this timestamp.''',
                            type=arg_parsers.Datetime.Parse)

        parser.add_argument(
            '--max-wait',
            help='An optional maximum number of seconds to wait.',
            type=arg_parsers.Duration(lower_bound='1s', upper_bound='60s'))

        parser.add_argument('name', help='Variable name.')
Example #5
0
    def Args(parser):
        """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
        flags.AddConfigFlag(parser)

        fail_group = parser.add_mutually_exclusive_group()
        fail_group.add_argument(
            '--fail-if-present',
            help='Fail if a variable with the specified name already exists.',
            action='store_true')
        fail_group.add_argument(
            '--fail-if-absent',
            help='Fail if a variable with the specified name does not exist.',
            action='store_true')

        parser.add_argument('name', help='The variable name.')
        parser.add_argument(
            'value',
            nargs='?',
            default=None,
            help=
            ('The variable value. If absent, the value will be read from stdin. '
             'The value is automatically base64-encoded, '
             'unless --is-text flag is set.'))

        parser.add_argument(
            '--is-text',
            default=False,
            required=False,
            action='store_true',
            help=('If True, send and store the value as text. Can '
                  'be used if the value contains only text '
                  '(UTF-8 encoded). This affects how the variable '
                  'is transmitted on the wire and requires less '
                  'quota on the backend.'))
Example #6
0
  def Args(parser):
    """Args is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go
          on the command line after this command. Positional arguments are
          allowed.
    """
    flags.AddConfigFlag(parser)

    max_wait = parser.add_argument(
        '--max-wait',
        help='The maximum amount of time to wait for a waiter to finish.',
        type=arg_parsers.Duration(lower_bound='1s',
                                  upper_bound='{0}s'.format(
                                      util.MAX_WAITER_TIMEOUT)))
    max_wait.detailed_help = """\
        The maximum amount of time to wait for a waiter to finish.
        Timeout values can be specified as seconds, minutes, or hours, using the
        's', 'm', and 'h' suffixes respectively. If no suffix is specified, the
        unit is assumed to be seconds.
        """

    parser.add_argument('name', help='The waiter name.')