getScans method

Future<Scan> getScans(
  1. String name, {
  2. String? endTime,
  3. String? startTime,
  4. String? view,
  5. String? $fields,
})

Request a specific scan with Database-specific data for Cloud Key Visualizer.

Request parameters:

name - Required. The unique name of the scan containing the requested information, specific to the Database service implementing this interface. Value must have pattern ^projects/\[^/\]+/instances/\[^/\]+/databases/\[^/\]+$.

endTime - The upper bound for the time range to retrieve Scan data for.

startTime - These fields restrict the Database-specific information returned in the Scan.data field. If a View is provided that does not include the Scan.data field, these are ignored. This range of time must be entirely contained within the defined time range of the targeted scan. The lower bound for the time range to retrieve Scan data for.

view - Specifies which parts of the Scan should be returned in the response. Note, if left unspecified, the FULL view is assumed. Possible string values are:

  • "VIEW_UNSPECIFIED" : Not specified, equivalent to SUMMARY.
  • "SUMMARY" : Server responses only include name, details, start_time and end_time. The default value. Note, the ListScans method may only use this view type, others view types are not supported.
  • "FULL" : Full representation of the scan is returned in the server response, including data.

$fields - Selector specifying which fields to include in a partial response.

Completes with a Scan.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<Scan> getScans(
  core.String name, {
  core.String? endTime,
  core.String? startTime,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (endTime != null) 'endTime': [endTime],
    if (startTime != null) 'startTime': [startTime],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name') + '/scans';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return Scan.fromJson(response_ as core.Map<core.String, core.dynamic>);
}