Class: Google::Apis::LoggingV2::HttpRequest

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

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ HttpRequest

Returns a new instance of HttpRequest.



1240
1241
1242
# File 'lib/google/apis/logging_v2/classes.rb', line 1240

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

Instance Attribute Details

#cache_fill_bytesFixnum

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted. Corresponds to the JSON property cacheFillBytes

Returns:

  • (Fixnum)


1153
1154
1155
# File 'lib/google/apis/logging_v2/classes.rb', line 1153

def cache_fill_bytes
  @cache_fill_bytes
end

#cache_hitBoolean Also known as: cache_hit?

Whether or not an entity was served from cache (with or without validation). Corresponds to the JSON property cacheHit

Returns:

  • (Boolean)


1158
1159
1160
# File 'lib/google/apis/logging_v2/classes.rb', line 1158

def cache_hit
  @cache_hit
end

#cache_lookupBoolean Also known as: cache_lookup?

Whether or not a cache lookup was attempted. Corresponds to the JSON property cacheLookup

Returns:

  • (Boolean)


1164
1165
1166
# File 'lib/google/apis/logging_v2/classes.rb', line 1164

def cache_lookup
  @cache_lookup
end

#cache_validated_with_origin_serverBoolean Also known as: cache_validated_with_origin_server?

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. Corresponds to the JSON property cacheValidatedWithOriginServer

Returns:

  • (Boolean)


1171
1172
1173
# File 'lib/google/apis/logging_v2/classes.rb', line 1171

def cache_validated_with_origin_server
  @cache_validated_with_origin_server
end

#latencyString

The request processing latency on the server, from the time the request was received until the response was sent. For WebSocket connections, this field refers to the entire time duration of the connection. Corresponds to the JSON property latency

Returns:

  • (String)


1179
1180
1181
# File 'lib/google/apis/logging_v2/classes.rb', line 1179

def latency
  @latency
end

#protocolString

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2" Corresponds to the JSON property protocol

Returns:

  • (String)


1184
1185
1186
# File 'lib/google/apis/logging_v2/classes.rb', line 1184

def protocol
  @protocol
end

#refererString

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). Corresponds to the JSON property referer

Returns:

  • (String)


1190
1191
1192
# File 'lib/google/apis/logging_v2/classes.rb', line 1190

def referer
  @referer
end

#remote_ipString

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", " FE80::0202:B3FF:FE1E:8329". Corresponds to the JSON property remoteIp

Returns:

  • (String)


1197
1198
1199
# File 'lib/google/apis/logging_v2/classes.rb', line 1197

def remote_ip
  @remote_ip
end

#request_methodString

The request method. Examples: "GET", "HEAD", "PUT", "POST". Corresponds to the JSON property requestMethod

Returns:

  • (String)


1202
1203
1204
# File 'lib/google/apis/logging_v2/classes.rb', line 1202

def request_method
  @request_method
end

#request_sizeFixnum

The size of the HTTP request message in bytes, including the request headers and the request body. Corresponds to the JSON property requestSize

Returns:

  • (Fixnum)


1208
1209
1210
# File 'lib/google/apis/logging_v2/classes.rb', line 1208

def request_size
  @request_size
end

#request_urlString

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". Corresponds to the JSON property requestUrl

Returns:

  • (String)


1214
1215
1216
# File 'lib/google/apis/logging_v2/classes.rb', line 1214

def request_url
  @request_url
end

#response_sizeFixnum

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

Returns:

  • (Fixnum)


1220
1221
1222
# File 'lib/google/apis/logging_v2/classes.rb', line 1220

def response_size
  @response_size
end

#server_ipString

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0. 1:80", "FE80::0202:B3FF:FE1E:8329". Corresponds to the JSON property serverIp

Returns:

  • (String)


1227
1228
1229
# File 'lib/google/apis/logging_v2/classes.rb', line 1227

def server_ip
  @server_ip
end

#statusFixnum

The response code indicating the status of response. Examples: 200, 404. Corresponds to the JSON property status

Returns:

  • (Fixnum)


1232
1233
1234
# File 'lib/google/apis/logging_v2/classes.rb', line 1232

def status
  @status
end

#user_agentString

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

Returns:

  • (String)


1238
1239
1240
# File 'lib/google/apis/logging_v2/classes.rb', line 1238

def user_agent
  @user_agent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
# File 'lib/google/apis/logging_v2/classes.rb', line 1245

def update!(**args)
  @cache_fill_bytes = args[:cache_fill_bytes] if args.key?(:cache_fill_bytes)
  @cache_hit = args[:cache_hit] if args.key?(:cache_hit)
  @cache_lookup = args[:cache_lookup] if args.key?(:cache_lookup)
  @cache_validated_with_origin_server = args[:cache_validated_with_origin_server] if args.key?(:cache_validated_with_origin_server)
  @latency = args[:latency] if args.key?(:latency)
  @protocol = args[:protocol] if args.key?(:protocol)
  @referer = args[:referer] if args.key?(:referer)
  @remote_ip = args[:remote_ip] if args.key?(:remote_ip)
  @request_method = args[:request_method] if args.key?(:request_method)
  @request_size = args[:request_size] if args.key?(:request_size)
  @request_url = args[:request_url] if args.key?(:request_url)
  @response_size = args[:response_size] if args.key?(:response_size)
  @server_ip = args[:server_ip] if args.key?(:server_ip)
  @status = args[:status] if args.key?(:status)
  @user_agent = args[:user_agent] if args.key?(:user_agent)
end