Skip to content

The api.objects.FileStorage class

Inherits from ABC > SimvueObject > StorageBase

Class for defining/accessing a File based storage system on the server.

Methods

__init__()

Retrieve an alert from the Simvue server by identifier


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]


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 file 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
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 default
offline bool = False if this instance should be created in offline mode, default False

Returns

FileStorage

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