Skip to content

update_crawler

update_crawler(
    name: NameString,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    role: Optional[Role] = None,
    database_name: Optional[DatabaseName] = None,
    description: Optional[DescriptionStringRemovable] = None,
    targets: Optional[CrawlerTargets] = None,
    schedule: Optional[CronExpression] = None,
    classifiers: Optional[ClassifierNameList] = None,
    table_prefix: Optional[TablePrefix] = None,
    schema_change_policy: Optional[SchemaChangePolicy] = None,
    recrawl_policy: Optional[RecrawlPolicy] = None,
    lineage_configuration: Optional[LineageConfiguration] = None,
    lake_formation_configuration: Optional[LakeFormationConfiguration] = None,
    configuration: Optional[CrawlerConfiguration] = None,
    crawler_security_configuration: Optional[CrawlerSecurityConfiguration] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> UpdateCrawlerResponse

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

Parameters:

  • name (NameString) –

    Name of the new crawler.

  • role (Optional[Role], default: None ) –

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

  • database_name (Optional[DatabaseName], default: None ) –

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

  • description (Optional[DescriptionStringRemovable], default: None ) –

    A description of the new crawler.

  • targets (Optional[CrawlerTargets], default: None ) –

    A list of targets to crawl.

  • schedule (Optional[CronExpression], default: None ) –

    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 * * ? *).

  • classifiers (Optional[ClassifierNameList], default: None ) –

    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.

  • table_prefix (Optional[TablePrefix], default: None ) –

    The table prefix used for catalog tables that are created.

  • schema_change_policy (Optional[SchemaChangePolicy], default: None ) –

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

  • recrawl_policy (Optional[RecrawlPolicy], default: None ) –

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

  • lineage_configuration (Optional[LineageConfiguration], default: None ) –

    Specifies data lineage configuration settings for the crawler.

  • lake_formation_configuration (Optional[LakeFormationConfiguration], default: None ) –

    Specifies Lake Formation configuration settings for the crawler.

  • configuration (Optional[CrawlerConfiguration], default: None ) –

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

  • crawler_security_configuration (Optional[CrawlerSecurityConfiguration], default: None ) –

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

  • catalog_id (Optional[CatalogIdString], default: None ) –

    The ID of the Data Catalog in which to store the crawler's output. If you omit this value, the existing value on the crawler is preserved.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def update_crawler(
    self,
    name: "capo_glue.types.name_string.NameString",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
    role: Optional["capo_glue.types.role.Role"] = None,
    database_name: Optional["capo_glue.types.database_name.DatabaseName"] = None,
    description: Optional[
        "capo_glue.types.description_string_removable.DescriptionStringRemovable"
    ] = None,
    targets: Optional["capo_glue.types.crawler_targets.CrawlerTargets"] = None,
    schedule: Optional["capo_glue.types.cron_expression.CronExpression"] = None,
    classifiers: Optional[
        "capo_glue.types.classifier_name_list.ClassifierNameList"
    ] = None,
    table_prefix: Optional["capo_glue.types.table_prefix.TablePrefix"] = None,
    schema_change_policy: Optional[
        "capo_glue.types.schema_change_policy.SchemaChangePolicy"
    ] = None,
    recrawl_policy: Optional["capo_glue.types.recrawl_policy.RecrawlPolicy"] = None,
    lineage_configuration: Optional[
        "capo_glue.types.lineage_configuration.LineageConfiguration"
    ] = None,
    lake_formation_configuration: Optional[
        "capo_glue.types.lake_formation_configuration.LakeFormationConfiguration"
    ] = None,
    configuration: Optional[
        "capo_glue.types.crawler_configuration.CrawlerConfiguration"
    ] = None,
    crawler_security_configuration: Optional[
        "capo_glue.types.crawler_security_configuration.CrawlerSecurityConfiguration"
    ] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.update_crawler_response.UpdateCrawlerResponse":
    """<p>Updates a crawler. If a crawler is running, you must stop it using <code>StopCrawler</code> before updating it.</p>

    Args:
        name: <p>Name of the new crawler.</p>
        role: <p>The IAM role or Amazon Resource Name (ARN) of an IAM role that is used by the new crawler to access customer resources.</p>
        database_name: <p>The Glue database where results are stored, such as: <code>arn:aws:daylight:us-east-1::database/sometable/*</code>.</p>
        description: <p>A description of the new crawler.</p>
        targets: <p>A list of targets to crawl.</p>
        schedule: <p>A <code>cron</code> expression used to specify the schedule (see <a href="https://docs.aws.amazon.com/glue/latest/dg/monitor-data-warehouse-schedule.html">Time-Based Schedules for Jobs and Crawlers</a>. For example, to run something every day at 12:15 UTC, you would specify: <code>cron(15 12 * * ? *)</code>.</p>
        classifiers: <p>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.</p>
        table_prefix: <p>The table prefix used for catalog tables that are created.</p>
        schema_change_policy: <p>The policy for the crawler's update and deletion behavior.</p>
        recrawl_policy: <p>A policy that specifies whether to crawl the entire dataset again, or to crawl only folders that were added since the last crawler run.</p>
        lineage_configuration: <p>Specifies data lineage configuration settings for the crawler.</p>
        lake_formation_configuration: <p>Specifies Lake Formation configuration settings for the crawler.</p>
        configuration: <p>Crawler configuration information. This versioned JSON string allows users to specify aspects of a crawler's behavior. For more information, see <a href="https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html">Setting crawler configuration options</a>.</p>
        crawler_security_configuration: <p>The name of the <code>SecurityConfiguration</code> structure to be used by this crawler.</p>
        catalog_id: <p>The ID of the Data Catalog in which to store the crawler's output. If you omit this value, the existing value on the crawler is preserved.</p>

    Raises:
        capo_glue.errors.crawler_running_exception.CrawlerRunningException: <p>The operation cannot be performed because the crawler is already running.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.version_mismatch_exception.VersionMismatchException: <p>There was a version conflict.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.update_crawler_request.UpdateCrawlerRequest]",
    ) -> OperationResponse[
        "capo_glue.types.update_crawler_response.UpdateCrawlerResponse"
    ]:
        import capo_glue._operations.aws_glue.update_crawler

        output, http_response = (
            capo_glue._operations.aws_glue.update_crawler.update_crawler(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCrawler")
    )
    input_: capo_glue.types.update_crawler_request.UpdateCrawlerRequest = {
        "name": name
    }
    if role is not None:
        input_["role"] = role
    if database_name is not None:
        input_["database_name"] = database_name
    if description is not None:
        input_["description"] = description
    if targets is not None:
        input_["targets"] = targets
    if schedule is not None:
        input_["schedule"] = schedule
    if classifiers is not None:
        input_["classifiers"] = classifiers
    if table_prefix is not None:
        input_["table_prefix"] = table_prefix
    if schema_change_policy is not None:
        input_["schema_change_policy"] = schema_change_policy
    if recrawl_policy is not None:
        input_["recrawl_policy"] = recrawl_policy
    if lineage_configuration is not None:
        input_["lineage_configuration"] = lineage_configuration
    if lake_formation_configuration is not None:
        input_["lake_formation_configuration"] = lake_formation_configuration
    if configuration is not None:
        input_["configuration"] = configuration
    if crawler_security_configuration is not None:
        input_["crawler_security_configuration"] = crawler_security_configuration
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output