OLD | NEW |
1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
2 | 2 |
3 library googleapis.cloudtrace.v1; | 3 library googleapis.cloudtrace.v1; |
4 | 4 |
5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
8 | 8 |
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
11 | 11 |
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
13 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
14 | 14 |
15 const core.String USER_AGENT = 'dart-api-client cloudtrace/v1'; | 15 const core.String USER_AGENT = 'dart-api-client cloudtrace/v1'; |
16 | 16 |
17 /** | 17 /** |
18 * Send and retrieve trace data from Google Cloud Trace. Data is generated and | 18 * Send and retrieve trace data from Stackdriver Trace. Data is generated and |
19 * available by default for all App Engine applications. Data from other | 19 * available by default for all App Engine applications. Data from other |
20 * applications can be written to Cloud Trace for display, reporting, and | 20 * applications can be written to Stackdriver Trace for display, reporting, and |
21 * analysis. | 21 * analysis. |
22 */ | 22 */ |
23 class CloudtraceApi { | 23 class CloudtraceApi { |
24 /** View and manage your data across Google Cloud Platform services */ | 24 /** View and manage your data across Google Cloud Platform services */ |
25 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 25 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
26 | 26 |
27 /** Write Trace data for a project or application */ | 27 /** Write Trace data for a project or application */ |
28 static const TraceAppendScope = "https://www.googleapis.com/auth/trace.append"
; | 28 static const TraceAppendScope = "https://www.googleapis.com/auth/trace.append"
; |
29 | 29 |
30 /** Read Trace data for a project or application */ | 30 /** Read Trace data for a project or application */ |
(...skipping 12 matching lines...) Expand all Loading... |
43 class ProjectsResourceApi { | 43 class ProjectsResourceApi { |
44 final commons.ApiRequester _requester; | 44 final commons.ApiRequester _requester; |
45 | 45 |
46 ProjectsTracesResourceApi get traces => new ProjectsTracesResourceApi(_request
er); | 46 ProjectsTracesResourceApi get traces => new ProjectsTracesResourceApi(_request
er); |
47 | 47 |
48 ProjectsResourceApi(commons.ApiRequester client) : | 48 ProjectsResourceApi(commons.ApiRequester client) : |
49 _requester = client; | 49 _requester = client; |
50 | 50 |
51 /** | 51 /** |
52 * Sends new traces to Stackdriver Trace or updates existing traces. If the ID | 52 * Sends new traces to Stackdriver Trace or updates existing traces. If the ID |
53 * of a trace that you send matches that of an existing trace, any fields in | 53 * of a trace that you send matches that of an existing trace, any fields |
54 * the existing trace and its spans are overwritten by the provided values, | 54 * in the existing trace and its spans are overwritten by the provided values, |
55 * and any new fields provided are merged with the existing trace data. If the | 55 * and any new fields provided are merged with the existing trace data. If the |
56 * ID does not match, a new trace is created. | 56 * ID does not match, a new trace is created. |
57 * | 57 * |
58 * [request] - The metadata request object. | 58 * [request] - The metadata request object. |
59 * | 59 * |
60 * Request parameters: | 60 * Request parameters: |
61 * | 61 * |
62 * [projectId] - ID of the Cloud project where the trace data is stored. | 62 * [projectId] - ID of the Cloud project where the trace data is stored. |
63 * | 63 * |
64 * Completes with a [Empty]. | 64 * Completes with a [Empty]. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 return _response.then((data) => new Trace.fromJson(data)); | 149 return _response.then((data) => new Trace.fromJson(data)); |
150 } | 150 } |
151 | 151 |
152 /** | 152 /** |
153 * Returns of a list of traces that match the specified filter conditions. | 153 * Returns of a list of traces that match the specified filter conditions. |
154 * | 154 * |
155 * Request parameters: | 155 * Request parameters: |
156 * | 156 * |
157 * [projectId] - ID of the Cloud project where the trace data is stored. | 157 * [projectId] - ID of the Cloud project where the trace data is stored. |
158 * | 158 * |
| 159 * [orderBy] - Field used to sort the returned traces. Optional. |
| 160 * Can be one of the following: |
| 161 * |
| 162 * * `trace_id` |
| 163 * * `name` (`name` field of root span in the trace) |
| 164 * * `duration` (difference between `end_time` and `start_time` fields of |
| 165 * the root span) |
| 166 * * `start` (`start_time` field of the root span) |
| 167 * |
| 168 * Descending order can be specified by appending `desc` to the sort field |
| 169 * (for example, `name desc`). |
| 170 * |
| 171 * Only one sort field is permitted. |
| 172 * |
| 173 * [filter] - An optional filter for the request. |
| 174 * |
| 175 * [endTime] - Start of the time interval (inclusive) during which the trace |
| 176 * data was |
| 177 * collected from the application. |
| 178 * |
| 179 * [startTime] - End of the time interval (inclusive) during which the trace |
| 180 * data was |
| 181 * collected from the application. |
| 182 * |
| 183 * [pageToken] - Token identifying the page of results to return. If provided, |
| 184 * use the |
| 185 * value of the `next_page_token` field from a previous request. Optional. |
| 186 * |
| 187 * [pageSize] - Maximum number of traces to return. If not specified or <= 0, |
| 188 * the |
| 189 * implementation selects a reasonable value. The implementation may |
| 190 * return fewer traces than the requested page size. Optional. |
| 191 * |
159 * [view] - Type of data returned for traces in the list. Optional. Default is | 192 * [view] - Type of data returned for traces in the list. Optional. Default is |
160 * `MINIMAL`. | 193 * `MINIMAL`. |
161 * Possible string values are: | 194 * Possible string values are: |
162 * - "VIEW_TYPE_UNSPECIFIED" : A VIEW_TYPE_UNSPECIFIED. | 195 * - "VIEW_TYPE_UNSPECIFIED" : A VIEW_TYPE_UNSPECIFIED. |
163 * - "MINIMAL" : A MINIMAL. | 196 * - "MINIMAL" : A MINIMAL. |
164 * - "ROOTSPAN" : A ROOTSPAN. | 197 * - "ROOTSPAN" : A ROOTSPAN. |
165 * - "COMPLETE" : A COMPLETE. | 198 * - "COMPLETE" : A COMPLETE. |
166 * | 199 * |
167 * [pageSize] - Maximum number of traces to return. If not specified or <= 0, | |
168 * the implementation selects a reasonable value. The implementation may | |
169 * return fewer traces than the requested page size. Optional. | |
170 * | |
171 * [pageToken] - Token identifying the page of results to return. If provided, | |
172 * use the value of the `next_page_token` field from a previous request. | |
173 * Optional. | |
174 * | |
175 * [startTime] - End of the time interval (inclusive) during which the trace | |
176 * data was collected from the application. | |
177 * | |
178 * [endTime] - Start of the time interval (inclusive) during which the trace | |
179 * data was collected from the application. | |
180 * | |
181 * [filter] - An optional filter for the request. | |
182 * | |
183 * [orderBy] - Field used to sort the returned traces. Optional. Can be one of | |
184 * the following: * `trace_id` * `name` (`name` field of root span in the | |
185 * trace) * `duration` (difference between `end_time` and `start_time` fields | |
186 * of the root span) * `start` (`start_time` field of the root span) | |
187 * Descending order can be specified by appending `desc` to the sort field | |
188 * (for example, `name desc`). Only one sort field is permitted. | |
189 * | |
190 * Completes with a [ListTracesResponse]. | 200 * Completes with a [ListTracesResponse]. |
191 * | 201 * |
192 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 202 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
193 * error. | 203 * error. |
194 * | 204 * |
195 * If the used [http.Client] completes with an error when making a REST call, | 205 * If the used [http.Client] completes with an error when making a REST call, |
196 * this method will complete with the same error. | 206 * this method will complete with the same error. |
197 */ | 207 */ |
198 async.Future<ListTracesResponse> list(core.String projectId, {core.String view
, core.int pageSize, core.String pageToken, core.String startTime, core.String e
ndTime, core.String filter, core.String orderBy}) { | 208 async.Future<ListTracesResponse> list(core.String projectId, {core.String orde
rBy, core.String filter, core.String endTime, core.String startTime, core.String
pageToken, core.int pageSize, core.String view}) { |
199 var _url = null; | 209 var _url = null; |
200 var _queryParams = new core.Map(); | 210 var _queryParams = new core.Map(); |
201 var _uploadMedia = null; | 211 var _uploadMedia = null; |
202 var _uploadOptions = null; | 212 var _uploadOptions = null; |
203 var _downloadOptions = commons.DownloadOptions.Metadata; | 213 var _downloadOptions = commons.DownloadOptions.Metadata; |
204 var _body = null; | 214 var _body = null; |
205 | 215 |
206 if (projectId == null) { | 216 if (projectId == null) { |
207 throw new core.ArgumentError("Parameter projectId is required."); | 217 throw new core.ArgumentError("Parameter projectId is required."); |
208 } | 218 } |
| 219 if (orderBy != null) { |
| 220 _queryParams["orderBy"] = [orderBy]; |
| 221 } |
| 222 if (filter != null) { |
| 223 _queryParams["filter"] = [filter]; |
| 224 } |
| 225 if (endTime != null) { |
| 226 _queryParams["endTime"] = [endTime]; |
| 227 } |
| 228 if (startTime != null) { |
| 229 _queryParams["startTime"] = [startTime]; |
| 230 } |
| 231 if (pageToken != null) { |
| 232 _queryParams["pageToken"] = [pageToken]; |
| 233 } |
| 234 if (pageSize != null) { |
| 235 _queryParams["pageSize"] = ["${pageSize}"]; |
| 236 } |
209 if (view != null) { | 237 if (view != null) { |
210 _queryParams["view"] = [view]; | 238 _queryParams["view"] = [view]; |
211 } | 239 } |
212 if (pageSize != null) { | |
213 _queryParams["pageSize"] = ["${pageSize}"]; | |
214 } | |
215 if (pageToken != null) { | |
216 _queryParams["pageToken"] = [pageToken]; | |
217 } | |
218 if (startTime != null) { | |
219 _queryParams["startTime"] = [startTime]; | |
220 } | |
221 if (endTime != null) { | |
222 _queryParams["endTime"] = [endTime]; | |
223 } | |
224 if (filter != null) { | |
225 _queryParams["filter"] = [filter]; | |
226 } | |
227 if (orderBy != null) { | |
228 _queryParams["orderBy"] = [orderBy]; | |
229 } | |
230 | 240 |
231 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/trac
es'; | 241 _url = 'v1/projects/' + commons.Escaper.ecapeVariable('$projectId') + '/trac
es'; |
232 | 242 |
233 var _response = _requester.request(_url, | 243 var _response = _requester.request(_url, |
234 "GET", | 244 "GET", |
235 body: _body, | 245 body: _body, |
236 queryParams: _queryParams, | 246 queryParams: _queryParams, |
237 uploadOptions: _uploadOptions, | 247 uploadOptions: _uploadOptions, |
238 uploadMedia: _uploadMedia, | 248 uploadMedia: _uploadMedia, |
239 downloadOptions: _downloadOptions); | 249 downloadOptions: _downloadOptions); |
240 return _response.then((data) => new ListTracesResponse.fromJson(data)); | 250 return _response.then((data) => new ListTracesResponse.fromJson(data)); |
241 } | 251 } |
242 | 252 |
243 } | 253 } |
244 | 254 |
245 | 255 |
246 | 256 |
247 /** | 257 /** |
248 * A generic empty message that you can re-use to avoid defining duplicated | 258 * A generic empty message that you can re-use to avoid defining duplicated |
249 * empty messages in your APIs. A typical example is to use it as the request or | 259 * empty messages in your APIs. A typical example is to use it as the request |
250 * the response type of an API method. For instance: service Foo { rpc | 260 * or the response type of an API method. For instance: |
251 * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON | 261 * |
252 * representation for `Empty` is empty JSON object `{}`. | 262 * service Foo { |
| 263 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 264 * } |
| 265 * |
| 266 * The JSON representation for `Empty` is empty JSON object `{}`. |
253 */ | 267 */ |
254 class Empty { | 268 class Empty { |
255 | 269 |
256 Empty(); | 270 Empty(); |
257 | 271 |
258 Empty.fromJson(core.Map _json) { | 272 Empty.fromJson(core.Map _json) { |
259 } | 273 } |
260 | 274 |
261 core.Map toJson() { | 275 core.Map toJson() { |
262 var _json = new core.Map(); | 276 var _json = new core.Map(); |
263 return _json; | 277 return _json; |
264 } | 278 } |
265 } | 279 } |
266 | 280 |
267 /** The response message for the `ListTraces` method. */ | 281 /** The response message for the `ListTraces` method. */ |
268 class ListTracesResponse { | 282 class ListTracesResponse { |
269 /** | 283 /** |
270 * If defined, indicates that there are more traces that match the request and | 284 * If defined, indicates that there are more traces that match the request |
271 * that this value should be passed to the next request to continue retrieving | 285 * and that this value should be passed to the next request to continue |
272 * additional traces. | 286 * retrieving additional traces. |
273 */ | 287 */ |
274 core.String nextPageToken; | 288 core.String nextPageToken; |
275 /** List of trace records returned. */ | 289 /** List of trace records returned. */ |
276 core.List<Trace> traces; | 290 core.List<Trace> traces; |
277 | 291 |
278 ListTracesResponse(); | 292 ListTracesResponse(); |
279 | 293 |
280 ListTracesResponse.fromJson(core.Map _json) { | 294 ListTracesResponse.fromJson(core.Map _json) { |
281 if (_json.containsKey("nextPageToken")) { | 295 if (_json.containsKey("nextPageToken")) { |
282 nextPageToken = _json["nextPageToken"]; | 296 nextPageToken = _json["nextPageToken"]; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 * and form a trace tree. Often, a trace contains a root span that describes the | 362 * and form a trace tree. Often, a trace contains a root span that describes the |
349 * end-to-end latency of an operation and, optionally, one or more subspans for | 363 * end-to-end latency of an operation and, optionally, one or more subspans for |
350 * its suboperations. Spans do not need to be contiguous. There may be gaps | 364 * its suboperations. Spans do not need to be contiguous. There may be gaps |
351 * between spans in a trace. | 365 * between spans in a trace. |
352 */ | 366 */ |
353 class TraceSpan { | 367 class TraceSpan { |
354 /** End time of the span in nanoseconds from the UNIX epoch. */ | 368 /** End time of the span in nanoseconds from the UNIX epoch. */ |
355 core.String endTime; | 369 core.String endTime; |
356 /** | 370 /** |
357 * Distinguishes between spans generated in a particular context. For example, | 371 * Distinguishes between spans generated in a particular context. For example, |
358 * two spans with the same name may be distinguished using `RPC_CLIENT` and | 372 * two spans with the same name may be distinguished using `RPC_CLIENT` |
359 * `RPC_SERVER` to identify queueing latency associated with the span. | 373 * and `RPC_SERVER` to identify queueing latency associated with the span. |
360 * Possible string values are: | 374 * Possible string values are: |
361 * - "SPAN_KIND_UNSPECIFIED" : A SPAN_KIND_UNSPECIFIED. | 375 * - "SPAN_KIND_UNSPECIFIED" : Unspecified. |
362 * - "RPC_SERVER" : A RPC_SERVER. | 376 * - "RPC_SERVER" : Indicates that the span covers server-side handling of an |
363 * - "RPC_CLIENT" : A RPC_CLIENT. | 377 * RPC or other |
| 378 * remote network request. |
| 379 * - "RPC_CLIENT" : Indicates that the span covers the client-side wrapper |
| 380 * around an RPC or |
| 381 * other remote request. |
364 */ | 382 */ |
365 core.String kind; | 383 core.String kind; |
366 /** Collection of labels associated with the span. */ | 384 /** |
| 385 * Collection of labels associated with the span. Label keys must be less than |
| 386 * 128 bytes. Label values must be less than 16 kilobytes. |
| 387 */ |
367 core.Map<core.String, core.String> labels; | 388 core.Map<core.String, core.String> labels; |
368 /** | 389 /** |
369 * Name of the trace. The trace name is sanitized and displayed in the | 390 * Name of the span. Must be less than 128 bytes. The span name is sanitized |
370 * Stackdriver Trace tool in the {% dynamic print site_values.console_name %}. | 391 * and displayed in the Stackdriver Trace tool in the |
371 * The name may be a method name or some other per-call site name. For the | 392 * {% dynamic print site_values.console_name %}. |
372 * same executable and the same call point, a best practice is to use a | 393 * The name may be a method name or some other per-call site name. |
373 * consistent name, which makes it easier to correlate cross-trace spans. | 394 * For the same executable and the same call point, a best practice is |
| 395 * to use a consistent name, which makes it easier to correlate |
| 396 * cross-trace spans. |
374 */ | 397 */ |
375 core.String name; | 398 core.String name; |
376 /** ID of the parent span, if any. Optional. */ | 399 /** ID of the parent span, if any. Optional. */ |
377 core.String parentSpanId; | 400 core.String parentSpanId; |
378 /** | 401 /** |
379 * Identifier for the span. This identifier must be unique within a trace. | 402 * Identifier for the span. Must be a 64-bit integer other than 0 and |
| 403 * unique within a trace. |
380 */ | 404 */ |
381 core.String spanId; | 405 core.String spanId; |
382 /** Start time of the span in nanoseconds from the UNIX epoch. */ | 406 /** Start time of the span in nanoseconds from the UNIX epoch. */ |
383 core.String startTime; | 407 core.String startTime; |
384 | 408 |
385 TraceSpan(); | 409 TraceSpan(); |
386 | 410 |
387 TraceSpan.fromJson(core.Map _json) { | 411 TraceSpan.fromJson(core.Map _json) { |
388 if (_json.containsKey("endTime")) { | 412 if (_json.containsKey("endTime")) { |
389 endTime = _json["endTime"]; | 413 endTime = _json["endTime"]; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 473 } |
450 | 474 |
451 core.Map toJson() { | 475 core.Map toJson() { |
452 var _json = new core.Map(); | 476 var _json = new core.Map(); |
453 if (traces != null) { | 477 if (traces != null) { |
454 _json["traces"] = traces.map((value) => (value).toJson()).toList(); | 478 _json["traces"] = traces.map((value) => (value).toJson()).toList(); |
455 } | 479 } |
456 return _json; | 480 return _json; |
457 } | 481 } |
458 } | 482 } |
OLD | NEW |