2727 }
2828 ],
2929 "source" : [
30- " import getpass\n " ,
3130 " import json\n " ,
32- " import os\n " ,
3331 " from pathlib import Path\n " ,
3432 " \n " ,
3533 " import pandas as pd\n " ,
6361 "execution_count" : null ,
6462 "metadata" : {},
6563 "outputs" : [],
66- "source" : " # STAC API Configuration\n STAC_API_URL = \" https://stac.core.eopf.eodc.eu/\"\n\n # Webhook Configuration\n WEBHOOK_URL = \" http://localhost:12000/samples\"\n\n print(\" ✅ Configuration loaded\" )"
64+ "source" : [
65+ " # STAC API Configuration\n " ,
66+ " STAC_API_URL = \" https://stac.core.eopf.eodc.eu/\"\n " ,
67+ " \n " ,
68+ " # Webhook Configuration\n " ,
69+ " WEBHOOK_URL = \" http://localhost:12000/samples\"\n " ,
70+ " \n " ,
71+ " print(\" ✅ Configuration loaded\" )"
72+ ]
6773 },
6874 {
6975 "cell_type" : " markdown" ,
426432 "execution_count" : null ,
427433 "metadata" : {},
428434 "outputs" : [],
429- "source": "def submit_item_to_pipeline(item_url: str, target_collection: str) -> bool:\n \"\"\"\n Submit a single STAC item to the data pipeline via HTTP webhook.\n\n Args:\n item_url: The self-link URL of the STAC item\n target_collection: The target collection for processing\n\n Returns:\n True if successful, False otherwise\n \"\"\"\n try:\n # Create payload\n payload = {\n \"source_url\": item_url,\n \"collection\": target_collection,\n \"action\": \"convert-v1-s2\", # specify the action to use the V1 S2 trigger\n }\n\n # Submit via HTTP webhook endpoint\n message = json.dumps(payload)\n response = requests.post(\n WEBHOOK_URL,\n data=message,\n headers={\"Content-Type\": \"application/json\"},\n )\n \n response.raise_for_status()\n return True\n\n except Exception as e:\n print(f\"❌ Error submitting item: {e}\")\n return False"
435+ "source" : [
436+ " def submit_item_to_pipeline(item_url: str, target_collection: str) -> bool:\n " ,
437+ " \"\"\"\n " ,
438+ " Submit a single STAC item to the data pipeline via HTTP webhook.\n " ,
439+ " \n " ,
440+ " Args:\n " ,
441+ " item_url: The self-link URL of the STAC item\n " ,
442+ " target_collection: The target collection for processing\n " ,
443+ " \n " ,
444+ " Returns:\n " ,
445+ " True if successful, False otherwise\n " ,
446+ " \"\"\"\n " ,
447+ " try:\n " ,
448+ " # Create payload\n " ,
449+ " payload = {\n " ,
450+ " \" source_url\" : item_url,\n " ,
451+ " \" collection\" : target_collection,\n " ,
452+ " \" action\" : \" convert-v1-s2\" , # specify the action to use the V1 S2 trigger\n " ,
453+ " }\n " ,
454+ " \n " ,
455+ " # Submit via HTTP webhook endpoint\n " ,
456+ " message = json.dumps(payload)\n " ,
457+ " response = requests.post(\n " ,
458+ " WEBHOOK_URL,\n " ,
459+ " data=message,\n " ,
460+ " headers={\" Content-Type\" : \" application/json\" },\n " ,
461+ " )\n " ,
462+ " \n " ,
463+ " response.raise_for_status()\n " ,
464+ " return True\n " ,
465+ " \n " ,
466+ " except Exception as e:\n " ,
467+ " print(f\" ❌ Error submitting item: {e}\" )\n " ,
468+ " return False"
469+ ]
430470 },
431471 {
432472 "cell_type" : " code" ,
31773217 },
31783218 "nbformat" : 4 ,
31793219 "nbformat_minor" : 4
3180- }
3220+ }
0 commit comments