updateCrawler method

Future<void> updateCrawler({
  1. required String name,
  2. List<String>? classifiers,
  3. String? configuration,
  4. String? crawlerSecurityConfiguration,
  5. String? databaseName,
  6. String? description,
  7. LineageConfiguration? lineageConfiguration,
  8. RecrawlPolicy? recrawlPolicy,
  9. String? role,
  10. String? schedule,
  11. SchemaChangePolicy? schemaChangePolicy,
  12. String? tablePrefix,
  13. CrawlerTargets? targets,
})

Updates a crawler. If a crawler is running, you must stop it using StopCrawler before updating it.

May throw InvalidInputException. May throw VersionMismatchException. May throw EntityNotFoundException. May throw CrawlerRunningException. May throw OperationTimeoutException.

Parameter name : Name of the new crawler.

Parameter classifiers : A list of custom classifiers that the user has registered. By default, all built-in classifiers are included in a crawl, but these custom classifiers always override the default classifiers for a given classification.

Parameter configuration : Crawler configuration information. This versioned JSON string allows users to specify aspects of a crawler's behavior. For more information, see Configuring a Crawler.

Parameter crawlerSecurityConfiguration : The name of the SecurityConfiguration structure to be used by this crawler.

Parameter databaseName : The AWS Glue database where results are stored, such as: arn:aws:daylight:us-east-1::database/sometable/*.

Parameter description : A description of the new crawler.

Parameter lineageConfiguration : Specifies data lineage configuration settings for the crawler.

Parameter recrawlPolicy : A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.

Parameter role : The IAM role or Amazon Resource Name (ARN) of an IAM role that is used by the new crawler to access customer resources.

Parameter schedule : A 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 * * ? *).

Parameter schemaChangePolicy : The policy for the crawler's update and deletion behavior.

Parameter tablePrefix : The table prefix used for catalog tables that are created.

Parameter targets : A list of targets to crawl.

Implementation

Future<void> updateCrawler({
  required String name,
  List<String>? classifiers,
  String? configuration,
  String? crawlerSecurityConfiguration,
  String? databaseName,
  String? description,
  LineageConfiguration? lineageConfiguration,
  RecrawlPolicy? recrawlPolicy,
  String? role,
  String? schedule,
  SchemaChangePolicy? schemaChangePolicy,
  String? tablePrefix,
  CrawlerTargets? targets,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'crawlerSecurityConfiguration',
    crawlerSecurityConfiguration,
    0,
    128,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    2048,
  );
  _s.validateStringLength(
    'tablePrefix',
    tablePrefix,
    0,
    128,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.UpdateCrawler'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (classifiers != null) 'Classifiers': classifiers,
      if (configuration != null) 'Configuration': configuration,
      if (crawlerSecurityConfiguration != null)
        'CrawlerSecurityConfiguration': crawlerSecurityConfiguration,
      if (databaseName != null) 'DatabaseName': databaseName,
      if (description != null) 'Description': description,
      if (lineageConfiguration != null)
        'LineageConfiguration': lineageConfiguration,
      if (recrawlPolicy != null) 'RecrawlPolicy': recrawlPolicy,
      if (role != null) 'Role': role,
      if (schedule != null) 'Schedule': schedule,
      if (schemaChangePolicy != null)
        'SchemaChangePolicy': schemaChangePolicy,
      if (tablePrefix != null) 'TablePrefix': tablePrefix,
      if (targets != null) 'Targets': targets,
    },
  );
}