The api.objects.S3Storage
class¶
Inherits from ABC
> SimvueObject
> StorageBase
Class for defining/accessing an S3 based storage system on the server.
Methods¶
__init__()¶
Initialise an S3Storage instance attaching a configuration
commit()¶
Send updates to the server, or if offline, store locally.
count()¶
Return the total number of entries for this object type from the server.
Returns
int
total from server database for current user.
delete()¶
Delete the server entry for this object.
Returns
dict[str, Any]
response from server on deletion.
get(...)¶
Retrieve items of this object type from the server.
Parameters
count | Optional[Annotated[int, Gt(gt=0)]] |
= None |
|
offset | Optional[Annotated[int, Ge(ge=0)]] |
= None |
Yields
tuple[str, SimvueObject | None]
object corresponding to an entry on the server.
Returns
Generator[tuple[str, SimvueObject | None], None, None]
get_config()¶
Retrieve configuration
ids(...)¶
Retrieve a list of all object identifiers.
Parameters
count | int | None |
= None |
|
offset | int | None |
= None |
Yields
str
identifiers for all objects of this type.
new(...)¶
Create a new S3 storage object.
Parameters
name | Annotated[str, FieldInfo(annotation=None, required=True, metadata=[_PydanticGeneralMetadata(pattern='^[a-zA-Z0-9\\-\\_\\s\\/\\.:]+$')])] |
||
disable_check | bool |
||
endpoint_url | <class 'pydantic.networks.HttpUrl'> |
||
region_name | str |
||
access_key_id | str |
||
secret_access_key | <class 'pydantic.types.SecretStr'> |
||
bucket | str |
||
is_tenant_useable | bool |
||
is_enabled | bool |
||
is_default | bool |
||
offline | bool |
= False |
Returns
S3Storage
instance of storage system with staged changes
on_reconnect()¶
Executed when a run switches from offline to online mode. In this case no action is taken.
read_only(...)¶
Set whether this object is in read only state.
Parameters
is_read_only | bool |
refresh()¶
Refresh staging from local data if in read-only mode.
to_dict()¶
Convert object to serializable dictionary.
Returns
dict[str, Any]
dictionary representation of this object
Properties¶
backend¶
Retrieve the backend of storage
created¶
Retrieve created datetime for the artifact
id¶
The identifier for this object if applicable.
Returns
str | None
is_default¶
Retrieve if this is the default storage for the user
is_enabled¶
Retrieve if this is enabled
is_tenant_useable¶
Retrieve if this is usable by the current user tenant
name¶
Retrieve the name for this storage
staged¶
Return currently staged changes to this object.
Returns
dict[str, Any] | None
the locally staged data if available.
url¶
The URL for accessing this object on the server.
Returns
simvue.api.url.URL | None