Skip to content

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 limit number of objects
offset Optional[Annotated[int, Ge(ge=0)]] = None set start index for objects list

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 limit number of objects
offset int | None = None set start index for objects list

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\\/\\.:]+$')])] name to allocated to this storage system
disable_check bool whether to disable checks for this system
endpoint_url <class 'pydantic.networks.HttpUrl'> endpoint defining the S3 upload URL
region_name str the region name associated with this storage system
access_key_id str the access key identifier for the storage
secret_access_key <class 'pydantic.types.SecretStr'> the secret access key, stored as a secret string
bucket str the bucket associated with this storage system
is_tenant_useable bool whether this system is usable by the current tenant
is_enabled bool whether to enable this system
is_default bool if this storage system should become the new is_default
offline bool = False if this instance should be created in offline mode, is_default 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 whether object is read only.

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