luna_lambda_tools.public.clients.lunavl.Api
- class luna_lambda_tools.public.clients.lunavl.Api(accountId=None, login=None, password=None, token=None, origin='http://127.0.0.1:5000', api=6, asyncRequest=False, lunaRequestId=None, totalTimeout=60, connectTimeout=None, sockReadTimeout=None, sockConnectTimeout=None, multipartBoundary='LUNACOREB0UnDaRyStRiNg', *, session=None, echo=False, **kwargs)[source]
Luna Api client
- __init__(accountId=None, login=None, password=None, token=None, origin='http://127.0.0.1:5000', api=6, asyncRequest=False, lunaRequestId=None, totalTimeout=60, connectTimeout=None, sockReadTimeout=None, sockConnectTimeout=None, multipartBoundary='LUNACOREB0UnDaRyStRiNg', *, session=None, echo=False, **kwargs)
Methods
__init__
([accountId, login, password, ...])calculateIntervals
(toCalculate, **kwargs)Calculate intervals using provided data
cancelTask
(taskId, **kwargs)Cancel a task by the task id.
checkBasicAttributesById
(attributeId[, ...])Check to exist an attributes with id=attribute_id
checkBodySample
(sampleId[, accountIdFilter])Check to exist a body sample with id=sample_id
checkEvent
(eventId[, accountIdFilter])Check event with id=eventId existence.
checkFace
(faceId[, accountIdFilter])Check a face with id=face_id existence
checkFaceSample
(sampleId[, accountIdFilter])Check to exist a face sample with id=sample_id
checkGeneralEvent
(eventId[, accountIdFilter])Check general event existence.
checkHandlerById
(handlerId[, accountIdFilter])Check whether handler exists by its id
checkHealth
([includeLunaServices, ...])Check health of luna service
checkISO
(inputData[, multifacePolicy, ...])Estimate and check input images by ISO.
checkImage
(imageId[, accountIdFilter, withMeta])Check to exist an image with id=image_id
checkLambda
(lambdaId[, accountIdFilter])Check lambda existence by id.
checkList
(listId[, accountIdFilter])Check list existence
checkObject
(objectId[, accountIdFilter])Check to exist an object with id=object_id
checkStream
(streamId[, accountId, targets])Check stream by id.
checkVerifier
(verifierId[, accountIdFilter])Check verifier existence
close
()Close current client.
countFaces
([timeLt, timeGte, faceIds, ...])Getting count of faces which satisfy filters
countGroups
([groupNames, groupIds, accountId])Get count of groups by filter.
countStreams
([accountId, streamIds, ...])Get stream by filters.
createAccount
(login, password, accountType)Create new account
createAgent
(agent, **kwargs)Create new agent.
createAnalytic
(analytic, **kwargs)Create new analytic.
createAttribute
([basicAttributes, ...])Create new attributes.
createClusteringTask
(filters[, ...])Create and start clustering task
createCrossMatchTask
(referenceFilters, ...)Create and start clustering task
createEstimatorTask
(source, handler[, ...])Create and start estimator task
createExporterTask
(filters[, columns, ...])Create and start exporter task.
createFace
([externalId, attributeId, ...])Create new face tests!
createGcTask
(target[, generalEventType, ...])Create and start gc task
createGroup
(groupName[, description])Create new stream group.
createHandler
([policies, handlerType, ...])Create new handler.
createLambda
(archive, lambdaName[, ...])Create lambda
createLambdaTask
(content[, description, ...])Create and start lambda task
createLinkerTask
(filters[, listId, ...])Create and start linker task
createList
([userData])Create new list
createROCTask
(markup[, accountIdFilter, ...])Create and start ROC task
createReportTask
(taskId[, columns, ...])Create and start clustering task
createSchedule
(taskType, contentKwargs, cron)Create schedule
createScheduleTemplate
(scheduleTemplate, ...)Create schedule template
createStream
(*, streamType, reference, analytics)Create new stream in luna-streams :type analytics:
List
[StreamAnalytic
] :param analytics: stream analytics :type name:Optional
[str
] :param name: stream name :type description:Optional
[str
] :param description: stream description :type streamType:Literal
['stream'
,'videofile'
] :param streamType: stream type :type downloadable:bool
:param downloadable: whether reference is downloadable :type timestampSource:Literal
['pts'
,'server'
,'frame_rate'
,'auto'
] :param timestampSource: timestamp source where pts - video labels, server - server time, frame_rate - video file auto logic described in openapi :type reference:str
:param reference: stream URL :type orientationStrategy:Literal
['static'
,'video_info'
] :param orientationStrategy: orientation strategy :type rotation:Optional
[Literal
[0
,90
,180
,270
]] :param rotation: angle of camera frame rotation (0, 90, 180 or 270) :type pts:Optional
[VideoPTS
] :param pts: video pts settings :type fps:Optional
[Real
] :param fps: video decoder fps :type location:Optional
[Location
] :param location: location that stream belongs :type source:Optional
[str
] :param source: additional stream information :type restart:Optional
[Restart
] :param restart: auto-restart configuration :type groupName:Optional
[str
] :param groupName: group name :type groupId:Optional
[str
] :param groupId: group identifier :type timeout:Optional
[int
] :param timeout: stream/videofile read timeout :type notificationPolicy:Optional
[StreamNotificationPolicy
] :param notificationPolicy: stream notification policy :type splittable:Optional
[int
] :param splittable: whether stream is splittable :type ffmpegKwargs:Optional
[dict
] :param ffmpegKwargs: additional ffmpeg kwargs :type behaviorParameters:Optional
[BehaviorParameters
] :param behaviorParameters: behavior parameters for streamcreateToken
([grantAllPermissions, ...])Create new token.
createVerifier
([policies, description])Create new verifier.
deleteAgent
(agentId[, accountId])Delete agent.
deleteAnalytics
(analyticIds[, accountId])Delete analytics.
deleteAttributeById
(attributeId, **kwargs)Delete attributes by id.
deleteBodySample
(sampleId, **kwargs)Delete body sample with id=sample_id
deleteEvent
(eventId[, accountId])Delete event by event_id and optional account_id.
deleteFace
(faceId, **kwargs)Delete face by id
deleteFaceAttributes
(faceId, **kwargs)Delete face attributes.
deleteFaceSample
(sampleId, **kwargs)Delete face sample with id=sample_id
deleteFaces
(faceIds[, ignore])Delete faces.
deleteGeneralEvent
(eventId[, accountId])Delete general event by event_id and optional account_id.
deleteGroup
(groupId[, withStreams, accountId])Delete group.
deleteGroupStreams
(groupId[, accountId])Remove all streams of a group.
deleteHandlerById
(handlerId, **kwargs)Remove handler by id :rtype:
Union
[Awaitable
[LunaResponse
],LunaResponse
]deleteImage
(imageId, **kwargs)Delete image with id=image_id
deleteLambda
(lambdaId[, accountIdFilter])Delete lambda by id.
deleteList
(listId[, withFaces])Remove list by id
deleteLists
(listIds[, withFaces])Delete lists.
deleteObject
(objectId, **kwargs)Delete object with id=object_id
deleteSchedule
(scheduleId[, accountIdFilter])Delete schedule by id
deleteScheduleTemplate
(scheduleId[, accountId])Create schedule template
deleteStream
(streamId[, accountId])Delete stream by id.
deleteStreamAnalyticsWorkingIntervals
(...[, ...])Delete stream analytics working intervals
deleteStreams
(streamIds[, accountId])Delete streams by filters (OR).
deleteStreamsLogs
([logTimeLt])Delete streams logs
deleteTask
(taskId, **kwargs)Delete a task by the task id.
deleteToken
(tokenId, **kwargs)Delete token.
deleteVerifier
(verifierId, **kwargs)Remove verifier
detectFaces
(inputData[, multifacePolicy, ...])Detect faces on input images.
emitEvents
(handlerId, inputData[, policies, ...])Emit input events.
emitStreamEvents
(handlerId, inputData, **kwargs)Emit beta events.
exportLambda
(lambdaId, **kwargs)Export lambda
extractAttrFromSample
(sampleIds[, ...])Extract attributes from samples.
fromCommonClient
(client)Convert common client to lambda client
generalConnect
([eventType, eventAccount, ...])Create general ws-connection to luna-sender
generalPublishOne
(event, **kwargs)Publish user generated event.
getAccount
([targets])Get account.
getAccounts
([page, pageSize, login, ...])Get account.
Get luna-api address
getAllStreamAnalyticsWorkingIntervals
(...[, ...])Get all stream analytics working intervals
getAnalytic
(analyticId[, accountId])Get analytic.
getAnalyticDocumentation
(analyticId[, accountId])Get analytic's documentation.
getAnalytics
([analyticIds, analyticIdGte, ...])Get analytics by filters.
getAsyncMode
([asyncRequest])Get final async mode.
getAttributeSamples
(attributeId[, ...])Retrieve a attribute by id.
getAttributes
(attributeIds[, ...])Get attributes ids by filters
getAuthHeader
([login, password, token, ...])Get authorization header by token or login and password
getBasicAttributesById
(attributeId[, ...])Get basic attributes (gender, age, ethnicity) by attrribute id.
getBodiesOfImages
(images)Return aiohttp request body or body_producer.
getBodyImages
(headers[, images])Function prepare body and content type for request, depends on incoming image(s).
getBodySample
(sampleId[, accountIdFilter])Get body sample by id
getConfig
([acceptHeaders, lunaRequestId, ...])Get config of luna service
getDeletedEvents
([deletionTimeGte, ...])Get deleted events.
getDeletedGeneralEvents
([deletionTimeGte, ...])Get deleted general events.
getDevelopmentManual
([lunaRequestId, ...])Get Development Manual of luna service
getError
(errorId[, accountIdFilter])Get error by id.
getErrors
([errorIds, taskIds, errorTimeLt, ...])Get errors with filters.
getErrorsCount
([errorIds, taskIds, ...])Get errors count with filters.
getEvent
(eventId[, target, accountIdFilter])Get event by id.
getEvents
([target, createTimeGte, ...])Get events by filters.
getEventsStats
([query])Get events statistics by aggregation (<aggregator> and <groupBy> on <target>) and filters.
getFace
(faceId[, targets, accountIdFilter])Get face by id
getFaceAttributes
(faceId[, targets, ...])Get face attributes
getFaceSample
(sampleId[, accountIdFilter])Get face sample by id
getFaceSamples
(faceId[, accountIdFilter])Get samples which are associated with the face attributes (gender, age, ethnicity, descriptor).
getFaces
([userData, eventId, listId, ...])Getting faces which satisfy filters
getFacesAttributesCount
([accountIdFilter])Count faces with attributes.
getFeatures
([lunaRequestId, asyncRequest, ...])Get platform features
getGeneralEvent
(eventId[, accountIdFilter])Get general event by id.
getGeneralEventDescriptors
([eventIds, ...])Get general event descriptors by filters.
getGeneralEvents
([eventType, createTimeGte, ...])Get general events by filters.
getGeneralEventsStats
([query])Get general events statistics by aggregation (<aggregator> and <groupBy> on <target>) and filters.
getGroup
(groupId[, accountId])Get group.
getGroups
([groupNames, groupIds, accountId, ...])Get groups by filters.
getHandlerById
(handlerId[, accountIdFilter])Get handler by its id
getHandlers
([description, handlerType, ...])Get handlers by filters
getHandlersCount
([description, handlerType, ...])Get handlers count by filters
getImage
(imageId[, accountIdFilter, withMeta])Get image by id
getLambda
(lambdaId[, accountIdFilter])Get lambda by id.
getLambdaImage
(lambdaId[, accountId])Get lambda by id.
getLambdaImageCreationLogs
(lambdaId[, tailLines])Get lambda image creation logs
getLambdaImageCreationStatus
(lambdaId[, ...])Check lambda image creation status by id.
getLambdaLogs
(lambdaId[, tailLines, ...])Get lambda logs
getLambdaSpec
(lambdaId[, accept, ...])Get lambda spec
getLambdaStatus
(lambdaId[, accountIdFilter])Check lambda status by id.
getLambdas
([accountIdFilter, createTimeLt, ...])Get lambdas by filters.
getList
(listId[, accountIdFilter])Get list by id
getLists
([createTimeLt, createTimeGte, ...])Get lists by filters
getListsCount
([listIds, listIdLt, ...])Get lists count by filters
getObject
(objectId[, accountIdFilter])Get an object by id
getPlugins
([lunaRequestId, asyncRequest, ...])Get plugins of luna service
getRequestId
([lunaRequestId])Get final request id.
getRequestIdAsDict
([lunaRequestId])Get final request id.
getRestream
(streamId[, restreamType, ...])Get restream
getSchedule
(scheduleId[, accountIdFilter])Get schedule by id
getScheduleTemplate
(scheduleId[, accountId])Create schedule template
getScheduleTemplateIntervals
(scheduleId[, ...])Create schedule template
getScheduleTemplates
([accountId, ...])Get schedule templates
getSchedules
([createTimeLt, createTimeGte, ...])Get schedules with filters
getSpecDocument
([acceptHeaders, ...])Get OpenApi documentation of luna service
getStandardHeaders
([lunaRequestId, ...])Get standard headers ("LUNA-Account-Id", "LUNA-Request-Id") for request. :type lunaRequestId:
Optional
[str
] :param lunaRequestId: Luna request Id . Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$ :type accountId:Optional
[str
] :param accountId: account id. Pattern: ^[0-9]{10},[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$ :type login:Optional
[str
] :param login: login :type password:Optional
[str
] :param password: password :type token:Optional
[str
] :param token: token.getStream
(streamId[, accountId, targets])Get stream by id.
getStreamAnalyticsWorkingIntervals
(streamId, ...)Get stream analytics working intervals
getStreams
([accountId, streamIds, ...])Get stream by filters.
getStreamsLogs
([accountId, streamIds, ...])Get streams logs
getTask
(taskId[, accountIdFilter])Get task by id.
getTaskErrors
(taskId[, page, pageSize, ...])Get task errors by task id.
getTaskNotificationPolicy
(taskId[, ...])Get task notification policy by task id.
getTaskResult
(taskId[, accountIdFilter])Get task result by task id.
getTaskSubTasks
(taskId[, accountIdFilter])Get task's sub tasks.
getTasks
([taskIds, createTimeLt, ...])Get tasks with filters.
getTasksCount
([taskIds, createTimeLt, ...])Get tasks count with filters.
getToken
(tokenId[, accountIdFilter])Get token.
getTokens
([page, pageSize, accountIdFilter, ...])Get tokens.
getTotalTimeout
([totalTimeout])Get final totalTimeout.
getVerifier
(verifierId[, accountIdFilter])Get verifier
getVerifiers
([description, page, pageSize, ...])Get verifiers by filters
getVerifiersCount
([description, accountIdFilter])Count verifiers that satisfy the filters
getVersion
([lunaRequestId, asyncRequest, ...])Get version of luna service
getVideoTask
(taskId, **kwargs)Get video task data
importLambda
([lambdaName, archive, ...])Update lambda
link
(groupId, streamIds, action[, accountId])Attach or detach streams to group.
linkFacesToList
(listId, action, faceIds, ...)attach/detach faces to the list
makeRequest
(url, method[, queryParams, ...])Prepare account header and make request.
match
(candidates, references[, ...])Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them.
matchBodies
(candidates, references[, ...])Matcher API allows to submit tasks to a service that searches for human bodies similar to a given reference(s) by matching them.
matchFaces
(candidates, references[, ...])Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them.
matchGeneralEvents
(candidates, references, ...)Matcher API allows to submit tasks to a service that searches for faces similar to a given reference(s) by matching them.
matchRaw
(candidates, references[, ...])Matcher raw API allows to match each candidate with each reference descriptors.
patchAccount
([newLogin, newPassword, ...])Patch account.
patchFace
(faceId[, externalId, userData, ...])Update fields of face (user_data, external_id, attribute_id)
patchGroup
(groupId, description[, accountId])Update group description.
patchGroupStreams
(groupId, action[, accountId])Patch stream by id.
patchLambda
(lambdaId[, lambdaName, ...])Patch lambda
patchSchedule
(scheduleId, action, **kwargs)Patch schedule by id
patchStream
(streamId, action[, accountId])Patch stream by id.
postAgentStreams
(agentId[, accountId])Get agent streams which processing must be started
postStreamsFeedback
(agentId, streamsInfo, ...)Post feedback on stream
predictLiveness
([images, urls, meta, xMeta, ...])Liveness API allows to predict liveness for given images.
proxyLambdaGet
(lambdaId, path[, queries, ...])Proxy GET request to lambda
proxyLambdaPost
(lambdaId, path[, body, ...])Proxy POST request to lambda
putFaceAttributes
(faceId[, attributeId, ...])Put face attributes.
putSchedule
(scheduleId, taskType, ...[, ...])Update schedule
putStreamAnalyticsWorkingIntervals
(streamId, ...)Create/replace stream analytics working intervals
putVerifier
(verifierId[, policies, description])Replace verifier
replaceAnalytic
(analyticId, analytic, **kwargs)Replace analytic.
replaceScheduleTemplate
(scheduleId, ...)Create schedule template
replaceStream
(*, streamId, streamType[, ...])Replace an existent stream in luna-streams
replaceTaskNotificationPolicy
(taskId[, ...])Replace task notification policy by task id.
replaceToken
(tokenId[, grantAllPermissions, ...])Replace token.
saveBodySample
(image[, ttl])Save body sample to the system.
saveEvent
(handlerId, event[, waitSaving])Save raw event.
saveFaceSample
(image[, ttl])Save face sample to the system.
saveGeneralEvents
(events[, waitEventsSaving])Save general events to luna-events.
saveImage
(image[, ttl])Save image to the system.
saveObject
(objectBody[, ttl, contentType])Save object to the system.
sdk
(inputData[, estimateImageModification, ...])Detect faces on input images.
streamsWsConnect
(streamId[, analyticIndex, ...])Create ws-connection to receive real time data from stream analytics
testConnection
([lunaRequestId, ...])Test connection to current configured service.
updateHandler
(handlerId[, policies, ...])Update a handler.
updateLambda
(lambdaId, archive, lambdaName)Update lambda
updateLambdaImage
(lambdaId, **kwargs)Update lambda using latest base image
updateList
(listId, userData, **kwargs)Update the list user_data
updateSettings
(**kwargs)Update settings.
validateHandler
(policies, **kwargs)Validate handler policies.
validateLambda
(archive[, lambdaType])Validate lambda.
verifyAccount
([accountId, token, login, ...])Verify account data.
verifyData
(verifierId, inputData[, ...])Perform data verification against specified objects.
verifyRaw
(candidates, references, ...)Verify raw API allows to match each candidate with each reference descriptors.
videosdk
(inputData[, accept])Process video
wsConnect
([ageLt, ageGte, gender, ...])Create ws-connection to luna-sender
Attributes
baseUri
Property get base part of url.
multipartBoundary
pluginsUri
Property get plugins uri
session
Aiohttp session getter.
versionUri
Property get version uri