Skip to content

Latest commit

 

History

History
118 lines (83 loc) · 2.81 KB

README.md

File metadata and controls

118 lines (83 loc) · 2.81 KB
    OpenAPI -> [generate tables + generate requests]
                        +
    Steampipe

OAPIGen Plugin for Steampipe

Use OpenAPI definitions to generate Steampipe SQL tables.

Quick start

Install

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       |
+--------+-----------------+-----------+

Developing

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:

Contributing

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: