blob: 923dbafde71112e22a32eb119865db16518a5920 [file] [log] [blame]
Sai Cheemalapatidf613972016-10-21 13:59:49 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="logging_v2.html">Stackdriver Logging API</a> . <a href="logging_v2.entries.html">entries</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#list">list(body, x__xgafv=None)</a></code></p>
79<p class="firstline">Lists log entries. Use this method to retrieve log entries from Cloud</p>
80<p class="toc_element">
81 <code><a href="#write">write(body, x__xgafv=None)</a></code></p>
82<p class="firstline">Writes log entries to Stackdriver Logging. All log entries are</p>
83<h3>Method Details</h3>
84<div class="method">
85 <code class="details" id="list">list(body, x__xgafv=None)</code>
86 <pre>Lists log entries. Use this method to retrieve log entries from Cloud
87Logging. For ways to export log entries, see
88[Exporting Logs](/logging/docs/export).
89
90Args:
91 body: object, The request body. (required)
92 The object takes the form of:
93
94{ # The parameters to `ListLogEntries`.
95 "orderBy": "A String", # Optional. How the results should be sorted. Presently, the only permitted
96 # values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
97 # option returns entries in order of increasing values of
98 # `LogEntry.timestamp` (oldest first), and the second option returns entries
99 # in order of decreasing timestamps (newest first). Entries with equal
100 # timestamps are returned in order of `LogEntry.insertId`.
101 "resourceNames": [ # Required. One or more cloud resources from which to retrieve log entries.
102 # Example: `"projects/my-project-1A"`, `"projects/1234567890"`. Projects
103 # listed in `projectIds` are added to this list.
104 "A String",
105 ],
106 "pageSize": 42, # Optional. The maximum number of results to return from this request.
107 # Non-positive values are ignored. The presence of `nextPageToken` in the
108 # response indicates that more results might be available.
109 "filter": "A String", # Optional. A filter that chooses which log entries to return. See [Advanced
110 # Logs Filters](/logging/docs/view/advanced_filters). Only log entries that
111 # match the filter are returned. An empty filter matches all log entries.
112 "pageToken": "A String", # Optional. If present, then retrieve the next batch of results from the
113 # preceding call to this method. `pageToken` must be the value of
114 # `nextPageToken` from the previous response. The values of other method
115 # parameters should be identical to those in the previous call.
116 "projectIds": [ # Deprecated. One or more project identifiers or project numbers from which
117 # to retrieve log entries. Examples: `"my-project-1A"`, `"1234567890"`. If
118 # present, these project identifiers are converted to resource format and
119 # added to the list of resources in `resourceNames`. Callers should use
120 # `resourceNames` rather than this parameter.
121 "A String",
122 ],
123 }
124
125 x__xgafv: string, V1 error format.
126 Allowed values
127 1 - v1 error format
128 2 - v2 error format
129
130Returns:
131 An object of the form:
132
133 { # Result returned from `ListLogEntries`.
134 "nextPageToken": "A String", # If there might be more results than appear in this response, then
135 # `nextPageToken` is included. To get the next set of results, call this
136 # method again using the value of `nextPageToken` as `pageToken`.
137 "entries": [ # A list of log entries.
138 { # An individual entry in a log.
139 "httpRequest": { # A common proto for logging HTTP requests. Only contains semantics # Optional. Information about the HTTP request associated with this
140 # log entry, if applicable.
141 # defined by the HTTP specification. Product-specific logging
142 # information MUST be defined in a separate message.
143 "status": 42, # The response code indicating the status of response.
144 # Examples: 200, 404.
145 "cacheValidatedWithOriginServer": True or False, # Whether or not the response was validated with the origin server before
146 # being served from cache. This field is only meaningful if `cache_hit` is
147 # True.
148 "requestMethod": "A String", # The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
149 "latency": "A String", # The request processing latency on the server, from the time the request was
150 # received until the response was sent.
151 "cacheFillBytes": "A String", # The number of HTTP response bytes inserted into cache. Set only when a
152 # cache fill was attempted.
153 "requestUrl": "A String", # The scheme (http, https), the host name, the path and the query
154 # portion of the URL that was requested.
155 # Example: `"http://example.com/some/info?color=red"`.
156 "serverIp": "A String", # The IP address (IPv4 or IPv6) of the origin server that the request was
157 # sent to.
158 "cacheLookup": True or False, # Whether or not a cache lookup was attempted.
159 "cacheHit": True or False, # Whether or not an entity was served from cache
160 # (with or without validation).
161 "referer": "A String", # The referer URL of the request, as defined in
162 # [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
163 "remoteIp": "A String", # The IP address (IPv4 or IPv6) of the client that issued the HTTP
164 # request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
165 "userAgent": "A String", # The user agent sent by the client. Example:
166 # `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`.
167 "requestSize": "A String", # The size of the HTTP request message in bytes, including the request
168 # headers and the request body.
169 "responseSize": "A String", # The size of the HTTP response message sent back to the client, in bytes,
170 # including the response headers and the response body.
171 },
172 "resource": { # An object representing a resource that can be used for monitoring, logging, # Required. The monitored resource associated with this log entry.
173 # Example: a log entry that reports a database error would be
174 # associated with the monitored resource designating the particular
175 # database that reported the error.
176 # billing, or other purposes. Examples include virtual machine instances,
177 # databases, and storage devices such as disks. The `type` field identifies a
178 # MonitoredResourceDescriptor object that describes the resource's
179 # schema. Information in the `labels` field identifies the actual resource and
180 # its attributes according to the schema. For example, a particular Compute
181 # Engine VM instance could be represented by the following object, because the
182 # MonitoredResourceDescriptor for `"gce_instance"` has labels
183 # `"instance_id"` and `"zone"`:
184 #
185 # { "type": "gce_instance",
186 # "labels": { "instance_id": "12345678901234",
187 # "zone": "us-central1-a" }}
188 "labels": { # Required. Values for all of the labels listed in the associated monitored
189 # resource descriptor. For example, Cloud SQL databases use the labels
190 # `"database_id"` and `"zone"`.
191 "a_key": "A String",
192 },
193 "type": "A String", # Required. The monitored resource type. This field must match
194 # the `type` field of a MonitoredResourceDescriptor object. For
195 # example, the type of a Cloud SQL database is `"cloudsql_database"`.
196 },
197 "severity": "A String", # Optional. The severity of the log entry. The default value is
198 # `LogSeverity.DEFAULT`.
199 "textPayload": "A String", # The log entry payload, represented as a Unicode string (UTF-8).
200 "timestamp": "A String", # Optional. The time the event described by the log entry occurred. If
201 # omitted, Stackdriver Logging will use the time the log entry is received.
202 "labels": { # Optional. A set of user-defined (key, value) data that provides additional
203 # information about the log entry.
204 "a_key": "A String",
205 },
206 "insertId": "A String", # Optional. A unique ID for the log entry. If you provide this
207 # field, the logging service considers other log entries in the
208 # same project with the same ID as duplicates which can be removed. If
209 # omitted, Stackdriver Logging will generate a unique ID for this
210 # log entry.
211 "jsonPayload": { # The log entry payload, represented as a structure that
212 # is expressed as a JSON object.
213 "a_key": "", # Properties of the object.
214 },
215 "logName": "A String", # Required. The resource name of the log to which this log entry
216 # belongs. The format of the name is
217 # `"projects/<project-id>/logs/<log-id>"`. Examples:
218 # `"projects/my-projectid/logs/syslog"`,
219 # `"projects/my-projectid/logs/library.googleapis.com%2Fbook_log"`.
220 #
221 # The log ID part of resource name must be less than 512 characters
222 # long and can only include the following characters: upper and
223 # lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
224 # characters: forward-slash, underscore, hyphen, and period.
225 # Forward-slash (`/`) characters in the log ID must be URL-encoded.
226 "protoPayload": { # The log entry payload, represented as a protocol buffer. Some
227 # Google Cloud Platform services use this field for their log
228 # entry payloads.
229 "a_key": "", # Properties of the object. Contains field @type with type URL.
230 },
231 "operation": { # Additional information about a potentially long-running operation with which # Optional. Information about an operation associated with the log entry, if
232 # applicable.
233 # a log entry is associated.
234 "last": True or False, # Optional. Set this to True if this is the last log entry in the operation.
235 "id": "A String", # Optional. An arbitrary operation identifier. Log entries with the
236 # same identifier are assumed to be part of the same operation.
237 "producer": "A String", # Optional. An arbitrary producer identifier. The combination of
238 # `id` and `producer` must be globally unique. Examples for `producer`:
239 # `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
240 "first": True or False, # Optional. Set this to True if this is the first log entry in the operation.
241 },
242 },
243 ],
244 }</pre>
245</div>
246
247<div class="method">
248 <code class="details" id="write">write(body, x__xgafv=None)</code>
249 <pre>Writes log entries to Stackdriver Logging. All log entries are
250written by this method.
251
252Args:
253 body: object, The request body. (required)
254 The object takes the form of:
255
256{ # The parameters to WriteLogEntries.
257 "resource": { # An object representing a resource that can be used for monitoring, logging, # Optional. A default monitored resource object that is assigned to all log
258 # entries in `entries` that do not specify a value for `resource`. Example:
259 #
260 # { "type": "gce_instance",
261 # "labels": {
262 # "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
263 #
264 # See LogEntry.
265 # billing, or other purposes. Examples include virtual machine instances,
266 # databases, and storage devices such as disks. The `type` field identifies a
267 # MonitoredResourceDescriptor object that describes the resource's
268 # schema. Information in the `labels` field identifies the actual resource and
269 # its attributes according to the schema. For example, a particular Compute
270 # Engine VM instance could be represented by the following object, because the
271 # MonitoredResourceDescriptor for `"gce_instance"` has labels
272 # `"instance_id"` and `"zone"`:
273 #
274 # { "type": "gce_instance",
275 # "labels": { "instance_id": "12345678901234",
276 # "zone": "us-central1-a" }}
277 "labels": { # Required. Values for all of the labels listed in the associated monitored
278 # resource descriptor. For example, Cloud SQL databases use the labels
279 # `"database_id"` and `"zone"`.
280 "a_key": "A String",
281 },
282 "type": "A String", # Required. The monitored resource type. This field must match
283 # the `type` field of a MonitoredResourceDescriptor object. For
284 # example, the type of a Cloud SQL database is `"cloudsql_database"`.
285 },
286 "partialSuccess": True or False, # Optional. Whether valid entries should be written even if some other
287 # entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
288 # entry is not written, the response status will be the error associated
289 # with one of the failed entries and include error details in the form of
290 # WriteLogEntriesPartialErrors.
291 "labels": { # Optional. Default labels that are added to the `labels` field of all log
292 # entries in `entries`. If a log entry already has a label with the same key
293 # as a label in this parameter, then the log entry's label is not changed.
294 # See LogEntry.
295 "a_key": "A String",
296 },
297 "logName": "A String", # Optional. A default log resource name that is assigned to all log entries
298 # in `entries` that do not specify a value for `log_name`. Example:
299 # `"projects/my-project/logs/syslog"`. See
300 # LogEntry.
301 "entries": [ # Required. The log entries to write. Values supplied for the fields
302 # `log_name`, `resource`, and `labels` in this `entries.write` request are
303 # added to those log entries that do not provide their own values for the
304 # fields.
305 #
306 # To improve throughput and to avoid exceeding the
307 # [quota limit](/logging/quota-policy) for calls to `entries.write`,
308 # you should write multiple log entries at once rather than
309 # calling this method for each individual log entry.
310 { # An individual entry in a log.
311 "httpRequest": { # A common proto for logging HTTP requests. Only contains semantics # Optional. Information about the HTTP request associated with this
312 # log entry, if applicable.
313 # defined by the HTTP specification. Product-specific logging
314 # information MUST be defined in a separate message.
315 "status": 42, # The response code indicating the status of response.
316 # Examples: 200, 404.
317 "cacheValidatedWithOriginServer": True or False, # Whether or not the response was validated with the origin server before
318 # being served from cache. This field is only meaningful if `cache_hit` is
319 # True.
320 "requestMethod": "A String", # The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
321 "latency": "A String", # The request processing latency on the server, from the time the request was
322 # received until the response was sent.
323 "cacheFillBytes": "A String", # The number of HTTP response bytes inserted into cache. Set only when a
324 # cache fill was attempted.
325 "requestUrl": "A String", # The scheme (http, https), the host name, the path and the query
326 # portion of the URL that was requested.
327 # Example: `"http://example.com/some/info?color=red"`.
328 "serverIp": "A String", # The IP address (IPv4 or IPv6) of the origin server that the request was
329 # sent to.
330 "cacheLookup": True or False, # Whether or not a cache lookup was attempted.
331 "cacheHit": True or False, # Whether or not an entity was served from cache
332 # (with or without validation).
333 "referer": "A String", # The referer URL of the request, as defined in
334 # [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
335 "remoteIp": "A String", # The IP address (IPv4 or IPv6) of the client that issued the HTTP
336 # request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
337 "userAgent": "A String", # The user agent sent by the client. Example:
338 # `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`.
339 "requestSize": "A String", # The size of the HTTP request message in bytes, including the request
340 # headers and the request body.
341 "responseSize": "A String", # The size of the HTTP response message sent back to the client, in bytes,
342 # including the response headers and the response body.
343 },
344 "resource": { # An object representing a resource that can be used for monitoring, logging, # Required. The monitored resource associated with this log entry.
345 # Example: a log entry that reports a database error would be
346 # associated with the monitored resource designating the particular
347 # database that reported the error.
348 # billing, or other purposes. Examples include virtual machine instances,
349 # databases, and storage devices such as disks. The `type` field identifies a
350 # MonitoredResourceDescriptor object that describes the resource's
351 # schema. Information in the `labels` field identifies the actual resource and
352 # its attributes according to the schema. For example, a particular Compute
353 # Engine VM instance could be represented by the following object, because the
354 # MonitoredResourceDescriptor for `"gce_instance"` has labels
355 # `"instance_id"` and `"zone"`:
356 #
357 # { "type": "gce_instance",
358 # "labels": { "instance_id": "12345678901234",
359 # "zone": "us-central1-a" }}
360 "labels": { # Required. Values for all of the labels listed in the associated monitored
361 # resource descriptor. For example, Cloud SQL databases use the labels
362 # `"database_id"` and `"zone"`.
363 "a_key": "A String",
364 },
365 "type": "A String", # Required. The monitored resource type. This field must match
366 # the `type` field of a MonitoredResourceDescriptor object. For
367 # example, the type of a Cloud SQL database is `"cloudsql_database"`.
368 },
369 "severity": "A String", # Optional. The severity of the log entry. The default value is
370 # `LogSeverity.DEFAULT`.
371 "textPayload": "A String", # The log entry payload, represented as a Unicode string (UTF-8).
372 "timestamp": "A String", # Optional. The time the event described by the log entry occurred. If
373 # omitted, Stackdriver Logging will use the time the log entry is received.
374 "labels": { # Optional. A set of user-defined (key, value) data that provides additional
375 # information about the log entry.
376 "a_key": "A String",
377 },
378 "insertId": "A String", # Optional. A unique ID for the log entry. If you provide this
379 # field, the logging service considers other log entries in the
380 # same project with the same ID as duplicates which can be removed. If
381 # omitted, Stackdriver Logging will generate a unique ID for this
382 # log entry.
383 "jsonPayload": { # The log entry payload, represented as a structure that
384 # is expressed as a JSON object.
385 "a_key": "", # Properties of the object.
386 },
387 "logName": "A String", # Required. The resource name of the log to which this log entry
388 # belongs. The format of the name is
389 # `"projects/<project-id>/logs/<log-id>"`. Examples:
390 # `"projects/my-projectid/logs/syslog"`,
391 # `"projects/my-projectid/logs/library.googleapis.com%2Fbook_log"`.
392 #
393 # The log ID part of resource name must be less than 512 characters
394 # long and can only include the following characters: upper and
395 # lower case alphanumeric characters: [A-Za-z0-9]; and punctuation
396 # characters: forward-slash, underscore, hyphen, and period.
397 # Forward-slash (`/`) characters in the log ID must be URL-encoded.
398 "protoPayload": { # The log entry payload, represented as a protocol buffer. Some
399 # Google Cloud Platform services use this field for their log
400 # entry payloads.
401 "a_key": "", # Properties of the object. Contains field @type with type URL.
402 },
403 "operation": { # Additional information about a potentially long-running operation with which # Optional. Information about an operation associated with the log entry, if
404 # applicable.
405 # a log entry is associated.
406 "last": True or False, # Optional. Set this to True if this is the last log entry in the operation.
407 "id": "A String", # Optional. An arbitrary operation identifier. Log entries with the
408 # same identifier are assumed to be part of the same operation.
409 "producer": "A String", # Optional. An arbitrary producer identifier. The combination of
410 # `id` and `producer` must be globally unique. Examples for `producer`:
411 # `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
412 "first": True or False, # Optional. Set this to True if this is the first log entry in the operation.
413 },
414 },
415 ],
416 }
417
418 x__xgafv: string, V1 error format.
419 Allowed values
420 1 - v1 error format
421 2 - v2 error format
422
423Returns:
424 An object of the form:
425
426 { # Result returned from WriteLogEntries.
427 # empty
428 }</pre>
429</div>
430
431</body></html>