Lists handler¶
Lists Handler
Module realize lists handler.
- class luna_backport3.app.handlers.lists_handler.ListsHandler(request)[source]¶
Handler for work with lists.
- async delete()[source]¶
Post a list, see spec delete lists.
- Return type:
HTTPResponse
- async get()[source]¶
Get lists, see spec get lists.
- Return type:
HTTPResponse
- async getFacesCountsInLists(listIds)[source]¶
Get faces count in lists.
- Parameters:
listIds – list ids to search
- Returns:
list id to faces count
- Return type:
mapping
- Return type:
Dict
[str
,int
]
- async getPersonsCountsInLists(listIds)[source]¶
Get persons count in lists.
- Parameters:
listIds – list ids to search
- Returns:
list id to faces count
- Return type:
mapping
- Return type:
Dict
[str
,int
]
- async loadLists(listType, page, pageSize)[source]¶
Load luna lists.
- Returns:
descriptorListIds: descriptor lists: id and user data pairs personsListIds: persons lists: id and user data pairs
- Return type:
dict
- Return type:
List
[Dict
]
- async post()[source]¶
Post a list, see spec post lists.
- Return type:
HTTPResponse
- async prepareListsAndCounts()[source]¶
Load descriptor and person lists for response.
- Service must return two responses at once:
“page” and “page_size” query result for descriptor lists.
“page” and “page_size” queries for person lists.
- Returns:
list ids from the page and total list counts
- Return type:
- class luna_backport3.app.handlers.lists_handler.LoadedListsAndCounts(descriptorLists: List[dict], personLists: List[dict], descriptorListsCount: int, personsListsCount: int)[source]¶
Lists and counts type.
- descriptorLists: List[dict]¶
descriptor lists
- descriptorListsCount: int¶
descriptor lists count
- personLists: List[dict]¶
person lists
- personsListsCount: int¶
person lists count
List handler¶
List Handler
Module realize list handler.
- class luna_backport3.app.handlers.list_handler.ListHandler(request)[source]¶
Handler for resource /storage/lists/{list_id}.
- async delete(listId)[source]¶
Get delete a list services, see spec delete list.
- Return type:
HTTPResponse
- async get(listId)[source]¶
Get list by id, see spec get list.
- Return type:
HTTPResponse
- async getFaceToPersonMap(faceIds)[source]¶
Get face to person mapping.
- Parameters:
faceIds – face ids
- Returns:
dict faceId -> personId (only existent links will be returned)
- Return type:
Dict
[str
,str
]
- async patch(listId)[source]¶
Get path list, see spec patch list.
- Return type:
HTTPResponse