예제 #1
0
    def Args(parser):
        parser.add_argument(
            'names',
            metavar='NAME',
            nargs='+',
            help='The names of the groups to remove members from.')

        parser.add_argument(
            '--members',
            metavar='USERNAME',
            required=True,
            type=arg_parsers.ArgList(min_length=1),
            action=arg_parsers.FloatingListValuesCatcher(),
            help='The names or fully-qualified URLs of the users to remove.')
예제 #2
0
def AddScopeArgs(parser):
    """Adds scope arguments for instances and instance-templates."""
    scopes_group = parser.add_mutually_exclusive_group()

    def AddScopesHelp():
        return """\
        Specifies service accounts and scopes for the
        instances. Service accounts generate access tokens that can be
        accessed through the instance metadata server and used to
        authenticate applications on the instance. The account can be
        either an email address or an alias corresponding to a
        service account. If account is omitted, the project's default
        service account is used. The default service account can be
        specified explicitly by using the alias ``default''. Example:

          $ {{command}} example-instance --scopes compute-rw,[email protected]=storage-rw

        If this flag is not provided, the following scopes are used:
        {default_scopes}. To create instances with no scopes, use
        ``--no-scopes'':

          $ {{command}} example-instance --no-scopes

        SCOPE can be either the full URI of the scope or an
        alias. Available aliases are:

        [options="header",format="csv",grid="none",frame="none"]
        |========
        Alias,URI
        {aliases}
        |========
        """.format(default_scopes=', '.join(constants.DEFAULT_SCOPES),
                   aliases='\n        '.join(
                       ','.join(value)
                       for value in sorted(constants.SCOPES.iteritems())))

    scopes = scopes_group.add_argument(
        '--scopes',
        type=arg_parsers.ArgList(min_length=1),
        action=arg_parsers.FloatingListValuesCatcher(),
        help='Specifies service accounts and scopes for the instances.',
        metavar='[ACCOUNT=]SCOPE')
    scopes.detailed_help = AddScopesHelp

    scopes_group.add_argument(
        '--no-scopes',
        action='store_true',
        help=(
            'If provided, the default scopes ({scopes}) are not added to the '
            'instances.'.format(scopes=', '.join(constants.DEFAULT_SCOPES))))
예제 #3
0
 def Args(parser):
   parser.add_argument('name',
                       help='The managed instance group name.')
   parser.add_argument(
       '--instances',
       type=arg_parsers.ArgList(min_length=1),
       action=arg_parsers.FloatingListValuesCatcher(),
       metavar='INSTANCE',
       required=True,
       help='Names of instances to abandon.')
   utils.AddZoneFlag(
       parser,
       resource_type='instance group manager',
       operation_type='abandon instances')
예제 #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.
    """
        parser.add_argument('group', help='Managed instance group name.')
        parser.add_argument('--instance',
                            type=arg_parsers.ArgList(min_length=1),
                            metavar='INSTANCE',
                            action=arg_parsers.FloatingListValuesCatcher(),
                            required=True,
                            help='Names of the instances to recreate.')
예제 #5
0
 def Args(parser):
     CreateBeta.Args(parser)
     parser.add_argument(
         '--remote-traffic-selector',
         type=arg_parsers.ArgList(min_length=1),
         action=arg_parsers.FloatingListValuesCatcher(),
         metavar='CIDR',
         help=
         ('Traffic selector is an agreement between IKE peers to permit '
          'traffic through a tunnel if the traffic matches a specified pair'
          ' of local and remote addresses.\n\n'
          'remote_traffic_selector allows to configure the remote addresses'
          ' that are permitted. The value should be a comma separated list '
          'of CIDR formatted strings. '
          'Example: 192.168.0.0/16,10.0.0.0/24.'))
예제 #6
0
def AddLocalSsdArgs(parser):
  """Adds local SSD argument for instances and instance-templates."""

  local_ssd = parser.add_argument(
      '--local-ssd',
      type=arg_parsers.ArgDict(spec={
          'device-name': str,
          'interface': (lambda x: x.upper()),
      }),
      action=arg_parsers.FloatingListValuesCatcher(
          argparse._AppendAction,  # pylint:disable=protected-access
          switch_value={}),
      help='(BETA) Specifies instances with attached local SSDs.',
      metavar='PROPERTY=VALUE')
  local_ssd.detailed_help = """
