turbot/bitbucket
steampipe plugin install bitbucket

Bitbucket + Steampipe

Bitbucket is a Git-based source code repository hosting service owned by Atlassian.

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

For example:

select
name,
uuid,
is_private,
full_name
from
bitbucket_my_repository;
+----------------------------+----------------------------------------+------------+--------------------------------------+
| name | uuid | is_private | full_name |
+----------------------------+----------------------------------------+------------+--------------------------------------+
| steampipe-plugin-bitbucket | {71624341-8873-4128-a356-f48c57c917e0} | true | LalitFort/steampipe-plugin-bitbucket |
| repo2 | {00ce5566-eba1-4a15-986d-85cc40f6b835} | true | LalitFort/repo2 |
+----------------------------+----------------------------------------+------------+--------------------------------------+

Documentation

Get started

Install

Download and install the latest Bitbucket plugin:

steampipe plugin install bitbucket

Credentials

ItemDescription
CredentialsBitbucket requires an app password.
PermissionsYou must create app password with the following scopes:
    - account:read
    - issue:read
    - pullrequest:read
    - repository:read
    - snippet:read
    - webhook:read
    - wiki:read
    - workspace:read

Configuration

Installing the latest bitbucket plugin will create a config file (~/.steampipe/config/bitbucket.spc) with a single connection named bitbucket:

connection "bitbucket" {
plugin = "bitbucket"
# Bitbucket username.
# Can also be set with the BITBUCKET_USERNAME environment variable.
# username = "MyUsername"
# Bitbucket app password, which can be created at https://bitbucket.org/account/settings/app-passwords/.
# Can also be set with the BITBUCKET_PASSWORD environment variable.
# password = "blHdmvlkFakeToken"
# Base URL of your Bitbucket Server.
# Defaults to "https://api.bitbucket.org/2.0".
# Can also be set with the BITBUCKET_API_BASE_URL environment variable.
# base_url = "https://api.bitbucket.org/2.0"
}

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- bitbucket

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_bitbucket;
CREATE SERVER steampipe_bitbucket FOREIGN DATA WRAPPER steampipe_postgres_bitbucket OPTIONS (config '<your_config>');
CREATE SCHEMA bitbucket;
IMPORT FOREIGN SCHEMA bitbucket FROM SERVER steampipe_bitbucket INTO bitbucket;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- bitbucket

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_bitbucket function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_bitbucket.so
sqlite> select steampipe_configure_bitbucket('<your_config>');

Export

This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- bitbucket

You can pass the configuration to the command with the --config argument:

steampipe_export_bitbucket --config '<your_config>' <table_name>