Class: Google::Apis::ComputeV1::SecurityPolicyRule

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
generated/google/apis/compute_v1/classes.rb,
generated/google/apis/compute_v1/representations.rb,
generated/google/apis/compute_v1/representations.rb

Overview

Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ SecurityPolicyRule

Returns a new instance of SecurityPolicyRule.



24249
24250
24251
# File 'generated/google/apis/compute_v1/classes.rb', line 24249

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#actionString

The Action to preform when the client connection triggers the rule. Can currently be either "allow" or "deny()" where valid values for status are 403, 404, and 502. Corresponds to the JSON property action

Returns:

  • (String)


24215
24216
24217
# File 'generated/google/apis/compute_v1/classes.rb', line 24215

def action
  @action
end

#descriptionString

An optional description of this resource. Provide this property when you create the resource. Corresponds to the JSON property description

Returns:

  • (String)


24221
24222
24223
# File 'generated/google/apis/compute_v1/classes.rb', line 24221

def description
  @description
end

#kindString

[Output only] Type of the resource. Always compute#securityPolicyRule for security policy rules Corresponds to the JSON property kind

Returns:

  • (String)


24227
24228
24229
# File 'generated/google/apis/compute_v1/classes.rb', line 24227

def kind
  @kind
end

#matchGoogle::Apis::ComputeV1::SecurityPolicyRuleMatcher

Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified. Corresponds to the JSON property match



24233
24234
24235
# File 'generated/google/apis/compute_v1/classes.rb', line 24233

def match
  @match
end

#previewBoolean Also known as: preview?

If set to true, the specified action is not enforced. Corresponds to the JSON property preview

Returns:

  • (Boolean)


24238
24239
24240
# File 'generated/google/apis/compute_v1/classes.rb', line 24238

def preview
  @preview
end

#priorityFixnum

An integer indicating the priority of a rule in the list. The priority must be a positive value between 0 and 2147483647. Rules are evaluated from highest to lowest priority where 0 is the highest priority and 2147483647 is the lowest prority. Corresponds to the JSON property priority

Returns:

  • (Fixnum)


24247
24248
24249
# File 'generated/google/apis/compute_v1/classes.rb', line 24247

def priority
  @priority
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



24254
24255
24256
24257
24258
24259
24260
24261
# File 'generated/google/apis/compute_v1/classes.rb', line 24254

def update!(**args)
  @action = args[:action] if args.key?(:action)
  @description = args[:description] if args.key?(:description)
  @kind = args[:kind] if args.key?(:kind)
  @match = args[:match] if args.key?(:match)
  @preview = args[:preview] if args.key?(:preview)
  @priority = args[:priority] if args.key?(:priority)
end