예제 #7
0
 def Args(parser):
   parser.add_argument('name', help='Managed instance group name.')
   parser.add_argument(
       '--target-pools',
       required=True,
       type=arg_parsers.ArgList(min_length=0),
       action=arg_parsers.FloatingListValuesCatcher(),
       metavar='TARGET_POOL',
       help=('Compute Engine Target Pools to add the instances to. '
             'Target Pools must be specified by name or by URL. Example: '
             '--target-pool target-pool-1,target-pool-2.'))
   utils.AddZoneFlag(
       parser,
       resource_type='instance group manager',
       operation_type='set target pools')
예제 #8
0
    def Args(parser):
        parser.add_argument(
            '--fingerprints',
            type=arg_parsers.ArgList(min_length=1),
            action=arg_parsers.FloatingListValuesCatcher(),
            metavar='FINGERPRINT',
            help='The fingerprints of the public keys to remove from the user.'
        )

        user_utils.AddUserArgument(
            parser,
            '',
            custom_help=(
                'If provided, the name of the user to remove public keys from. '
                'Else, the default user will be used.'))
예제 #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.
    """
        parser.add_argument('group', help='Managed instance group name.')
        parser.add_argument(
            '--target-pool',
            type=arg_parsers.ArgList(min_length=1),
            metavar='TARGET_POOL',
            action=arg_parsers.FloatingListValuesCatcher(),
            required=True,
            help='Names of the Compute Engine target pool resources to use.')
예제 #10
0
    def Args(parser):
        parser.add_argument('name',
                            help='The name of the unmanaged instance group.')

        parser.add_argument(
            '--instances',
            required=True,
            type=arg_parsers.ArgList(min_length=1),
            action=arg_parsers.FloatingListValuesCatcher(),
            metavar='INSTANCE',
            help='The names of the instances to remove from the instance group.'
        )

        utils.AddZoneFlag(parser,
                          resource_type='unmanaged instance group',
                          operation_type='remove instances from')
예제 #11
0
    def Args(parser):
        parser.add_argument(
            '--instances',
            type=arg_parsers.ArgList(min_length=1),
            action=arg_parsers.FloatingListValuesCatcher(),
            help='Specifies a list of instances to add to the target pool.',
            metavar='INSTANCE',
            required=True)

        utils.AddZoneFlag(parser,
                          resource_type='instances',
                          operation_type='add to the target pool')

        parser.add_argument(
            'name',
            help='The name of the target pool to which to add the instances.')
예제 #12
0
  def Args(parser):
    ssh_utils.BaseSSHCLICommand.Args(parser)

    user_host = parser.add_argument(
        'user_host',
        completion_resource='compute.instances',
        help='Specifies the user/instance for the serial port connection',
        metavar='[USER@]INSTANCE')
    user_host.detailed_help = """\
        Specifies the user/instance to for the serial port connection.

        ``USER'' specifies the username to authenticate as. If omitted,
        the current OS user is selected.
        """

    port = parser.add_argument(
        '--port',
        help=('The number of the requested serial port. '
              'Can be 1-4, default is 1.'),
        type=arg_parsers.BoundedInt(1, 4))
    port.detailed_help = """\
        Instances can support up to four serial ports. By default, this
        command will connect to the first serial port. Setting this flag
        will connect to the requested serial port.
        """

    extra_args = parser.add_argument(
        '--extra-args',
        help=('Extra key-value pairs to pass to the connection.'),
        type=arg_parsers.ArgDict(min_length=1),
        action=arg_parsers.FloatingListValuesCatcher(),
        default={},
        metavar='KEY=VALUE')
    extra_args.detailed_help = """\
        Optional arguments can be passed to the serial port connection by
        passing key-value pairs to this flag.
        """

    parser.add_argument(
        '--serial-port-gateway',
        help=argparse.SUPPRESS,
        default=SERIAL_PORT_GATEWAY)

    flags.AddZoneFlag(
        parser,
        resource_type='instance',
        operation_type='connect to')
예제 #13
0
파일: arg_util.py 프로젝트: bopopescu/SDK
def AddCommonTestRunArgs(parser):
  """Register args which are common to all 'gcloud test run' commands.

  Args:
    parser: An argparse parser used to add arguments that follow a command
        in the CLI.
  """
  argspec_arg = parser.add_argument(
      'argspec', nargs='?',
      help='An ARG_FILE:ARG_GROUP_NAME pair, where ARG_FILE is the path to a '
      'file containing groups of test arguments in yaml format, and '
      'ARG_GROUP_NAME is the particular yaml object holding a group of '
      'arg:value pairs to use. Run *$ gcloud topic arg-files* for more '
      'information and examples.')
  argspec_arg.completer = arg_file.ArgSpecCompleter

  parser.add_argument(
      '--type', choices=['instrumentation', 'robo'],
      help='The type of test to run '
      '(_TYPE_ may be one of: instrumentation, robo).')
  parser.add_argument(
      '--app',
      help='The path to the application binary file. The path may be in the '
      'local filesystem or in Google Cloud Storage using gs:// notation.')
  parser.add_argument(
      '--app-package',
      help='The Java package of the application under test (default: extracted '
      'from the APK manifest).')
  parser.add_argument(
      '--async', action='store_true',
      help='Invoke a test asynchronously without waiting for test results.')
  parser.add_argument(
      '--auto-google-login', action='store_true',
      help=argparse.SUPPRESS)
      # TODO(user): add this help text when ready for this to be exposed:
      # help='Automatically log into the test device using a preconfigured '
      # 'Google account before beginning the test.')
  parser.add_argument(
      '--obb-files',
      type=arg_parsers.ArgList(min_length=1, max_length=2),
      metavar='OBB_FILE',
      action=arg_parsers.FloatingListValuesCatcher(),
      help='A list of one or two Android OBB file names which will be copied '
      'to each test device before the tests will run (default: None). Each '
      'OBB file name must conform to the format as specified by Android (e.g. '
      '[main|patch].0300110.com.example.android.obb) and will be installed '
      'into <shared-storage>/Android/obb/<package-name>/ on the test device')
예제 #14
0
    def Args(parser):
        parser.add_argument('name',
                            help='The name of the unmanaged instance group.')

        parser.add_argument(
            '--instances',
            required=True,
            type=arg_parsers.ArgList(min_length=1),
            action=arg_parsers.FloatingListValuesCatcher(),
            metavar='INSTANCE',
            help='A list of names of instances to add to the instance group. '
            'These must exist beforehand and must live in the same zone as '
            'the instance group.')

        utils.AddZoneFlag(parser,
                          resource_type='unmanaged instance group',
                          operation_type='add instances to')
예제 #15
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.
    """
        parser.add_argument('pool', help='Replica pool name.')
        parser.add_argument(
            '--abandon-instance',
            type=arg_parsers.ArgList(),
            metavar='INSTANCE',
            action=arg_parsers.FloatingListValuesCatcher(),
            required=False,
            default=None,
            help='Names of the instances to abandon, but not delete.')
