Пример #1
0
 def CommonArgs(parser):
     # Flags specific to managed CR
     managed_group = flags.GetManagedArgGroup(parser)
     flags.AddRegionArg(managed_group)
     flags.AddAllowUnauthenticatedFlag(managed_group)
     flags.AddRevisionSuffixArg(managed_group)
     flags.AddServiceAccountFlag(managed_group)
     flags.AddCloudSQLFlags(managed_group)
     # Flags specific to CRoGKE
     gke_group = flags.GetGkeArgGroup(parser)
     concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION
                                    ]).AddToParser(gke_group)
     # Flags not specific to any platform
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(prompt=True),
         'Service to deploy to.',
         required=True,
         prefixes=False)
     flags.AddSourceRefFlags(parser)
     flags.AddFunctionArg(parser)
     flags.AddMutexEnvVarsFlags(parser)
     flags.AddMemoryFlag(parser)
     flags.AddConcurrencyFlag(parser)
     flags.AddTimeoutFlag(parser)
     flags.AddAsyncFlag(parser)
     concept_parsers.ConceptParser([service_presentation
                                    ]).AddToParser(parser)
Пример #2
0
 def Args(parser):
   # Flags specific to managed CR
   managed_group = flags.GetManagedArgGroup(parser)
   flags.AddRegionArg(managed_group)
   flags.AddServiceAccountFlag(managed_group)
   # Flags specific to CRoGKE
   gke_group = flags.GetGkeArgGroup(parser)
   concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION
                                 ]).AddToParser(gke_group)
   # Flags specific to connecting to a Kubernetes cluster (kubeconfig)
   kubernetes_group = flags.GetKubernetesArgGroup(parser)
   flags.AddKubeconfigFlags(kubernetes_group)
   # Flags not specific to any platform
   service_presentation = presentation_specs.ResourcePresentationSpec(
       '--service',
       resource_args.GetServiceResourceSpec(prompt=True),
       'Service to update the configuration of.',
       required=True,
       prefixes=False)
   flags.AddAlphaPlatformArg(parser)
   flags.AddMutexEnvVarsFlags(parser)
   flags.AddMemoryFlag(parser)
   flags.AddConcurrencyFlag(parser)
   flags.AddTimeoutFlag(parser)
   flags.AddAsyncFlag(parser)
   concept_parsers.ConceptParser([service_presentation]).AddToParser(parser)
Пример #3
0
 def CommonArgs(parser):
     # Flags specific to managed CR
     managed_group = flags.GetManagedArgGroup(parser)
     flags.AddRegionArg(managed_group)
     flags.AddServiceAccountFlag(managed_group)
     flags.AddCloudSQLFlags(managed_group)
     # Flags specific to CRoGKE
     gke_group = flags.GetGkeArgGroup(parser)
     concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION
                                    ]).AddToParser(gke_group)
     # Flags not specific to any platform
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(prompt=True),
         'Service to update the configuration of.',
         required=True,
         prefixes=False)
     flags.AddMutexEnvVarsFlags(parser)
     flags.AddMemoryFlag(parser)
     flags.AddConcurrencyFlag(parser)
     flags.AddTimeoutFlag(parser)
     flags.AddAsyncFlag(parser)
     flags.AddLabelsFlags(parser, add_create=False)
     concept_parsers.ConceptParser([service_presentation
                                    ]).AddToParser(parser)
Пример #4
0
 def Args(parser):
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(prompt=True),
         'Service to deploy to.',
         required=True,
         prefixes=False)
     flags.AddSourceRefFlags(parser)
     flags.AddRegionArg(parser)
     flags.AddPlatformArg(parser)
     flags.AddKubeconfigFlags(parser)
     flags.AddFunctionArg(parser)
     flags.AddMutexEnvVarsFlags(parser)
     flags.AddCpuFlag(parser)
     flags.AddMemoryFlag(parser)
     flags.AddConcurrencyFlag(parser)
     flags.AddTimeoutFlag(parser)
     flags.AddAsyncFlag(parser)
     flags.AddEndpointVisibilityEnum(parser)
     flags.AddCloudSQLFlags(parser)
     flags.AddAllowUnauthenticatedFlag(parser)
     flags.AddServiceAccountFlag(parser)
     concept_parsers.ConceptParser(
         [resource_args.CLUSTER_PRESENTATION,
          service_presentation]).AddToParser(parser)
