Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b1e1624
update project structure and apply some fixes
Jan 23, 2024
287c9fd
update golangci-lint version in test workflow
Jan 23, 2024
73ecab3
bump google.golang.org/grpc and golang.org/x/net
Jan 24, 2024
1399eab
add baremetal/drivers and blockstorage/snapshots
Jan 25, 2024
ecdd35d
update baremetal drivers
Jan 30, 2024
41460ea
add baremetal tables
Feb 1, 2024
4b0f3da
add blockstorage/qos
Feb 2, 2024
d7b2de7
add availabiilty zones, backups, limits and qos for blockstorage
Feb 2, 2024
26238b3
fix spec and baremetal microversion
Feb 5, 2024
1ecfa74
add blockstorage/limits
Feb 5, 2024
1881c27
add compute/images
Feb 6, 2024
fbaa606
add service info in table names
Feb 6, 2024
431c8c8
add compute/limits
Feb 6, 2024
01795ce
add compute/network
Feb 6, 2024
9d6ae8f
apply formatting
Feb 6, 2024
99a028f
add compute/secgroups and small fix on compute/limits
Feb 7, 2024
83cf966
implement spec validation and comment tables without resource
Feb 7, 2024
4af157e
fix blockstorage/limits columns types
Feb 7, 2024
ba7a3f4
use gophercloud blockstorage/limits struct
Feb 7, 2024
17c1416
add compute/tenantnetworks and compute/serverusage
Feb 8, 2024
3f3659a
add blockstorage/quotasets and blockstorage/services
Feb 9, 2024
378b61b
add blockstorage/quotasets_usage
Feb 9, 2024
3cda75e
fix blockstorage/volumes_backups and compute/limits
Feb 9, 2024
6a93f4d
update error handling
Feb 9, 2024
765f6a8
apply formatting
Feb 9, 2024
f46f3fd
add identity/domains, tenants and imageservice members
Feb 9, 2024
f832cfc
add identity/services
Feb 12, 2024
b30a03b
fix small bugs
Feb 12, 2024
19fa3ed
change endpoint names
Feb 12, 2024
ae888ed
update dependecies and apply formatting
Feb 13, 2024
89ba6cd
use tagtype from utils
Feb 13, 2024
d97acdb
add include/exclude tables in spec. With @gambu94
Feb 13, 2024
7b69d22
fix match func, add some additional tests. With @gambu94
Feb 14, 2024
7dbac8f
apply formatting
Feb 14, 2024
e411e67
chore: remove unused func, add all available tables changing the spec…
Feb 14, 2024
f87a210
new destination DB URI and minor fixes on limits to solve incremental…
Feb 22, 2024
e52ad38
chore: update deps
Feb 29, 2024
479f824
chore: revert api naming
Feb 29, 2024
357ddad
fix: image service renaming
Feb 29, 2024
3bb09fe
fix: remove x := x in for loops, reduntant with Go1.22
Feb 29, 2024
f085d76
fix: client getTables method
Feb 29, 2024
e39f4a2
update goreleaser ldflags
Feb 29, 2024
8cceeec
fix: add kind to plugin init and change to var for ldflags to work
Mar 1, 2024
90e2302
fix: remove deprecated API
Mar 1, 2024
97b1c35
fix: remove commented code and apply formatting
Mar 1, 2024
d724a46
fix: image members and instance security groups
Mar 1, 2024
292da01
add: identity groups, regions, registeredlimits and roles
Mar 1, 2024
978a353
replace internals with cq-plugin-utils lib
Mar 5, 2024
2a58b04
add identity catalog
Mar 5, 2024
640f5db
fix: identity/services and remove catalog
Mar 7, 2024
1798a29
bump to plugin-sdk v4.32.1 and gophercloud v1.11.0
Mar 7, 2024
b573d6f
add checks on input spec
Mar 7, 2024
0853ff7
add check on spec at plugin loading time
Mar 11, 2024
7ac5c76
fix: check spec endpoint is not nil
Mar 11, 2024
42122b0
chore: update cq-plugin-utils
Mar 11, 2024
6ca84bb
fix: update .gjthub ci
Mar 11, 2024
c803aa2
update .gitignore
Mar 11, 2024
c422a96
fix: prevent go doc fail when spec is empty
Mar 11, 2024
e225263
fix: change from goreleaser to makefile.
Mar 11, 2024
c5ceee3
fix: golangci-lint workflow
Mar 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.51.2
version: v1.56.2
args: --timeout=5m
skip-cache: false
- name: Get dependencies
run: go get -t -d ./...
- name: Build
Expand Down
210 changes: 210 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,213 @@
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,windows,linux,go,goland+all
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,windows,linux,go,goland+all

### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

### GoLand+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### GoLand+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,windows,linux,go,goland+all

