Example #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)

        flags.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.'
        )
Example #2
0
def _CommonArgs(parser, multiple_network_interface_cards, release_track):
    """Common arguments used in Alpha, Beta, and GA."""
    metadata_utils.AddMetadataArgs(parser)
    instances_flags.AddDiskArgs(parser)
    if release_track in [base.ReleaseTrack.ALPHA]:
        instances_flags.AddCreateDiskArgs(parser)
    instances_flags.AddLocalSsdArgs(parser)
    instances_flags.AddCanIpForwardArgs(parser)
    instances_flags.AddAddressArgs(
        parser,
        instances=False,
        multiple_network_interface_cards=multiple_network_interface_cards)
    instances_flags.AddMachineTypeArgs(parser)
    instances_flags.AddMaintenancePolicyArgs(parser)
    instances_flags.AddNoRestartOnFailureArgs(parser)
    instances_flags.AddPreemptibleVmArgs(parser)
    instances_flags.AddScopeArgs(parser)
    instances_flags.AddTagsArgs(parser)
    instances_flags.AddCustomMachineTypeArgs(parser)
    instances_flags.AddImageArgs(parser)
    instances_flags.AddNetworkArgs(parser)

    flags.AddRegionFlag(parser,
                        resource_type='instance template',
                        operation_type='create')

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

    instance_templates_flags.INSTANCE_TEMPLATE_ARG.AddArgument(parser)
Example #3
0
    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.')

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

        parser.add_argument('name', help='The name of the router.')
  def Args(parser):
    parser.display_info.AddFormat(instance_templates_flags.DEFAULT_LIST_FORMAT)
    metadata_utils.AddMetadataArgs(parser)
    instances_flags.AddDiskArgs(parser)
    instances_flags.AddCreateDiskArgs(parser)
    instances_flags.AddLocalSsdArgsWithSize(parser)
    instances_flags.AddCanIpForwardArgs(parser)
    instances_flags.AddAddressArgs(
        parser, multiple_network_interface_cards=False, instances=False)
    instances_flags.AddMachineTypeArgs(parser)
    instances_flags.AddMaintenancePolicyArgs(parser, deprecate=True)
    instances_flags.AddNoRestartOnFailureArgs(parser)
    instances_flags.AddPreemptibleVmArgs(parser)
    instances_flags.AddServiceAccountAndScopeArgs(parser, False)
    instances_flags.AddTagsArgs(parser)
    instances_flags.AddCustomMachineTypeArgs(parser)
    instances_flags.AddNetworkArgs(parser)
    instances_flags.AddDockerArgs(parser)
    instances_flags.AddMinCpuPlatformArgs(parser, base.ReleaseTrack.ALPHA)
    instances_flags.AddNetworkTierArgs(parser, instance=True)

    flags.AddRegionFlag(
        parser,
        resource_type='instance template',
        operation_type='create')

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

    CreateFromContainer.InstanceTemplateArg = (
        instance_templates_flags.MakeInstanceTemplateArg())
    CreateFromContainer.InstanceTemplateArg.AddArgument(
        parser, operation_type='create')
Example #5
0
    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.')

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

        parser.add_argument('name', help='The name of the router.')
Example #6
0
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),
        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()
        flags.AddRegionFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='set target pools',
            explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        flags.AddZoneFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='set target pools',
            explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        flags.AddZoneFlag(parser,
                          resource_type='instance group manager',
                          operation_type='set target pools')
Example #7
0
def AddBackendServiceName(parser, is_regional=False, is_global=True):
    """Add args to specify regional, global (or both) backend service.

  Some commands accept both regional and global resources.
  Args:
    parser: argparse parser.
    is_regional: bool, include region flag.
    is_global: bool, if also regional add global flag, otherwise do nothing.
  """
    parser.add_argument('name', help='The name of the backend service.')

    if is_regional:
        # Only add --global flag if we are supporting regional resource.
        if is_global:
            scope = parser.add_mutually_exclusive_group()
            scope.add_argument(
                '--global',
                action='store_true',
                help='If provided, it is assumed the backend service is global.'
            )
        else:
            scope = parser

        flags.AddRegionFlag(scope,
                            resource_type='backend service',
                            operation_type='operate on')
