コード例 #1
0
 def Filter(self, context, args):
     """See base class."""
     base.RequireProjectID(args)
     # Explicitly override container group's LEGACY billing configuration.
     properties.VALUES.billing.quota_project.Set(
         properties.VALUES.billing.CURRENT_PROJECT)
     return context
コード例 #2
0
 def Filter(self, context, args):
     """Runs before command.Run and validates platform with passed args."""
     # Ensures a platform is set on the run/platform property and
     # all other passed args are valid for this platform and release track.
     flags.GetAndValidatePlatform(args, self.ReleaseTrack(),
                                  flags.Product.EVENTS)
     base.RequireProjectID(args)
     self._CheckPlatform()
     return context
コード例 #3
0
 def Filter(self, context, args):
     # TODO(b/190528585):  Determine if command group works with project number
     base.RequireProjectID(args)
     del context, args
     # Intentionally disable the user project override.  Cloud Shell is inteded
     # to be able to be used without first creating a GCP project.
     # Additionally, Cloud Shell is a free product with per user quota, so
     # enabling the API on gcloud will not cost gcloud money.
     base.DisableUserProjectQuota()
コード例 #4
0
    def Filter(self, context, args):
        """Initialize context for source commands.

    Args:
      context: The current context.
      args: The argparse namespace that was specified on the CLI or API.

    Returns:
      The updated context.
    """
        # TODO(b/190539713):  Determine if command group works with project number
        base.RequireProjectID(args)
        base.DisableUserProjectQuota()
コード例 #5
0
    def Filter(self, context, args):
        """Modify the context that will be given to this group's commands when run.

    Args:
      context: {str:object}, A set of key-value pairs that can be used for
        common initialization among commands.
      args: argparse.Namespace: The same namespace given to the corresponding
        .Run() invocation.

    Returns:
      The refined command context.
    """
        base.RequireProjectID(args)
        return context
コード例 #6
0
    def Filter(self, context, args):
        """Context() is a filter function that can update the context.

    Args:
      context: The current context.
      args: The argparse namespace that was specified on the CLI or API.

    Returns:
      The updated context.
    """
        # TODO(b/190533981):  Determine if command group works with project number
        base.RequireProjectID(args)
        base.DisableUserProjectQuota()
        context['servicemanagement-v1'] = apis.GetClientInstance(
            'servicemanagement', 'v1')
        context['servicemanagement-v1-messages'] = apis.GetMessagesModule(
            'servicemanagement', 'v1')

        return context
コード例 #7
0
    def Filter(self, context, args):
        """Modify the context that will be given to this group's commands when run.

    Args:
      context: The current context.
      args: The argparse namespace given to the corresponding .Run() invocation.

    Returns:
      The updated context.
    """
        # TODO(b/190533984):  Determine if command group works with project number
        base.RequireProjectID(args)
        base.DisableUserProjectQuota()
        context['clouderrorreporting_client_v1beta1'] = apis.GetClientInstance(
            'clouderrorreporting', 'v1beta1')
        context[
            'clouderrorreporting_messages_v1beta1'] = apis.GetMessagesModule(
                'clouderrorreporting', 'v1beta1')

        context['clouderrorreporting_resources'] = resources
        return context
コード例 #8
0
  def Filter(self, context, args):
    """Modify the context that will be given to this group's commands when run.

    Args:
      context: {str:object}, A set of key-value pairs that can be used for
          common initialization among commands.
      args: argparse.Namespace: The same namespace given to the corresponding
          .Run() invocation.

    Returns:
      The refined command context.
    """
    # TODO(b/190528955):  Determine if command group works with project number
    base.RequireProjectID(args)
    # The Composer API performs quota checking based on the resource project, so
    # user project overrides are not needed. The 'environments run' command
    # spawns a call to the Kubernetes Engine API, and the 'container' command
    # group also disables user project quota; removing this line will break
    # 'composer environments run.'
    base.DisableUserProjectQuota()

    return context
コード例 #9
0
 def Filter(self, context, args):
     # TODO(b/190534642):  Determine if command group works with project number
     base.RequireProjectID(args)
     del context, args
     base.DisableUserProjectQuota()
コード例 #10
0
 def Filter(self, context, args):
     # TODO(b/190524392):  Determine if command group works with project number
     base.RequireProjectID(args)
     del context, args
     base.DisableUserProjectQuota()
     resources.REGISTRY.RegisterApiByName('apigateway', 'v1')
コード例 #11
0
 def Filter(self, context, args):
   # TODO(b/190541554):  Determine if command group works with project number
   base.RequireProjectID(args)
   del context, args
コード例 #12
0
 def Filter(self, context, args):
   """Enables User-Project override for this surface."""
   base.EnableUserProjectQuota()
   # TODO(b/190538573):  Determine if command group works with project number
   base.RequireProjectID(args)
コード例 #13
0
 def Filter(self, context, args):
     """See base class."""
     base.RequireProjectID(args)
     return context
コード例 #14
0
 def Filter(self, context, args):
   # TODO(b/190536377):  Determine if command group works with project number
   base.RequireProjectID(args)
   del context, args
   base.EnableUserProjectQuotaWithFallback()
コード例 #15
0
 def Filter(self, context, args):
   # TODO(b/190524958):  Determine if command group works with project number
   base.RequireProjectID(args)
   del context, args
   base.DisableUserProjectQuota()
   base.OptOutRequests()  # TODO(b/168048260): Remove to migrate to requests.
コード例 #16
0
 def Filter(self, context, args):
     base.RequireProjectID(args)
     del context, args
コード例 #17
0
 def Filter(self, context, args):
   # TODO(b/190528427):  Determine if command group works with project number
   base.RequireProjectID(args)
   flags.Validate(args)
   return context
コード例 #18
0
 def Filter(self, context, args):
     """Runs before any commands in this group."""
     # TODO(b/190539410):  Determine if command group works with project number
     base.RequireProjectID(args)
     del context, args