Business Rules - Priorities =========================== Get ~~~ .. http:get:: /api/repositories/(string:repository)/priorities :synopsis: List business rule priorities in the repository Get a list of business rule priorities in the :doc:`repository` .. code-block:: http GET /api/repositories/test/priorities HTTP/1.1 Accept: application/json .. csv-table:: :header: Response Code, Reason :widths: 25, 75 200, No error 500, Server error The response contains a JSON list containing all the priorities in the :doc:`repository`, each one containing the numeric ID (the priority value), the name of the priority, the description of the priority, and a flag indicating if the priority is used in a Business Rule For example, the request above would result in the following response: .. code-block:: json [ [ 1, "Priority 1", "", "Y" ], [ 2, "Priority 2", "", "N" ], [ 3, "Priority 3", "", "Y" ], [ 4, "Priority 4", "", "Y" ], [ 5, "Priority 5", "", "N" ], [ 6, "Priority 6", "", "N" ], [ 7, "Priority 7", "", "Y" ], [ 8, "Priority 8", "", "Y" ], [ 9, "Priority 9", "", "N" ], [ 10, "Priority 10", "", "N" ] ] Add ~~~ .. http:post:: /api/repositories/(string:repository)/priorities :synopsis: Add a priority Adds a priority to the repository. Note: will overwrite any existing priority with the same id. :jsonparam body: The request body The request requires a :doc:`standard-request` packet. .. code-block:: http POST /api/repositories/test/priorities HTTP/1.1 Content-Type: application/json { "command": "add", "data": { "priority": "15", "name": "new priority", "description": "a new priority" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 201, Success 500, Server error Edit ~~~~ .. http:post:: /api/repositories/(string:repository)/priorities/(number:priority) :synopsis: Edit a priority Edits a priority. If you change the PRIORITY field, this operation will overwrite any existing priority with this value. :jsonparam body: The request body The request requires a :doc:`standard-request` packet. .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, The name of the :doc:`repository` to access priority, number, The id number of the priority .. code-block:: http POST /api/repositories/test/priorities/15 HTTP/1.1 Content-Type: application/json { "command": "edit", "data": { "priority": "19", "name": "changed priority", "description": "a changed priority" } } .. csv-table:: :header: Response Code, Reason :widths: 25, 75 201, Success 500, Server error Delete ~~~~~~ .. http:delete:: /api/repositories/(string:repository)/priorities/(number:priority) :synopsis: Deletes a priority from the repository .. csv-table:: :header: Parameter, Type, Purpose :widths: 20, 20, 60 :stub-columns: 1 repository, string, The name of the :doc:`repository` to access priority, number, The id number of the priority .. code-block:: http DELETE /api/repositories/test/priorities/15 HTTP/1.1 .. csv-table:: :header: Response Code, Reason :widths: 25, 75 204, Success 500, Server error