create method
Creates a new exclusion in the _Default sink in a specified parent resource.
Only log entries belonging to that resource can be excluded. You can have up to 10 exclusions in a resource.
request
- The metadata request object.
Request parameters:
parent
- Required. The parent resource in which to create the exclusion:
"projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
"billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
examples:"projects/my-logging-project" "organizations/123456789"
Value must have pattern ^organizations/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a LogExclusion.
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<LogExclusion> create(
LogExclusion request,
core.String parent, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/exclusions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return LogExclusion.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}