Library Entities ================ .. http:get:: /api/repositories/(string:repository)/library/entities :synopsis: List all entities in a repository Retrieves a list of all library entities in a :doc:`repository ` .. http:post:: /api/repositories/(string:repository)/library/entities :synopsis: Filter the entities or execute commands against the entities + Retrieve a filtered list of entities in a :doc:`repository ` + Associate and disassociate an :doc:`entity ` with a :doc:`library entity ` + Promote rules from an :doc:`entity ` to a :doc:`library entity ` + Add an :doc:`entity ` to the library .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, the name of the :doc:`repository ` .. _le_count: Count ~~~~~~~~ .. http:get:: /api/repositories/(string:repository)/library/entities/count :synopsis: Get the number of library entities in the repository Returns the number of library entities in the repository. .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error The response contains the number of library entities in the repository. .. code-block:: json { "count": "5" } .. _le_show_all: Show All ~~~~~~~~ Show all library entities. .. code-block:: http GET /api/repositories/jupiter/library/entities HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error The response will be a :doc:`standard-response`. The columns displayed for each :doc:`libraryentity` are: .. csv-table:: :header: Human Name, Column Name, Description :widths: 25, 25, 50 "ID", "model_entity_id", "Internal entity reference" "Name", "name", "The schema name for the library entity" "Description", "description", "Business Description" "Attributes", "_display_attributes", "The number of attributes" "Business Rules", "_business_rules", "The number of business rules defined for this library" "Created By", "CREATED_BY", "User who created the library" "Date Created", "_created_date", "When the library was created" "Edited By", "EDITED_BY", "The user who last edited the library" "Edited Date", "_edited_date", "When the library was last edited" "Associations", "_associations", "Are there any associations for this rule." The ``rows`` array will contain one element for each :doc:`libraryentity`: .. code-block:: json { "dataRow": [ "2", "LibInput", "Test Library Entity", "1", "2", "bob", "2014/11/06 12:25:12", "bob", "2014/11/13 11:55:02", "1" ], "metadata": { "url": "/api/repositories/jupiter/library/entities/2" } } If there are no library entities, the ``rows`` value will be an empty array. .. _le_show_filtered: Show ~~~~ Show a filtered list of library entities. .. code-block:: http POST /api/repositories/jupiter/library/entities HTTP/1.1 Content-Type: application/json { "command": "get", "options": { "pageStart": 1, "pageSize": 30 } } The list of repositories may be paged and/or filtered; the request requires a :doc:`standard-request`. The response is a :doc:`standard-response` containing a list of repositories matching the criteria in the request. See the :ref:`show all ` section for more detail. .. _le_add: Add ~~~ Add an entity to the library. .. code-block:: http POST /api/repositories/jupiter/library/entities HTTP/1.1 Content-Type: application/json { "command": "add", "data": { "name": "entity name", "description": "entity description" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 201, Success 500, Server error The request requires a :doc:`standard-request` packet; the ``command`` field must be ``add``. The ``name`` field is required; ``description`` is optional. If the operation completes successfully, the response contains the URL to the new :doc:`library entity `. .. _le_associate: Associate ~~~~~~~~~ Associate a :doc:`library entity ` with one or more real :doc:`entities `. See the :ref:`associate ` command for more detail. .. _le_disassociate: Disassociate ~~~~~~~~~~~~ Disassociate a :doc:`library entity ` from one or more real :doc:`entities `. See the :ref:`disassociate ` command for more detail. .. _le_promote: Promote ~~~~~~~ Promote one or more :doc:`business rules ` from a real :doc:`entity ` to a :doc:`library entity `. See the :ref:`promote ` command for more detail. .. _le_import: Import ~~~~~~ Import one or more :doc:`library entity ` :doc:`business rules `. See the :ref:`import ` command for more detail. .. _le_export: Export ~~~~~~ Export one or more :doc:`entities ` from the library. For more detail, see the :ref:`export ` command. .. _le_unused: Delete Unused Attributes ~~~~~~~~~~~~~~~~~~~~~~~~ Delete unused attributes from one or more :doc:`library entities `. See the :ref:`delete unused attributes ` command for more detail.