updateCrawlerSchedule method

Future<void> updateCrawlerSchedule({
  1. required String crawlerName,
  2. String? schedule,
})

Updates the schedule of a crawler using a cron expression.

May throw EntityNotFoundException. May throw InvalidInputException. May throw VersionMismatchException. May throw SchedulerTransitioningException. May throw OperationTimeoutException.

Parameter crawlerName : The name of the crawler whose schedule to update.

Parameter schedule : The updated cron expression used to specify the schedule (see Time-Based Schedules for Jobs and Crawlers. For example, to run something every day at 12:15 UTC, you would specify: cron(15 12 * * ? *).

Implementation

Future<void> updateCrawlerSchedule({
  required String crawlerName,
  String? schedule,
}) async {
  ArgumentError.checkNotNull(crawlerName, 'crawlerName');
  _s.validateStringLength(
    'crawlerName',
    crawlerName,
    1,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.UpdateCrawlerSchedule'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'CrawlerName': crawlerName,
      if (schedule != null) 'Schedule': schedule,
    },
  );
}