steampipe-plugin-oapigen

command module
v0.0.0-...-f9bd827 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

    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:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package oapigen generates tables from OpenAPI documents.
Package oapigen generates tables from OpenAPI documents.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL