Documentation

Peer extends Message
in package

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.

Generated from protobuf message google.rpc.context.AttributeContext.Peer

Table of Contents

Properties

$ip  : mixed
The IP address of the peer.
$port  : mixed
The network port of the peer.
$principal  : mixed
The identity of this peer. Similar to `Request.auth.principal`, but relative to the peer instead of the request. For example, the identity associated with a load balancer that forwarded the request.
$region_code  : mixed
The CLDR country/region code associated with the above IP address.
$labels  : mixed
The labels associated with the peer.

Methods

__construct()  : mixed
Constructor.
getIp()  : string
The IP address of the peer.
getLabels()  : MapField
The labels associated with the peer.
getPort()  : int|string
The network port of the peer.
getPrincipal()  : string
The identity of this peer. Similar to `Request.auth.principal`, but relative to the peer instead of the request. For example, the identity associated with a load balancer that forwarded the request.
getRegionCode()  : string
The CLDR country/region code associated with the above IP address.
setIp()  : $this
The IP address of the peer.
setLabels()  : $this
The labels associated with the peer.
setPort()  : $this
The network port of the peer.
setPrincipal()  : $this
The identity of this peer. Similar to `Request.auth.principal`, but relative to the peer instead of the request. For example, the identity associated with a load balancer that forwarded the request.
setRegionCode()  : $this
The CLDR country/region code associated with the above IP address.

Properties

$ip

The IP address of the peer.

protected mixed $ip = ''

Generated from protobuf field string ip = 1 [json_name = "ip"];

$port

The network port of the peer.

protected mixed $port = 0

Generated from protobuf field int64 port = 2 [json_name = "port"];

$principal

The identity of this peer. Similar to `Request.auth.principal`, but relative to the peer instead of the request. For example, the identity associated with a load balancer that forwarded the request.

protected mixed $principal = ''

Generated from protobuf field string principal = 7 [json_name = "principal"];

$region_code

The CLDR country/region code associated with the above IP address.

protected mixed $region_code = ''

If the IP address is private, the region_code should reflect the physical location where this peer is running.

Generated from protobuf field string region_code = 8 [json_name = "regionCode"];

$labels

The labels associated with the peer.

private mixed $labels

Generated from protobuf field map<string, string> labels = 6 [json_name = "labels"];

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $data = NULL ]) : mixed
Parameters
$data : array<string|int, mixed> = NULL

{ Optional. Data for populating the Message object.

@type string $ip
      The IP address of the peer.
@type int|string $port
      The network port of the peer.
@type array|\Google\Protobuf\Internal\MapField $labels
      The labels associated with the peer.
@type string $principal
      The identity of this peer. Similar to `Request.auth.principal`, but
      relative to the peer instead of the request. For example, the
      identity associated with a load balancer that forwarded the request.
@type string $region_code
      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.

}

getIp()

The IP address of the peer.

public getIp() : string

Generated from protobuf field string ip = 1 [json_name = "ip"];

Return values
string

getLabels()

The labels associated with the peer.

public getLabels() : MapField

Generated from protobuf field map<string, string> labels = 6 [json_name = "labels"];

Return values
MapField

getPort()

The network port of the peer.

public getPort() : int|string

Generated from protobuf field int64 port = 2 [json_name = "port"];

Return values
int|string

getPrincipal()

The identity of this peer. Similar to `Request.auth.principal`, but relative to the peer instead of the request. For example, the identity associated with a load balancer that forwarded the request.

public getPrincipal() : string

Generated from protobuf field string principal = 7 [json_name = "principal"];

Return values
string

getRegionCode()

The CLDR country/region code associated with the above IP address.

public getRegionCode() : string

If the IP address is private, the region_code should reflect the physical location where this peer is running.

Generated from protobuf field string region_code = 8 [json_name = "regionCode"];

Return values
string

setIp()

The IP address of the peer.

public setIp(string $var) : $this

Generated from protobuf field string ip = 1 [json_name = "ip"];

Parameters
$var : string
Return values
$this

setLabels()

The labels associated with the peer.

public setLabels(array<string|int, mixed>|MapField $var) : $this

Generated from protobuf field map<string, string> labels = 6 [json_name = "labels"];

Parameters
$var : array<string|int, mixed>|MapField
Return values
$this

setPort()

The network port of the peer.

public setPort(int|string $var) : $this

Generated from protobuf field int64 port = 2 [json_name = "port"];

Parameters
$var : int|string
Return values
$this

setPrincipal()

The identity of this peer. Similar to `Request.auth.principal`, but relative to the peer instead of the request. For example, the identity associated with a load balancer that forwarded the request.

public setPrincipal(string $var) : $this

Generated from protobuf field string principal = 7 [json_name = "principal"];

Parameters
$var : string
Return values
$this

setRegionCode()

The CLDR country/region code associated with the above IP address.

public setRegionCode(string $var) : $this

If the IP address is private, the region_code should reflect the physical location where this peer is running.

Generated from protobuf field string region_code = 8 [json_name = "regionCode"];

Parameters
$var : string
Return values
$this

        
On this page

Search results