savant_rs.webserver.kvs

savant_rs.webserver.kvs.del_attribute(ns, name)

Delete an attribute from the key-value store.

Parameters:
  • ns (str) – Namespace to delete from.

  • name (str) – Name to delete.

Returns:

The attribute deleted.

Return type:

Optional[Attribute]

savant_rs.webserver.kvs.del_attributes(ns=None, name=None, no_gil=False)

Delete attributes from the key-value store.

Parameters:
  • ns (Optional[str]) – Namespace to delete from (Glob). None means “*”.

  • name (Optional[str]) – Name to delete (Glob). None means “*”.

savant_rs.webserver.kvs.deserialize_attributes(serialized)

Deserialize a byte buffer to a list of attributes.

Parameters:

serialized (bytes) – The serialized attributes.

Returns:

The deserialized attributes.

Return type:

List[Attribute]

Raises:

ValueError – If deserialization fails.

savant_rs.webserver.kvs.get_attribute(ns, name)

Get an attribute from the key-value store.

Parameters:
  • ns (str) – Namespace to get from.

  • name (str) – Name to get.

Returns:

The attribute found.

Return type:

Optional[Attribute]

savant_rs.webserver.kvs.search_attributes(ns=None, name=None, no_gil=False)

Search for attributes in the key-value store.

Parameters:
  • ns (Optional[str]) – Namespace to search for (Glob). None means “*”.

  • name (Optional[str]) – Name to search for (Glob). None means “*”.

Returns:

List of attributes found.

Return type:

List[Attribute]

savant_rs.webserver.kvs.search_keys(ns=None, name=None, no_gil=False)

Search for keys in the key-value store.

Parameters:
  • ns (Optional[str]) – Namespace to search for (Glob). None means “*”.

  • name (Optional[str]) – Name to search for (Glob). None means “*”.

Returns:

List of keys found.

Return type:

List[Tuple[str, str]]

savant_rs.webserver.kvs.serialize_attributes(attributes)

Serialize a list of attributes to a byte buffer.

Parameters:

attributes (List[Attribute]) – List of attributes to serialize.

Returns:

The serialized attributes.

Return type:

bytes

Raises:

ValueError – If serialization fails.

savant_rs.webserver.kvs.set_attributes(attributes, ttl=None)

Set attributes in the key-value store.

Parameters:
  • attributes (List[Attribute]) – List of attributes to set.

  • ttl (Optional[int]) – Time-to-live for the attributes.