Skip to content

register_schema_version

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

Adds a new version to the existing schema. Returns an error if new version of schema does not meet the compatibility requirements of the schema set. This API will not create a new schema set and will return a 404 error if the schema set is not already present in the Schema Registry.

If this is the first schema definition to be registered in the Schema Registry, this API will store the schema version and return immediately. Otherwise, this call has the potential to run longer than other operations due to compatibility modes. You can call the GetSchemaVersion API with the SchemaVersionId to check compatibility modes.

If the same schema definition is already stored in Schema Registry as a version, the schema ID of the existing schema is returned to the caller.

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. Either SchemaArn or SchemaName and RegistryName has to be provided.

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

  • schema_definition (SchemaDefinitionString) –

    The schema definition using the DataFormat setting for the SchemaName.

Raises:

Source code in docs_src/capo_glue/_services/glue.py
def register_schema_version(
    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.register_schema_version_response.RegisterSchemaVersionResponse"
):
    """<p>Adds a new version to the existing schema. Returns an error if new version of schema does not meet the compatibility requirements of the schema set. This API will not create a new schema set and will return a 404 error if the schema set is not already present in the Schema Registry.</p> <p>If this is the first schema definition to be registered in the Schema Registry, this API will store the schema version and return immediately. Otherwise, this call has the potential to run longer than other operations due to compatibility modes. You can call the <code>GetSchemaVersion</code> API with the <code>SchemaVersionId</code> to check compatibility modes.</p> <p>If the same schema definition is already stored in Schema Registry as a version, the schema ID of the existing schema is returned to the caller.</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. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p> </li> <li> <p>SchemaId$SchemaName: The name of the schema. Either <code>SchemaArn</code> or <code>SchemaName</code> and <code>RegistryName</code> has to be provided.</p> </li> </ul>
        schema_definition: <p>The schema definition using the <code>DataFormat</code> setting for the <code>SchemaName</code>.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Two processes are trying to modify a resource simultaneously.</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.resource_number_limit_exceeded_exception.ResourceNumberLimitExceededException: <p>A resource numerical limit was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_glue.types.register_schema_version_input.RegisterSchemaVersionInput]",
    ) -> OperationResponse[
        "capo_glue.types.register_schema_version_response.RegisterSchemaVersionResponse"
    ]:
        import capo_glue._operations.aws_glue.register_schema_version

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RegisterSchemaVersion")
    )
    input_: capo_glue.types.register_schema_version_input.RegisterSchemaVersionInput = {
        "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