-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement mock for S3Tables service (#8470)
- Loading branch information
1 parent
786a8ad
commit 4f565fb
Showing
14 changed files
with
1,565 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.. _implementedservice_s3tables: | ||
|
||
.. |start-h3| raw:: html | ||
|
||
<h3> | ||
|
||
.. |end-h3| raw:: html | ||
|
||
</h3> | ||
|
||
======== | ||
s3tables | ||
======== | ||
|
||
.. autoclass:: moto.s3tables.models.S3TablesBackend | ||
|
||
|start-h3| Implemented features for this service |end-h3| | ||
|
||
- [X] create_namespace | ||
- [X] create_table | ||
- [X] create_table_bucket | ||
- [X] delete_namespace | ||
- [X] delete_table | ||
- [X] delete_table_bucket | ||
- [ ] delete_table_bucket_policy | ||
- [ ] delete_table_policy | ||
- [X] get_namespace | ||
- [X] get_table | ||
- [X] get_table_bucket | ||
- [ ] get_table_bucket_maintenance_configuration | ||
- [ ] get_table_bucket_policy | ||
- [ ] get_table_maintenance_configuration | ||
- [ ] get_table_maintenance_job_status | ||
- [ ] get_table_metadata_location | ||
- [ ] get_table_policy | ||
- [X] list_namespaces | ||
- [X] list_table_buckets | ||
- [X] list_tables | ||
- [ ] put_table_bucket_maintenance_configuration | ||
- [ ] put_table_bucket_policy | ||
- [ ] put_table_maintenance_configuration | ||
- [ ] put_table_policy | ||
- [X] rename_table | ||
- [X] update_table_metadata_location | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .models import s3tables_backends # noqa: F401 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
"""Exceptions raised by the s3tables service.""" | ||
|
||
from moto.core.exceptions import JsonRESTError | ||
|
||
|
||
class BadRequestException(JsonRESTError): | ||
code = 400 | ||
|
||
def __init__(self, message: str) -> None: | ||
super().__init__("BadRequestException", message) | ||
|
||
|
||
class InvalidContinuationToken(BadRequestException): | ||
msg = "The continuation token is not valid." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class InvalidTableBucketName(BadRequestException): | ||
msg = "The specified bucket name is not valid." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class InvalidTableName(BadRequestException): | ||
template = "1 validation error detected: Value '%s' at 'name' failed to satisfy constraint: Member must satisfy regular expression pattern: [0-9a-z_]*" | ||
|
||
def __init__(self, name: str) -> None: | ||
super().__init__(self.template.format(name)) | ||
|
||
|
||
class InvalidNamespaceName(BadRequestException): | ||
msg = "The specified namespace name is not valid." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class InvalidMetadataLocation(BadRequestException): | ||
msg = "The specified metadata location is not valid." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class NothingToRename(BadRequestException): | ||
msg = "Neither a new namespace name nor a new table name is specified." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class NotFoundException(JsonRESTError): | ||
code = 404 | ||
|
||
def __init__(self, message: str) -> None: | ||
super().__init__("NotFoundException", message) | ||
|
||
|
||
class NamespaceDoesNotExist(NotFoundException): | ||
msg = "The specified namespace does not exist." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class DestinationNamespaceDoesNotExist(NotFoundException): | ||
msg = "The specified destination namespace does not exist." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class TableDoesNotExist(NotFoundException): | ||
msg = "The specified table does not exist." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class ConflictException(JsonRESTError): | ||
code = 409 | ||
|
||
def __init__(self, message: str) -> None: | ||
super().__init__("ConflictException", message) | ||
|
||
|
||
class VersionTokenMismatch(ConflictException): | ||
msg = "Provided version token does not match the table version token." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) | ||
|
||
|
||
class TableAlreadyExists(ConflictException): | ||
msg = "A table with an identical name already exists in the namespace." | ||
|
||
def __init__(self) -> None: | ||
super().__init__(self.msg) |
Oops, something went wrong.