Skip to content

Commit 848aa67

Browse files
committed
improve documentation about upload tracking prograss API
1 parent 5131055 commit 848aa67

File tree

2 files changed

+44
-155
lines changed

2 files changed

+44
-155
lines changed

devel/api/linked_resources/index.rst

Lines changed: 0 additions & 139 deletions
This file was deleted.

devel/api/usage/index.rst

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -281,29 +281,39 @@ Example:
281281
282282
Tracking dataset upload progress
283283
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
284-
When an upload request is executed, GeoNode creates an “upload objectand keeps updating its state and progress (it’s a property attribute, calculated on getting the response) attributes as the resource is being created and configured in Geoserver.
285-
The states used include:
286-
- READY
287-
- RUNNING
288-
- PENDING
289-
- WAITING
290-
- INCOMPLETE
291-
- COMPLETE
292-
- INVALID
293-
- PROCESSED
294-
295-
When the dataset is successfully uploaded, the final state of the upload is set to ``PROCESSED`` and progress is calculated as ``100.0``.
296-
297-
In order to view ongoing uploads, and their states, you can use the API ``GET /api/v2/uploads`` or ``GET /api/v2/uploads/{id}`` if the upload id is known. You can also filter uploads with state.
298-
Eg ``GET /api/v2/uploads?filter{state}=PROCESSED``
284+
When an upload request is executed, GeoNode creates an "Execution request" and keeps updating its state and progress (it’s a property attribute, calculated on getting the response) attributes as the resource is being created and configured in Geoserver.
285+
An execution can be in one of the following status:
286+
- ``ready``
287+
- ``running``
288+
- ``failed``
289+
- ``finished``
290+
291+
When the dataset is successfully uploaded, the final state of the upload is set to ``finished``.
292+
293+
In order to view status of the execution, the API method ``GET /api/v2/executionrequest/{execution_id}`` where ``{execution_id}`` is the value returned by the initial call to the upload API.
294+
295+
The returned object contains, beyond all the information related to the execution, the inputs that were passed to the execution request, and output params specific to the type of execution.
296+
In the case of a dataset upload, the output params contain the URL of the catalog page for the new datast.
297+
298+
.. code-block:: json
299+
300+
"output_params": {
301+
"detail_url": [
302+
"/catalogue/#/dataset/9881"
303+
]
304+
},
305+
306+
You can also filter executions by status.
307+
Eg ``GET /api/v2/executionrequest?filter{action}=import&filter{source}=upload&filter{status}=finished``
308+
299309
300310
Example:
301311
302312
.. code-block:: python
303313
304314
import requests
305315
306-
url = "https://master.demo.geonode.org/api/v2/uploads"
316+
url = "https://stable.demo.geonode.org/api/v2/executionrequest/5f640b6b-8c51-4514-a054-995133fee107"
307317
headers = {
308318
'Authorization': 'Basic dXNlcjpwYXNzd29yZA=='
309319
}
@@ -630,3 +640,21 @@ The ``status_url`` property returns the URL to track kthe progress of the reques
630640
631641
632642
The operation will be completed once the ``status`` property is updated with the value ``finished``.
643+
644+
Linked Resources Listing and Details
645+
------------------------------------
646+
647+
All available linked_resources can be listed with API ``GET /api/v2/resources/{pk}/linked_resources``.
648+
where pk Resource base id
649+
650+
Example Requests:
651+
^^^^^^^^^^^^^^^^^
652+
653+
1. List all resource links
654+
655+
.. code-block:: python
656+
657+
import requests
658+
659+
url = "https://master.demo.geonode.org/api/v2/resources/{pk}/linked_resources"
660+
response = requests.request("GET", url)

0 commit comments

Comments
 (0)