• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<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.projects.html">projects</a> . <a href="logging_v2.projects.metrics.html">metrics</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#create">create(parent, body, x__xgafv=None)</a></code></p>
79<p class="firstline">Creates a logs-based metric.</p>
80<p class="toc_element">
81  <code><a href="#delete">delete(metricName, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes a logs-based metric.</p>
83<p class="toc_element">
84  <code><a href="#get">get(metricName, x__xgafv=None)</a></code></p>
85<p class="firstline">Gets a logs-based metric.</p>
86<p class="toc_element">
87  <code><a href="#list">list(parent, pageToken=None, x__xgafv=None, pageSize=None)</a></code></p>
88<p class="firstline">Lists logs-based metrics.</p>
89<p class="toc_element">
90  <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93  <code><a href="#update">update(metricName, body, x__xgafv=None)</a></code></p>
94<p class="firstline">Creates or updates a logs-based metric.</p>
95<h3>Method Details</h3>
96<div class="method">
97    <code class="details" id="create">create(parent, body, x__xgafv=None)</code>
98  <pre>Creates a logs-based metric.
99
100Args:
101  parent: string, The resource name of the project in which to create the metric:
102"projects/[PROJECT_ID]"
103The new metric must be provided in the request. (required)
104  body: object, The request body. (required)
105    The object takes the form of:
106
107{ # Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.
108    "filter": "A String", # Required. An advanced logs filter which is used to match log entries. Example:
109        # "resource.type=gae_app AND severity>=ERROR"
110        # The maximum length of the filter is 20000 characters.
111    "version": "A String", # Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.
112    "description": "A String", # Optional. A description of this metric, which is used in documentation.
113    "name": "A String", # Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests".
114  }
115
116  x__xgafv: string, V1 error format.
117    Allowed values
118      1 - v1 error format
119      2 - v2 error format
120
121Returns:
122  An object of the form:
123
124    { # Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.
125      "filter": "A String", # Required. An advanced logs filter which is used to match log entries. Example:
126          # "resource.type=gae_app AND severity>=ERROR"
127          # The maximum length of the filter is 20000 characters.
128      "version": "A String", # Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.
129      "description": "A String", # Optional. A description of this metric, which is used in documentation.
130      "name": "A String", # Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests".
131    }</pre>
132</div>
133
134<div class="method">
135    <code class="details" id="delete">delete(metricName, x__xgafv=None)</code>
136  <pre>Deletes a logs-based metric.
137
138Args:
139  metricName: string, The resource name of the metric to delete:
140"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
141 (required)
142  x__xgafv: string, V1 error format.
143    Allowed values
144      1 - v1 error format
145      2 - v2 error format
146
147Returns:
148  An object of the form:
149
150    { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance:
151      # service Foo {
152      #   rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
153      # }
154      # The JSON representation for Empty is empty JSON object {}.
155  }</pre>
156</div>
157
158<div class="method">
159    <code class="details" id="get">get(metricName, x__xgafv=None)</code>
160  <pre>Gets a logs-based metric.
161
162Args:
163  metricName: string, The resource name of the desired metric:
164"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
165 (required)
166  x__xgafv: string, V1 error format.
167    Allowed values
168      1 - v1 error format
169      2 - v2 error format
170
171Returns:
172  An object of the form:
173
174    { # Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.
175      "filter": "A String", # Required. An advanced logs filter which is used to match log entries. Example:
176          # "resource.type=gae_app AND severity>=ERROR"
177          # The maximum length of the filter is 20000 characters.
178      "version": "A String", # Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.
179      "description": "A String", # Optional. A description of this metric, which is used in documentation.
180      "name": "A String", # Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests".
181    }</pre>
182</div>
183
184<div class="method">
185    <code class="details" id="list">list(parent, pageToken=None, x__xgafv=None, pageSize=None)</code>
186  <pre>Lists logs-based metrics.
187
188Args:
189  parent: string, Required. The name of the project containing the metrics:
190"projects/[PROJECT_ID]"
191 (required)
192  pageToken: string, Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call.
193  x__xgafv: string, V1 error format.
194    Allowed values
195      1 - v1 error format
196      2 - v2 error format
197  pageSize: integer, Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available.
198
199Returns:
200  An object of the form:
201
202    { # Result returned from ListLogMetrics.
203    "metrics": [ # A list of logs-based metrics.
204      { # Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.
205          "filter": "A String", # Required. An advanced logs filter which is used to match log entries. Example:
206              # "resource.type=gae_app AND severity>=ERROR"
207              # The maximum length of the filter is 20000 characters.
208          "version": "A String", # Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.
209          "description": "A String", # Optional. A description of this metric, which is used in documentation.
210          "name": "A String", # Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests".
211        },
212    ],
213    "nextPageToken": "A String", # If there might be more results than appear in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.
214  }</pre>
215</div>
216
217<div class="method">
218    <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
219  <pre>Retrieves the next page of results.
220
221Args:
222  previous_request: The request for the previous page. (required)
223  previous_response: The response from the request for the previous page. (required)
224
225Returns:
226  A request object that you can call 'execute()' on to request the next
227  page. Returns None if there are no more items in the collection.
228    </pre>
229</div>
230
231<div class="method">
232    <code class="details" id="update">update(metricName, body, x__xgafv=None)</code>
233  <pre>Creates or updates a logs-based metric.
234
235Args:
236  metricName: string, The resource name of the metric to update:
237"projects/[PROJECT_ID]/metrics/[METRIC_ID]"
238The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. (required)
239  body: object, The request body. (required)
240    The object takes the form of:
241
242{ # Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.
243    "filter": "A String", # Required. An advanced logs filter which is used to match log entries. Example:
244        # "resource.type=gae_app AND severity>=ERROR"
245        # The maximum length of the filter is 20000 characters.
246    "version": "A String", # Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.
247    "description": "A String", # Optional. A description of this metric, which is used in documentation.
248    "name": "A String", # Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests".
249  }
250
251  x__xgafv: string, V1 error format.
252    Allowed values
253      1 - v1 error format
254      2 - v2 error format
255
256Returns:
257  An object of the form:
258
259    { # Describes a logs-based metric. The value of the metric is the number of log entries that match a logs filter in a given time interval.
260      "filter": "A String", # Required. An advanced logs filter which is used to match log entries. Example:
261          # "resource.type=gae_app AND severity>=ERROR"
262          # The maximum length of the filter is 20000 characters.
263      "version": "A String", # Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed.
264      "description": "A String", # Optional. A description of this metric, which is used in documentation.
265      "name": "A String", # Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests".
266    }</pre>
267</div>
268
269</body></html>