Notebook guide

This commit is contained in:
Fabio Sinibaldi 2022-04-08 15:45:05 +02:00
parent 615b05408c
commit 2e6fa21426
1 changed files with 25 additions and 445 deletions

View File

@ -4,6 +4,7 @@
"cell_type": "markdown",
"id": "64e0639b-c024-49eb-93ef-3c67539dec34",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
@ -46,81 +47,12 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "fcc15ae5-fc3f-4146-b77c-bf23231c9ae6",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: rich[jupyter] in /opt/conda/lib/python3.9/site-packages (12.2.0)\n",
"Requirement already satisfied: pygments<3.0.0,>=2.6.0 in /opt/conda/lib/python3.9/site-packages (from rich[jupyter]) (2.11.2)\n",
"Requirement already satisfied: commonmark<0.10.0,>=0.9.0 in /opt/conda/lib/python3.9/site-packages (from rich[jupyter]) (0.9.1)\n",
"Requirement already satisfied: ipywidgets<8.0.0,>=7.5.1 in /opt/conda/lib/python3.9/site-packages (from rich[jupyter]) (7.7.0)\n",
"Requirement already satisfied: traitlets>=4.3.1 in /opt/conda/lib/python3.9/site-packages (from ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (5.1.1)\n",
"Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /opt/conda/lib/python3.9/site-packages (from ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (1.1.0)\n",
"Requirement already satisfied: ipykernel>=4.5.1 in /opt/conda/lib/python3.9/site-packages (from ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (6.11.0)\n",
"Requirement already satisfied: nbformat>=4.2.0 in /opt/conda/lib/python3.9/site-packages (from ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (5.2.0)\n",
"Requirement already satisfied: ipython-genutils~=0.2.0 in /opt/conda/lib/python3.9/site-packages (from ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.2.0)\n",
"Requirement already satisfied: widgetsnbextension~=3.6.0 in /opt/conda/lib/python3.9/site-packages (from ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (3.6.0)\n",
"Requirement already satisfied: ipython>=4.0.0 in /opt/conda/lib/python3.9/site-packages (from ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (8.2.0)\n",
"Requirement already satisfied: jupyter-client>=6.1.12 in /opt/conda/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (7.2.1)\n",
"Requirement already satisfied: debugpy>=1.0 in /opt/conda/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (1.5.1)\n",
"Requirement already satisfied: setuptools>=60 in /opt/conda/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (61.3.1)\n",
"Requirement already satisfied: nest-asyncio in /opt/conda/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (1.5.5)\n",
"Requirement already satisfied: psutil in /opt/conda/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (5.9.0)\n",
"Requirement already satisfied: matplotlib-inline>=0.1 in /opt/conda/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.1.3)\n",
"Requirement already satisfied: tornado>=6.1 in /opt/conda/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (6.1)\n",
"Requirement already satisfied: decorator in /opt/conda/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (5.1.1)\n",
"Requirement already satisfied: stack-data in /opt/conda/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.2.0)\n",
"Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /opt/conda/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (3.0.27)\n",
"Requirement already satisfied: pickleshare in /opt/conda/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.7.5)\n",
"Requirement already satisfied: jedi>=0.16 in /opt/conda/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.18.1)\n",
"Requirement already satisfied: pexpect>4.3 in /opt/conda/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (4.8.0)\n",
"Requirement already satisfied: backcall in /opt/conda/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.2.0)\n",
"Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /opt/conda/lib/python3.9/site-packages (from nbformat>=4.2.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (4.4.0)\n",
"Requirement already satisfied: jupyter-core in /opt/conda/lib/python3.9/site-packages (from nbformat>=4.2.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (4.9.2)\n",
"Requirement already satisfied: notebook>=4.4.1 in /opt/conda/lib/python3.9/site-packages (from widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (6.4.10)\n",
"Requirement already satisfied: parso<0.9.0,>=0.8.0 in /opt/conda/lib/python3.9/site-packages (from jedi>=0.16->ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.8.3)\n",
"Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /opt/conda/lib/python3.9/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.18.1)\n",
"Requirement already satisfied: attrs>=17.4.0 in /opt/conda/lib/python3.9/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.2.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (21.4.0)\n",
"Requirement already satisfied: entrypoints in /opt/conda/lib/python3.9/site-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.4)\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in /opt/conda/lib/python3.9/site-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (2.8.2)\n",
"Requirement already satisfied: pyzmq>=22.3 in /opt/conda/lib/python3.9/site-packages (from jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (22.3.0)\n",
"Requirement already satisfied: nbconvert>=5 in /opt/conda/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (6.4.5)\n",
"Requirement already satisfied: jinja2 in /opt/conda/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (3.1.1)\n",
"Requirement already satisfied: Send2Trash>=1.8.0 in /opt/conda/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (1.8.0)\n",
"Requirement already satisfied: prometheus-client in /opt/conda/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.13.1)\n",
"Requirement already satisfied: terminado>=0.8.3 in /opt/conda/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.13.3)\n",
"Requirement already satisfied: argon2-cffi in /opt/conda/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (21.3.0)\n",
"Requirement already satisfied: ptyprocess>=0.5 in /opt/conda/lib/python3.9/site-packages (from pexpect>4.3->ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.7.0)\n",
"Requirement already satisfied: wcwidth in /opt/conda/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.2.5)\n",
"Requirement already satisfied: executing in /opt/conda/lib/python3.9/site-packages (from stack-data->ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.8.3)\n",
"Requirement already satisfied: asttokens in /opt/conda/lib/python3.9/site-packages (from stack-data->ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (2.0.5)\n",
"Requirement already satisfied: pure-eval in /opt/conda/lib/python3.9/site-packages (from stack-data->ipython>=4.0.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.2.2)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (2.1.1)\n",
"Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.5.13)\n",
"Requirement already satisfied: defusedxml in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.7.1)\n",
"Requirement already satisfied: mistune<2,>=0.8.1 in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.8.4)\n",
"Requirement already satisfied: jupyterlab-pygments in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.1.2)\n",
"Requirement already satisfied: pandocfilters>=1.4.1 in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (1.5.0)\n",
"Requirement already satisfied: beautifulsoup4 in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (4.10.0)\n",
"Requirement already satisfied: testpath in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.6.0)\n",
"Requirement already satisfied: bleach in /opt/conda/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (4.1.0)\n",
"Requirement already satisfied: six>=1.5 in /opt/conda/lib/python3.9/site-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.12->ipykernel>=4.5.1->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (1.16.0)\n",
"Requirement already satisfied: argon2-cffi-bindings in /opt/conda/lib/python3.9/site-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (21.2.0)\n",
"Requirement already satisfied: cffi>=1.0.1 in /opt/conda/lib/python3.9/site-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (1.15.0)\n",
"Requirement already satisfied: soupsieve>1.2 in /opt/conda/lib/python3.9/site-packages (from beautifulsoup4->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (2.3.1)\n",
"Requirement already satisfied: packaging in /opt/conda/lib/python3.9/site-packages (from bleach->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (21.3)\n",
"Requirement already satisfied: webencodings in /opt/conda/lib/python3.9/site-packages (from bleach->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (0.5.1)\n",
"Requirement already satisfied: pycparser in /opt/conda/lib/python3.9/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (2.21)\n",
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/conda/lib/python3.9/site-packages (from packaging->bleach->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.0->ipywidgets<8.0.0,>=7.5.1->rich[jupyter]) (3.0.7)\n"
]
}
],
"outputs": [],
"source": [
"import requests\n",
"import json\n",
@ -170,6 +102,7 @@
"cell_type": "markdown",
"id": "2b565fd2-4884-4a01-a6f7-300ea8fd7028",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
@ -227,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "1cf34b3e-56ca-43c7-8206-3e16cebb80e0",
"metadata": {},
"outputs": [],
@ -238,124 +171,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "ba665887-9718-44ee-be51-62283fa2dbb2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GOING TO SEND POST REQUEST TO https://geoportal.dev.int.d4science.net/geoportal-service/srv/projects/basic\n",
"Data is {\"myTitle\": \"Some Big Title\"}\n",
"RESPONSE STATUS 200\n",
"Resulting project is \n"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_id\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"62502e8902ad3d59dffb098e\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_version\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"1.0.0\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_info\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_creationInfo\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_user\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_username\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"FAKE\"</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_context\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_id\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"/gcube/devsec/devVRE\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_name\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"/devVRE\"</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_instant\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2022-04-08T14:46:01.718\"</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lastEditInfo\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_access\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_policy\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"OPEN\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_license\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"\"</span>\n",
" <span style=\"font-weight: bold\">}</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_profileID\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"basic\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_profileVersion\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"1.0.0\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lifecycleInformation\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_phase\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"DRAFT\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lastInvokedStep\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lastOperationStatus\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"OK\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_errorMessages\"</span>: <span style=\"font-weight: bold\">[]</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_warningMessages\"</span>: <span style=\"font-weight: bold\">[]</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_triggeredEvents\"</span>: <span style=\"font-weight: bold\">[</span>\n",
" <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"event\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"INIT_DOCUMENT\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"lastOperationStatus\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"OK\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"errorMessages\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"warningMessages\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>\n",
" <span style=\"font-weight: bold\">}</span>\n",
" <span style=\"font-weight: bold\">]</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_notes\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_relationships\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_spatialReference\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_temporalReference\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_theDocument\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"myTitle\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Some Big Title\"</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lock\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>\n",
"<span style=\"font-weight: bold\">}</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_id\"\u001b[0m: \u001b[32m\"62502e8902ad3d59dffb098e\"\u001b[0m,\n",
" \u001b[1;34m\"_version\"\u001b[0m: \u001b[32m\"1.0.0\"\u001b[0m,\n",
" \u001b[1;34m\"_info\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_creationInfo\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_user\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_username\"\u001b[0m: \u001b[32m\"FAKE\"\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_context\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_id\"\u001b[0m: \u001b[32m\"/gcube/devsec/devVRE\"\u001b[0m,\n",
" \u001b[1;34m\"_name\"\u001b[0m: \u001b[32m\"/devVRE\"\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_instant\"\u001b[0m: \u001b[32m\"2022-04-08T14:46:01.718\"\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_lastEditInfo\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"_access\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_policy\"\u001b[0m: \u001b[32m\"OPEN\"\u001b[0m,\n",
" \u001b[1;34m\"_license\"\u001b[0m: \u001b[32m\"\"\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_profileID\"\u001b[0m: \u001b[32m\"basic\"\u001b[0m,\n",
" \u001b[1;34m\"_profileVersion\"\u001b[0m: \u001b[32m\"1.0.0\"\u001b[0m,\n",
" \u001b[1;34m\"_lifecycleInformation\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_phase\"\u001b[0m: \u001b[32m\"DRAFT\"\u001b[0m,\n",
" \u001b[1;34m\"_lastInvokedStep\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"_lastOperationStatus\"\u001b[0m: \u001b[32m\"OK\"\u001b[0m,\n",
" \u001b[1;34m\"_errorMessages\"\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
" \u001b[1;34m\"_warningMessages\"\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
" \u001b[1;34m\"_triggeredEvents\"\u001b[0m: \u001b[1m[\u001b[0m\n",
" \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"event\"\u001b[0m: \u001b[32m\"INIT_DOCUMENT\"\u001b[0m,\n",
" \u001b[1;34m\"lastOperationStatus\"\u001b[0m: \u001b[32m\"OK\"\u001b[0m,\n",
" \u001b[1;34m\"errorMessages\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"warningMessages\"\u001b[0m: \u001b[3;35mnull\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
" \u001b[1m]\u001b[0m,\n",
" \u001b[1;34m\"_notes\"\u001b[0m: \u001b[3;35mnull\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_relationships\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"_spatialReference\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"_temporalReference\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"_theDocument\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"myTitle\"\u001b[0m: \u001b[32m\"Some Big Title\"\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_lock\"\u001b[0m: \u001b[3;35mnull\u001b[0m\n",
"\u001b[1m}\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"project= send(method=\"POST\",dest=projects_endpoint,data=json.dumps(doc))\n",
"\n",
@ -387,30 +206,12 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "2b0076fa-0ab5-44a5-b069-2fdc0d6d70be",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"myTitle\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"Some Big Title\"</span>\n",
"<span style=\"font-weight: bold\">}</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"myTitle\"\u001b[0m: \u001b[32m\"Some Big Title\"\u001b[0m\n",
"\u001b[1m}\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"print_json(data=project[\"_theDocument\"])"
]
@ -429,26 +230,12 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "8e2fd339-4117-49d4-9a3c-d9463d35ba2d",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000\">\"62502e8902ad3d59dffb098e\"</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[32m\"62502e8902ad3d59dffb098e\"\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"print_json(data=project[\"_id\"])"
]
@ -470,58 +257,12 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "228daf3a-ec36-403c-84f4-dc7ff1fde026",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_creationInfo\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_user\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_username\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"FAKE\"</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_context\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_id\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"/gcube/devsec/devVRE\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_name\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"/devVRE\"</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_instant\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"2022-04-08T14:46:01.718\"</span>\n",
" <span style=\"font-weight: bold\">}</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lastEditInfo\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_access\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_policy\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"OPEN\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_license\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"\"</span>\n",
" <span style=\"font-weight: bold\">}</span>\n",
"<span style=\"font-weight: bold\">}</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_creationInfo\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_user\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_username\"\u001b[0m: \u001b[32m\"FAKE\"\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_context\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_id\"\u001b[0m: \u001b[32m\"/gcube/devsec/devVRE\"\u001b[0m,\n",
" \u001b[1;34m\"_name\"\u001b[0m: \u001b[32m\"/devVRE\"\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_instant\"\u001b[0m: \u001b[32m\"2022-04-08T14:46:01.718\"\u001b[0m\n",
" \u001b[1m}\u001b[0m,\n",
" \u001b[1;34m\"_lastEditInfo\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"_access\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_policy\"\u001b[0m: \u001b[32m\"OPEN\"\u001b[0m,\n",
" \u001b[1;34m\"_license\"\u001b[0m: \u001b[32m\"\"\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
"\u001b[1m}\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"print_json(data=project[\"_info\"])"
]
@ -547,56 +288,12 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "d2059a6e-b1a5-484a-a48e-16158d6015d5",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_phase\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"DRAFT\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lastInvokedStep\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_lastOperationStatus\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"OK\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_errorMessages\"</span>: <span style=\"font-weight: bold\">[]</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_warningMessages\"</span>: <span style=\"font-weight: bold\">[]</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_triggeredEvents\"</span>: <span style=\"font-weight: bold\">[</span>\n",
" <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"event\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"INIT_DOCUMENT\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"lastOperationStatus\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"OK\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"errorMessages\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"warningMessages\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>\n",
" <span style=\"font-weight: bold\">}</span>\n",
" <span style=\"font-weight: bold\">]</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"_notes\"</span>: <span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">null</span>\n",
"<span style=\"font-weight: bold\">}</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"_phase\"\u001b[0m: \u001b[32m\"DRAFT\"\u001b[0m,\n",
" \u001b[1;34m\"_lastInvokedStep\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"_lastOperationStatus\"\u001b[0m: \u001b[32m\"OK\"\u001b[0m,\n",
" \u001b[1;34m\"_errorMessages\"\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
" \u001b[1;34m\"_warningMessages\"\u001b[0m: \u001b[1m[\u001b[0m\u001b[1m]\u001b[0m,\n",
" \u001b[1;34m\"_triggeredEvents\"\u001b[0m: \u001b[1m[\u001b[0m\n",
" \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"event\"\u001b[0m: \u001b[32m\"INIT_DOCUMENT\"\u001b[0m,\n",
" \u001b[1;34m\"lastOperationStatus\"\u001b[0m: \u001b[32m\"OK\"\u001b[0m,\n",
" \u001b[1;34m\"errorMessages\"\u001b[0m: \u001b[3;35mnull\u001b[0m,\n",
" \u001b[1;34m\"warningMessages\"\u001b[0m: \u001b[3;35mnull\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
" \u001b[1m]\u001b[0m,\n",
" \u001b[1;34m\"_notes\"\u001b[0m: \u001b[3;35mnull\u001b[0m\n",
"\u001b[1m}\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"print_json(data=project[\"_lifecycleInformation\"])"
]
@ -673,7 +370,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "4323986d-218f-4997-9fe0-c9ba9e3e3c84",
"metadata": {},
"outputs": [],
@ -687,43 +384,10 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "6123e5e5-9150-47bd-a49a-b2bc21915d34",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GOING TO SEND PUT REQUEST TO https://geoportal.dev.int.d4science.net/geoportal-service/srv/projects/basic/62502e8902ad3d59dffb098e\n",
"Data is {\"myTitle\": \"My newer edited title\", \"section\": {\"sectionTitle\": \"My new SubSection\"}}\n",
"RESPONSE STATUS 200\n"
]
},
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"myTitle\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"My newer edited title\"</span>,\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"section\"</span>: <span style=\"font-weight: bold\">{</span>\n",
" <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">\"sectionTitle\"</span>: <span style=\"color: #008000; text-decoration-color: #008000\">\"My new SubSection\"</span>\n",
" <span style=\"font-weight: bold\">}</span>\n",
"<span style=\"font-weight: bold\">}</span>\n",
"</pre>\n"
],
"text/plain": [
"\u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"myTitle\"\u001b[0m: \u001b[32m\"My newer edited title\"\u001b[0m,\n",
" \u001b[1;34m\"section\"\u001b[0m: \u001b[1m{\u001b[0m\n",
" \u001b[1;34m\"sectionTitle\"\u001b[0m: \u001b[32m\"My new SubSection\"\u001b[0m\n",
" \u001b[1m}\u001b[0m\n",
"\u001b[1m}\u001b[0m\n"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"# NB uncomment to actually perform edit\n",
"project = send(method=\"PUT\",data=json.dumps(doc),dest=projects_endpoint+\"/\"+str(project[\"_id\"]))\n",
@ -773,7 +437,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "07965581-532d-45e8-bbf8-0bbec1a15273",
"metadata": {},
"outputs": [],
@ -799,37 +463,10 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"id": "832e043c-870b-4509-be92-d90865cfd105",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GOING TO SEND POST REQUEST TO https://geoportal.dev.int.d4science.net/geoportal-service/srv/projects/basic/registerFiles/62502e8902ad3d59dffb098e\n",
"Data is {\"fieldDefinitionPath\": \"$.section._children[?(@.fileset)]\", \"parentPath\": \"$.section\", \"fieldName\": \"fileset\", \"streams\": [{\"url\": \"https://www.cnr.it/sites/all/themes/custom/cnr03_theme/img/cnrlogo.svg\", \"filename\": \"myLogo.svg\"}]}\n",
"RESPONSE STATUS 500\n",
"CAUSE \n",
"<!doctype html><html lang=\"en\"><head><title>HTTP Status 500 Internal Server Error</title><style type=\"text/css\">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 Internal Server Error</h1><hr class=\"line\" /><p><b>Type</b> Status Report</p><p><b>Message</b> Internal Server Error</p><p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request.</p><hr class=\"line\" /><h3>Apache Tomcat/8.5.39 (Ubuntu)</h3></body></html>\n"
]
},
{
"ename": "JSONDecodeError",
"evalue": "Expecting value: line 1 column 1 (char 0)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mJSONDecodeError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [11]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m project \u001b[38;5;241m=\u001b[39m \u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mPOST\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mdest\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mprojects_endpoint\u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/registerFiles/\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mproject\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m_id\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mjson\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdumps\u001b[49m\u001b[43m(\u001b[49m\u001b[43mregisterFilesetRequest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOur Registered FileSet\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 4\u001b[0m print_json(data\u001b[38;5;241m=\u001b[39mproject[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_theDocument\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msection\u001b[39m\u001b[38;5;124m\"\u001b[39m][\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfileset\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n",
"Input \u001b[0;32mIn [1]\u001b[0m, in \u001b[0;36msend\u001b[0;34m(dest, data, method, params)\u001b[0m\n\u001b[1;32m 38\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCAUSE \u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m+\u001b[39m\u001b[38;5;28mstr\u001b[39m(response\u001b[38;5;241m.\u001b[39mreason))\n\u001b[1;32m 39\u001b[0m \u001b[38;5;28mprint\u001b[39m(response\u001b[38;5;241m.\u001b[39mtext)\n\u001b[0;32m---> 40\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mjson\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloads\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresponse\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtext\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/conda/lib/python3.9/json/__init__.py:346\u001b[0m, in \u001b[0;36mloads\u001b[0;34m(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[0m\n\u001b[1;32m 341\u001b[0m s \u001b[38;5;241m=\u001b[39m s\u001b[38;5;241m.\u001b[39mdecode(detect_encoding(s), \u001b[38;5;124m'\u001b[39m\u001b[38;5;124msurrogatepass\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 343\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[1;32m 344\u001b[0m parse_int \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m parse_float \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[1;32m 345\u001b[0m parse_constant \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_pairs_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m kw):\n\u001b[0;32m--> 346\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_default_decoder\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdecode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 347\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 348\u001b[0m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;241m=\u001b[39m JSONDecoder\n",
"File \u001b[0;32m/opt/conda/lib/python3.9/json/decoder.py:337\u001b[0m, in \u001b[0;36mJSONDecoder.decode\u001b[0;34m(self, s, _w)\u001b[0m\n\u001b[1;32m 332\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecode\u001b[39m(\u001b[38;5;28mself\u001b[39m, s, _w\u001b[38;5;241m=\u001b[39mWHITESPACE\u001b[38;5;241m.\u001b[39mmatch):\n\u001b[1;32m 333\u001b[0m \u001b[38;5;124;03m\"\"\"Return the Python representation of ``s`` (a ``str`` instance\u001b[39;00m\n\u001b[1;32m 334\u001b[0m \u001b[38;5;124;03m containing a JSON document).\u001b[39;00m\n\u001b[1;32m 335\u001b[0m \n\u001b[1;32m 336\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 337\u001b[0m obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraw_decode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_w\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mend\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 338\u001b[0m end \u001b[38;5;241m=\u001b[39m _w(s, end)\u001b[38;5;241m.\u001b[39mend()\n\u001b[1;32m 339\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m end \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(s):\n",
"File \u001b[0;32m/opt/conda/lib/python3.9/json/decoder.py:355\u001b[0m, in \u001b[0;36mJSONDecoder.raw_decode\u001b[0;34m(self, s, idx)\u001b[0m\n\u001b[1;32m 353\u001b[0m obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mscan_once(s, idx)\n\u001b[1;32m 354\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m--> 355\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m JSONDecodeError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mExpecting value\u001b[39m\u001b[38;5;124m\"\u001b[39m, s, err\u001b[38;5;241m.\u001b[39mvalue) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28mNone\u001b[39m\n\u001b[1;32m 356\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m obj, end\n",
"\u001b[0;31mJSONDecodeError\u001b[0m: Expecting value: line 1 column 1 (char 0)"
]
}
],
"outputs": [],
"source": [
"project = send(method=\"POST\",dest=projects_endpoint+\"/registerFiles/\"+str(project[\"_id\"]),data=json.dumps(registerFilesetRequest))\n",
"\n",
@ -895,69 +532,10 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"id": "c1b72a2d-ce83-4e3d-94e0-8f3fd0638bd0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GOING TO SEND POST REQUEST TO https://geoportal.dev.int.d4science.net/geoportal-service/srv/projects/basic/step/62502e8902ad3d59dffb098e\n",
"Data is {\"stepID\": \"PUBLISH\"}\n",
"RESPONSE STATUS 400\n",
"CAUSE \n",
"Error (400) : this resource cannot process this request because it is malformed\n",
"Stacktrace:\n",
"org.gcube.smartgears.handlers.application.request.RequestException: error contating authorization for polices\n",
"\tat org.gcube.smartgears.handlers.application.request.RequestError.toException(RequestError.java:110)\n",
"\tat org.gcube.smartgears.handlers.application.request.RequestError.fire(RequestError.java:94)\n",
"\tat org.gcube.smartgears.handlers.application.request.RequestValidator.validatePolicy(RequestValidator.java:130)\n",
"\tat org.gcube.smartgears.handlers.application.request.RequestValidator.handleRequest(RequestValidator.java:62)\n",
"\tat org.gcube.smartgears.handlers.application.RequestHandler.onEvent(RequestHandler.java:58)\n",
"\tat org.gcube.smartgears.handlers.application.RequestHandler.onEvent(RequestHandler.java:21)\n",
"\tat org.gcube.smartgears.handlers.Pipeline.forward(Pipeline.java:65)\n",
"\tat org.gcube.smartgears.handlers.Pipeline.forward(Pipeline.java:72)\n",
"\tat org.gcube.smartgears.managers.RequestManager.doFilter(RequestManager.java:89)\n",
"\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n",
"\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n",
"\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200)\n",
"\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\n",
"\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)\n",
"\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)\n",
"\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)\n",
"\tat org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)\n",
"\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)\n",
"\tat org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679)\n",
"\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\n",
"\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)\n",
"\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)\n",
"\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)\n",
"\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)\n",
"\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n",
"\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n",
"\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n",
"\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n",
"\tat java.lang.Thread.run(Thread.java:748)\n",
"\n"
]
},
{
"ename": "JSONDecodeError",
"evalue": "Expecting value: line 1 column 1 (char 0)",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mJSONDecodeError\u001b[0m Traceback (most recent call last)",
"Input \u001b[0;32mIn [15]\u001b[0m, in \u001b[0;36m<cell line: 4>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m#NB Assuming UCID = \"basic\"\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;66;03m#Prepare STEP execution request\u001b[39;00m\n\u001b[1;32m 3\u001b[0m STEPrequest\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstepID\u001b[39m\u001b[38;5;124m\"\u001b[39m : \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mPUBLISH\u001b[39m\u001b[38;5;124m\"\u001b[39m}\n\u001b[0;32m----> 4\u001b[0m project\u001b[38;5;241m=\u001b[39m \u001b[43msend\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmethod\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mPOST\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43mdest\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mprojects_endpoint\u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m/step/\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[38;5;28;43mstr\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mproject\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m_id\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mjson\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdumps\u001b[49m\u001b[43m(\u001b[49m\u001b[43mSTEPrequest\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOur resulting project new lifecycle information\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 7\u001b[0m print_json(data\u001b[38;5;241m=\u001b[39mproject[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_lifecycleInformation\u001b[39m\u001b[38;5;124m\"\u001b[39m])\n",
"Input \u001b[0;32mIn [1]\u001b[0m, in \u001b[0;36msend\u001b[0;34m(dest, data, method, params)\u001b[0m\n\u001b[1;32m 38\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCAUSE \u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m+\u001b[39m\u001b[38;5;28mstr\u001b[39m(response\u001b[38;5;241m.\u001b[39mreason))\n\u001b[1;32m 39\u001b[0m \u001b[38;5;28mprint\u001b[39m(response\u001b[38;5;241m.\u001b[39mtext)\n\u001b[0;32m---> 40\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mjson\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloads\u001b[49m\u001b[43m(\u001b[49m\u001b[43mresponse\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtext\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[0;32m/opt/conda/lib/python3.9/json/__init__.py:346\u001b[0m, in \u001b[0;36mloads\u001b[0;34m(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)\u001b[0m\n\u001b[1;32m 341\u001b[0m s \u001b[38;5;241m=\u001b[39m s\u001b[38;5;241m.\u001b[39mdecode(detect_encoding(s), \u001b[38;5;124m'\u001b[39m\u001b[38;5;124msurrogatepass\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 343\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[1;32m 344\u001b[0m parse_int \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m parse_float \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m\n\u001b[1;32m 345\u001b[0m parse_constant \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m object_pairs_hook \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m kw):\n\u001b[0;32m--> 346\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_default_decoder\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdecode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 347\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 348\u001b[0m \u001b[38;5;28mcls\u001b[39m \u001b[38;5;241m=\u001b[39m JSONDecoder\n",
"File \u001b[0;32m/opt/conda/lib/python3.9/json/decoder.py:337\u001b[0m, in \u001b[0;36mJSONDecoder.decode\u001b[0;34m(self, s, _w)\u001b[0m\n\u001b[1;32m 332\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecode\u001b[39m(\u001b[38;5;28mself\u001b[39m, s, _w\u001b[38;5;241m=\u001b[39mWHITESPACE\u001b[38;5;241m.\u001b[39mmatch):\n\u001b[1;32m 333\u001b[0m \u001b[38;5;124;03m\"\"\"Return the Python representation of ``s`` (a ``str`` instance\u001b[39;00m\n\u001b[1;32m 334\u001b[0m \u001b[38;5;124;03m containing a JSON document).\u001b[39;00m\n\u001b[1;32m 335\u001b[0m \n\u001b[1;32m 336\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 337\u001b[0m obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraw_decode\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43midx\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_w\u001b[49m\u001b[43m(\u001b[49m\u001b[43ms\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mend\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 338\u001b[0m end \u001b[38;5;241m=\u001b[39m _w(s, end)\u001b[38;5;241m.\u001b[39mend()\n\u001b[1;32m 339\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m end \u001b[38;5;241m!=\u001b[39m \u001b[38;5;28mlen\u001b[39m(s):\n",
"File \u001b[0;32m/opt/conda/lib/python3.9/json/decoder.py:355\u001b[0m, in \u001b[0;36mJSONDecoder.raw_decode\u001b[0;34m(self, s, idx)\u001b[0m\n\u001b[1;32m 353\u001b[0m obj, end \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mscan_once(s, idx)\n\u001b[1;32m 354\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mStopIteration\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m--> 355\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m JSONDecodeError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mExpecting value\u001b[39m\u001b[38;5;124m\"\u001b[39m, s, err\u001b[38;5;241m.\u001b[39mvalue) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28mNone\u001b[39m\n\u001b[1;32m 356\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m obj, end\n",
"\u001b[0;31mJSONDecodeError\u001b[0m: Expecting value: line 1 column 1 (char 0)"
]
}
],
"outputs": [],
"source": [
"#NB Assuming UCID = \"basic\"\n",
"#Prepare STEP execution request\n",
@ -1202,6 +780,7 @@
"cell_type": "markdown",
"id": "053cd583-abbe-423d-a77b-62601700c2f0",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [
@ -1418,6 +997,7 @@
"cell_type": "markdown",
"id": "4e9068c1-2a16-4890-8f4d-9966c0352f0c",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source": [