updateScheduledQuery method
- required String executionRoleArn,
- required String identifier,
- required QueryLanguage queryLanguage,
- required String queryString,
- required String scheduleExpression,
- String? description,
- DestinationConfiguration? destinationConfiguration,
- List<
String> ? logGroupIdentifiers, - int? scheduleEndTime,
- int? scheduleStartTime,
- int? startTimeOffset,
- ScheduledQueryState? state,
- String? timezone,
Updates an existing scheduled query with new configuration. This operation uses PUT semantics, allowing modification of query parameters, schedule, and destinations.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter executionRoleArn :
The updated ARN of the IAM role that grants permissions to execute the
query and deliver results.
Parameter identifier :
The ARN or name of the scheduled query to update.
Parameter queryLanguage :
The updated query language for the scheduled query.
Parameter queryString :
The updated query string to execute.
Parameter scheduleExpression :
The updated cron expression that defines when the scheduled query runs.
Parameter description :
An updated description for the scheduled query.
Parameter destinationConfiguration :
The updated configuration for where to deliver query results.
Parameter logGroupIdentifiers :
The updated array of log group names or ARNs to query.
Parameter scheduleEndTime :
The updated end time for the scheduled query in Unix epoch format.
Parameter scheduleStartTime :
The updated start time for the scheduled query in Unix epoch format.
Parameter startTimeOffset :
The updated time offset in seconds that defines the lookback period for
the query.
Parameter state :
The updated state of the scheduled query.
Parameter timezone :
The updated timezone for evaluating the schedule expression.
Implementation
Future<UpdateScheduledQueryResponse> updateScheduledQuery({
required String executionRoleArn,
required String identifier,
required QueryLanguage queryLanguage,
required String queryString,
required String scheduleExpression,
String? description,
DestinationConfiguration? destinationConfiguration,
List<String>? logGroupIdentifiers,
int? scheduleEndTime,
int? scheduleStartTime,
int? startTimeOffset,
ScheduledQueryState? state,
String? timezone,
}) async {
_s.validateNumRange(
'scheduleEndTime',
scheduleEndTime,
0,
1152921504606846976,
);
_s.validateNumRange(
'scheduleStartTime',
scheduleStartTime,
0,
1152921504606846976,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Logs_20140328.UpdateScheduledQuery'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'executionRoleArn': executionRoleArn,
'identifier': identifier,
'queryLanguage': queryLanguage.value,
'queryString': queryString,
'scheduleExpression': scheduleExpression,
if (description != null) 'description': description,
if (destinationConfiguration != null)
'destinationConfiguration': destinationConfiguration,
if (logGroupIdentifiers != null)
'logGroupIdentifiers': logGroupIdentifiers,
if (scheduleEndTime != null) 'scheduleEndTime': scheduleEndTime,
if (scheduleStartTime != null) 'scheduleStartTime': scheduleStartTime,
if (startTimeOffset != null) 'startTimeOffset': startTimeOffset,
if (state != null) 'state': state.value,
if (timezone != null) 'timezone': timezone,
},
);
return UpdateScheduledQueryResponse.fromJson(jsonResponse.body);
}