예제 #16
0
  def Args(parser):
    parser.add_argument(
        'name',
        help='The name of the instance group.')

    parser.add_argument(
        '--named-ports',
        required=True,
        type=arg_parsers.ArgList(min_length=1),
        action=arg_parsers.FloatingListValuesCatcher(),
        metavar='NAME:PORT',
        help='The comma-separated list of key:value pairs representing '
        'the service name and the port that it is running on.')

    utils.AddZoneFlag(
        parser,
        resource_type='instance group',
        operation_type='set named ports for')
예제 #17
0
  def Args(parser):
    BaseLister.Args(parser)

    scope = parser.add_mutually_exclusive_group()

    scope.add_argument(
        '--regions',
        metavar='REGION',
        help=('If provided, only regional resources are shown. '
              'If arguments are provided, only resources from the given '
              'regions are shown.'),
        action=arg_parsers.FloatingListValuesCatcher(switch_value=[]),
        type=arg_parsers.ArgList())
    scope.add_argument(
        '--global',
        action='store_true',
        help='If provided, only global resources are shown.',
        default=False)
    def Args(parser):
        tags_group = parser.add_mutually_exclusive_group(required=True)
        tags = tags_group.add_argument(
            '--tags',
            type=arg_parsers.ArgList(min_length=1),
            action=arg_parsers.FloatingListValuesCatcher(),
            help='Tags to remove from the instance.',
            metavar='TAG')
        tags.detailed_help = """\
        Specifies strings to be removed from the instance tags.
        Multiple tags can be removed by repeating this flag.
        """
        tags_group.add_argument('--all',
                                action='store_true',
                                default=False,
                                help='Remove all tags from the instance.')

        base_classes.InstanceTagsMutatorMixin.Args(parser)
