Skip to content

Commit

Permalink
Adding extra information into default collection.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysrevans3 committed Sep 19, 2024
1 parent 37411c4 commit 73e520b
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions esgf-consumer/esgf_consumer/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,43 @@ async def _create_collection(
json={
"type": "Collection",
"id": collection_id,
"description": collection_id,
"stac_version": "1.0.1",
"stac_extensions": [],
"license": "",
"license": "No license",
"extent": {
"spatial": {"bbox": [[-180, -90, 180, 90]]},
"temporal": {
"interval": [["1992-01-01T00:00:00Z", "2015-12-31T00:00:00Z"]]
},
},
"links": [
{
"rel": "self",
"type": "application/geo+json",
"href": f"https://api.stac.ceda.ac.uk/collections/{collection_id}",
},
{
"rel": "parent",
"type": "application/json",
"href": "https://api.stac.ceda.ac.uk/",
},
{
"rel": "queryables",
"type": "application/json",
"href": f"https://api.stac.ceda.ac.uk/collections/{collection_id}/queryables",
},
{
"rel": "items",
"type": "application/geo+json",
"href": f"https://api.stac.ceda.ac.uk/collections/cmip6/{collection_id}",
},
{
"rel": "root",
"type": "application/json",
"href": "https://api.stac.ceda.ac.uk/",
},
],
},
)

Expand All @@ -57,5 +91,5 @@ async def _create_collection(

# TODO: Implement this correctly
create_result.raise_for_status()

raise Exception("Could not create collection")

0 comments on commit 73e520b

Please sign in to comment.