Пример #5
0
 def CommonArgs(parser):
     # Flags specific to managed CR
     managed_group = flags.GetManagedArgGroup(parser)
     flags.AddRegionArg(managed_group)
     flags.AddServiceAccountFlag(managed_group)
     flags.AddCloudSQLFlags(managed_group)
     # Flags specific to CRoGKE
     gke_group = flags.GetGkeArgGroup(parser)
     concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION
                                    ]).AddToParser(gke_group)
     # Flags specific to connecting to a Kubernetes cluster (kubeconfig)
     kubernetes_group = flags.GetKubernetesArgGroup(parser)
     flags.AddKubeconfigFlags(kubernetes_group)
     # Flags specific to connecting to a cluster
     cluster_group = flags.GetClusterArgGroup(parser)
     flags.AddEndpointVisibilityEnum(cluster_group)
     flags.AddCpuFlag(cluster_group)
     # Flags not specific to any platform
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(prompt=True),
         'Service to update the configuration of.',
         required=True,
         prefixes=False)
     flags.AddPlatformArg(parser)
     flags.AddMutexEnvVarsFlags(parser)
     flags.AddMemoryFlag(parser)
     flags.AddConcurrencyFlag(parser)
     flags.AddTimeoutFlag(parser)
     flags.AddAsyncFlag(parser)
     flags.AddLabelsFlags(parser, add_create=False)
     flags.AddMaxInstancesFlag(parser)
     concept_parsers.ConceptParser([service_presentation
                                    ]).AddToParser(parser)
Пример #6
0
    def CommonArgs(parser):
        # Flags specific to managed CR
        managed_group = flags.GetManagedArgGroup(parser)
        flags.AddAllowUnauthenticatedFlag(managed_group)
        flags.AddServiceAccountFlag(managed_group)
        flags.AddCloudSQLFlags(managed_group)
        flags.AddRevisionSuffixArg(managed_group)

        # Flags specific to connecting to a cluster
        cluster_group = flags.GetClusterArgGroup(parser)
        flags.AddEndpointVisibilityEnum(cluster_group)

        # Flags not specific to any platform
        service_presentation = presentation_specs.ResourcePresentationSpec(
            'SERVICE',
            resource_args.GetServiceResourceSpec(prompt=True),
            'Service to deploy to.',
            required=True,
            prefixes=False)
        flags.AddImageArg(parser)
        flags.AddFunctionArg(parser)
        flags.AddMutexEnvVarsFlags(parser)
        flags.AddMemoryFlag(parser)
        flags.AddConcurrencyFlag(parser)
        flags.AddTimeoutFlag(parser)
        flags.AddAsyncFlag(parser)
        flags.AddLabelsFlags(parser)
        flags.AddMaxInstancesFlag(parser)
        flags.AddCommandFlag(parser)
        flags.AddArgsFlag(parser)
        flags.AddPortFlag(parser)
        flags.AddCpuFlag(parser)
        concept_parsers.ConceptParser([service_presentation
                                       ]).AddToParser(parser)
Пример #7
0
 def CommonArgs(parser):
   service_presentation = presentation_specs.ResourcePresentationSpec(
       'SERVICE',
       resource_args.GetServiceResourceSpec(),
       'Service to delete.',
       required=True,
       prefixes=False)
   concept_parsers.ConceptParser([service_presentation]).AddToParser(parser)