예제 #19
0
def _AddArgs(parser, multizonal):
  """Adds args."""
  parser.add_argument('name', help='Managed instance group name.')
  parser.add_argument(
      '--template',
      required=True,
      help=('Specifies the instance template to use when creating new '
            'instances.'))
  parser.add_argument(
      '--base-instance-name',
      help=('The base name to use for the Compute Engine instances that will '
            'be created with the managed instance group. If not provided '
            'base instance name will be the prefix of instance group name.'))
  parser.add_argument(
      '--size',
      required=True,
      help=('The initial number of instances you want in this group.'))
  parser.add_argument(
      '--description',
      help='An optional description for this group.')
  parser.add_argument(
      '--target-pool',
      type=arg_parsers.ArgList(),
      action=arg_parsers.FloatingListValuesCatcher(),
      metavar='TARGET_POOL',
      help=('Specifies any target pools you want the instances of this '
            'managed instance group to be part of.'))
  if multizonal:
    scope_parser = parser.add_mutually_exclusive_group()
    flags.AddRegionFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='create',
        explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
    flags.AddZoneFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='create',
        explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
  else:
    flags.AddZoneFlag(
        parser,
        resource_type='instance group manager',
        operation_type='create')
예제 #20
0
 def Args(parser):
     parser.add_argument('name', help='Managed instance group name.')
     mutually_exclusive_group = parser.add_mutually_exclusive_group()
     mutually_exclusive_group.add_argument(
         '--clear-target-pools',
         action='store_true',
         help='Do not add instances to any Compute Engine Target Pools.')
     mutually_exclusive_group.add_argument(
         '--target-pools',
         type=arg_parsers.ArgList(min_length=1),
         action=arg_parsers.FloatingListValuesCatcher(),
         metavar='TARGET_POOL',
         help=(
             'Compute Engine Target Pools to add the instances to. '
             'Target Pools must can specified by name or by URL. Example: '
             '--target-pool target-pool-1,target-pool-2'))
     utils.AddZoneFlag(parser,
                       resource_type='instance group manager',
                       operation_type='set target pools')
예제 #21
0
    def Args(parser):
        parser.add_argument(
            '--instances',
            type=arg_parsers.ArgList(min_length=1),
            action=arg_parsers.FloatingListValuesCatcher(),
            help=
            'Specifies a list of instances to remove from the target pool.',
            completion_resource='compute.instances',
            metavar='INSTANCE',
            required=True)

        flags.AddZoneFlag(parser,
                          resource_type='instances',
                          operation_type='remove from the target pool')

        parser.add_argument(
            'name',
            completion_resource='compute.targetPools',
            help=
            'The name of the target pool from which to remove the instances.')
예제 #22
0
    def Args(parser):
        parser.add_argument('group', help='The name of the instance group.')

        parser.add_argument('--named-ports',
                            required=True,
                            type=arg_parsers.ArgList(),
                            action=arg_parsers.FloatingListValuesCatcher(),
                            metavar='NAME:PORT',
                            help="""\
            The comma-separated list of key:value pairs representing
            the service name and the port that it is running on.

            To clear the list of named ports pass empty list as flag value.
            For example:

              $ {command} example-instance-group --named-ports ""
            """)

        utils.AddZoneFlag(parser,
                          resource_type='instance group',
                          operation_type='set named ports for')
예제 #23
0
  def Args(parser):
    user_utils.AddUserArgument(parser, '', custom_help=(
        'If provided, the name of the user to add a public key to. '
        'Else, the default user will be used.'))

    parser.add_argument(
        '--public-key-files',
        required=True,
        type=arg_parsers.ArgList(min_length=1),
        action=arg_parsers.FloatingListValuesCatcher(),
        metavar='LOCAL_FILE_PATH',
        help='The path to a public-key file.')

    parser.add_argument(
        '--description',
        help='A description of the public keys')

    expiration = parser.add_argument(
        '--expire',
        help='How long until the public keys expire, e.g. 7d for 7 days',
        type=arg_parsers.Duration())
    expiration.detailed_help = """\
예제 #24
0
    def Args(parser):
        _Args(parser, compute_alpha_messages)

        enable_cdn = parser.add_argument(
            '--enable-cdn',
            action='store_true',
            default=None,  # Tri-valued, None => don't change the setting.
            help='Enable cloud CDN.')
        enable_cdn.detailed_help = """\
        Enable Cloud CDN for the backend service. Cloud CDN can cache HTTP
        responses from a backend service at the edge of the network, close to
        users.
        """

        health_checks = parser.add_argument(
            '--health-checks',
            type=arg_parsers.ArgList(min_length=1),
            metavar='HEALTH_CHECK',
            action=arg_parsers.FloatingListValuesCatcher(),
            help=('Specifies a list of health check objects for checking the '
                  'health of the backend service.'))
        health_checks.detailed_help = """\
