REST API
create_item()
Create a new item from the request body.
Returns:
| Type | Description |
|---|---|
Response
|
201 with the created item, 422 on validation error, or 500 on error. |
Source code in templates/api/handler.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
get_item(id)
Retrieve an item by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The unique identifier of the item. |
required |
Returns:
| Type | Description |
|---|---|
Response
|
200 with the item, 404 if not found, or 500 on error. |
Source code in templates/api/handler.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
main(event, context)
Lambda entry point for the API Gateway handler.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
dict
|
The API Gateway proxy event. |
required |
context
|
LambdaContext
|
The Lambda execution context. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
The API Gateway proxy response. |
Source code in templates/api/handler.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |