OpenAPI -> [generate tables + generate requests]
+
Steampipe
Use OpenAPI definitions to generate Steampipe SQL tables.
- Get started →
- Documentation: Table definitions & examples
- Community: Join #steampipe on Slack →
- Get involved: Issues
Download and install the latest OAPIGen plugin:
steampipe plugin install oapigen
Configure your config file to include directories with OAPIGen definition files.
connection "oapigen" {
plugin = "oapigen"
# Documents refers to the OpenAPI definition(s) being used.
documents = ["some/path/to/openapi-definition.yaml"]
# Version of OpenAPI spec being used.
Version = 3
# Prefix is the prefix for the defined paths.
prefix = "http://127.0.0.1:1234"
}
Run steampipe:
steampipe query
TODO: include a petstore yaml file.
Query all the pets available from the petstore api:
select
pet_id,
pet_name,
pet_type
from
oapigen_petstore_pets;
+--------+-----------------+-----------+
| pet_id | pet_name | pet_type |
+--------+-----------------+-----------+
| 1 | Fido | dog |
| 2 | Fluffy | cat |
+--------+-----------------+-----------+
Prerequisites:
Clone:
git clone https://github.com/lyda/steampipe-plugin-oapigen.git
cd steampipe-plugin-oapigen
Build, which automatically installs the new version to your ~/.steampipe/plugins
directory:
make
Configure the plugin:
cp config/* ~/.steampipe/config
vi ~/.steampipe/config/oapigen.spc
Try it!
steampipe query
> .inspect oapigen
Further reading:
Please see the contribution guidelines and our code of conduct. All contributions are subject to the Apache 2.0 open source license.
help wanted
issues: