list method
List OS policy assignment reports for all Compute Engine VM instances in the specified zone.
Request parameters:
parent
- Required. The parent resource name. Format:
projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/{assignment}/reports
For {project}
, either project-number
or project-id
can be provided.
For {instance}
, either instance-name
, instance-id
, or -
can be
provided. If '-' is provided, the response will include
OSPolicyAssignmentReports for all instances in the project/location. For
{assignment}
, either assignment-id
or -
can be provided. If '-' is
provided, the response will include OSPolicyAssignmentReports for all
OSPolicyAssignments in the project/location. Either {instance} or
{assignment} must be -
. For example:
projects/{project}/locations/{location}/instances/{instance}/osPolicyAssignments/-/reports
returns all reports for the instance
projects/{project}/locations/{location}/instances/-/osPolicyAssignments/{assignment-id}/reports
returns all the reports for the given assignment across all instances.
projects/{project}/locations/{location}/instances/-/osPolicyAssignments/-/reports
returns all the reports for all assignments across all instances.
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/instances/\[^/\]+/osPolicyAssignments/\[^/\]+$
.
filter
- If provided, this field specifies the criteria that must be met
by the OSPolicyAssignmentReport
API resource that is included in the
response.
pageSize
- The maximum number of results to return.
pageToken
- A pagination token returned from a previous call to the
ListOSPolicyAssignmentReports
method that indicates where this listing
should continue from.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a ListOSPolicyAssignmentReportsResponse.
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<ListOSPolicyAssignmentReportsResponse> list(
core.String parent, {
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (filter != null) 'filter': [filter],
if (pageSize != null) 'pageSize': ['${pageSize}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/reports';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListOSPolicyAssignmentReportsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}