Class: Google::Apis::ComputeV1::Firewall::Allowed

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

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) ⇒ Allowed

Returns a new instance of Allowed



2511
2512
2513
# File 'generated/google/apis/compute_v1/classes.rb', line 2511

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

Instance Attribute Details

#ip_protocolString

The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, sctp), or the IP protocol number. Corresponds to the JSON property IPProtocol

Returns:

  • (String)


2501
2502
2503
# File 'generated/google/apis/compute_v1/classes.rb', line 2501

def ip_protocol
  @ip_protocol
end

#portsArray<String>

An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. Corresponds to the JSON property ports

Returns:

  • (Array<String>)


2509
2510
2511
# File 'generated/google/apis/compute_v1/classes.rb', line 2509

def ports
  @ports
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2516
2517
2518
2519
# File 'generated/google/apis/compute_v1/classes.rb', line 2516

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