Example #8
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 recreate.')
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        flags.AddRegionFlag(
            scope_parser,
            resource_type='instance group',
            operation_type='recreate instances',
            explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
        flags.AddZoneFlag(
            scope_parser,
            resource_type='instance group manager',
            operation_type='recreate instances',
            explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
        flags.AddZoneFlag(parser,
                          resource_type='instance group manager',
                          operation_type='recreate instances')
Example #9
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')
Example #10
0
def AddInstanceGroup(parser, operation_type, with_deprecated_zone=False):
    """Add arguments to define instance group."""
    parser.add_argument(
        '--instance-group',
        required=True,
        help='The name or URI of a Google Cloud Instance Group.')

    scope_parser = parser.add_mutually_exclusive_group()
    flags.AddRegionFlag(
        scope_parser,
        resource_type='instance group',
        operation_type='{0} the backend service'.format(operation_type),
        flag_prefix='instance-group',
        explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
    if with_deprecated_zone:
        flags.AddZoneFlag(
            scope_parser,
            resource_type='instance group',
            operation_type='{0} the backend service'.format(operation_type),
            explanation='DEPRECATED, use --instance-group-zone flag instead.')
    flags.AddZoneFlag(
        scope_parser,
        resource_type='instance group',
        operation_type='{0} the backend service'.format(operation_type),
        flag_prefix='instance-group',
        explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
  def Args(parser):
    metadata_utils.AddMetadataArgs(parser)
    instances_flags.AddDiskArgs(parser)
    instances_flags.AddCreateDiskArgs(parser)
    instances_flags.AddLocalSsdArgsWithSize(parser)
    instances_flags.AddCanIpForwardArgs(parser)
    instances_flags.AddAddressArgs(parser, instances=False)
    instances_flags.AddMachineTypeArgs(parser)
    instances_flags.AddMaintenancePolicyArgs(parser)
    instances_flags.AddNoRestartOnFailureArgs(parser)
    instances_flags.AddPreemptibleVmArgs(parser)
    instances_flags.AddServiceAccountAndScopeArgs(parser, False)
    instances_flags.AddTagsArgs(parser)
    instances_flags.AddCustomMachineTypeArgs(parser)
    instances_flags.AddExtendedMachineTypeArgs(parser)
    instances_flags.AddNetworkArgs(parser)
    instances_flags.AddDockerArgs(parser)
    instances_flags.AddMinCpuPlatformArgs(parser)

    flags.AddRegionFlag(
        parser,
        resource_type='instance template',
        operation_type='create')

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

    CreateFromContainer.InstanceTemplateArg = (
        instance_templates_flags.MakeInstanceTemplateArg())
    CreateFromContainer.InstanceTemplateArg.AddArgument(parser)
Example #12
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()
      flags.AddRegionFlag(
          scope_parser,
          resource_type='instance or instance group',
          operation_type='get named ports for',
          explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
      flags.AddZoneFlag(
          scope_parser,
          resource_type='instance or instance group',
          operation_type='get named ports for',
          explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
    else:
      flags.AddZoneFlag(
          parser,
          resource_type='instance or instance group',
          operation_type='get named ports for')
Example #13
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)
    flags.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 AddInstanceGroup(parser, multizonal=False):
    """Add arguments to define instance group."""
    g = parser.add_mutually_exclusive_group(required=True)

    g.add_argument(
        '--group',
        help=('The name of the legacy instance group '
              '(deprecated resourceViews API) that will receive the traffic. '
              'Use --instance-group flag instead.'))

    g.add_argument(
        '--instance-group',
        help=(
            'The name or URI of a Google Cloud Instance Group that can receive'
            ' traffic.'))

    scope_parser = parser
    if multizonal:
        scope_parser = parser.add_mutually_exclusive_group()
        flags.AddRegionFlag(scope_parser,
                            resource_type='instance group',
                            operation_type='add to the backend service')
    flags.AddZoneFlag(scope_parser,
                      resource_type='instance group',
                      operation_type='add to the backend service')
Example #15
0
    def Args(cls, parser):
        cls.ROUTER_ARG = routers_flags.RouterArgumentForNat()
        cls.ROUTER_ARG.AddArgument(parser)

        compute_flags.AddRegionFlag(parser, 'NAT', operation_type='describe')

        nats_flags.AddNatNameArg(parser, operation_type='describe')
Example #16
0
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()
    flags.AddRegionFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='resize',
        explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
    flags.AddZoneFlag(
        scope_parser,
        resource_type='instance group manager',
        operation_type='resize',
        explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
  else:
    flags.AddZoneFlag(
        parser,
        resource_type='instance group manager',
        operation_type='resize')
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()
    flags.AddRegionFlag(
        scope_parser,
        resource_type='managed instance group',
        operation_type='wait until stable',
        explanation=flags.REGION_PROPERTY_EXPLANATION_NO_DEFAULT)
    flags.AddZoneFlag(
        scope_parser,
        resource_type='managed instance group',
        operation_type='wait until stable',
        explanation=flags.ZONE_PROPERTY_EXPLANATION_NO_DEFAULT)
  else:
    flags.AddZoneFlag(
        parser,
        resource_type='managed instance group',
        operation_type='wait until stable')
Example #18
0
    def Args(parser):
        """Register flags for this command."""
        flags.JOB_NAME.AddToParser(parser)
        flags.PACKAGE_PATH.AddToParser(parser)
        flags.PACKAGES.AddToParser(parser)
        flags.MODULE_NAME.AddToParser(parser)
        compute_flags.AddRegionFlag(parser, 'machine learning training job',
                                    'submit')
        flags.CONFIG.AddToParser(parser)
        flags.STAGING_BUCKET.AddToParser(parser)
        parser.add_argument('--job-dir',
                            type=storage_util.ObjectReference.FromUrl,
                            help="""\
            A Google Cloud Storage path in which to store training outputs and
            other data needed for training.

            This path will be passed to your TensorFlow program as `--job_dir`
            command-line arg. The benefit of specifying this field is that Cloud
            ML will validate the path for use in training.

            If packages must be uploaded and `--staging-bucket` is not provided,
            this path will be used instead.
        """)
        flags.GetUserArgs(local=False).AddToParser(parser)
        flags.SCALE_TIER.AddToParser(parser)
        flags.RUNTIME_VERSION.AddToParser(parser)
        base.ASYNC_FLAG.AddToParser(parser)
def _Args(parser, release_track):
  """Add flags shared by all release tracks."""
  parser.display_info.AddFormat(instance_templates_flags.DEFAULT_LIST_FORMAT)
  metadata_utils.AddMetadataArgs(parser)
  instances_flags.AddDiskArgs(parser)
  instances_flags.AddCreateDiskArgs(parser)
  instances_flags.AddLocalSsdArgsWithSize(parser)
  instances_flags.AddCanIpForwardArgs(parser)
  instances_flags.AddAddressArgs(parser, instances=False)
  instances_flags.AddMachineTypeArgs(parser)
  deprecate_maintenance_policy = release_track in [base.ReleaseTrack.ALPHA]
  instances_flags.AddMaintenancePolicyArgs(parser, deprecate_maintenance_policy)
  instances_flags.AddNoRestartOnFailureArgs(parser)
  instances_flags.AddPreemptibleVmArgs(parser)
  instances_flags.AddServiceAccountAndScopeArgs(parser, False)
  instances_flags.AddTagsArgs(parser)
  instances_flags.AddCustomMachineTypeArgs(parser)
  instances_flags.AddNetworkArgs(parser)
  instances_flags.AddKonletArgs(parser)
  instances_flags.AddImageArgs(parser)
  instances_flags.AddMinCpuPlatformArgs(parser, base.ReleaseTrack.ALPHA)

  flags.AddRegionFlag(
      parser,
      resource_type='instance template',
      operation_type='create')

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

  CreateWithContainer.InstanceTemplateArg = (
      instance_templates_flags.MakeInstanceTemplateArg())
  CreateWithContainer.InstanceTemplateArg.AddArgument(
      parser, operation_type='create')
    def Args(parser):
        metadata_utils.AddMetadataArgs(parser)
        instances_flags.AddDiskArgs(parser)
        instances_flags.AddCreateDiskArgs(parser)
        instances_flags.AddLocalSsdArgs(parser)
        instances_flags.AddCanIpForwardArgs(parser)
        instances_flags.AddAddressArgs(parser, instances=False)
        instances_flags.AddMachineTypeArgs(parser)
        instances_flags.AddMaintenancePolicyArgs(parser)
        instances_flags.AddNoRestartOnFailureArgs(parser)
        instances_flags.AddPreemptibleVmArgs(parser)
        instances_flags.AddScopeArgs(parser)
        instances_flags.AddTagsArgs(parser)
        instances_flags.AddCustomMachineTypeArgs(parser)
        instances_flags.AddNetworkArgs(parser)
        instances_flags.AddDockerArgs(parser)

        flags.AddRegionFlag(parser,
                            resource_type='instance template',
                            operation_type='create')

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

        instance_templates_flags.INSTANCE_TEMPLATE_ARG.AddArgument(parser)
Example #21
0
def _AddSubmitTrainingArgs(parser):
  """Add arguments for `jobs submit training` command."""
  flags.JOB_NAME.AddToParser(parser)
  flags.PACKAGE_PATH.AddToParser(parser)
  flags.PACKAGES.AddToParser(parser)
  flags.GetModuleNameFlag(required=False).AddToParser(parser)
  compute_flags.AddRegionFlag(parser, 'machine learning training job',
                              'submit')
  flags.CONFIG.AddToParser(parser)
  flags.STAGING_BUCKET.AddToParser(parser)
  flags.GetJobDirFlag(upload_help=True).AddToParser(parser)
  flags.GetUserArgs(local=False).AddToParser(parser)
  jobs_util.ScaleTierFlagMap().choice_arg.AddToParser(parser)
  flags.RUNTIME_VERSION.AddToParser(parser)
  flags.AddPythonVersionFlag(parser, 'during training')

  sync_group = parser.add_mutually_exclusive_group()
  # TODO(b/36195821): Use the flag deprecation machinery when it supports the
  # store_true action
  sync_group.add_argument(
      '--async', action='store_true', help=(
          '(DEPRECATED) Display information about the operation in progress '
          'without waiting for the operation to complete. '
          'Enabled by default and can be omitted; use `--stream-logs` to run '
          'synchronously.'))
  sync_group.add_argument(
      '--stream-logs',
      action='store_true',
      help=('Block until job completion and stream the logs while the job runs.'
            '\n\n'
            'Note that even if command execution is halted, the job will still '
            'run until cancelled with\n\n'
            '    $ gcloud ai-platform jobs cancel JOB_ID'))
  labels_util.AddCreateLabelsFlags(parser)
    def Args(parser):
        flags.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.')
Example #23
0
  def Args(cls, parser):
    cls.ROUTER_ARG = routers_flags.RouterArgumentForNat()
    cls.ROUTER_ARG.AddArgument(parser)

    rules_flags.AddRuleNumberArg(parser)
    rules_flags.AddNatNameArg(parser)
    compute_flags.AddRegionFlag(
        parser, 'NAT containing the Rule', operation_type='describe')
def _Args(parser,
          release_track,
          container_mount_enabled=False,
          enable_guest_accelerators=False,
          support_multi_writer=True):
    """Add flags shared by all release tracks."""
    parser.display_info.AddFormat(instance_templates_flags.DEFAULT_LIST_FORMAT)
    metadata_utils.AddMetadataArgs(parser)
    instances_flags.AddDiskArgs(
        parser, container_mount_enabled=container_mount_enabled)
    instances_flags.AddCreateDiskArgs(
        parser,
        container_mount_enabled=container_mount_enabled,
        support_multi_writer=support_multi_writer)
    if release_track == base.ReleaseTrack.ALPHA:
        instances_flags.AddLocalSsdArgsWithSize(parser)
    elif release_track == base.ReleaseTrack.BETA:
        instances_flags.AddLocalSsdArgs(parser)
    instances_flags.AddCanIpForwardArgs(parser)
    instances_flags.AddContainerMountDiskFlag(parser)
    instances_flags.AddAddressArgs(parser, instances=False, containers=True)
    instances_flags.AddMachineTypeArgs(parser)
    deprecate_maintenance_policy = release_track in [base.ReleaseTrack.ALPHA]
    instances_flags.AddMaintenancePolicyArgs(parser,
                                             deprecate_maintenance_policy)
    instances_flags.AddNoRestartOnFailureArgs(parser)
    instances_flags.AddPreemptibleVmArgs(parser)
    instances_flags.AddServiceAccountAndScopeArgs(parser, False)
    instances_flags.AddTagsArgs(parser)
    instances_flags.AddCustomMachineTypeArgs(parser)
    instances_flags.AddNetworkArgs(parser)
    instances_flags.AddKonletArgs(parser)
    instances_flags.AddImageArgs(parser)
    instances_flags.AddMinCpuPlatformArgs(parser, release_track)
    instances_flags.AddNetworkTierArgs(parser, instance=True)
    instances_flags.AddConfidentialComputeArgs(parser)
    instances_flags.AddShieldedInstanceConfigArgs(parser)
    labels_util.AddCreateLabelsFlags(parser)
    instances_flags.AddPrivateNetworkIpArgs(parser)

    if enable_guest_accelerators:
        instances_flags.AddAcceleratorArgs(parser)

    flags.AddRegionFlag(parser,
                        resource_type='instance template',
                        operation_type='create')

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

    CreateWithContainer.InstanceTemplateArg = (
        instance_templates_flags.MakeInstanceTemplateArg())
    CreateWithContainer.InstanceTemplateArg.AddArgument(
        parser, operation_type='create')

    parser.display_info.AddCacheUpdater(completers.InstanceTemplatesCompleter)
Example #25
0
    def Args(cls, parser):
        cls.ROUTER_ARG = routers_flags.RouterArgumentForNat()
        cls.ROUTER_ARG.AddArgument(parser)

        base.ASYNC_FLAG.AddToParser(parser)

        compute_flags.AddRegionFlag(parser, 'NAT', operation_type='create')

        nats_flags.AddNatNameArg(parser, operation_type='create')
        nats_flags.AddCommonNatArgs(parser)
Example #26
0
    def Args(parser):
        base_classes.AddFieldsFlag(parser, 'targetPoolInstanceHealth')

        flags.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):
     """Register flags for this command."""
     flags.JOB_NAME.AddToParser(parser)
     flags.PACKAGE_PATH.AddToParser(parser)
     flags.PACKAGES.AddToParser(parser)
     flags.MODULE_NAME.AddToParser(parser)
     compute_flags.AddRegionFlag(parser, 'machine learning training job',
                                 'submit')
     flags.CONFIG.AddToParser(parser)
     flags.STAGING_BUCKET.AddToParser(parser)
     flags.USER_ARGS.AddToParser(parser)
Example #28
0
    def Args(cls, parser):
        cls.ROUTER_ARG = routers_flags.RouterArgumentForNat()
        cls.ROUTER_ARG.AddArgument(parser)

        rules_flags.AddNatNameArg(parser)

        parser.display_info.AddFormat(rules_flags.DEFAULT_LIST_FORMAT)

        compute_flags.AddRegionFlag(parser,
                                    'NAT containing the Rules',
                                    operation_type='list')
 def Args(parser):
     """Register flags for this command."""
     flags.JOB_NAME.AddToParser(parser)
     flags.PACKAGE_PATH.AddToParser(parser)
     flags.PACKAGES.AddToParser(parser)
     flags.MODULE_NAME.AddToParser(parser)
     compute_flags.AddRegionFlag(parser, 'machine learning training job',
                                 'submit')
     flags.CONFIG.AddToParser(parser)
     flags.GetStagingBucket(required=True).AddToParser(parser)
     flags.USER_ARGS.AddToParser(parser)
     base.ASYNC_FLAG.AddToParser(parser)
Example #30
0
    def Args(parser):
        """Adds common flags for mutating addresses."""
        scope = parser.add_mutually_exclusive_group()

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