# How to issue requests to HSDS Lambda?

**URL:** <https://forum.hdfgroup.org/t/how-to-issue-requests-to-hsds-lambda/10136>\
**Category:** HSDS\
**Created:** [August 24, 2022, 9:45pm UTC](https://forum.hdfgroup.org/t/how-to-issue-requests-to-hsds-lambda/10136 "2022-08-24T21:45:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jreadey](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/jreadey/32/870_2.png) [@jreadey](https://forum.hdfgroup.org/u/jreadey)\
**Post date:** [August 26, 2022, 12:01am UTC](https://forum.hdfgroup.org/t/how-to-issue-requests-to-hsds-lambda/10136/2 "2022-08-26T00:01:52Z")

</div>

Hi, thanks for trying out HSDS lambda functions!

For the lambda event, you’ll need to provide a JSON that will tell the code how to fetch the data. The structure is basically what’s documented here: [https://github.com/HDFGroup/hdf-rest-api](https://github.com/HDFGroup/hdf-rest-api) wrapped up in a json with keys: “method”, “path”, and “params”. (the example in the docs are using an out-dated format that had “request” instead of “path”).

method will be: “GET”, “POST”, “PUT”, or “DELETE”. (the standard http actions)  
path: is just the http path (i.e. the part after the service endpoint)  
params: are the query parameters for the request

Also you can have a “body” key (for POST requests), and a “headers” key for any http headers (typically you don’t need this).

In the AWS Management Console for Lambda, it’s convenient to setup some test events like this one:

```
  {
      "method": "GET",
      "path": "/datasets/d-d29fda32-85f3-11e7-bf89-0242ac110008/value",
      "params": {
        "domain": "/nrel/wtk-us.h5",
        "select": "[:5000,620,1401]",
        "bucket": "nrel-pds-hsds"
      }
    }

```

With these you should get an output equivalent to the following h5pyd code:

```
f = h5pyd.File("/nrel/wtk-us.h5", bucket="nrel-pds-hsds")
dset = f["windspeed_80m"]
data = dset[0:100,620,1401]
print(data)

```

Let me know if that works for you.

In your example, I’m guessing that lambda code isn’t able to find any relevant data. It should return a 404 (not found) or 403 (unauthorized), but instead is just returning the /about response. I’ll look into this.

---

_[View the full topic](https://forum.hdfgroup.org/t/how-to-issue-requests-to-hsds-lambda/10136)._
