Exemplo n.º 1
0
    def Args(parser):
        parser.add_argument(
            '--backup-pool',
            nargs='?',
            completion_resource='targetPools',
            help=('Name of the target pool that will serve as backup. '
                  'If this flag is provided without a value, the existing '
                  'backup pool is removed.'),
            required=True)

        utils.AddRegionFlag(parser,
                            resource_type='target pool',
                            operation_type='set a backup pool for')

        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].'))

        parser.add_argument(
            'name',
            completion_resource='targetPools',
            help='The name of the target pool for which to set the backup pool.'
        )
Exemplo n.º 2
0
    def AddArgs(parser, multizonal):
        parser.add_argument('name', help='The name of the instance group.')

        parser.add_argument('--limit',
                            type=arg_parsers.BoundedInt(1, sys.maxint),
                            help='The maximum number of results.')

        sort_by = parser.add_argument('--sort-by', help='A field to sort by.')
        sort_by.detailed_help = """\
        A field to sort by. To perform a descending-order sort, prefix
        the value of this flag with a tilde (``~'').
        """

        if multizonal:
            scope_parser = parser.add_mutually_exclusive_group()
            utils.AddRegionFlag(
                scope_parser,
                resource_type='instance or instance group',
                operation_type='get named ports for',
                explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
            utils.AddZoneFlag(
                scope_parser,
                resource_type='instance or instance group',
                operation_type='get named ports for',
                explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
        else:
            utils.AddZoneFlag(parser,
                              resource_type='instance or instance group',
                              operation_type='get named ports for')
Exemplo n.º 3
0
 def Args(parser):
   _CommonArgs(parser)
   instance_utils.AddNetworkArgsAlpha(parser)
   utils.AddRegionFlag(
       parser,
       resource_type='instance template',
       operation_type='create')
Exemplo n.º 4
0
  def Args(parser):
    parser.add_argument(
        '--description',
        help='An optional description of this router.')

    parser.add_argument(
        '--network',
        required=True,
        help='The network for this router')

    parser.add_argument(
        '--asn',
        required=True,
        type=int,
        # TODO(stephenmw): improve this help
        help='The BGP asn for this router')

    utils.AddRegionFlag(
        parser,
        resource_type='router',
        operation_type='create')

    parser.add_argument(
        'name',
        help='The name of the router.')
Exemplo n.º 5
0
def _AddArgs(parser, multizonal):
    """Adds args."""
    managed_instance_groups_utils.AddAutoscalerArgs(parser)
    parser.add_argument(
        'name',
        metavar='NAME',
        completion_resource='compute.instanceGroupManagers',
        help='Managed instance group which autoscaling parameters will be set.'
    )
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        utils.AddRegionFlag(
            scope_parser,
            resource_type='resources',
            operation_type='update',
            explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        utils.AddZoneFlag(
            scope_parser,
            resource_type='resources',
            operation_type='update',
            explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        utils.AddZoneFlag(parser,
                          resource_type='resources',
                          operation_type='update')
Exemplo n.º 6
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()
            utils.AddRegionFlag(
                scope_parser,
                resource_type='instance group',
                operation_type='set named ports for',
                explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
            utils.AddZoneFlag(
                scope_parser,
                resource_type='instance group',
                operation_type='set named ports for',
                explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
        else:
            utils.AddZoneFlag(parser,
                              resource_type='instance group',
                              operation_type='set named ports for')
Exemplo n.º 7
0
def _AddArgs(parser, multizonal):
  """Adds args."""
  parser.add_argument('name', help='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 delete.')
  if multizonal:
    scope_parser = parser.add_mutually_exclusive_group()
    utils.AddRegionFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='delete instances',
        explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
    utils.AddZoneFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='delete instances',
        explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
  else:
    utils.AddZoneFlag(
        parser,
        resource_type='instance group manager',
        operation_type='delete instances')
def _AddArgs(parser, multizonal):
    """Add args."""
    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.'))
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        utils.AddRegionFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='set target pools',
            explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        utils.AddZoneFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='set target pools',
            explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        utils.AddZoneFlag(parser,
                          resource_type='instance group manager',
                          operation_type='set target pools')
Exemplo n.º 9
0
    def Args(parser):
        parser.add_argument('--peer-name',
                            required=True,
                            help='The name of the peer being added.')

        parser.add_argument('--peer-asn',
                            required=True,
                            type=int,
                            help='The asn of the peer being added.')

        parser.add_argument('--vpn-tunnel',
                            required=True,
                            help='The tunnel of the peer being added.')

        parser.add_argument(
            '--ip-address',
            help='The link local address of the router for this peer.')

        parser.add_argument('--peer-ip-address',
                            help='The link local address of the peer.')

        parser.add_argument(
            '--mask-length',
            type=int,
            # TODO(stephenmw): better help
            help=
            'The mask for network used for the server and peer IP addresses.')

        utils.AddRegionFlag(parser,
                            resource_type='router',
                            operation_type='update')

        parser.add_argument('name', help='The name of the router.')
Exemplo n.º 10
0
def _AddArgs(parser, multizonal):
  """Adds args."""
  parser.add_argument('name',
                      help='Name of the managed instance group.')
  parser.add_argument('--timeout',
                      type=int,
                      help='Timeout in seconds for waiting '
                      'for group becoming stable.')
  if multizonal:
    scope_parser = parser.add_mutually_exclusive_group()
    utils.AddRegionFlag(
        scope_parser,
        resource_type='managed instance group',
        operation_type='wait until stable',
        explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
    utils.AddZoneFlag(
        scope_parser,
        resource_type='managed instance group',
        operation_type='wait until stable',
        explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
  else:
    utils.AddZoneFlag(
        parser,
        resource_type='managed instance group',
        operation_type='wait until stable')
    def Args(parser):
        parser.add_argument('--peer-name',
                            required=True,
                            help='The name of the peer being modified.')

        parser.add_argument(
            '--interface',
            help='The new interface of the peer being modified.')

        parser.add_argument('--peer-asn',
                            type=int,
                            help='The new asn of the peer being modified.')

        parser.add_argument(
            '--ip-address',
            help='The new link local address of the router for this peer.')

        parser.add_argument('--peer-ip-address',
                            help='The new link local address of the peer.')

        parser.add_argument(
            '--advertised-route-priority',
            type=int,
            help=
            'The priority of routes advertised to this BGP peer. In the case '
            'where there is more than one matching route of maximum length, '
            'the routes with lowest priority value win. 0 <= priority <= '
            '65535.')

        utils.AddRegionFlag(parser,
                            resource_type='router',
                            operation_type='update')

        parser.add_argument('name', help='The name of the router.')
Exemplo n.º 12
0
def _CommonArgs(parser):
  """Common arguments used in Alpha, Beta, and GA."""
  metadata_utils.AddMetadataArgs(parser)
  instance_utils.AddDiskArgs(parser)
  instance_utils.AddLocalSsdArgs(parser)
  instance_utils.AddCanIpForwardArgs(parser)
  instance_utils.AddAddressArgs(parser, instances=False)
  instance_utils.AddMachineTypeArgs(parser)
  instance_utils.AddMaintenancePolicyArgs(parser)
  instance_utils.AddNoRestartOnFailureArgs(parser)
  instance_utils.AddPreemptibleVmArgs(parser)
  instance_utils.AddScopeArgs(parser)
  instance_utils.AddTagsArgs(parser)
  instance_utils.AddCustomMachineTypeArgs(parser)

  instance_utils.AddNetworkArgs(parser)
  utils.AddRegionFlag(
      parser,
      resource_type='instance template',
      operation_type='create')

  parser.add_argument(
      '--description',
      help='Specifies a textual description for the instance template.')

  parser.add_argument(
      'name',
      metavar='NAME',
      help='The name of the instance template to create.')
    def Args(parser):
        parser.add_argument('--interface-name',
                            required=True,
                            help='The name of the interface being added.')

        parser.add_argument('--vpn-tunnel',
                            required=True,
                            help='The tunnel of the interface being added.')

        parser.add_argument(
            '--ip-address',
            type=utils.IPV4Argument,
            help='The link local address of the router for this interface.')

        parser.add_argument(
            '--mask-length',
            type=int,
            # TODO(user): better help
            help='The mask for network used for the server IP address.')

        utils.AddRegionFlag(parser,
                            resource_type='router',
                            operation_type='update')

        parser.add_argument('name', help='The name of the router.')
Exemplo n.º 14
0
    def Args(parser):
        parser.add_argument('--peer-name',
                            required=True,
                            help='The name of the peer being removed.')

        utils.AddRegionFlag(parser,
                            resource_type='router',
                            operation_type='update')

        parser.add_argument('name', help='The name of the router.')
Exemplo n.º 15
0
    def Args(parser):
        base_classes.AddFieldsFlag(parser, 'targetPoolInstanceHealth')

        utils.AddRegionFlag(parser,
                            resource_type='target pool',
                            operation_type='get health information for')

        parser.add_argument('name',
                            completion_resource='targetPools',
                            help='The name of the target pool.')
    def Args(parser):
        """Adds common flags for mutating addresses."""
        scope = parser.add_mutually_exclusive_group()

        utils.AddRegionFlag(scope,
                            resource_type='address',
                            operation_type='operate on')

        scope.add_argument(
            '--global',
            action='store_true',
            help='If provided, it is assumed the addresses are global.')
    def Args(parser):
        """Adds common flags for mutating forwarding rules."""
        scope = parser.add_mutually_exclusive_group()

        utils.AddRegionFlag(scope,
                            resource_type='forwarding rule',
                            operation_type='operate on')

        global_flag = scope.add_argument(
            '--global',
            action='store_true',
            help='If provided, it is assumed the forwarding rules are global.')
        global_flag.detailed_help = """\
Exemplo n.º 18
0
  def Args(parser):
    """Adds arguments to the supplied parser."""

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

    ike_version = parser.add_argument(
        '--ike-version',
        choices=[1, 2],
        type=int,
        help='Internet Key Exchange protocol version number.')
    ike_version.detailed_help = """\
        Internet Key Exchange protocol version number.
        Valid options are 1 and 2.  Default is 2.
        """

    parser.add_argument(
        '--peer-address',
        required=True,
        help='A valid IP-v4 address representing the remote tunnel endpoint')

    # TODO(jeffvaughan) Add other group members
    shared_secret = parser.add_argument(
        '--shared-secret',
        type=ValidateSimpleSharedSecret,
        required=True,
        help='A shared secret consisting of printable characters')
    shared_secret.detailed_help = (
        'A shared secret consisting of printable characters.  Valid '
        'arguments match the regular expression ' +
        _PRINTABLE_CHARS_PATTERN)

    parser.add_argument(
        '--target-vpn-gateway',
        required=True,
        help='A reference to a target vpn gateway')

    utils.AddRegionFlag(
        parser,
        resource_type='VPN Tunnel',
        operation_type='create')

    parser.add_argument(
        'name',
        help='The name of the VPN tunnel.')
Exemplo n.º 19
0
    def Args(parser):
        parser.add_argument(
            '--http-health-check',
            help=('Specifies an HTTP health check object to add to the '
                  'target pool.'),
            metavar='HEALTH_CHECK',
            completion_resource='httpHealthCheck',
            required=True)

        utils.AddRegionFlag(parser,
                            resource_type='target pool',
                            operation_type='add health checks to')

        parser.add_argument(
            'name',
            completion_resource='targetPools',
            help='The name of the target pool to which to add the health check.'
        )
Exemplo n.º 20
0
    def Args(parser):
        parser.add_argument('--description',
                            help='An optional description of this subnetwork.')

        parser.add_argument(
            '--network',
            required=True,
            help='The network to which the subnetwork belongs.')

        parser.add_argument(
            '--range',
            required=True,
            help='The IP space allocated to this subnetwork in CIDR format.')

        utils.AddRegionFlag(parser,
                            resource_type='subnetwork',
                            operation_type='create')

        parser.add_argument('name', help='The name of the subnetwork.')
Exemplo n.º 21
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()
        utils.AddRegionFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='create',
            explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        utils.AddZoneFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='create',
            explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        utils.AddZoneFlag(parser,
                          resource_type='instance group manager',
                          operation_type='create')
Exemplo n.º 22
0
def _AddArgs(parser, multizonal):
    """Adds args."""
    parser.add_argument('name', help='Managed instance group name.')
    managed_instance_groups_utils.AddAutohealingArgs(parser)
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        utils.AddRegionFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='set autohealing policy',
            explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        utils.AddZoneFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='set autohealing policy',
            explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        utils.AddZoneFlag(parser,
                          resource_type='instance group manager',
                          operation_type='set autohealing policy')
def _AddArgs(parser, multizonal=False):
    """Adds args."""
    g = parser.add_mutually_exclusive_group(required=True)
    g.add_argument('--group',
                   help=('The name of the legacy instance group '
                         '(deprecated resourceViews API) to remove. '
                         'Use --instance-group flag instead.'))
    g.add_argument('--instance-group',
                   help='The name or URI of the instance group to remove.')

    scope_parser = parser
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        utils.AddRegionFlag(scope_parser,
                            resource_type='instance group',
                            operation_type='remove from the backend service')
    utils.AddZoneFlag(parser,
                      resource_type='instance group',
                      operation_type='remove from the backend service')

    parser.add_argument('name', help='The name of the backend service.')
Exemplo n.º 24
0
    def ListInstancesArgs(parser, multizonal=False):
        parser.add_argument('name', help='The name of the instance group.')

        parser.add_argument('--limit',
                            type=arg_parsers.BoundedInt(1, sys.maxint),
                            help='The maximum number of results.')

        sort_by = parser.add_argument('--sort-by', help='A field to sort by.')
        sort_by.detailed_help = """\
        A field to sort by. To perform a descending-order sort, prefix
        the value of this flag with a tilde (``~'').
        """

        uri = parser.add_argument(
            '--uri',
            action='store_true',
            help='If provided, a list of URIs is printed instead of a table.')
        uri.detailed_help = """\
        If provided, the list command will only print URIs for the
        resources returned.  If this flag is not provided, the list
        command will print a human-readable table of useful resource
        data.
        """

        if multizonal:
            scope_parser = parser.add_mutually_exclusive_group()
            utils.AddRegionFlag(
                scope_parser,
                resource_type='instance group',
                operation_type='list instances in',
                explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
            utils.AddZoneFlag(
                scope_parser,
                resource_type='instance group',
                operation_type='list instances in',
                explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
        else:
            utils.AddZoneFlag(parser,
                              resource_type='instance group',
                              operation_type='list instances in')
Exemplo n.º 25
0
    def Args(parser):
        """Adds arguments to the supplied parser."""

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

        network = parser.add_argument(
            '--network',
            required=True,
            help='A reference to a network in this project')
        network.detailed_help = """\
       A reference to a network in this project to
       contain the VPN Gateway.
       """

        utils.AddRegionFlag(parser,
                            resource_type='Target VPN Gatway',
                            operation_type='create')

        parser.add_argument('name', help='The name of the target VPN Gateway.')
def _AddArgs(parser, multizonal):
    """Adds args."""
    parser.add_argument('names',
                        metavar='NAME',
                        nargs='+',
                        completion_resource='compute.instanceGroupManagers',
                        list_command_path=None,
                        help='The resources to delete.')
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        utils.AddRegionFlag(
            scope_parser,
            resource_type='resources',
            operation_type='delete',
            explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        utils.AddZoneFlag(
            scope_parser,
            resource_type='resources',
            operation_type='delete',
            explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        utils.AddZoneFlag(parser,
                          resource_type='resources',
                          operation_type='delete')
def _AddArgs(parser, multizonal):
    """Adds args."""
    parser.add_argument('name', help='Managed instance group name.')
    parser.add_argument(
        '--size',
        required=True,
        type=int,
        help=('Target number of instances in managed instance group.'))
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        utils.AddRegionFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='resize',
            explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        utils.AddZoneFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='resize',
            explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        utils.AddZoneFlag(parser,
                          resource_type='instance group manager',
                          operation_type='resize')
Exemplo n.º 28
0
def _AddArgs(parser, multizonal):
  """Adds args."""
  parser.add_argument('name', help='Managed instance group name.')
  parser.add_argument(
      '--template',
      required=True,
      help=('Compute Engine instance template resource to be used.'))
  if multizonal:
    scope_parser = parser.add_mutually_exclusive_group()
    utils.AddRegionFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='set instance template',
        explanation=constants.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
    utils.AddZoneFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='set instance template',
        explanation=constants.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
  else:
    utils.AddZoneFlag(
        parser,
        resource_type='instance group manager',
        operation_type='set instance template')
Exemplo n.º 29
0
    def Args(parser):
        backup_pool = parser.add_argument(
            '--backup-pool',
            help='Defines the fallback pool for the target pool.')
        backup_pool.detailed_help = """\
        Together with ``--failover-ratio'', this flag defines the fallback
        behavior of the target pool (primary pool) to be created by this
        command. If the ratio of the healthy instances in the primary pool
        is at or below the specified ``--failover-ratio value'', then traffic
        arriving at the load-balanced IP address will be directed to the
        backup pool. If this flag is provided, then ``--failover-ratio'' is
        required.
        """

        parser.add_argument(
            '--description',
            help='An optional description of this target pool.')

        failover_ratio = parser.add_argument(
            '--failover-ratio',
            type=float,
            help=('The ratio of healthy instances below which the backup pool '
                  'will be used.'))
        failover_ratio.detailed_help = """\
        Together with ``--backup-pool'', defines the fallback behavior of the
        target pool (primary pool) to be created by this command. If the
        ratio of the healthy instances in the primary pool is at or below this
        number, traffic arriving at the load-balanced IP address will be
        directed to the backup pool. For example, if 0.4 is chosen as the
        failover ratio, then traffic will fail over to the backup pool if
        more than 40% of the instances become unhealthy.
        If not set, the traffic will be directed the
        instances in this pool in the ``force'' mode, where traffic will be
        spread to the healthy instances with the best effort, or to all
        instances when no instance is healthy.
        If this flag is provided, then ``--backup-pool'' is required.
        """

        health_check = parser.add_argument(
            '--health-check',
            help=
            ('Specifies HttpHealthCheck to determine the health of instances '
             'in the pool.'),
            metavar='HEALTH_CHECK')
        health_check.detailed_help = """\
        Specifies an HTTP health check resource to use to determine the health
        of instances in this pool. If no health check is specified, traffic will
        be sent to all instances in this target pool as if the instances
        were healthy, but the health status of this pool will appear as
        unhealthy as a warning that this target pool does not have a health
        check.
        """

        utils.AddRegionFlag(parser,
                            resource_type='target pool',
                            operation_type='create')

        session_affinity = parser.add_argument(
            '--session-affinity',
            choices=SESSION_AFFINITIES,
            type=lambda x: x.upper(),
            default='NONE',
            help='The session affinity option for the target pool.')
        session_affinity.detailed_help = """\
        Specifies the session affinity option for the connection.
        If ``NONE'' is selected, then connections from the same client
        IP address may go to any instance in the target pool.
        If ``CLIENT_IP'' is selected, then connections
        from the same client IP address will go to the same instance
        in the target pool.
        If ``CLIENT_IP_PROTO'' is selected, then connections from the same
        client IP with the same IP protocol will go to the same client pool.
        If not specified, then ``NONE'' is used as a default.
        """

        parser.add_argument('name', help='The name of the target pool.')
    def Args(parser):
        """Adds arguments to the supplied parser."""

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

        ike_version = parser.add_argument(
            '--ike-version',
            choices=[1, 2],
            type=int,
            help='Internet Key Exchange protocol version number.')
        ike_version.detailed_help = """\
        Internet Key Exchange protocol version number.
        Valid options are 1 and 2.  Default is 2.
        """

        parser.add_argument(
            '--peer-address',
            required=True,
            help='A valid IP-v4 address representing the remote tunnel endpoint'
        )

        # TODO(user) Add other group members
        shared_secret = parser.add_argument(
            '--shared-secret',
            type=ValidateSimpleSharedSecret,
            required=True,
            help='A shared secret consisting of printable characters')
        shared_secret.detailed_help = (
            'A shared secret consisting of printable characters.  Valid '
            'arguments match the regular expression ' +
            _PRINTABLE_CHARS_PATTERN)

        parser.add_argument('--target-vpn-gateway',
                            required=True,
                            help='A reference to a target vpn gateway')

        parser.add_argument('--ike-networks',
                            type=arg_parsers.ArgList(min_length=1),
                            action=arg_parsers.FloatingListValuesCatcher(),
                            help=argparse.SUPPRESS)

        parser.add_argument(
            '--local-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'
             'local_traffic_selector allows to configure the local addresses '
             'that are permitted. The value should be a comma separate list of'
             ' CIDR formatted strings. Example: 192.168.0.0/16,10.0.0.0/24.'))

        utils.AddRegionFlag(parser,
                            resource_type='VPN Tunnel',
                            operation_type='create')

        parser.add_argument('name', help='The name of the VPN tunnel.')