stac-extensions / order

Allows assets ordering management within STAC specification.
Apache License 2.0
8 stars 1 forks source link

Order link and result example #9

Open lhcorralo opened 2 years ago

lhcorralo commented 2 years ago

Hi!

Reading the documentation, it says that the link to order an item will be in the links section, with rel=order (well, at least I interpret it). I would consider adding also a proposal for the link.

I know that STAC is using HATEOAS, so the specification at the moment is good ("if rel=order, just shut up and follow that link"), but adding an standard link format would help to implementers.

The href could go like this:

POST http://<server>/<api_url>/collections/<collection_id>/items/<item_id>/order

The example is based in the current hierarchy of collections and items, adding another level, and supposing that an order can retrieve a single item. In addition, I think POST is the appropriate method, as sometimes ordering allows, for example, to provide a notification email.

The result of calling to the order link could be also added as part of the order extension. I guess it could be something like this:

{
  "id": "1234-5678-901234567890",
  "links": [
    {
      "rel": "cancel",
      "href": "http://<server>/<api_url>/collections/<collection_id>/items/<item_id>/order/1234-5678-901234567890"
    }
  ]
}

Following the above definition, cancelling an order would be done by calling.

DELETE http://<server>/<api_url>/collections/<collection_id>/items/<item_id>/order/<order_id>

Thanks!

Luis

christophenoel commented 1 month ago

The URL syntax depends on the implementation of the ordering API. Therefore, in my view, these details do not fall under the scope of this STAC extension, but it seems like a good idea to propose a STAC API extension for ordering.