Google Cloud Service Control V1 Client - Class HttpRequest (1.3.0)

Reference documentation and code samples for the Google Cloud Service Control V1 Client class HttpRequest.

A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.

Generated from protobuf message google.api.servicecontrol.v1.HttpRequest

Namespace

Google \ Cloud \ ServiceControl \ V1

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ request_method string

The request method. Examples: "GET", "HEAD", "PUT", "POST".

↳ request_url string

The scheme (http, https), the host name, the path, and the query portion of the URL that was requested. Example: "http://example.com/some/info?color=red".

↳ request_size int|string

The size of the HTTP request message in bytes, including the request headers and the request body.

↳ status int

The response code indicating the status of the response. Examples: 200, 404.

↳ response_size int|string

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

↳ user_agent string

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

↳ remote_ip string

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

↳ server_ip string

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

↳ referer string

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

↳ latency Google\Protobuf\Duration

The request processing latency on the server, from the time the request was received until the response was sent.

↳ cache_lookup bool

Whether or not a cache lookup was attempted.

↳ cache_hit bool

Whether or not an entity was served from cache (with or without validation).

↳ cache_validated_with_origin_server bool

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

↳ cache_fill_bytes int|string

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

↳ protocol string

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

getRequestMethod

The request method. Examples: "GET", "HEAD", "PUT", "POST".

Returns
TypeDescription
string

setRequestMethod

The request method. Examples: "GET", "HEAD", "PUT", "POST".

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRequestUrl

The scheme (http, https), the host name, the path, and the query portion of the URL that was requested.

Example: "http://example.com/some/info?color=red".

Returns
TypeDescription
string

setRequestUrl

The scheme (http, https), the host name, the path, and the query portion of the URL that was requested.

Example: "http://example.com/some/info?color=red".

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRequestSize

The size of the HTTP request message in bytes, including the request headers and the request body.

Returns
TypeDescription
int|string

setRequestSize

The size of the HTTP request message in bytes, including the request headers and the request body.

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getStatus

The response code indicating the status of the response.

Examples: 200, 404.

Returns
TypeDescription
int

setStatus

The response code indicating the status of the response.

Examples: 200, 404.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getResponseSize

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

Returns
TypeDescription
int|string

setResponseSize

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getUserAgent

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

Returns
TypeDescription
string

setUserAgent

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRemoteIp

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

Returns
TypeDescription
string

setRemoteIp

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getServerIp

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

Returns
TypeDescription
string

setServerIp

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getReferer

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

Returns
TypeDescription
string

setReferer

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getLatency

The request processing latency on the server, from the time the request was received until the response was sent.

Returns
TypeDescription
Google\Protobuf\Duration|null

hasLatency

clearLatency

setLatency

The request processing latency on the server, from the time the request was received until the response was sent.

Parameter
NameDescription
var Google\Protobuf\Duration
Returns
TypeDescription
$this

getCacheLookup

Whether or not a cache lookup was attempted.

Returns
TypeDescription
bool

setCacheLookup

Whether or not a cache lookup was attempted.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getCacheHit

Whether or not an entity was served from cache (with or without validation).

Returns
TypeDescription
bool

setCacheHit

Whether or not an entity was served from cache (with or without validation).

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getCacheValidatedWithOriginServer

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

Returns
TypeDescription
bool

setCacheValidatedWithOriginServer

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getCacheFillBytes

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

Returns
TypeDescription
int|string

setCacheFillBytes

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

Parameter
NameDescription
var int|string
Returns
TypeDescription
$this

getProtocol

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

Returns
TypeDescription
string

setProtocol

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

Parameter
NameDescription
var string
Returns
TypeDescription
$this