Luna services clients description ================================= Luna-services clients are adapted for usage in a lambda and are available through the ``clients`` property of the lambda request (or of a ``BaseLambdaTask`` instance for a *tasks* lambda), e.g. ``request.clients.events`` or ``self.clients.events``. A client is initialized only if its service is enabled for the lambda by the *ADDITIONAL_SERVICES_USAGE* configurator setting (except the always-available ``lambdas`` client and the ``api`` client of an external agent). Accessing an unavailable client raises a ``UserTaskLambdaException`` with a message telling which service is disabled, so a lambda can be written against a service as an optional dependency (see `service availability check <./development.html#luna-services-clients>`_). Which clients are available depends on the lambda type, see the table below. For every lambda type the same wrapper interface is used, so the same code works in any lambda type that provides the client. Availability by lambda type --------------------------- .. list-table:: :header-rows: 1 :widths: 25 15 15 15 15 15 * - Client - Standalone - Handlers - Tasks - Agent - External agent * - `events <#events-client>`_ - yes - yes - yes - yes - no * - `faces <#faces-client>`_ - yes - yes - yes - no - no * - `matcher <#luna-python-matcher-client>`_ - yes - yes - yes - no - no * - `faceSamplesStore <#luna-image-store-client>`_ - yes - yes - yes - yes - no * - `bodySamplesStore <#luna-image-store-client>`_ - yes - yes - yes - yes - no * - `imageOriginStore <#luna-image-store-client>`_ - yes - yes - yes - yes - no * - `objectOriginStore <#luna-image-store-client>`_ - no - no - yes - no - no * - `sdk <#luna-remote-sdk-client>`_ - yes - yes - yes - yes - no * - `videoAgent <#luna-video-agent-client>`_ - yes - yes - yes - yes - no * - `sender <#luna-sender-client>`_ - yes - yes - yes - yes - no * - `handlers <#luna-handlers-client>`_ - yes - yes - yes - yes - no * - `lambdas <#lambdas-internal-api-client>`_ - yes - yes - yes - yes - yes * - `api <#luna-api-client>`_ - no - no - no - no - yes Clients overview ---------------- All wrapper classes and their methods are described in the sections below. Every class and method name links to the rendered wrapper source code, the source link is also available next to every documented method. .. list-table:: :header-rows: 1 :widths: 22 28 25 25 * - Client - Wrapper class - Luna service - Purpose * - ``clients.events`` - `Events <_modules/luna_lambda_tools/public/clients/events.html#Events>`_ - *luna-events* - `save/get/delete events and event statistics <#events-client>`_ * - ``clients.faces`` - `Faces <_modules/luna_lambda_tools/public/clients/faces.html#Faces>`_ - *luna-faces* - `create/get/delete faces, attributes and lists <#faces-client>`_ * - ``clients.matcher`` - `LPM <_modules/luna_lambda_tools/public/clients/lpm.html#LPM>`_ - *luna-python-matcher* - `match/crossmatch faces and bodies <#luna-python-matcher-client>`_ * - ``clients.faceSamplesStore`` / ``clients.bodySamplesStore`` / ``clients.imageOriginStore`` / ``clients.objectOriginStore`` - `LIS <_modules/luna_lambda_tools/public/clients/lis.html#LIS>`_ - *luna-image-store* - `create/get/delete images and objects <#luna-image-store-client>`_ * - ``clients.sdk`` - `LRS <_modules/luna_lambda_tools/public/clients/lrs.html#LRS>`_ - *luna-remote-sdk* - `detect/extract/estimate via remote LUNA SDK <#luna-remote-sdk-client>`_ * - ``clients.videoAgent`` - `LVA <_modules/luna_lambda_tools/public/clients/lva.html#LVA>`_ - *luna-video-agent* - `process a video via the video sdk <#luna-video-agent-client>`_ * - ``clients.sender`` - `Sender <_modules/luna_lambda_tools/public/clients/sender.html#Sender>`_ - *luna-sender* - `publish images/objects to the handlers pipeline <#luna-sender-client>`_ * - ``clients.handlers`` - `Handlers <_modules/luna_lambda_tools/public/clients/handlers.html#Handlers>`_ - *luna-handlers* - `call handler estimations and manage handlers <#luna-handlers-client>`_ * - ``clients.lambdas`` - `Lambdas <_modules/luna_lambda_tools/public/clients/lambdas.html#Lambdas>`_ - *luna-lambda* (internal api) - `interact with other lambdas <#lambdas-internal-api-client>`_ * - ``clients.api`` - `Api <_modules/luna_lambda_tools/public/clients/lunavl.html#Api>`_ - *luna-api* - `complete REST api of the platform <#luna-api-client>`_ For type-specific usage notes see the service clients section of the corresponding chapter: `standalone <./standalone.html#standalone-lambda-service-clients>`_, `handlers <./handlers.html#handlers-lambda-service-clients>`_, `tasks <./tasks.html#tasks-lambda-service-clients>`_, `agent <./agent.html#agent-lambda-service-clients>`_. Events client ------------- The *luna-events* client which allows to create events, get events and get events statistics .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.events :members: Faces client ------------ The *luna-faces* client which allows to create/get/delete faces/attributes/lists .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.faces :members: Luna Image Store client ----------------------- The *luna-image-store* client which allows to create/get/delete images and objects. Several clients of the same type may be available for the same lambda: face samples store, body samples store, images origin store and objects origin store, each configured separately. .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.lis :members: Luna Python Matcher client -------------------------- The *luna-python-matcher* client which allows to match/crossmatch faces/bodies .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.lpm :members: Luna Remote SDK client ---------------------- The *luna-remote-sdk* client which allows to detect faces/bodies in images, extract descriptors and estimate several parameters. .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.lrs :members: Luna Video Agent client ------------------------- The *luna-video-agent* client which allows to process a video (frame extraction and analytics) via the video sdk .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.lva :members: Luna Sender client ------------------ The *luna-sender* client which allows to publish images/objects to the *luna-handlers* pipeline .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.sender :members: Luna Handlers client -------------------- The *luna-handlers* client which allows to call *luna-handlers* estimations and manage handlers .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.handlers :members: Luna Api client --------------- The *luna-api* client which implements complete REST API of the *luna-api* service *Available only for an `external lambda agent <./agent.html#external-agent>`_ .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.lunavl :members: :exclude-members: fromCommonClient :show-inheritance: .. automodule:: luna3.lunavl.httpclient :members: :show-inheritance: :inherited-members: Lambdas internal api client --------------------------- The *internal api* client which allows lambdas to interact with each other. Available for every lambda type, including an external agent lambda .. seealso:: `availability <#availability-by-lambda-type>`_ .. automodule:: luna_lambda_tools.public.clients.lambdas :members: