示例#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.AddRequiredConfigFlag(parser)

        parser.add_argument(
            '--newer-than',
            help="""Return immediately if the stored variable is
                        newer than this time. See $ gcloud topic datetimes
                        for information on time formats.""",
            type=arg_parsers.Datetime.Parse)

        parser.add_argument('--max-wait',
                            help="""\
        An optional maximum time to wait. For example, "30s".
        See $ gcloud topic datetimes for information on duration formats.""",
                            type=arg_parsers.Duration(lower_bound='1s',
                                                      upper_bound='60s'))

        parser.add_argument('name', help='Variable name.')
示例#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.AddRequiredConfigFlag(parser)
示例#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.AddRequiredConfigFlag(parser)
        parser.display_info.AddFormat(
            'table(name, createTime.date(), waiter_status(), error.message)')
示例#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.AddRequiredConfigFlag(parser)

        parser.add_argument('--values',
                            action='store_true',
                            help=('List the variables for which you have Get '
                                  'IAM permission along with their values.'))
示例#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.AddRequiredConfigFlag(parser)
    base.ASYNC_FLAG.AddToParser(parser)

    parser.add_argument(
        '--timeout',
        type=arg_parsers.Duration(lower_bound='1s',
                                  upper_bound='{0}s'.format(
                                      util.MAX_WAITER_TIMEOUT)),
        required=True,
        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.')
示例#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.AddRequiredConfigFlag(parser)
        base.ASYNC_FLAG.AddToParser(parser)

        parser.add_argument('--timeout',
                            type=arg_parsers.Duration(
                                lower_bound='1s',
                                upper_bound='{0}s'.format(
                                    util.MAX_WAITER_TIMEOUT)),
                            required=True,
                            help="""\
        The amount of time to wait before failing with DEADLINE_EXCEEDED.
        See $ gcloud topic datetimes for information on duration formats.
        """)

        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.')
示例#7
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.AddRequiredConfigFlag(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.')
示例#8
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.AddRequiredConfigFlag(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.')
示例#9
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.AddRequiredConfigFlag(parser)

        parser.add_argument('--max-wait',
                            type=arg_parsers.Duration(
                                lower_bound='1s',
                                upper_bound='{0}s'.format(
                                    util.MAX_WAITER_TIMEOUT)),
                            help="""\
        The maximum amount of time to wait for a waiter to finish.
        See $ gcloud topic datetimes for information on duration formats.
        """)

        parser.add_argument('name', help='The waiter name.')
示例#10
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.AddRequiredConfigFlag(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.'))
示例#11
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.AddRequiredConfigFlag(parser)

        parser.add_argument('--max-wait',
                            type=arg_parsers.Duration(
                                lower_bound='1s',
                                upper_bound='{0}s'.format(
                                    util.MAX_WAITER_TIMEOUT)),
                            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.')