예제 #25
0
  def AddArgs(parser, multizonal):
    parser.add_argument(
        'group',
        help='The name of the instance group.')

    parser.add_argument(
        '--named-ports',
        required=True,
        type=arg_parsers.ArgList(),
        action=arg_parsers.FloatingListValuesCatcher(),
        metavar='NAME:PORT',
        help="""\
            The comma-separated list of key:value pairs representing
            the service name and the port that it is running on.

            To clear the list of named ports pass empty list as flag value.
            For example:

              $ {command} example-instance-group --named-ports ""
            """)

    if multizonal:
      scope_parser = parser.add_mutually_exclusive_group()
      flags.AddRegionFlag(
          scope_parser,
          resource_type='instance group',
          operation_type='set named ports for',
          explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
      flags.AddZoneFlag(
          scope_parser,
          resource_type='instance group',
          operation_type='set named ports for',
          explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
      flags.AddZoneFlag(
          parser,
          resource_type='instance group',
          operation_type='set named ports for')
예제 #26
0
  def Args(parser):
    parser.add_argument(
        '--description',
        help=('An optional, textual description for the snapshots being '
              'created.'))

    snapshot_names = parser.add_argument(
        '--snapshot-names',
        type=arg_parsers.ArgList(min_length=1),
        action=arg_parsers.FloatingListValuesCatcher(),
        metavar='SNAPSHOT_NAME',
        help='Names to assign to the snapshots.')
    snapshot_names.detailed_help = """\
        Names to assign to the snapshots. Without this option, the
        name of each snapshot will be a random, 16-character
        hexadecimal number that starts with a letter. The values of
        this option run parallel to the disks specified. For example,

          $ {command} my-disk-1 my-disk-2 my-disk-3 --snapshot-name snapshot-1 snapshot-2 snapshot-3

        will result in ``my-disk-1'' being snapshotted as
        ``snapshot-1'', ``my-disk-2'' as ``snapshot-2'', and so on.
        """

    disk = parser.add_argument(
        'disk_names',
        metavar='DISK_NAME',
        nargs='+',
        help='The names of the disks to snapshot.')
    cli = SnapshotDisks.GetCLIGenerator()
    disk.completer = utils.GetCompleterForResource('compute.disks', cli)

    utils.AddZoneFlag(
        parser,
        resource_type='disks',
        operation_type='snapshot',
        cli=cli)
예제 #27
0
def AddFieldsFlag(parser, resource_type):
  """Adds the --fields flag to the given parser.

  This function is to be called from implementations of describe/list
  subcommands. The resulting help text of --fields will contain all
  valid values for the flag. We need this function becasue Args() is a
  static method so the only way to communicate the resource type is by
  having the subclass pass it in.

  Args:
    parser: The parser to add --fields to.
    resource_type: The resource type as defined in the resource_specs
      module.
  """

  def GenerateDetailedHelp():
    return ('Fields to display. Possible values are:\n+\n  ' +
            '\n  '.join(resource_specs.GetSpec(
                resource_type, compute_v1_messages, 'v1').fields))

  fields = parser.add_argument(
      '--fields',
      type=arg_parsers.ArgList(min_length=1),
      metavar='FIELD',
      action=arg_parsers.FloatingListValuesCatcher(),

      # We have not reached an agreement over the --fields flag for
      # Cloud SDK tools. It has been agreed that the compute component
      # will keep --fields but will keep it undocumented until
      # consensus can be reached over the flag's fate.
      help=argparse.SUPPRESS)

  # Note that we do not actually call GenerateDetailedHelp, the help
  # generator does that. This is important because getting the set of
  # fields is a potentially expensive operation, so we only want to do
  # it when needed.
  fields.detailed_help = GenerateDetailedHelp
예제 #28
0
  def Args(parser):
    """Register flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
          to capture some information, but behaves like an ArgumentParser.
    """
    parser.add_argument(
        'name',
        metavar='NAME',
        help='The name of the cluster to update.')
    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument(
        '--monitoring-service',
        help='The monitoring service to use for the cluster. Options '
        'are: "monitoring.googleapis.com" (the Google Cloud Monitoring '
        'service),  "none" (no metrics will be exported from the cluster)')
    group.add_argument(
        '--update-addons',
        type=arg_parsers.ArgDict(spec={
            api_adapter.INGRESS: _ParseAddonDisabled,
            api_adapter.HPA: _ParseAddonDisabled,
        }),
        dest='disable_addons',
        action=arg_parsers.FloatingListValuesCatcher(),
        metavar='ADDON=ENABLED|DISABLED',
        help='''Cluster addons to enable or disable. Options are
  {hpa}=ENABLED|DISABLED
  {ingress}=ENABLED|DISABLED'''.format(
      hpa=api_adapter.HPA, ingress=api_adapter.INGRESS))
    parser.add_argument(
        '--wait',
        action='store_true',
        default=True,
        help='Poll the operation for completion after issuing an update '
        'request.')
예제 #29
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.
    """
        parser.add_argument('group', help='Managed instance group name.')
        parser.add_argument(
            '--template',
            required=True,
            help=(
                'Name of the Compute Engine instance template resource to be '
                'used.'))
        parser.add_argument(
            '--base-instance-name',
            required=True,
            help=
            'The base name to use for the Compute Engine instances that will '
            'be created in the managed instance group.')
        parser.add_argument(
            '--size',
            required=True,
            help='Initial number of instances in the managed instance group.')
        parser.add_argument('--description',
                            help='Managed instance group description.')
        parser.add_argument(
            '--target-pool',
            type=arg_parsers.ArgList(),
            metavar='TARGET_POOL',
            # TODO(user): URLs should be allowed.
            action=arg_parsers.FloatingListValuesCatcher(),
            help='Compute Engine Target Pools to add the instances to. '
            'Target Pools must be specified by name, not by URL. Example: '
            '--target-pools "target-pool-1,target-pool-2"')
def _Args(parser):
  """Add arguments for route creation."""

  parser.add_argument(
      '--description',
      help='An optional, textual description for the route.')

  parser.add_argument(
      '--network',
      default='default',
      help='Specifies the network to which the route will be applied.')

  tags = parser.add_argument(
      '--tags',
      type=arg_parsers.ArgList(min_length=1),
      action=arg_parsers.FloatingListValuesCatcher(),
      default=[],
      metavar='TAG',
      help='Identifies the set of instances that this route will apply to.')
  tags.detailed_help = """\
      Identifies the set of instances that this route will apply to. If no
      tags are provided, the route will apply to all instances in the network.
      """

  destination_range = parser.add_argument(
      '--destination-range',
      required=True,
      help=('The destination range of outgoing packets that the route will '
            'apply to.'))
  destination_range.detailed_help = """\
      The destination range of outgoing packets that the route will
      apply to. To match all traffic, use ``0.0.0.0/0''.
      """

  priority = parser.add_argument(
      '--priority',
      default=1000,
      help=('Specifies the priority of this route relative to other routes '
            'with the same specifity.'),
      type=int)
  priority.detailed_help = """\
      Specifies the priority of this route relative to other routes
      with the same specifity. The lower the value, the higher the
      priority.
      """

  next_hop = parser.add_mutually_exclusive_group(required=True)

  _AddGaHops(next_hop)

  next_hop_instance_zone = parser.add_argument(
      '--next-hop-instance-zone',
      help='The zone of the next hop instance.',
      action=actions.StoreProperty(properties.VALUES.compute.zone))
  next_hop_instance_zone.detailed_help = ("""\
      The zone of the next hop instance.
      """ + constants.ZONE_PROPERTY_EXPLANATION)

  next_hop_vpn_tunnel_region = parser.add_argument(
      '--next-hop-vpn-tunnel-region',
      help='The region of the next hop vpn tunnel.')
  next_hop_vpn_tunnel_region.detailed_help = ("""\
     The region of the next hop vpn tunnel.
     """ + constants.REGION_PROPERTY_EXPLANATION)

  parser.add_argument(
      'name',
      help='The name to assign to the route.')