Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame^] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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_v2beta1.html">Google Cloud Logging API</a> . <a href="logging_v2beta1.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 Logging. For ways to export log entries, see [Exporting Logs](/logging/docs/export).</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 Cloud Logging. All log entries in Cloud Logging are written by this method.</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 Logging. For ways to export log entries, see [Exporting Logs](/logging/docs/export). |
| 87 | |
| 88 | Args: |
| 89 | body: object, The request body. (required) |
| 90 | The object takes the form of: |
| 91 | |
| 92 | { # The parameters to `ListLogEntries`. |
| 93 | "filter": "A String", # Optional. An [advanced logs filter](/logging/docs/view/advanced_filters). The filter is compared against all log entries in the projects specified by `projectIds`. Only entries that match the filter are retrieved. An empty filter matches all log entries. |
| 94 | "projectIds": [ # Required. One or more project IDs or project numbers from which to retrieve log entries. Examples of a project ID: `"my-project-1A"`, `"1234567890"`. |
| 95 | "A String", |
| 96 | ], |
| 97 | "pageSize": 42, # Optional. The maximum number of results to return from this request. Fewer results might be returned. You must check for the `nextPageToken` result to determine if additional results are available, which you can retrieve by passing the `nextPageToken` value in the `pageToken` parameter to the next request. |
| 98 | "orderBy": "A String", # Optional. How the results should be sorted. Presently, the only permitted values are `"timestamp"` (default) and `"timestamp desc"`. The first option returns entries in order of increasing values of `LogEntry.timestamp` (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of `LogEntry.insertId`. |
| 99 | "pageToken": "A String", # Optional. If the `pageToken` request parameter is supplied, then the next page of results in the set are retrieved. The `pageToken` parameter must be set with the value of the `nextPageToken` result parameter from the previous request. The values of `projectIds`, `filter`, and `orderBy` must be the same as in the previous request. |
| 100 | } |
| 101 | |
| 102 | x__xgafv: string, V1 error format. |
| 103 | |
| 104 | Returns: |
| 105 | An object of the form: |
| 106 | |
| 107 | { # Result returned from `ListLogEntries`. |
| 108 | "nextPageToken": "A String", # If there are more results than were returned, then `nextPageToken` is given a value in the response. To get the next batch of results, call this method again using the value of `nextPageToken` as `pageToken`. |
| 109 | "entries": [ # A list of log entries. |
| 110 | { # An individual entry in a log. |
| 111 | "httpRequest": { # A common proto for logging HTTP requests. # Optional. Information about the HTTP request associated with this log entry, if applicable. |
| 112 | "status": 42, # The response code indicating the status of response. Examples: 200, 404. |
| 113 | "cacheHit": True or False, # Whether or not an entity was served from cache (with or without validation). |
| 114 | "requestUrl": "A 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"`. |
| 115 | "requestMethod": "A String", # The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. |
| 116 | "referer": "A String", # The referer URL of the request, as defined in [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). |
| 117 | "remoteIp": "A 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"`. |
| 118 | "validatedWithOriginServer": True or False, # 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. |
| 119 | "userAgent": "A String", # The user agent sent by the client. Example: `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`. |
| 120 | "requestSize": "A String", # The size of the HTTP request message in bytes, including the request headers and the request body. |
| 121 | "responseSize": "A String", # The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body. |
| 122 | }, |
| 123 | "resource": { # A specific monitored resource or a group of monitored resources. # Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error. |
| 124 | "labels": { # Values for some or all of the labels listed in the associated monitored resource descriptor. For example, specify a specific Cloud SQL database by supplying values for both the `"database_id"` and `"zone"` labels. Specify the set of all Cloud SQL databases in a particular location by supplying a value for only the `"zone"` label. |
| 125 | "a_key": "A String", |
| 126 | }, |
| 127 | "type": "A String", # The type of monitored resource. This field must match the value of the `type` field in a MonitoredResourceDescriptor object. For example, `"cloudsql_database"` represents Cloud SQL databases. |
| 128 | }, |
| 129 | "severity": "A String", # Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. |
| 130 | "textPayload": "A String", # The log entry payload, represented as a Unicode string (UTF-8). |
| 131 | "timestamp": "A String", # Optional. The time the event described by the log entry occurred. If omitted, Cloud Logging will use the time the log entry is written. |
| 132 | "labels": { # Optional. A set of user-defined (key, value) data that provides additional information about the log entry. |
| 133 | "a_key": "A String", |
| 134 | }, |
| 135 | "insertId": "A String", # Optional. A unique ID for the log entry. If you provide this field, the logging service considers other log entries in the same log with the same ID as duplicates which can be removed. If omitted, Cloud Logging will generate a unique ID for this log entry. |
| 136 | "jsonPayload": { # The log entry payload, represented as a structure that is expressed as a JSON object. |
| 137 | "a_key": "", # Properties of the object. |
| 138 | }, |
| 139 | "logName": "A String", # Required. The resource name of the log to which this log entry belongs. The format of the name is `projects/<project-id>/logs/<log-id%gt;`. Examples: `"projects/my-projectid/logs/syslog"`, `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`. The log ID part of resource name must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters: [A-Za-z0-9]; and punctuation characters: forward-slash, underscore, hyphen, and period. Forward-slash (`/`) characters in the log ID must be URL-encoded. |
| 140 | "protoPayload": { # The log entry payload, represented as a protocol buffer. You can only use `protoPayload` values that belong to a set of approved types. |
| 141 | "a_key": "", # Properties of the object. Contains field @ype with type URL. |
| 142 | }, |
| 143 | "operation": { # Additional information about a potentially long-running operation with which a log entry is associated. # Optional. Information about an operation associated with the log entry, if applicable. |
| 144 | "last": True or False, # Optional. Set this to True if this is the last log entry in the operation. |
| 145 | "id": "A String", # Required. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. |
| 146 | "producer": "A String", # Required. An arbitrary producer identifier. The combination of `id` and `producer` must be globally unique. Examples for `producer`: `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`. |
| 147 | "first": True or False, # Optional. Set this to True if this is the first log entry in the operation. |
| 148 | }, |
| 149 | }, |
| 150 | ], |
| 151 | }</pre> |
| 152 | </div> |
| 153 | |
| 154 | <div class="method"> |
| 155 | <code class="details" id="write">write(body, x__xgafv=None)</code> |
| 156 | <pre>Writes log entries to Cloud Logging. All log entries in Cloud Logging are written by this method. |
| 157 | |
| 158 | Args: |
| 159 | body: object, The request body. (required) |
| 160 | The object takes the form of: |
| 161 | |
| 162 | { # The parameters to WriteLogEntries. |
| 163 | "resource": { # A specific monitored resource or a group of monitored resources. # Optional. A default monitored resource for those log entries in `entries` that do not specify their own `resource`. |
| 164 | "labels": { # Values for some or all of the labels listed in the associated monitored resource descriptor. For example, specify a specific Cloud SQL database by supplying values for both the `"database_id"` and `"zone"` labels. Specify the set of all Cloud SQL databases in a particular location by supplying a value for only the `"zone"` label. |
| 165 | "a_key": "A String", |
| 166 | }, |
| 167 | "type": "A String", # The type of monitored resource. This field must match the value of the `type` field in a MonitoredResourceDescriptor object. For example, `"cloudsql_database"` represents Cloud SQL databases. |
| 168 | }, |
| 169 | "labels": { # Optional. User-defined `key:value` items that are added to the `labels` field of each log entry in `entries`, except when a log entry specifies its own `key:value` item with the same key. Example: `{ "size": "large", "color":"red" }` |
| 170 | "a_key": "A String", |
| 171 | }, |
| 172 | "logName": "A String", # Optional. A default log resource name for those log entries in `entries` that do not specify their own `logName`. Example: `"projects/my-project/logs/syslog"`. See LogEntry. |
| 173 | "entries": [ # Required. The log entries to write. The log entries must have values for all required fields. |
| 174 | { # An individual entry in a log. |
| 175 | "httpRequest": { # A common proto for logging HTTP requests. # Optional. Information about the HTTP request associated with this log entry, if applicable. |
| 176 | "status": 42, # The response code indicating the status of response. Examples: 200, 404. |
| 177 | "cacheHit": True or False, # Whether or not an entity was served from cache (with or without validation). |
| 178 | "requestUrl": "A 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"`. |
| 179 | "requestMethod": "A String", # The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. |
| 180 | "referer": "A String", # The referer URL of the request, as defined in [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). |
| 181 | "remoteIp": "A 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"`. |
| 182 | "validatedWithOriginServer": True or False, # 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. |
| 183 | "userAgent": "A String", # The user agent sent by the client. Example: `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`. |
| 184 | "requestSize": "A String", # The size of the HTTP request message in bytes, including the request headers and the request body. |
| 185 | "responseSize": "A String", # The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body. |
| 186 | }, |
| 187 | "resource": { # A specific monitored resource or a group of monitored resources. # Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error. |
| 188 | "labels": { # Values for some or all of the labels listed in the associated monitored resource descriptor. For example, specify a specific Cloud SQL database by supplying values for both the `"database_id"` and `"zone"` labels. Specify the set of all Cloud SQL databases in a particular location by supplying a value for only the `"zone"` label. |
| 189 | "a_key": "A String", |
| 190 | }, |
| 191 | "type": "A String", # The type of monitored resource. This field must match the value of the `type` field in a MonitoredResourceDescriptor object. For example, `"cloudsql_database"` represents Cloud SQL databases. |
| 192 | }, |
| 193 | "severity": "A String", # Optional. The severity of the log entry. The default value is `LogSeverity.DEFAULT`. |
| 194 | "textPayload": "A String", # The log entry payload, represented as a Unicode string (UTF-8). |
| 195 | "timestamp": "A String", # Optional. The time the event described by the log entry occurred. If omitted, Cloud Logging will use the time the log entry is written. |
| 196 | "labels": { # Optional. A set of user-defined (key, value) data that provides additional information about the log entry. |
| 197 | "a_key": "A String", |
| 198 | }, |
| 199 | "insertId": "A String", # Optional. A unique ID for the log entry. If you provide this field, the logging service considers other log entries in the same log with the same ID as duplicates which can be removed. If omitted, Cloud Logging will generate a unique ID for this log entry. |
| 200 | "jsonPayload": { # The log entry payload, represented as a structure that is expressed as a JSON object. |
| 201 | "a_key": "", # Properties of the object. |
| 202 | }, |
| 203 | "logName": "A String", # Required. The resource name of the log to which this log entry belongs. The format of the name is `projects/<project-id>/logs/<log-id%gt;`. Examples: `"projects/my-projectid/logs/syslog"`, `"projects/1234567890/logs/library.googleapis.com%2Fbook_log"`. The log ID part of resource name must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters: [A-Za-z0-9]; and punctuation characters: forward-slash, underscore, hyphen, and period. Forward-slash (`/`) characters in the log ID must be URL-encoded. |
| 204 | "protoPayload": { # The log entry payload, represented as a protocol buffer. You can only use `protoPayload` values that belong to a set of approved types. |
| 205 | "a_key": "", # Properties of the object. Contains field @ype with type URL. |
| 206 | }, |
| 207 | "operation": { # Additional information about a potentially long-running operation with which a log entry is associated. # Optional. Information about an operation associated with the log entry, if applicable. |
| 208 | "last": True or False, # Optional. Set this to True if this is the last log entry in the operation. |
| 209 | "id": "A String", # Required. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation. |
| 210 | "producer": "A String", # Required. An arbitrary producer identifier. The combination of `id` and `producer` must be globally unique. Examples for `producer`: `"MyDivision.MyBigCompany.com"`, "github.com/MyProject/MyApplication"`. |
| 211 | "first": True or False, # Optional. Set this to True if this is the first log entry in the operation. |
| 212 | }, |
| 213 | }, |
| 214 | ], |
| 215 | } |
| 216 | |
| 217 | x__xgafv: string, V1 error format. |
| 218 | |
| 219 | Returns: |
| 220 | An object of the form: |
| 221 | |
| 222 | { # Result returned from WriteLogEntries. empty |
| 223 | }</pre> |
| 224 | </div> |
| 225 | |
| 226 | </body></html> |