Class: Google::Apis::NetworksecurityV1::Rule

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/networksecurity_v1/classes.rb,
lib/google/apis/networksecurity_v1/representations.rb,
lib/google/apis/networksecurity_v1/representations.rb

Overview

Specification of rules.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Rule

Returns a new instance of Rule.



4244
4245
4246
# File 'lib/google/apis/networksecurity_v1/classes.rb', line 4244

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

Instance Attribute Details

#destinationsArray<Google::Apis::NetworksecurityV1::Destination>

Optional. List of attributes for the traffic destination. All of the destinations must match. A destination is a match if a request matches all the specified hosts, ports, methods and headers. If not set, the action specified in the 'action' field will be applied without any rule checks for the destination. Corresponds to the JSON property destinations



4234
4235
4236
# File 'lib/google/apis/networksecurity_v1/classes.rb', line 4234

def destinations
  @destinations
end

#sourcesArray<Google::Apis::NetworksecurityV1::Source>

Optional. List of attributes for the traffic source. All of the sources must match. A source is a match if both principals and ip_blocks match. If not set, the action specified in the 'action' field will be applied without any rule checks for the source. Corresponds to the JSON property sources



4242
4243
4244
# File 'lib/google/apis/networksecurity_v1/classes.rb', line 4242

def sources
  @sources
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4249
4250
4251
4252
# File 'lib/google/apis/networksecurity_v1/classes.rb', line 4249

def update!(**args)
  @destinations = args[:destinations] if args.key?(:destinations)
  @sources = args[:sources] if args.key?(:sources)
end