def Args(cls, parser): """Set up arguments for this command.""" backend_buckets_flags.AddUpdatableArgs(cls, parser, 'update') backend_buckets_flags.GCS_BUCKET_ARG.AddArgument(parser) signed_url_flags.AddSignedUrlCacheMaxAge(parser, required=False, unspecified_help='') if cls._support_flexible_cache_step_one: cdn_flags.AddFlexibleCacheStepOne(parser, 'backend bucket', update_command=True) if cls._support_negative_cache: cdn_flags.AddNegativeCache(parser, 'backend bucket', update_command=True) if cls._support_flexible_cache_step_two: cdn_flags.AddFlexibleCacheStepTwo(parser, 'backend bucket', update_command=True) if cls._support_edge_policies: cls.EDGE_SECURITY_POLICY_ARG = ( security_policy_flags. EdgeSecurityPolicyArgumentForTargetResource( resource='backend bucket')) cls.EDGE_SECURITY_POLICY_ARG.AddArgument(parser)
def Args(cls, parser, support_l7_internal_load_balancer, support_failover, support_logging, support_multinic, support_client_only, support_grpc_protocol, support_all_protocol, support_subsetting, support_flexible_cache_step_one): """Add flags to create a backend service to the parser.""" parser.display_info.AddFormat(flags.DEFAULT_LIST_FORMAT) flags.GLOBAL_REGIONAL_BACKEND_SERVICE_ARG.AddArgument( parser, operation_type='create') flags.AddDescription(parser) cls.HEALTH_CHECK_ARG = flags.HealthCheckArgument( support_regional_health_check=support_l7_internal_load_balancer) cls.HEALTH_CHECK_ARG.AddArgument(parser, cust_metavar='HEALTH_CHECK') cls.HTTP_HEALTH_CHECK_ARG = flags.HttpHealthCheckArgument() cls.HTTP_HEALTH_CHECK_ARG.AddArgument(parser, cust_metavar='HTTP_HEALTH_CHECK') cls.HTTPS_HEALTH_CHECK_ARG = flags.HttpsHealthCheckArgument() cls.HTTPS_HEALTH_CHECK_ARG.AddArgument( parser, cust_metavar='HTTPS_HEALTH_CHECK') flags.AddTimeout(parser) flags.AddPortName(parser) flags.AddProtocol(parser, default=None, support_grpc_protocol=support_grpc_protocol, support_all_protocol=support_all_protocol) flags.AddEnableCdn(parser) flags.AddSessionAffinity(parser, support_client_only=support_client_only) flags.AddAffinityCookieTtl(parser) flags.AddConnectionDrainingTimeout(parser) flags.AddLoadBalancingScheme( parser, include_l7_ilb=support_l7_internal_load_balancer) flags.AddCustomRequestHeaders(parser, remove_all_flag=False) flags.AddCacheKeyIncludeProtocol(parser, default=True) flags.AddCacheKeyIncludeHost(parser, default=True) flags.AddCacheKeyIncludeQueryString(parser, default=True) flags.AddCacheKeyQueryStringList(parser) AddIapFlag(parser) parser.display_info.AddCacheUpdater(flags.BackendServicesCompleter) signed_url_flags.AddSignedUrlCacheMaxAge(parser, required=False) if support_subsetting: flags.AddSubsettingPolicy(parser) if support_failover: flags.AddConnectionDrainOnFailover(parser, default=None) flags.AddDropTrafficIfUnhealthy(parser, default=None) flags.AddFailoverRatio(parser) if support_logging: flags.AddEnableLogging(parser) flags.AddLoggingSampleRate(parser) if support_multinic: flags.AddNetwork(parser) if support_flexible_cache_step_one: cdn_flags.AddFlexibleCacheStepOne(parser, 'backend service')
def Args(cls, parser): """Set up arguments for this command.""" parser.display_info.AddFormat( backend_buckets_flags.DEFAULT_LIST_FORMAT) backend_buckets_flags.AddUpdatableArgs(cls, parser, 'create') backend_buckets_flags.REQUIRED_GCS_BUCKET_ARG.AddArgument(parser) parser.display_info.AddCacheUpdater( backend_buckets_flags.BackendBucketsCompleter) signed_url_flags.AddSignedUrlCacheMaxAge(parser, required=False) if cls._support_flexible_cache_step_one: cdn_flags.AddFlexibleCacheStepOne(parser, 'backend bucket')
def Args(cls, parser): """Set up arguments for this command.""" backend_buckets_flags.AddUpdatableArgs(cls, parser, 'update') backend_buckets_flags.GCS_BUCKET_ARG.AddArgument(parser) signed_url_flags.AddSignedUrlCacheMaxAge(parser, required=False, unspecified_help='') if cls._support_flexible_cache_step_one: cdn_flags.AddFlexibleCacheStepOne(parser, 'backend bucket', update_command=True)
def Args(cls, parser, support_l7_internal_load_balancer, support_failover, support_logging, support_client_only, support_grpc_protocol, support_subsetting, support_all_protocol, support_flexible_cache_step_one, support_flexible_cache_step_two, support_negative_cache, support_edge_policies): """Add all arguments for updating a backend service.""" flags.GLOBAL_REGIONAL_BACKEND_SERVICE_ARG.AddArgument( parser, operation_type='update') flags.AddDescription(parser) cls.HEALTH_CHECK_ARG = flags.HealthCheckArgument( support_regional_health_check=support_l7_internal_load_balancer) cls.HEALTH_CHECK_ARG.AddArgument(parser, cust_metavar='HEALTH_CHECK') cls.HTTP_HEALTH_CHECK_ARG = flags.HttpHealthCheckArgument() cls.HTTP_HEALTH_CHECK_ARG.AddArgument(parser, cust_metavar='HTTP_HEALTH_CHECK') cls.HTTPS_HEALTH_CHECK_ARG = flags.HttpsHealthCheckArgument() cls.HTTPS_HEALTH_CHECK_ARG.AddArgument( parser, cust_metavar='HTTPS_HEALTH_CHECK') flags.AddNoHealthChecks(parser) cls.SECURITY_POLICY_ARG = ( security_policy_flags.SecurityPolicyArgumentForTargetResource( resource='backend service')) cls.SECURITY_POLICY_ARG.AddArgument(parser) if support_edge_policies: cls.EDGE_SECURITY_POLICY_ARG = ( security_policy_flags. EdgeSecurityPolicyArgumentForTargetResource( resource='backend service')) cls.EDGE_SECURITY_POLICY_ARG.AddArgument(parser) flags.AddTimeout(parser, default=None) flags.AddPortName(parser) flags.AddProtocol(parser, default=None, support_grpc_protocol=support_grpc_protocol, support_all_protocol=support_all_protocol) flags.AddConnectionDrainingTimeout(parser) flags.AddEnableCdn(parser) flags.AddCacheKeyIncludeProtocol(parser, default=None) flags.AddCacheKeyIncludeHost(parser, default=None) flags.AddCacheKeyIncludeQueryString(parser, default=None) flags.AddCacheKeyQueryStringList(parser) flags.AddSessionAffinity(parser, support_client_only=support_client_only) flags.AddAffinityCookieTtl(parser) signed_url_flags.AddSignedUrlCacheMaxAge(parser, required=False, unspecified_help='') if support_subsetting: flags.AddSubsettingPolicy(parser) if support_failover: flags.AddConnectionDrainOnFailover(parser, default=None) flags.AddDropTrafficIfUnhealthy(parser, default=None) flags.AddFailoverRatio(parser) if support_logging: flags.AddEnableLogging(parser) flags.AddLoggingSampleRate(parser) AddIapFlag(parser) flags.AddCustomRequestHeaders(parser, remove_all_flag=True, default=None) if support_flexible_cache_step_one: cdn_flags.AddFlexibleCacheStepOne(parser, 'backend service', update_command=True) if support_flexible_cache_step_two: cdn_flags.AddFlexibleCacheStepTwo(parser, 'backend service', update_command=True) if support_negative_cache: cdn_flags.AddNegativeCache(parser, 'backend service', update_command=True)