Пример #8
0
 def CommonArgs(parser):
   service_presentation = presentation_specs.ResourcePresentationSpec(
       'SERVICE',
       resource_args.GetServiceResourceSpec(),
       'Service to delete.',
       required=True,
       prefixes=False)
   concept_parsers.ConceptParser([service_presentation]).AddToParser(parser)
   flags.AddAsyncFlag(parser, default_async_for_cluster=True)
 def Args(parser):
   service_presentation = presentation_specs.ResourcePresentationSpec(
       'SERVICE',
       resource_args.GetServiceResourceSpec(prompt=True),
       'Service to update the configuration of.',
       required=True,
       prefixes=False)
   flags.AddAsyncFlag(parser)
   flags.AddUpdateTrafficFlags(parser)
   concept_parsers.ConceptParser([service_presentation]).AddToParser(parser)
Пример #10
0
 def Args(parser):
     flags.AddRegionArg(parser)
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(),
         'Service to delete.',
         required=True,
         prefixes=False)
     concept_parsers.ConceptParser(
         [resource_args.CLUSTER_PRESENTATION,
          service_presentation]).AddToParser(parser)
Пример #11
0
    def CommonArgs(parser):
        # Flags specific to managed CR
        managed_group = flags.GetManagedArgGroup(parser)
        flags.AddAllowUnauthenticatedFlag(managed_group)
        flags.AddBinAuthzPolicyFlags(managed_group)
        flags.AddBinAuthzBreakglassFlag(managed_group)
        flags.AddCloudSQLFlags(managed_group)
        flags.AddCpuThrottlingFlag(managed_group)
        flags.AddRevisionSuffixArg(managed_group)
        flags.AddVpcConnectorArgs(managed_group)
        flags.AddEgressSettingsFlag(managed_group)
        flags.AddCmekKeyFlag(managed_group)
        flags.AddCmekKeyRevocationActionTypeFlag(managed_group)

        # Flags specific to connecting to a cluster
        cluster_group = flags.GetClusterArgGroup(parser)
        flags.AddEndpointVisibilityEnum(cluster_group)
        flags.AddConfigMapsFlags(cluster_group)

        # Flags not specific to any platform
        service_presentation = presentation_specs.ResourcePresentationSpec(
            'SERVICE',
            resource_args.GetServiceResourceSpec(prompt=True),
            'Service to deploy to.',
            required=True,
            prefixes=False)
        flags.AddPlatformAndLocationFlags(parser)
        flags.AddFunctionArg(parser)
        flags.AddMutexEnvVarsFlags(parser)
        flags.AddMemoryFlag(parser)
        flags.AddConcurrencyFlag(parser)
        flags.AddTimeoutFlag(parser)
        flags.AddAsyncFlag(parser)
        flags.AddLabelsFlags(parser)
        flags.AddGeneralAnnotationFlags(parser)
        flags.AddMinInstancesFlag(parser)
        flags.AddMaxInstancesFlag(parser)
        flags.AddCommandFlag(parser)
        flags.AddArgsFlag(parser)
        flags.AddPortFlag(parser)
        flags.AddCpuFlag(parser)
        flags.AddNoTrafficFlag(parser)
        flags.AddDeployTagFlag(parser)
        flags.AddServiceAccountFlag(parser)
        flags.AddClientNameAndVersionFlags(parser)
        flags.AddIngressFlag(parser)
        flags.AddHttp2Flag(parser)
        flags.AddSourceAndImageFlags(parser)
        flags.AddSecretsFlags(parser)
        concept_parsers.ConceptParser([service_presentation
                                       ]).AddToParser(parser)
        # No output by default, can be overridden by --format
        parser.display_info.AddFormat('none')
Пример #12
0
 def Args(parser):
     flags.AddRegionArg(parser)
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(),
         'Service to describe.',
         required=True,
         prefixes=False)
     concept_parsers.ConceptParser(
         [resource_args.CLUSTER_PRESENTATION,
          service_presentation]).AddToParser(parser)
     parser.display_info.AddFormat(
         'yaml(apiVersion, kind, metadata, spec, status)')
