diff --git a/docs/source/oclapi/apireference/bulkimporting.md b/docs/source/oclapi/apireference/bulkimporting.md index 87b3367..53ec84e 100644 --- a/docs/source/oclapi/apireference/bulkimporting.md +++ b/docs/source/oclapi/apireference/bulkimporting.md @@ -303,49 +303,65 @@ To view the final outcome of a previous bulk import, use a GET request to specif GET /importers/bulk-import/?task=:taskid[&result=:format] ``` * GET Request Parameters: - * **task** (Required for GET request) - Task ID of a previously submitted bulk import request - * **result** (Optional) - default="summary"; format of the results to be returned. Options are: - * **summary** -- one line of plain text (see `OclImportResults.get_detailed_summary()`) - * **report** -- longer report of plain text (see `OclImportResults.display_report()`) - * **json** -- full results object serialized to JSON (see `OclImportResults.to_json()`) -_”Summary” example_ -``` -Processed 348 of 348 -- 346 NEW (200:39, 201:307); 1 UPDATE (200:1); 1 DELETE (200:1) -``` - - -_”Report” example_ - - -``` -REPORT OF IMPORT RESULTS: -/orgs/DATIM-MOH-BW-FY19/collections/HTS-TST-N-MOH-HllvX50cXC0/: -NEW 200: -[{"message": "Added the latest versions of concept to the collection. Future updates will not be added automatically.", -"added": true, "expression": -... -``` - - -_”JSON” example_ - - - - -``` -{ - "count": 348, - "elapsed_seconds": 94.10947012901306, - "total_lines": 348, - "num_skipped": 0, - "results": { - "/orgs/DATIM-MOH-BW-FY19/collections/HTS-TST-N-MOH-HllvX50cXC0/": { - "NEW": { - "200": [ - { - "obj_type": "Reference", - "text": "{\"data\": {\"expressions\": [\"/orgs/DATIM-MOH-BW-FY19/sources/DATIM-Alignment-Indicators/mappings/MAP-DATIM-HAS-OPTION-HTS_TST_N_MOH-HllvX50cXC0/\", \"/orgs/PEPFAR/sources/DATIM-MOH-FY19/concepts/HTS_TST_N_MOH/\", \"/orgs/PEPFAR/sources/DATIM-MOH-FY19/concepts/HllvX50cXC0/\", \"/orgs/DATIM-MOH-BW-FY19/sources/ -``` + * **task=\** (Required for GET request) - Task ID of a previously submitted bulk import request + * **result=json** (Optional) - full results object serialized to JSON (see `OclImportResults.to_json()`) + +Default GET Response (without `?result=json`) has: +1. "message" (string) + ```doctest + Started: 2024-08-08 02:58:04.072628 | Processed: 62/62 | Created: 48 | Updated: 1 | Deleted: 0 | Existing: 1 | Permission Denied: 0 | Unchanged: 11 | Time: 41.45secs + ``` +2. ”report” (json) -- _Summary of the result in counts_ + ```json + { + "total": , # Total number of lines/requests in the import content + "processed": , # Number of lines/requests processed + "created": , # Number of new resources created + "updated": , # Number of new resources updated + "invalid": int, # Number of invalid (bad) resources + "exists": , # Number of resources that already exist + "failed": , # Number of resources that failed to be created/updated + "exception": , # Number of resources that caused an exception + "deleted": , # Number of resources that were deleted + "others": , # Number of resources that OCL had no idea on what to do with + "unknown": , # Number of resources that had "resource_type" unknown to OCL + "permission_denied": , # Number of resources that the user did not have permission to create/update + "unchanged": , # Number of resources that were unchanged due to same standard checksum + "elapsed_seconds": , # Time taken to process the import + "start_time": , # Time the import started + "child_resource_time_distribution": { + "concept": , # Time taken to process concepts + "mapping": # Time taken to process mappings + } + } + ``` + + +GET Response with `?result=json` has: +1. "result" (json) -- _An extended format of "report" with more details_ + ```json + { + "total": , # Total number of lines/requests in the import content + "processed": , # Number of lines/requests processed + "created": , # List of new resources created + "updated": , # List of new resources updated + "invalid": , # List of invalid (bad) resources + "exists": , # List of resources that already exist + "failed": , # List of resources that failed to be created/updated + "exception": , # List of resources that caused an exception + "deleted": , # List of resources that were deleted + "others": , # List of resources that OCL had no idea on what to do with + "unknown": , # List of resources that had "resource_type" unknown to OCL + "permission_denied": , # List of resources that the user did not have permission to create/update + "unchanged": , # List of resources that were unchanged due to same standard checksum + "elapsed_seconds": , # Time taken to process the import + "start_time": , # Time the import started + "child_resource_time_distribution": { + "concept": , # Time taken to process concepts + "mapping": # Time taken to process mappings + } + } + ``` * Notes: