Playing with tags¶
Note
Tags are available in IRMA from version 1.3.0
Creating a tag¶
You could create tags by using the command line tools
>>> from irmacl.helpers import *
>>> tag_list()
[]
>>> tag_new("archive")
{u'text': u'archive', u'id': 1}
>>> tag_list()
[Tag archive [1]]:
or directly from your terminal by using curl and posting a json with ‘text’ key:
$ curl -H "Content-Type: application/json; charset=UTF-8" -X POST -d '{"text":"<your tag>"}' http://172.16.1.30/api/v1.1/tags
Note
There is currently no way to create a tag directly from the web IHM.
Tagging a File¶
Directly in web IHM, once you are on a file details page:
Just click the tag bar and you will see all available tags. You could add multiple tags.
It is also possible to add a tag through command line tools:
>>> from irmacl.helpers import *
>>> help(file_tag_add)
Signature: file_tag_add(sha256, tagid, verbose=False)
Docstring:
Add a tag to a File
:param sha256: file sha256 hash
:type sha256: str of (64 chars)
:param tagid: tag id
:type tagid: int
:return: No return
>>> file_tag_add("346ae869f7c7ac7394196de44ab4cfcde0d1345048457d03106c1a0481fba853",1)
Searching by tag¶
You could specify one or more tags while searching for files too:
choose your tag list then hit the search button:
or by command line:
>>> from irmacl.helpers import *
>>> file_search(tags=[1])
(1, [<irma.apiclient.IrmaResults at 0x7f079ca23890>])