Пример #13
0
 def Args(parser):
     service_presentation = presentation_specs.ResourcePresentationSpec(
         '--service',
         resource_args.GetServiceResourceSpec(prompt=True),
         'Service to update the configuration of.',
         required=True,
         prefixes=False)
     flags.AddRegionArg(parser)
     flags.AddMutexEnvVarsFlags(parser)
     flags.AddMemoryFlag(parser)
     flags.AddConcurrencyFlag(parser)
     flags.AddAsyncFlag(parser)
     concept_parsers.ConceptParser(
         [resource_args.CLUSTER_PRESENTATION,
          service_presentation]).AddToParser(parser)
Пример #14
0
 def CommonArgs(parser):
   # Flags specific to managed CR
   managed_group = flags.GetManagedArgGroup(parser)
   flags.AddRegionArg(managed_group)
   # Flags specific to CRoGKE
   gke_group = flags.GetGkeArgGroup(parser)
   concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION
                                 ]).AddToParser(gke_group)
   # Flags not specific to any platform
   service_presentation = presentation_specs.ResourcePresentationSpec(
       'SERVICE',
       resource_args.GetServiceResourceSpec(),
       'Service to delete.',
       required=True,
       prefixes=False)
   concept_parsers.ConceptParser([service_presentation]).AddToParser(parser)
Пример #15
0
 def Args(parser):
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(prompt=True),
         'Service to deploy to.',
         required=True,
         prefixes=False)
     flags.AddSourceRefFlags(parser)
     flags.AddRegionArg(parser)
     flags.AddFunctionArg(parser)
     flags.AddMutexEnvVarsFlags(parser)
     flags.AddMemoryFlag(parser)
     flags.AddConcurrencyFlag(parser)
     flags.AddAsyncFlag(parser)
     concept_parsers.ConceptParser(
         [resource_args.CLUSTER_PRESENTATION,
          service_presentation]).AddToParser(parser)
Пример #16
0
  def CommonArgs(cls, parser):
    service_presentation = presentation_specs.ResourcePresentationSpec(
        'SERVICE',
        resource_args.GetServiceResourceSpec(prompt=True),
        'Service to update the configuration of.',
        required=True,
        prefixes=False)
    flags.AddAsyncFlag(parser)
    flags.AddUpdateTrafficFlags(parser)
    flags.AddTrafficTagsFlags(parser)
    concept_parsers.ConceptParser([service_presentation]).AddToParser(parser)

    resource_printer.RegisterFormatter(
        traffic_printer.TRAFFIC_PRINTER_FORMAT,
        traffic_printer.TrafficPrinter,
        hidden=True)
    parser.display_info.AddFormat(traffic_printer.TRAFFIC_PRINTER_FORMAT)
Пример #17
0
 def CommonArgs(parser):
   # Flags specific to managed CR
   managed_group = flags.GetManagedArgGroup(parser)
   flags.AddRegionArg(managed_group)
   # Flags specific to CRoGKE
   gke_group = flags.GetGkeArgGroup(parser)
   concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION
                                 ]).AddToParser(gke_group)
   # Flags not specific to any platform
   service_presentation = presentation_specs.ResourcePresentationSpec(
       'SERVICE',
       resource_args.GetServiceResourceSpec(),
       'Service to describe.',
       required=True,
       prefixes=False)
   concept_parsers.ConceptParser([service_presentation]).AddToParser(parser)
   parser.display_info.AddFormat(
       'yaml(apiVersion, kind, metadata, spec, status)')
Пример #18
0
    def Args(parser):
        # Flags specific to CRoGKE
        gke_group = flags.GetGkeArgGroup(parser)
        concept_parsers.ConceptParser([resource_args.CLUSTER_PRESENTATION
                                       ]).AddToParser(gke_group)

        # Flags not specific to any platform
        service_presentation = presentation_specs.ResourcePresentationSpec(
            'SERVICE',
            resource_args.GetServiceResourceSpec(prompt=True),
            'Service to update the configuration of.',
            required=True,
            prefixes=False)
        flags.AddAsyncFlag(parser)
        flags.AddSetTrafficFlags(parser)
        concept_parsers.ConceptParser([service_presentation
                                       ]).AddToParser(parser)
        flags.AddPlatformArg(parser)
Пример #19
0
    def CommonArgs(parser):
        service_presentation = presentation_specs.ResourcePresentationSpec(
            'SERVICE',
            resource_args.GetServiceResourceSpec(),
            'Service to describe.',
            required=True,
            prefixes=False)
        concept_parsers.ConceptParser([service_presentation
                                       ]).AddToParser(parser)

        resource_printer.RegisterFormatter(
            service_printer.SERVICE_PRINTER_FORMAT,
            service_printer.ServicePrinter,
            hidden=True)
        parser.display_info.AddFormat(service_printer.SERVICE_PRINTER_FORMAT)
        resource_printer.RegisterFormatter(
            export_printer.EXPORT_PRINTER_FORMAT,
            export_printer.ExportPrinter,
            hidden=True)
Пример #20
0
    def CommonArgs(parser):
        # Flags specific to managed CR
        managed_group = flags.GetManagedArgGroup(parser)
        flags.AddAllowUnauthenticatedFlag(managed_group)
        flags.AddCloudSQLFlags(managed_group)
        flags.AddRevisionSuffixArg(managed_group)
        flags.AddVpcConnectorArg(managed_group)

        # Flags specific to connecting to a cluster
        cluster_group = flags.GetClusterArgGroup(parser)
        flags.AddSecretsFlags(cluster_group)
        flags.AddConfigMapsFlags(cluster_group)
        flags.AddHttp2Flag(cluster_group)

        # Flags not specific to any platform
        service_presentation = presentation_specs.ResourcePresentationSpec(
            'SERVICE',
            resource_args.GetServiceResourceSpec(prompt=True),
            'Service to deploy to.',
            required=True,
            prefixes=False)
        flags.AddFunctionArg(parser)
        flags.AddMutexEnvVarsFlags(parser)
        flags.AddMemoryFlag(parser)
        flags.AddConcurrencyFlag(parser)
        flags.AddTimeoutFlag(parser)
        flags.AddAsyncFlag(parser)
        flags.AddLabelsFlags(parser)
        flags.AddMaxInstancesFlag(parser)
        flags.AddCommandFlag(parser)
        flags.AddArgsFlag(parser)
        flags.AddPortFlag(parser)
        flags.AddCpuFlag(parser)
        flags.AddNoTrafficFlag(parser)
        flags.AddServiceAccountFlag(parser)
        concept_parsers.ConceptParser([service_presentation
                                       ]).AddToParser(parser)
        # No output by default, can be overridden by --format
        parser.display_info.AddFormat('none')
 def CommonArgs(parser):
     service_presentation = presentation_specs.ResourcePresentationSpec(
         'SERVICE',
         resource_args.GetServiceResourceSpec(),
         'Service to proxy locally.',
         required=True,
         prefixes=False)
     flags.AddPortFlag(
         parser,
         help_text='Local port number to expose the proxied service. '
         'If not specified, it will be set to 8080.')
     flags.AddTokenFlag(parser)
     flags.AddDeployTagFlag(
         parser,
         help_text=
         'Traffic tag of the service to expose via the proxy. If not '
         'specified, the default service URL will be proxied which may '
         'serve different revisions based on traffic-splits. '
         'Custom tags can be used to proxy specific revisions. Please see '
         'https://cloud.google.com/run/docs/rollouts-rollbacks-traffic-migration#tags.'
     )
     concept_parsers.ConceptParser([service_presentation
                                    ]).AddToParser(parser)