Skip to content

Latest commit

 

History

History

README.md

Setup Hooks (Python)

Demonstrates how to use setup hooks to prepare data and configuration before API execution.

Run on Intuned

Run on Intuned

APIs

API Description
demo-hook Demonstrates how setup hook data is passed to and used within an API handler

Getting started

Install dependencies

uv sync

If the intuned CLI is not installed, install it globally:

npm install -g @intuned/cli

After installing dependencies, intuned command should be available in your environment.

Run an API

intuned dev run api demo-hook .parameters/api/demo-hook/default.json

Save project

intuned dev provision

Deploy

intuned dev deploy

Project structure

/
├── api/
│   └── demo-hook.py          # Demo API showing hook data usage
├── hooks/
│   └── setup_context.py      # Main setup hook executed before API runs
├── utils/
│   └── types_and_schemas.py  # Pydantic models and type definitions
├── intuned-resources/
│   └── jobs/
│       └── demo-hook.job.jsonc  # Job definition for demo-hook API
├── .parameters/api/          # Test parameters
├── Intuned.jsonc             # Project config
├── pyproject.toml            # Python dependencies
└── README.md

Related