Tag

class trustar.models.tag.Tag(name, id=None, enclave_id=None)

Models a Tag.

Variables:
  • name – The name of the tag, i.e. “malicious”.
  • id – The ID of the tag.
  • enclave_id – The Enclave object representing the enclave that the tag belongs to.
__init__(name, id=None, enclave_id=None)

Constructs a tag object.

Parameters:
  • name – The name of the tag, i.e. “malicious”.
  • id – The ID of the tag.
  • enclave_id – The ID of the enclave the tag belongs to.
classmethod from_dict(tag)

Create a tag object from a dictionary. This method is intended for internal use, to construct a Tag object from the body of a response json. It expects the keys of the dictionary to match those of the json that would be found in a response to an API call such as GET /enclave-tags.

Parameters:tag – The dictionary.
Returns:The Tag object.
to_dict(remove_nones=False)

Creates a dictionary representation of the tag.

Parameters:remove_nones – Whether None values should be filtered out of the dictionary. Defaults to False.
Returns:A dictionary representation of the tag.