Remove versions from the specified schema. A version number or range may be supplied. If the compatibility mode forbids deleting of a version that is necessary, such as BACKWARDS_FULL, an error is returned. Calling the GetSchemaVersions API after this call will list the status of the deleted versions.
When the range of version numbers contain check pointed version, the API will return a 409 conflict and will not proceed with the deletion. You have to remove the checkpoint first using the DeleteSchemaCheckpoint API before using this API.
You cannot use the DeleteSchemaVersions API to delete the first schema version in the schema set. The first schema version can only be deleted by the DeleteSchema API. This operation will also delete the attached SchemaVersionMetadata under the schema versions. Hard deletes will be enforced on the database.
If the compatibility mode forbids deleting of a version that is necessary, such as BACKWARDS_FULL, an error is returned.
Parameters:
-
schema_id
(SchemaId)
–
This is a wrapper structure that may contain the schema name and Amazon Resource Name (ARN).
-
versions
(VersionsString)
–
A version range may be supplied which may be of the format:
-
a single version number, 5
-
a range, 5-8 : deletes versions 5, 6, 7, 8
Raises:
Source code in docs_src/capo_glue/_services/glue.py
| def delete_schema_versions(
self,
schema_id: "capo_glue.types.schema_id.SchemaId",
versions: "capo_glue.types.versions_string.VersionsString",
*,
config_overrides: Optional[GlueClientConfig] = None,
) -> "capo_glue.types.delete_schema_versions_response.DeleteSchemaVersionsResponse":
"""<p>Remove versions from the specified schema. A version number or range may be supplied. If the compatibility mode forbids deleting of a version that is necessary, such as BACKWARDS_FULL, an error is returned. Calling the <code>GetSchemaVersions</code> API after this call will list the status of the deleted versions.</p> <p>When the range of version numbers contain check pointed version, the API will return a 409 conflict and will not proceed with the deletion. You have to remove the checkpoint first using the <code>DeleteSchemaCheckpoint</code> API before using this API.</p> <p>You cannot use the <code>DeleteSchemaVersions</code> API to delete the first schema version in the schema set. The first schema version can only be deleted by the <code>DeleteSchema</code> API. This operation will also delete the attached <code>SchemaVersionMetadata</code> under the schema versions. Hard deletes will be enforced on the database.</p> <p>If the compatibility mode forbids deleting of a version that is necessary, such as BACKWARDS_FULL, an error is returned.</p>
Args:
schema_id: <p>This is a wrapper structure that may contain the schema name and Amazon Resource Name (ARN).</p>
versions: <p>A version range may be supplied which may be of the format:</p> <ul> <li> <p>a single version number, 5</p> </li> <li> <p>a range, 5-8 : deletes versions 5, 6, 7, 8</p> </li> </ul>
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.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.delete_schema_versions_input.DeleteSchemaVersionsInput]",
) -> OperationResponse[
"capo_glue.types.delete_schema_versions_response.DeleteSchemaVersionsResponse"
]:
import capo_glue._operations.aws_glue.delete_schema_versions
output, http_response = (
capo_glue._operations.aws_glue.delete_schema_versions.delete_schema_versions(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteSchemaVersions")
)
input_: capo_glue.types.delete_schema_versions_input.DeleteSchemaVersionsInput = {
"schema_id": schema_id,
"versions": versions,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|