## CUSTOM
# Binaries for programs and plugins
*.exe
*.exe~
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ builds:
- CGO_ENABLED=1
- GO111MODULE=on
ldflags:
- -s -w -X github.com/github.com/dihedron/cq-source-openstack/resources/plugin.Version={{.Version}}
- -s -w -X github.com/dihedron/cq-source-openstack/plugin/plugin.Version={{.Version}}
goos:
- windows
- linux
Expand Down
91 changes: 88 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,91 @@
.PHONY: local
local:
goreleaser build --single-target --snapshot --clean
NAME := cq-source-openstack
DESCRIPTION := CloudQuery OpenStack source plugin
KIND := source
COPYRIGHT := 2024 © Andrea Funtò
LICENSE := MIT
LICENSE_URL := https://opensource.org/license/mit/
VERSION_MAJOR := 0
VERSION_MINOR := 1
VERSION_PATCH := 0
VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
[email protected]
[email protected]
LICENSE="MIT"
RELEASE=1
PRODUCER_URL=https://github.com/dihedron/
DOWNLOAD_URL=$(PRODUCER_URL)cq-source-openstack

SHELL := /bin/bash

platforms="$$(go tool dist list)"
module := $$(grep "module .*" go.mod | sed 's/module //gi')
package := $(module)/version
now := $$(date --rfc-3339=seconds)
# comment this to disable compression; to improve compression
# consider replacing upx -9 with upx --brute (slow!)
strip := -w -s

#
# Linux x86-64 build settings
#
linux/amd64: GOAMD64 = v3

#
# Windows x86-64 build settings
#
windows/amd64: GOAMD64 = v3

.PHONY: default
default: linux/amd64;

%:
@go mod tidy
ifeq (, $(shell which govulncheck))
@go install golang.org/x/vuln/cmd/govulncheck@latest
endif
@govulncheck ./...
@for platform in "$(platforms)"; do \
if test "$(@)" = "$$platform"; then \
echo "Building target $(@)..."; \
mkdir -p dist/$(@); \
GOOS=$(shell echo $(@) | cut -d "/" -f 1) \
GOARCH=$(shell echo $(@) | cut -d "/" -f 2) \
GOAMD64=$(GOAMD64) \
CGO_ENABLED=0 \
go build -v \
-ldflags="\
$(strip) \
-X '$(package).Name=$(NAME)' \
-X '$(package).Description=$(DESCRIPTION)' \
-X '$(package).Kind=$(KIND)' \
-X '$(package).Copyright=$(COPYRIGHT)' \
-X '$(package).License=$(LICENSE)' \
-X '$(package).LicenseURL=$(LICENSE_URL)' \
-X '$(package).BuildTime=$(now)' \
-X '$(package).VersionMajor=$(VERSION_MAJOR)' \
-X '$(package).VersionMinor=$(VERSION_MINOR)' \
-X '$(package).VersionPatch=$(VERSION_PATCH)'" \
-o dist/$(@)/ .;\
echo ...done!; \
fi; \
done

.PHONY: optimise
optimise:
ifeq (, $(shell which upx))
@sudo apt install upx
endif
@for binary in `find dist/ -name 'cq-source-openstack*'`; do \
upx --brute $$binary; \
done;

.PHONY: clean
clean:
@rm -rf dist

# .PHONY: local
# local:
# goreleaser build --single-target --snapshot --clean

.PHONY: test
test:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# CloudQuery OpenStack Source Plugin

[![test](https://github.com/github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml/badge.svg)](https://github.com/github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/github.com/dihedron/cq-source-openstack)](https://goreportcard.com/report/github.com/github.com/dihedron/cq-source-openstack)
[![test](https://github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml/badge.svg)](https://github.com/dihedron/cq-source-openstack/actions/workflows/test.yaml)
[![Go Report Card](https://goreportcard.com/badge/github.com/dihedron/cq-source-openstack)](https://goreportcard.com/report/github.com/dihedron/cq-source-openstack)

A source plugin for CloudQuery that loads data from OpenStack to any database, data warehouse or data lake supported by [CloudQuery](https://www.cloudquery.io/), such as PostgreSQL, BigQuery, Athena, and many more.

OpenStack is the most widely used open source cloud platform; it powers hundreds of private clouds and some public clouds too;.
OpenStack is the most widely used open source cloud platform; it powers hundreds of private clouds and some public clouds too.

## Links

Expand Down
28 changes: 14 additions & 14 deletions _test/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
version: '3.7'
services:
cloudquery:
image: postgres:14
restart: unless-stopped
environment:
- POSTGRES_USER=cloudquery
- POSTGRES_PASSWORD=cloudquery
logging:
options:
max-size: 10m
max-file: "3"
ports:
- '5433:5432'
volumes:
- cloudquery_data:/var/lib/postgresql/data
cloudquery:
image: postgres:14
restart: unless-stopped
environment:
- POSTGRES_USER=cloudquery
- POSTGRES_PASSWORD=cloudquery
logging:
options:
max-size: 10m
max-file: "3"
ports:
- '5433:5432'
volumes:
- cloudquery_data:/var/lib/postgresql/data
volumes:
cloudquery_data:
external: false
Loading