Direct API requests to tntapi
You can use HTTP API to extract data directly from the tntapi
.
In this section:
General Information
API requests to tntapi
are to be sent to http://<tnt_api_host_ip:port>
.
Tip
The port for API requests can be found in the environment CFG_LISTEN_PORT
:
docker exec -ti tnt-1-1 env
docker exec -ti tnt-1-1 env | grep CFG_LISTEN
CFG_LISTEN_HOST=0.0.0.0
CFG_LISTEN_PORT=8001
API requests to tntapi
may contain the following parameters in path segments:
API version only v2 at the moment.
:name
: gallery name.
Node status
GET /v2/status
This method returns read_only
node status and repeat header "X-read-only"
value.
If the value is "true"
it means that the tntapi
node has follower
status and only read operations are available.
Otherwise, if the value is "false"
, it means that the tntapi
node has leader
status, read and write operations with the node are available.
Returns:
HTTP 200 and list with null values on success.
HTTP with a status other than 200 and an error description in the body on failure.
Example
Request
curl -D - -X GET -s 'http://localhost:8001/v2/status'
Response
HTTP/1.1 200 Ok
X-request-id: TN:cU4qiMGc
Content-type: application/json
X-read-only: false
Content-length: 19
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
{"read_only":false}
Add Face
POST /v2/faces/add/:name[?return_face=false]
Parameters in path segments:
:name
: gallery name.return_face
: non-required parameter (default value false).
Parameters in body:
JSON-encoded array of faces with the following fields:
"id"
: face id in the gallery, uint64_t."facen"
: raw feature vector, base64."facen_model"
: facen model name, string."meta"
: face metadata, dictionary.
The field "facen_model"
is not required. When adding the first face to the gallery, the value will be saved in the gallery. Otherwise, if there is already a saved value in the gallery, it will be checked.
If the values in the request and in the gallery are different, the error 400 Gallery[:name]: facen model mismatch: required :exp_val, got :val
will be returned.
Returns:
HTTP 200 and a list with null values on success. If
"return_face=true"
is specified in the request,"id"
and"meta"
will be returned for successfully added faces.HTTP 404 if a gallery with the given name doesn’t exist.
HTTP with a status other than 200 and error description in the body on failure.
Example
Request
curl -D - -s 'http://localhost:8001/v2/faces/add/testgal' --data '
[
{
"id": 9223372036854776000,
"facen": "qgI3vZRv/z0BQTk9rcirOyZrE72yi047zl9gPSER2z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GJ06PTCGJTsDAS09/dgqPYT0ej20BjW+NPE7PLP3C7mTy4s85D5iPHrbUT3+3xA9Fcg0PCSdLD3AFbg82byAPC4doDymsHS8cvk3vJHogruI+ig9+qiWvSj+w7x7TFE8f6kXvEeAqz3Lcqs8K5envJXVxDwqbKU8KaFRvFxQ1bx+WNS8WuSAPSfHyTzFkWy93J0gPecFMTtNRlG9Ae3PvWd6JD13SC48wG7JvCxJhDwsxyW9BeAHPfe9oLueZO09UJDLvK+Uq7rsggk+ja8EO1ejozwgkjI+2kK2PLedhDw4Y/O8S19rvRPXZz2aVcI9+OUcvCfdjT0ocIm9c3vju97AE72sI4w9rHuYPexB+TywgcU7fkQyumxQgr0Ik9g66oFGPSeljjxayPG8WBj+Pce4tL2EdgS90s/UPJ5Fsr3P46y9fOpGvfC9ojtO5Ao9nqRUvbUNYz00+KE8WgZyvKsWlD0YTma9hu2tPTX2ZD3kZ967tCJuvEADurxYUnO9Ezs1vdIGUT2N9IO9hligPU7BEr3l4aE729c5vNV/hD0/NpO9MdHavW1WuT0=",
"meta": {
"cam_id": "223900",
"person_id": "123"
}
}
]'
Response
HTTP/1.1 200 Ok
X-request-id: TN:T39tIFME
Content-type: application/json
X-read-only: false
Content-length: 60
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
[null,{"error":{"code":400,"message":"face 'id' required"}}]
Remove Face
POST /v2/faces/delete/:name
Parameters in path segments:
:name
: gallery name.
Parameters in body:
JSON-encoded array of face ids to be removed.
Returns:
- HTTP 200 and a list of error values on success:
null
if face was successfully removed.{"error": {"code": 404, ...}}
if a face did not exist.
HTTP 404 if a gallery with the given name doesn’t exist.
HTTP with a status other than 200 and error description in the body on failure.
Example
Request
curl -D - -s 'http://localhost:8001/v2/faces/delete/testgal' --data '[1, 4, 922, 3]'
Response
HTTP/1.1 200 Ok
X-request-id: TN:sgi6xdVO
Content-type: application/json
X-read-only: false
Content-length: 6
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
[null, null, null, null]
Face Search
POST /v2/faces/search/:name
Parameters in path segments:
:name
: gallery name.
Parameters in body:
JSON-encoded search request with the following fields:
limit
: maximum number of faces in the response.without_facen
: (default=false) do not return facen in response.without_meta
: (default=false) do not return meta in response.sort
: sorting order. Pass one of the following values:id
: increasing order by id,-id
: decreasing order by id,-score
: decreasing order by face similarity (only if you search for faces with similar feature vectors).filter
(filters): *facen
: (optional) search for faces with similar feature vectors. Pass a dictionary with the following fields:data
: raw feature vector, base64;score
: range of similarity between faces [threshold similarity; 1], where1
is 100% match. *id
andmeta/<meta_key>
: search by face id and metastring content. To set this filter, use the following operators:range
: range of values, only for numbers.set
: id or metastring must contain at least one value from a given set, for numbers and strings.subset
: id or metastring must include all values from a given subset, for numbers and strings.like
: similar tolike
in SQL requests: only ‘aa%’, ‘aa%’, and ‘%aa%’ are supported. Only for strings and set[string]. In the case of set[string], the filter will return result if at least one value meets the filter condition.ilike
: similar tolike
but case-insensitive, only for strings and set[string].
The logic of the set/subset
filters for fields of type set[string]
is as follows:
set
– if any of the request values are in the set of values stored in database (the non-empty intersection of sets).subset
– if all of the request values are in the set of values stored in database (the intersection of sets is equal to the set from request).
There are supported types of sorts (sort
):
id
– asc (1) or desc (-1). It works only if filters by facen and live index (fast index) are used (both conditions require).score
– only desc (-1) type supported. It works only when facen filter is used.
If facen_model
is set, and the values in the gallery and request are different, an error will be returned in response.
Returns:
JSON-encoded array with faces on success. The value in the
X-search-stat
header indicates whether the fast index was used for the search:with_index
orwithout_index
.Note
Fast index will not be used if any of id or meta filters are set.
HTTP with a status other than 200 and error description in the body on failure.
Example
Request
curl -D - -s 'http://localhost:8001/v2/faces/search/testgal' --data '
{
"limit": 2,
"sort": {
"score": -1
},
"filter": {
"facen": {
"data": "xaGhPRPZODu7p8Q9+YV+PFQbRTxXboY92YCCPW31sT22s5o6FvNMPevNATxNpqA8x8QXPXbZsj2cX5w9rBUsPR0BeD1/4jo8gNIbPY4BXz39jAk9Z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s8Maa1PQqWvD2mA3I8d9cWPYqPvz16oic9r1wjPd7wZT0UeTE9KZd3PAJ/tD0v87U6h6+NPXLVHj2TuTE9tEBDPHleDj0gu4A9Jl05PZ9Ihj3WBp89aptbPDTxYTwRnrs9Q71+PTZ/Gz3mVsQ9gx9jPeWYDjzFrYU96J0yPYBAkzr27P48EoufPBMRdT07JCQ9dhM7PR7ZtD0XJKE62+qnPOmVRD16anM9uP70OMsoaz1SeGM9XnpgPSJnED33z349qAOhPW+Gvjzh7Yg85Lc/Paq8nT09s8U9CSgyPYRQIz0bE0s9KGk2PAHCHz1d4ao9CACmPTLw4zzVOzg6G6y9PeilATxQ/i093pAyPGnfkTztO5s7y3WsPZirOj2uTbE8q7qdPeo6Ez1yD7o9BryOPWb6aDxln609FCLgPJHPQT2QbXg91w/VO4NaaT2bVQE9z8oFPQzF7DywcDM919ZvPaDXez3usK07Xne4PK4yvT2lk+Q8DqrHPASwtj0=",
"score": [0.75, 1]
},
"id": {
"range": [9223372036854776003, 9223372036854776009]
},
"meta": {
"person_id": {
"range": [1, 3]
},
"tags": {
"set": ["2", "4"]
}
}
}
}'
Response
HTTP/1.1 200 Ok
X-request-id: TN:fCQ3wdqQ
X-search-stat: batch_size:1, linearLinear:(idx:1,seen:7);linearIndexed:(idx:0,seen:0);fastIndex:no;
Content-type: application/json
X-read-only: false
Content-length: 3786
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
{
"facen_size": 320,
"facen_model": "test",
"results": [
{
"facen": "xaGhPRPZODu7p8Q9+YV+PFQbRTxXboY92YCCPW31sT22s5o6FvNMPevNATxNpqA8x8QXPXbZsj2cX5w9rBUsPR0BeD1/4jo8gNIbPY4BXz39jAk9ZxhlPUyvgz0kyqU91ddxPU8YMz3lV109PbjdPMvqyjy3u3881PCrPMKtFDz93LQ9Gi/XO3K1+Dx+0k89NVOqPRZ0ZD24FaY98kKDPZjCkz1k84A9RFFkPdbfpT0hsmw9pL0XPdkuhTxLE589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Gz3mVsQ9gx9jPeWYDjzFrYU96J0yPYBAkzr27P48EoufPBMRdT07JCQ9dhM7PR7ZtD0XJKE62+qnPOmVRD16anM9uP70OMsoaz1SeGM9XnpgPSJnED33z349qAOhPW+Gvjzh7Yg85Lc/Paq8nT09s8U9CSgyPYRQIz0bE0s9KGk2PAHCHz1d4ao9CACmPTLw4zzVOzg6G6y9PeilATxQ/i093pAyPGnfkTztO5s7y3WsPZirOj2uTbE8q7qdPeo6Ez1yD7o9BryOPWb6aDxln609FCLgPJHPQT2QbXg91w/VO4NaaT2bVQE9z8oFPQzF7DywcDM919ZvPaDXez3usK07Xne4PK4yvT2lk+Q8DqrHPASwtj0=",
"meta": {
"timestamp": 0,
"photo_hash": "",
"tags": ["1", "2", "3"],
"person_id": 1,
"cam_id": "223901"
},
"score": 0.9999,
"id": 9223372036854776003
},
{
"facen": "W7/+PE/4rzygS7s9DQKYPdCsgDwKnK097YC4PZRjvT0dnwE9EQGRPKqo4DwosNA8dtsFPRcv8zzoAr89auiMPBuiEz19BRw95+p5PV51Sj0GmqM82qCaPYh2uT2g/4w9JZsCPYYGRT1NAAc9eaAKOw0UDD1UQcE968mTPaKgxT0j95I9Gw3VPO79kT2PIWI9fKa7PLI9kD3Kup89qeaNPUEkfj0DMRI74FgIOfh/0DzcW4892wkwPbBeuz1pjDI9f7EiPXjV2DzSQak834mHPQj0PD2Ssp89dzuNPICKvT2yOY89RCQcPagt/zzZ+LE9ioUyOy0w8Txb8709t0ZmPSlrxDwk7qo8WkdAPcDH4Dz4XAU9vF9aPU82Jj2yzDY97cPBPXwgQz3Q46g8I7p9PUYMvj2oa1A8TDs/PcFibT02QfE70GeoPYnKqj3y96Q91UAkPYKzij3gsOc8Mw2oPQwdiD2NBqk9hvNcPGFJEj2yZH89mLC5PWYQgD0hTFY8h1irPYbmAT1rQXM9vUkIPSeQpD08SYk9vGrIPDNFoD3c48A8hgEkPRtuSD3/MT49wLjkPErkiT1Ha088lf5bPftnajuJ2Yw9AK16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5+mz0qAqM7lb8YPUwpUD0=",
"meta": {
"timestamp": 0,
"photo_hash": "",
"tags": ["2", "4"],
"person_id": 3,
"cam_id": "223901"
},
"score": 0.8818,
"id": 9223372036854776005
}
]
}
Multi Search
POST /v2/faces/search_multi
Parameters in body:
JSON-encoded search request with the following fields:
galleries
: list of galleries for search.limit
: maximum number of faces in the response.without_facen
: (default=false) do not return facen in response.without_meta
: (default=false) do not return meta in response.sort
: sorting order. Pass one of the following values:id
: increasing order by id,-id
: decreasing order by id,-score
: decreasing order by face similarity (only if you search for faces with similar feature vectors).filter
(filters): *facen
: (optional) search for faces with similar feature vectors. Pass a dictionary with the following fields:data
: raw feature vector, base64;score
: range of similarity between faces [threshold similarity; 1], where1
is 100% match. *id
andmeta/<meta_key>
: search by face id and metastring content. To set this filter, use the following operators:range
: range of values, only for numbers.set
: id or metastring must contain at least one value from a given set, for numbers and strings.subset
: id or metastring must include all values from a given subset, for numbers and strings.like
: similar tolike
in SQL requests: only ‘aa%’, ‘aa%’, and ‘%aa%’ are supported. Only for strings and set[string]. In the case of set[string], the filter will return result if at least one value meets the filter condition.ilike
: similar tolike
but case-insensitive, only for strings and set[string].
The options and notes are similar to the search method in one gallery, except:
JSON-encoded array with galleries search results objects.
Any galleries objects on response contains array with results likes search method and gallery name.
Returns:
HTTP with a status other than 200 and error description in the body on failure.
Example
Request
curl -D - -s 'http://localhost:8001/v2/faces/search_multi' --data '
{
"galleries": ["testgal", "newgll"],
"limit": 2,
"sort": {
"score": -1
},
"filter": {
"facen": {
"data": "xaGhPRPZODu7p8Q9+YV+PFQbRTxXboY92YCCPW31sT22s5o6FvNMPevNATxNpqA8x8QXPXbZsj2cX5w9rBUsPR0BeD1/4jo8gNIbPY4BXz39jAk9ZxhlPUyvgz0kyqU91ddxPU8YMz3lV109PbjdPMvqyjy3u3881PCrPMKtFDz93LQ9Gi/XO3K1+Dx+0k89NVOqPRZ0ZD24FaY98kKDPZjCkz1k84A9RFFkPdbfpT0hsmw9pL0XP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Q71+PTZ/Gz3mVsQ9gx9jPeWYDjzFrYU96J0yPYBAkzr27P48EoufPBMRdT07JCQ9dhM7PR7ZtD0XJKE62+qnPOmVRD16anM9uP70OMsoaz1SeGM9XnpgPSJnED33z349qAOhPW+Gvjzh7Yg85Lc/Paq8nT09s8U9CSgyPYRQIz0bE0s9KGk2PAHCHz1d4ao9CACmPTLw4zzVOzg6G6y9PeilATxQ/i093pAyPGnfkTztO5s7y3WsPZirOj2uTbE8q7qdPeo6Ez1yD7o9BryOPWb6aDxln609FCLgPJHPQT2QbXg91w/VO4NaaT2bVQE9z8oFPQzF7DywcDM919ZvPaDXez3usK07Xne4PK4yvT2lk+Q8DqrHPASwtj0=",
"score": [0.75, 1]
},
"id": {
"range": [9223372036854776003, 9223372036854776009]
},
"meta": {
"person_id": {
"range": [1, 3]
},
"tags": {
"set": ["2", "4"]
}
}
}
}'
Response
HTTP/1.1 200 Ok
X-request-id: TN:c4atIug6
Content-type: application/json
X-read-only: false
Content-length: 7610
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
[
{
"gallery": "testgal",
"facen_size": 320,
"facen_model": "test",
"results": [
{
"facen": "xaGhPRPZODu7p8Q9+YV+PFQbRTxXboY92YCCPW31sT22s5o6FvNMPevNATxNpqA8x8QXPXbZsj2cX5w9rBUsPR0BeD1/4jo8gNIbPY4BXz39jAk9ZxhlPUyvgz0kyqU91ddxPU8YMz3lV109PbjdPMvqyjy3u3881PCrPMKtFDz93LQ9Gi/XO3K1+Dx+0k89NVOqPRZ0ZD24FaY98kKDPZjCkz1k84A9RFFkPdbfpT0hsmw9pL0XPdkuhTxLE589FqpwPRjvgTsZbWA9ix+kPdskUz31crw9w+RePebhlzzjycc96wqRPRIvKz1OeLU8wHixPE1ovz10gkY953+kPNnNSz3OYjs90n2MPQbWtjz5Yms8jWCyPY/Gfj1L3zA9yV64PYr2ezwiEyw9wwqvPQfllD1C1Fo9JxDEPWUaOD21Nww7QivkPCDMMz3n7309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CACmPTLw4zzVOzg6G6y9PeilATxQ/i093pAyPGnfkTztO5s7y3WsPZirOj2uTbE8q7qdPeo6Ez1yD7o9BryOPWb6aDxln609FCLgPJHPQT2QbXg91w/VO4NaaT2bVQE9z8oFPQzF7DywcDM919ZvPaDXez3usK07Xne4PK4yvT2lk+Q8DqrHPASwtj0=",
"meta": {
"timestamp": 0,
"photo_hash": "",
"tags": [
"1",
"2",
"3"
],
"person_id": 1,
"cam_id": "223901"
},
"score": 0.9999,
"id": 9223372036854776003
},
{
"facen": "W7/+PE/4rzygS7s9DQKYPdCsgDwKnK097YC4PZRjvT0dnwE9EQGRPKqo4DwosNA8dtsFPRcv8zzoAr89auiMPBuiEz19BRw95+p5PV51Sj0GmqM82qCaPYh2uT2g/4w9JZsCPYYGRT1NAAc9eaAKOw0UDD1UQcE968mTPaKgxT0j95I9Gw3VPO79kT2PIWI9fKa7PLI9kD3Kup89qeaNPUEkfj0DMRI74FgIOfh/0DzcW4892wkwPbBeuz1pjDI9f7EiPXjV2DzSQak834mHPQj0PD2Ssp89dzuNPICKvT2yOY89RCQcPagt/zzZ+LE9ioUyOy0w8Txb8709t0ZmPSlrxDwk7qo8WkdAPcDH4Dz4XAU9vF9aPU82Jj2yzDY97cPBPXwgQz3Q46g8I7p9PUYMvj2oa1A8TDs/PcFibT02QfE70GeoPYnKqj3y96Q91UAkPYKzij3gsOc8Mw2oPQwdiD2NBqk9hvNcPGFJEj2yZH89mLC5PWYQgD0hTFY8h1irPYbmAT1rQXM9vUkIPSeQpD08SYk9vGrIPDNFoD3c48A8hgEkPRtuSD3/MT49wLjkPErkiT1Ha088lf5bPftnajuJ2Yw9AK16Pa51sz3pvCg7oteWOpatoD13KXE9nBI3PX1TOjuuVA89JJE1Otu+JT1QtC09Jh4WPBiEoT2jdy09KpffPDg6gzy+PO886kqePQKywT1Jfh09+vkMPaw3yTyTaXs9OdNxPJ9Cjz2czYA9Xd15PAO6Bj2ss4g89QK5PQnatD3gj0Q8oAjsO7+PVToBT0A98kqtPcyTRzyJr3c9qI3APctDhD0V7jQ9pI+RPTC4Ej0nQz89BUC+PS7HZz1f66o9546xPM1/xD37kQw9g3pJPHGGFj3SAlQ95T6HPYzKtz16jbA9JPifPepCij08biI9OgSCPfMGvT3iKrM8T1YGPXjVrz0HxUc7vLeJPV1wEz0+ncY6QAUCPRd9SDuQ5MM9Y2FLPAMGpzznQic9vnDCPW4nPzu1VV89sE1+PVTVCz0Jhzw9Do1DPZm6kDsC/Y48SmqaPUZdrzwPYRE9hcTEPGrTiD1w2Ag9Ki1pPSAWMz3E/oE9w1vnPHo0zjuuwIU9MA7mOy+BuDwEo2E9Y2gRPcErOj1qmi89ehOLPSxpvzvn/JU9bGWKPRGzrj3zPIs9sAOhPTYTWzs8Bb07f/ATPABYmD3X61w8tgIUPSTBWz3NqYc86+anPVOuOTzoSJg9ICczPfEHZj24n78946Z0PWsMjTsfFLE9GodDOxFkxT1JpCg9/vIKPQvdOTvJAS89jEKXPZVqfD1NXhw98iu5PQ0oTD271Fs8rLyrPFWbeD1BArg9bQWBPA8+hD148qk8l5WlPbQKgj2+DHw9KMsLPbyd1TwT/iY9zuNlPRl1sjy2zeA8MO5pPclxYD16s6o9PwS5PW4vTDykZBw9Y9i7PVn0xjzIGAE98IVfPSzrlj3lPp09dA6VPYaBwTzZE509wciKO5/przwiT4w9c5uOPIqUsD0s0yQ8drucPS1RjT30Fqg8lyhSPQVexT2ujqs8FkS9O++yqT2/pLw9xiSaPGlbTj08EnA9GzGYPVwEjD2GNEU98z0vPea/kz0yKx49aMKUPSOD+DyyW6g93ZVtPV8NeT1ZVYY9CUztPIPzvT3s6Bs8m7y6PX5+mz0qAqM7lb8YPUwpUD0=",
"meta": {
"timestamp": 0,
"photo_hash": "",
"tags": ["2", "4"],
"person_id": 3,
"cam_id": "223901"
},
"score": 0.8818,
"id": 9223372036854776005
}
]
},
{
"gallery": "newgll",
"facen_size": 320,
"facen_model": "",
"results": [
{
"facen": "xaGhPRPZODu7p8Q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yTLo48ZiuRPUDa0Dy/bJs99t3GPEybjjzri6w885S3PS7Ksj3iacQ9ZQM8PIZdHz2sqH4835U/PLBlUTxP8748776wPTSMpT0qIUs8Maa1PQqWvD2mA3I8d9cWPYqPvz16oic9r1wjPd7wZT0UeTE9KZd3PAJ/tD0v87U6h6+NPXLVHj2TuTE9tEBDPHleDj0gu4A9Jl05PZ9Ihj3WBp89aptbPDTxYTwRnrs9Q71+PTZ/Gz3mVsQ9gx9jPeWYDjzFrYU96J0yPYBAkzr27P48EoufPBMRdT07JCQ9dhM7PR7ZtD0XJKE62+qnPOmVRD16anM9uP70OMsoaz1SeGM9XnpgPSJnED33z349qAOhPW+Gvjzh7Yg85Lc/Paq8nT09s8U9CSgyPYRQIz0bE0s9KGk2PAHCHz1d4ao9CACmPTLw4zzVOzg6G6y9PeilATxQ/i093pAyPGnfkTztO5s7y3WsPZirOj2uTbE8q7qdPeo6Ez1yD7o9BryOPWb6aDxln609FCLgPJHPQT2QbXg91w/VO4NaaT2bVQE9z8oFPQzF7DywcDM919ZvPaDXez3usK07Xne4PK4yvT2lk+Q8DqrHPASwtj0=",
"meta": {
"timestamp": 0,
"photo_hash": "",
"tags": ["1", "2", "3"],
"person_id": 1,
"cam_id": "223901"
},
"score": 0.9999,
"id": 9223372036854776003
},
{
"facen": "W7/+PE/4rzygS7s9DQKYPdCsgDwKnK097YC4PZRjvT0dnwE9EQGRPKqo4DwosNA8dtsFPRcv8zzoAr89auiMPBuiEz19BRw95+p5PV51Sj0GmqM82qCaPYh2uT2g/4w9JZsCPYYGRT1NAAc9eaAKOw0UDD1UQcE968mTPaKgxT0j95I9Gw3VPO79kT2PIWI9fKa7PLI9kD3Kup89qeaNPUEkfj0DMRI74FgIOfh/0DzcW4892wkwPbBeuz1pjDI9f7EiPXjV2DzSQak834mHPQj0PD2Ssp89dzuNPICKvT2yOY89RCQcPagt/zzZ+LE9ioUyOy0w8Txb8709t0ZmPSlrxDwk7qo8WkdAPcDH4Dz4XAU9vF9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W4vTDykZBw9Y9i7PVn0xjzIGAE98IVfPSzrlj3lPp09dA6VPYaBwTzZE509wciKO5/przwiT4w9c5uOPIqUsD0s0yQ8drucPS1RjT30Fqg8lyhSPQVexT2ujqs8FkS9O++yqT2/pLw9xiSaPGlbTj08EnA9GzGYPVwEjD2GNEU98z0vPea/kz0yKx49aMKUPSOD+DyyW6g93ZVtPV8NeT1ZVYY9CUztPIPzvT3s6Bs8m7y6PX5+mz0qAqM7lb8YPUwpUD0=",
"meta": {
"timestamp": 0,
"photo_hash": "",
"tags": ["1","4"],
"person_id": 3,
"cam_id": "223901"
},
"score": 0.8818,
"id": 9223372036854776005
}
]
}
]
Edit Face Metadata and/or Feature Vector
POST /v2/faces/update/:name
Parameters in path segments:
:name
: gallery name.
Parameters in body:
JSON-encoded array with faces with the following fields:
"id"
: face id, uint64_t."facen"
: (optional) new feature vector, base64. If omitted or passed asnull
, the relevant field in the database won’t be updated."meta"
: dictionary with metadata to be updated. If some metastring is omitted or passed asnull
, the relevant field in the database won’t be updated.
Returns:
- HTTP 200 and a list of update results on success:
a dictionary with all face parameters, including not updated, on success.
{error: {code: ..., ...}}
if there is an error.
HTTP 404 and an error description if a face with the given id doesn’t exist.
HTTP with a status other than 200 and an error description in the body on failure.
Example
Request
curl -D - -s 'http://localhost:8001/v2/faces/update/testgal' --data '
[
{
"id": 9223372036854776002,
"facen": "sy2BPb3xrz1ffbY9QJ0sPTlpAD2D+5A91tgePCIdGDwjSfQ8SupkPNMv2jwS5o48BvHNPETWWD3qSFo6zDp6PaiDpT3FHjA9lK+yPdxFKj2pJEc86uugPe2cpz1u8oM9OZ2NPWNKBT20D6U8+qwhPP/SKTvPP8s8E4v2PB6lnz2A7SQ9UK0gPRTxLz3Ukrg991C7PfrsZz0thTs9BwQQPVwvuj3/iAM8/TaLPHg4pjzwvy49jwzTPHk/pz2QpTc9lAelPLV3Az3WJgI9sT2gPXdgwD0oKoc9mzaxPTe52TweKZo9+GW6PThnYz3i4HM9SgQrPV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Hh89BHyPPdSsmD2qcnA9S2GlPEBMoT2Ih7s9gyYOPfG2sDzLlP88lNx1PTA3mz0Befg8gryUPbBpyDsesqE9lSc8PcCNiT0d1bw9UDmoPAwLOT3OPas9ZJO2PRcNrz2+kIg9E7GCPXTmtD0Ku7g9kaN/PfkQGz00sl09kZewOnUuBzsgm/I8oYojOi/d7jxmrzk8G2ITPfxqiT3OqyY9WwRqPZ4OWT0BtI0983dOPeGxgD0CECA928C1PLbbujx8f2U8WpwSPfjElD3Hq6s94BRgPcsTuTx66b490c4JPW1dxD0=",
"meta": {
"timestamp": 350
}
}
]'
Response
HTTP/1.1 200 Ok
X-request-id: TN:hsMZrt0g
Content-type: application/json
X-read-only: false
Content-length: 1847
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
[{"meta":{"timestamp":350,"photo_hash":"","tags":[],"person_id":123,"cam_id":"223900"},"id":9223372036854776002,"facen":"sy2BPb3xrz1ffbY9QJ0sPTlpAD2D+5A91tgePCIdGDwjSfQ8SupkPNMv2jwS5o48BvHNPETWWD3qSFo6zDp6PaiDpT3FHjA9lK+yPdxFKj2pJEc86uugPe2cpz1u8oM9OZ2NPWNKBT20D6U8+qwhPP\/SKTvPP8s8E4v2PB6lnz2A7SQ9UK0gPRTxLz3Ukrg991C7PfrsZz0thTs9BwQQPVwvuj3\/iAM8\/TaLPHg4pjzwvy49jwzTPHk\/pz2QpTc9lAelPLV3Az3WJgI9sT2gPXdgwD0oKoc9mzaxPTe52TweKZo9+GW6PThnYz3i4HM9SgQrPVq4qD0CUQI8JrmfPcXoMD3vX4k85SVWPSDfhT29YTs8\/BXCPHMSrj1JNDw9nze5PRbYtT2xN5w9Ms0uPWWd5jwLixg9LLCBPb2sxzyLa4E8xpumPeM8gTzcuos8KdG+PctOWT2LmMo8ot58PVwdrD2LmH48pbMrPTGrPj3fqKM9haB4PHlVUzzGIr88\/VGhPUzHBz2GTtg81YT8PKAtjzsmPbM9jkebPRSWBD01ADQ9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WT0BtI0983dOPeGxgD0CECA928C1PLbbujx8f2U8WpwSPfjElD3Hq6s94BRgPcsTuTx66b490c4JPW1dxD0="}]
List Galleries
POST /v2/galleries/list
Returns:
JSON-encoded array with galleries with the following fields:
space
: space name,name
: gallery name,faces
: number of faces in a gallery.
Example
Request
curl -D - -s -X POST http://localhost:8001/v2/galleries/list
Response
HTTP/1.1 200 Ok
X-request-id: TN:6iRqT5FR
Content-type: application/json
X-read-only: false
Content-length: 60
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
{"results":[{"space":"default","name":"testgal","faces":0}]}
Get Gallery Info
POST /v2/galleries/get/:name
Parameters in path segments:
:name
: gallery name.
Returns:
HTTP 200 and a dictionary with gallery parameters on success.
HTTP 404 and error description if a gallery with the given name doesn’t exist.
HTTP with a status other than 200 and error description in the body on failure.
Example
Request
curl -D - -s -X POST http://localhost:8001/v2/galleries/get/testgal
Response
HTTP/1.1 200 Ok
X-request-id: TN:rPLOWTbi
Content-type: application/json
X-read-only: false
Content-length: 49
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
{"facen_size":320,"faces":2,"facen_model":"test"}
Create Gallery
POST /v2/galleries/add/:name[?space=default]
Parameters in path segments:
:name
: gallery name."space"
: space name from schema configuration, string. Non-required. Default value: default.
Parameters in body:
JSON-encoded object with faces with the following fields:
"live_idx"
: live index settings, object. See live index settings for setup value."space"
: space name from schema configuration, string.
Returns:
HTTP 201 and empty body on success.
HTTP with a status other than 201 and error description in the body on failure.
Example
Request
curl -D - -X POST -s 'http://localhost:8001/v2/galleries/add/testgal'
Response
HTTP/1.1 201 Created
X-request-id: TN:BCdY11F4
Content-type: application/json
X-read-only: false
Content-length: 4
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
null
Remove Gallery
POST /v2/galleries/delete/:name
Parameters in path segments:
:name
: gallery name to be deleted.
Returns:
HTTP 204 and empty on success.
HTTP with a status other than 204 and an error description in the body on failure.
Example
Request
curl -D - -X POST -s 'http://localhost:8001/v2/galleries/delete/testgal'
Response
HTTP/1.1 204 No content
X-request-id: TN:a5HYFcKK
Content-type: application/json
X-read-only: false
Content-length: 4
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)
Rename Gallery
POST /v2/galleries/rename/:name/:newname
Parameters in path segments:
:name
: gallery name.:newname
: new gallery name.
Returns:
HTTP 204 and empty on success.
HTTP with a status other than 204 and an error description in the body on failure.
Example
Request
curl -D - -X POST -s 'http://localhost:8001/v2/galleries/rename/testgal/newgal'
Response
HTTP/1.1 204 No content
X-request-id: TN:a5HYFcKK
Content-type: application/json
X-read-only: false
Content-length: 4
Connection: keep-alive
Server: Tarantool http (tarantool v2.10.4-2-gd536a7aa5)