Class: Google::Apis::ServicecontrolV2::Peer

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

Overview

This message defines attributes for a node that handles a network request. The node can be either a service or an application that sends, forwards, or receives the request. Service peers should fill in principal and labels as appropriate.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Peer

Returns a new instance of Peer.



600
601
602
# File 'lib/google/apis/servicecontrol_v2/classes.rb', line 600

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

Instance Attribute Details

#ipString

The IP address of the peer. Corresponds to the JSON property ip

Returns:

  • (String)


574
575
576
# File 'lib/google/apis/servicecontrol_v2/classes.rb', line 574

def ip
  @ip
end

#labelsHash<String,String>

The labels associated with the peer. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


579
580
581
# File 'lib/google/apis/servicecontrol_v2/classes.rb', line 579

def labels
  @labels
end

#portFixnum

The network port of the peer. Corresponds to the JSON property port

Returns:

  • (Fixnum)


584
585
586
# File 'lib/google/apis/servicecontrol_v2/classes.rb', line 584

def port
  @port
end

#principalString

The identity of this peer. Similar to Request.auth.principal, but relative to the peer instead of the request. For example, the idenity associated with a load balancer that forwared the request. Corresponds to the JSON property principal

Returns:

  • (String)


591
592
593
# File 'lib/google/apis/servicecontrol_v2/classes.rb', line 591

def principal
  @principal
end

#region_codeString

The CLDR country/region code associated with the above IP address. If the IP address is private, the region_code should reflect the physical location where this peer is running. Corresponds to the JSON property regionCode

Returns:

  • (String)


598
599
600
# File 'lib/google/apis/servicecontrol_v2/classes.rb', line 598

def region_code
  @region_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



605
606
607
608
609
610
611
# File 'lib/google/apis/servicecontrol_v2/classes.rb', line 605

def update!(**args)
  @ip = args[:ip] if args.key?(:ip)
  @labels = args[:labels] if args.key?(:labels)
  @port = args[:port] if args.key?(:port)
  @principal = args[:principal] if args.key?(:principal)
  @region_code = args[:region_code] if args.key?(:region_code)
end