Skip to content

compare_domain_configuration

compare_domain_configuration(
    source_domain_arn: DomainArn,
    target_domain_arn: DomainArn,
    categories: MetadataCategoryList,
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
) -> CompareDomainConfigurationResponse

Compares the metadata of two domains and reports where they differ. Use this operation to check that a secondary domain is configured consistently with its primary before you rely on it, because replication copies index data but does not copy domain metadata such as index templates, ingest pipelines, or security roles.

You choose which categories to compare. The response reports, for each category, how many items match, how many exist on only one domain, and which fields diverge.

Parameters:

  • source_domain_arn (DomainArn) –

    The Amazon Resource Name (ARN) of the domain to compare from.

  • target_domain_arn (DomainArn) –

    The Amazon Resource Name (ARN) of the domain to compare against.

  • categories (MetadataCategoryList) –

    The metadata categories to compare. At least one is required, and only the categories you name are read and returned.

    • aliases

    • alerting_monitors

    • cluster_settings

    • component_templates

    • ingest_pipelines

    • ism_policies — index state management policies

    • security_action_groups

    • security_internal_users

    • security_role_mappings

    • security_roles

    • templates — index templates

    The set of categories grows over time, so this list is not fixed. A category the service does not recognise is rejected with the supported categories named in the error message.

Raises:

Source code in docs_src/capo_opensearch/_services/open_search.py
def compare_domain_configuration(
    self,
    source_domain_arn: "capo_opensearch.types.domain_arn.DomainArn",
    target_domain_arn: "capo_opensearch.types.domain_arn.DomainArn",
    categories: "capo_opensearch.types.metadata_category_list.MetadataCategoryList",
    *,
    config_overrides: Optional[OpenSearchClientConfig] = None,
) -> "capo_opensearch.types.compare_domain_configuration_response.CompareDomainConfigurationResponse":
    """<p>Compares the metadata of two domains and reports where they differ. Use this operation to check that a secondary domain is configured consistently with its primary before you rely on it, because replication copies index data but does not copy domain metadata such as index templates, ingest pipelines, or security roles.</p> <p>You choose which categories to compare. The response reports, for each category, how many items match, how many exist on only one domain, and which fields diverge.</p>

    Args:
        source_domain_arn: <p>The Amazon Resource Name (ARN) of the domain to compare from.</p>
        target_domain_arn: <p>The Amazon Resource Name (ARN) of the domain to compare against.</p>
        categories: <p>The metadata categories to compare. At least one is required, and only the categories you name are read and returned.</p> <ul> <li> <p> <code>aliases</code> </p> </li> <li> <p> <code>alerting_monitors</code> </p> </li> <li> <p> <code>cluster_settings</code> </p> </li> <li> <p> <code>component_templates</code> </p> </li> <li> <p> <code>ingest_pipelines</code> </p> </li> <li> <p> <code>ism_policies</code> — index state management policies</p> </li> <li> <p> <code>security_action_groups</code> </p> </li> <li> <p> <code>security_internal_users</code> </p> </li> <li> <p> <code>security_role_mappings</code> </p> </li> <li> <p> <code>security_roles</code> </p> </li> <li> <p> <code>templates</code> — index templates</p> </li> </ul> <p>The set of categories grows over time, so this list is not fixed. A category the service does not recognise is rejected with the supported categories named in the error message.</p>

    Raises:
        capo_opensearch.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access an unsupported operation.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_opensearch.types.compare_domain_configuration_request.CompareDomainConfigurationRequest]",
    ) -> OperationResponse[
        "capo_opensearch.types.compare_domain_configuration_response.CompareDomainConfigurationResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.compare_domain_configuration

        output, http_response = (
            capo_opensearch._operations.amazon_open_search_service.compare_domain_configuration.compare_domain_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CompareDomainConfiguration")
    )
    input_: capo_opensearch.types.compare_domain_configuration_request.CompareDomainConfigurationRequest = {
        "source_domain_arn": source_domain_arn,
        "target_domain_arn": target_domain_arn,
        "categories": categories,
    }

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