Esempio n. 1
0
  def Args(cls, parser):
    cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
    cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='update')
    parser.add_argument(
        '--description',
        help=('An optional, textual description for the security policy.'))

    parser.add_argument(
        '--enable-layer7-ddos-defense',
        action='store_true',
        default=None,
        help=('Whether to enable Cloud Armor Layer 7 DDoS Defense Adaptive '
              'Protection.'))

    parser.add_argument(
        '--layer7-ddos-defense-rule-visibility',
        choices=['STANDARD', 'PREMIUM'],
        type=lambda x: x.upper(),
        metavar='VISIBILITY_TYPE',
        help=('The visibility type indicates whether the rules are opaque or '
              'transparent.'))

    parser.add_argument(
        '--enable-ml',
        action='store_true',
        default=None,
        help=('Whether to enable Cloud Armor Adaptive Protection'))
Esempio n. 2
0
    def Args(cls, parser):
        cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
        cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='create')

        group = parser.add_group(mutex=True, help='Creation options.')

        group.add_argument(
            '--type',
            choices=['CLOUD_ARMOR', 'CLOUD_ARMOR_EDGE'],
            type=lambda x: x.upper(),
            metavar='SECURITY_POLICY_TYPE',
            help=(
                'The type indicates the intended use of the security policy.'))

        group.add_argument(
            '--file-name',
            help=(
                'The name of the JSON or YAML file to create a security policy '
                'config from.'))

        parser.add_argument(
            '--file-format',
            choices=['json', 'yaml'],
            help=
            ('The format of the file to create the security policy config from. '
             'Specify either yaml or json. Defaults to yaml if not specified. '
             'Will be ignored if --file-name is not specified.'))

        parser.add_argument(
            '--description',
            help=('An optional, textual description for the security policy.'))

        parser.display_info.AddCacheUpdater(
            flags.GlobalSecurityPoliciesCompleter)
Esempio n. 3
0
    def Args(cls, parser):
        cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
        cls.SECURITY_POLICY_ARG.AddArgument(parser)

        parser.add_argument(
            '--description',
            help='An optional, textual description for the security policy.')
Esempio n. 4
0
  def Args(cls, parser):
    cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
    cls.SECURITY_POLICY_ARG.AddArgument(parser)

    parser.add_argument(
        '--file-name',
        required=True,
        help=('The name of the JSON or YAML file to import the security policy '
              'config from.'))
    def Args(cls, parser):
        cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
        cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='create')

        parser.add_argument(
            '--description',
            help='An optional, textual description for the security policy.')

        parser.display_info.AddCacheUpdater(completers.RoutesCompleter)
  def Args(cls, parser):
    cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
    cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='update')
    parser.add_argument(
        '--description',
        help=('An optional, textual description for the security policy.'))

    flags.AddCloudArmorAdaptiveProtection(parser)
    flags.AddAdvancedOptions(parser)
    flags.AddRecaptchaOptions(parser)
Esempio n. 7
0
    def Args(cls, parser):
        cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
        cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='update')
        parser.add_argument(
            '--description',
            help=('An optional, textual description for the security policy.'))

        parser.add_argument(
            '--enable-ml',
            action='store_true',
            default=None,
            help=('Whether to enable Cloud Armor Adaptive Protection'))
  def Args(cls, parser):
    cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
    cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='export')

    parser.add_argument(
        '--file-name',
        required=True,
        help='The name of the file to export the security policy config to.')

    parser.add_argument(
        '--file-format',
        choices=['json', 'yaml'],
        help=(
            'The format of the file to export the security policy config to. '
            'Specify either yaml or json. Defaults to yaml if not specified.'))
Esempio n. 9
0
 def Args(cls, parser):
     cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument(plural=True)
     cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='delete')
     parser.display_info.AddCacheUpdater(flags.SecurityPoliciesCompleter)
Esempio n. 10
0
 def Args(cls, parser):
   cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument()
   cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='describe')
Esempio n. 11
0
 def Args(cls, parser):
     cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument(plural=True)
     cls.SECURITY_POLICY_ARG.AddArgument(parser)
Esempio n. 12
0
 def Args(cls, parser):
     cls.SECURITY_POLICY_ARG = flags.SecurityPolicyArgument(plural=True)
     cls.SECURITY_POLICY_ARG.AddArgument(parser, operation_type='delete')