Skip to content

get_schema_by_definition

get_schema_by_definition(
    schema_id: SchemaId,
    schema_definition: SchemaDefinitionString,
    *,
    config_overrides: Optional[GlueClientConfig] = None,
) -> GetSchemaByDefinitionResponse

Retrieves a schema by the SchemaDefinition. The schema definition is sent to the Schema Registry, canonicalized, and hashed. If the hash is matched within the scope of the SchemaName or ARN (or the default registry, if none is supplied), that schema’s metadata is returned. Otherwise, a 404 or NotFound error is returned. Schema versions in Deleted statuses will not be included in the results.

Parameters:

  • schema_id (SchemaId) –

    This is a wrapper structure to contain schema identity fields. The structure contains:

    • SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of SchemaArn or SchemaName has to be provided.

    • SchemaId$SchemaName: The name of the schema. One of SchemaArn or SchemaName has to be provided.

  • schema_definition (SchemaDefinitionString) –

    The definition of the schema for which schema details are required.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def get_schema_by_definition(
    self,
    schema_id: "capo_glue.types.schema_id.SchemaId",
    schema_definition: "capo_glue.types.schema_definition_string.SchemaDefinitionString",
    *,
    config_overrides: Optional[GlueClientConfig] = None,
) -> "capo_glue.types.get_schema_by_definition_response.GetSchemaByDefinitionResponse":
    """<p>Retrieves a schema by the <code>SchemaDefinition</code>. The schema definition is sent to the Schema Registry, canonicalized, and hashed. If the hash is matched within the scope of the <code>SchemaName</code> or ARN (or the default registry, if none is supplied), that schema’s metadata is returned. Otherwise, a 404 or NotFound error is returned. Schema versions in <code>Deleted</code> statuses will not be included in the results.</p>

    Args:
        schema_id: <p>This is a wrapper structure to contain schema identity fields. The structure contains:</p> <ul> <li> <p>SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p> </li> <li> <p>SchemaId$SchemaName: The name of the schema. One of <code>SchemaArn</code> or <code>SchemaName</code> has to be provided.</p> </li> </ul>
        schema_definition: <p>The definition of the schema for which schema details are required.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.get_schema_by_definition_input.GetSchemaByDefinitionInput]",
    ) -> OperationResponse[
        "capo_glue.types.get_schema_by_definition_response.GetSchemaByDefinitionResponse"
    ]:
        import capo_glue._operations.aws_glue.get_schema_by_definition

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetSchemaByDefinition")
    )
    input_: capo_glue.types.get_schema_by_definition_input.GetSchemaByDefinitionInput = {
        "schema_id": schema_id,
        "schema_definition": schema_definition,
    }

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