Library Entity Associated Entities Mapping ========================================== .. code-block:: http /api/repositories/{repository}/library/entities/{libraryID}/associatedentities/{entityID}/mapping .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, The name of the :doc:`repository` libraryID, int, The ID of the library entity entityID, int, The ID of the entity to which the above library is associated Glossary ~~~~~~~~ Abbreviations used in this document: .. csv-table:: :header: Term, Meaning :widths: 30, 70 EID, Entity ID (integer) LID, Library ID (integer) RAID, Real Attribute ID (integer) LAID, Library Attribute ID (integer) .. _leaem_show: Get ~~~ .. http:get:: /api/repositories/(string:repository)/library/entities/(int:libraryID)/associatedentities/(int:entityID)/mapping :synopsis: Get entities associated with a library entity Gets a list of attribute mappings between entity associated with a :doc:`libraryentity` .. code-block:: http GET /api/repositories/jupiter/library/entities/2/associatedentities/1/mapping HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error The response will be a :doc:`standard-response`, with a list of the attribute mappings between :doc:`entities` associated with the :doc:`libraryentity`. Each array row contains the mapping of library attribute to the associated entity attribute: .. code-block:: json { "attributeMapList": [ { "realAttribute": { "id": "1", "columnsisedName": "ACCOUNT_ID", "humanisedName": "Account ID" }, "libraryAttribute": { "id": "1", "name": "Account ID" } }, { "realAttribute": { "id": "5", "columnsisedName": "BILLING_ADDRESS2", "humanisedName": "Billing Address2" }, "libraryAttribute": { "id": "2", "name": "Bank Accountnumber" } } ] } .. _leaem_edit: Edit ~~~~ .. http:post:: /api/repositories/(string:repository)/library/entities/(int:libraryID)/associatedentities/(int:entityID)/mapping :synopsis: Execute commands against the library attribute mappings of a particular library entity Edit the attribute mappings of a library entity :jsonparam body: The request body The request packet must contain the ``command`` and ``data`` elements. The ``options`` element is not required. The command must be ``edit``. .. code-block:: json { "command": "edit", "data": { "entity":"EID", "library":"LID", "mapping": [ { "realAttr": "RAID", "libAttr": "LAID" }, { "realAttr": "RAID", "libAttr": "LAID" } ] } } The data element should contain three key-value pairs: .. csv-table:: :header: Key, Purpose :widths: 30, 70 entity, ID of the real entity library, ID of the library entity mapping, array of attribute mappings All the fields are required. `mapping` should contain an array of attribute ID mappings from the library entity with ID `library` to the real entity with ID `entity`. All the mappings specified in `mapping` array will be edited. .. code-block:: http POST /api/repositories/jupiter/library/entities/2/associatedentities/1/mapping HTTP/1.1 Content-Type: application/json { "command": "edit", "data": { "entity": "1", "library": "2", "mapping": [ { "realAttr": "1", "libAttr": "1" } ] } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 204, Success 400, No data received 400, Invalid parameters 500, Server error The attribute mappings will be upgraded as a background task. The response will contain a link to the scheduled task. .. code-block:: json { "job": "/api/repositories/jupiter/scheduler/1", }