def CommonArgs(parser): # Flags not specific to any platform service_presentation = presentation_specs.ResourcePresentationSpec( 'JOB', resource_args.GetJobResourceSpec(prompt=True), 'Job to create.', required=True, prefixes=False) flags.AddImageArg(parser) flags.AddLabelsFlag(parser) flags.AddParallelismFlag(parser) flags.AddCompletionsFlag(parser) flags.AddMaxAttemptsFlag(parser) flags.AddServiceAccountFlag(parser) flags.AddSetEnvVarsFlag(parser) flags.AddSetCloudSQLFlag(parser) flags.AddVpcConnectorArg(parser) flags.AddEgressSettingsFlag(parser) flags.AddMemoryFlag(parser) flags.AddCpuFlag(parser, managed_only=True) flags.AddCommandFlag(parser) flags.AddArgsFlag(parser) flags.AddClientNameAndVersionFlags(parser) flags.AddBinAuthzPolicyFlags(parser, with_clear=False) flags.AddBinAuthzBreakglassFlag(parser) polling_group = parser.add_mutually_exclusive_group() flags.AddAsyncFlag(polling_group) flags.AddWaitForCompletionFlag(polling_group) concept_parsers.ConceptParser([service_presentation]).AddToParser(parser) # No output by default, can be overridden by --format parser.display_info.AddFormat('none')
def Args(parser): Deploy.CommonArgs(parser) # Flags specific to VPCAccess managed_group = flags.GetManagedArgGroup(parser) flags.AddEgressSettingsFlag(managed_group) # Flags specific to connecting to a cluster cluster_group = flags.GetClusterArgGroup(parser) flags.AddEndpointVisibilityEnum(cluster_group, deprecated=True) # Flags not specific to any platform flags.AddMinInstancesFlag(parser) flags.AddDeployTagFlag(parser) flags.AddIngressFlag(parser) # Flags inherited from gcloud builds submit flags.AddConfigFlags(parser) flags.AddSourceFlag(parser) flags.AddBuildTimeoutFlag(parser) # TODO(b/165145546): Remove advanced build flags for 'gcloud run deploy' build_flags.AddGcsSourceStagingDirFlag(parser, True) build_flags.AddGcsLogDirFlag(parser, True) build_flags.AddMachineTypeFlag(parser, True) build_flags.AddDiskSizeFlag(parser, True) build_flags.AddSubstitutionsFlag(parser, True) build_flags.AddWorkerPoolFlag(parser, True) build_flags.AddNoCacheFlag(parser, True) build_flags.AddIgnoreFileFlag(parser, True)
def SetUp(self): self.arg_parser = calliope_test_util.ArgumentParser() flags.AddVpcConnectorArg(self.arg_parser) flags.AddEgressSettingsFlag(self.arg_parser) self.can_prompt = self.StartObjectPatch(console_io, 'CanPrompt') self.prompt_continue = self.StartObjectPatch(console_io, 'PromptContinue') self.service = service.Service.New(self.mock_serverless_client, self.namespace.namespacesId)
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')
def Args(parser): Update.CommonArgs(parser) # Flags specific to managed CR managed_group = flags.GetManagedArgGroup(parser) flags.AddEgressSettingsFlag(managed_group) # Flags only supported on GKE and Knative cluster_group = flags.GetClusterArgGroup(parser) flags.AddEndpointVisibilityEnum(cluster_group) # Flags not specific to any platform flags.AddDeployTagFlag(parser) flags.AddMinInstancesFlag(parser)