Skip to content

Commit

Permalink
feat:added steampipe tables
Browse files Browse the repository at this point in the history
  • Loading branch information
ArshiaBP committed Dec 10, 2024
1 parent 1d6579f commit d4cc065
Show file tree
Hide file tree
Showing 27 changed files with 867 additions and 11 deletions.
12 changes: 6 additions & 6 deletions provider/describer/blueprints.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import (
"sync"
)

func ListBluePrints(ctx context.Context, handler *RenderAPIHandler, stream *models.StreamSender) ([]models.Resource, error) {
func ListBlueprints(ctx context.Context, handler *RenderAPIHandler, stream *models.StreamSender) ([]models.Resource, error) {
var wg sync.WaitGroup
renderChan := make(chan models.Resource)
errorChan := make(chan error, 1) // Buffered channel to capture errors

go func() {
defer close(renderChan)
defer close(errorChan)
if err := processBluePrints(ctx, handler, renderChan, &wg); err != nil {
if err := processBlueprints(ctx, handler, renderChan, &wg); err != nil {
errorChan <- err // Send error to the error channel
}
wg.Wait()
Expand All @@ -45,8 +45,8 @@ func ListBluePrints(ctx context.Context, handler *RenderAPIHandler, stream *mode
}
}

func GetBluePrint(ctx context.Context, handler *RenderAPIHandler, resourceID string) (*models.Resource, error) {
blueprint, err := processBluePrint(ctx, handler, resourceID)
func GetBlueprint(ctx context.Context, handler *RenderAPIHandler, resourceID string) (*models.Resource, error) {
blueprint, err := processBlueprint(ctx, handler, resourceID)
if err != nil {
return nil, err
}
Expand All @@ -60,7 +60,7 @@ func GetBluePrint(ctx context.Context, handler *RenderAPIHandler, resourceID str
return &value, nil
}

func processBluePrints(ctx context.Context, handler *RenderAPIHandler, renderChan chan<- models.Resource, wg *sync.WaitGroup) error {
func processBlueprints(ctx context.Context, handler *RenderAPIHandler, renderChan chan<- models.Resource, wg *sync.WaitGroup) error {
var blueprints []model.BlueprintDescription
var blueprintListResponse []model.BlueprintResponse
var resp *http.Response
Expand Down Expand Up @@ -125,7 +125,7 @@ func processBluePrints(ctx context.Context, handler *RenderAPIHandler, renderCha
return nil
}

func processBluePrint(ctx context.Context, handler *RenderAPIHandler, resourceID string) (*model.ProjectDescription, error) {
func processBlueprint(ctx context.Context, handler *RenderAPIHandler, resourceID string) (*model.ProjectDescription, error) {
var project model.ProjectDescription
var resp *http.Response
baseURL := "https://api.render.com/v1/blueprints/"
Expand Down
80 changes: 75 additions & 5 deletions provider/resource_types/resource-types.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,79 @@
[
{
"ResourceName": "AWS::Redshift::Snapshot",
"ListDescriber": "ParallelDescribeRegional(describer.RedshiftSnapshot)",
"GetDescriber": "ParallelDescribeRegionalSingleResource(describer.GetRedshiftSnapshot)",
"SteampipeTable": "aws_redshift_snapshot",
"Model": "RedshiftSnapshot"
"ResourceName": "Render/Blueprint",
"ListDescriber": "DescribeListByRender(describer.ListBlueprints)",
"GetDescriber": "DescribeSingleByRender(describer.GetBlueprint)",
"SteampipeTable": "render_blueprint",
"Model": "Blueprint"
},
{
"ResourceName": "Render/Deploy",
"ListDescriber": "DescribeListByRender(describer.ListDeploys)",
"GetDescriber": "DescribeSingleByRender(describer.GetDeploy)",
"SteampipeTable": "render_deploy",
"Model": "Deploy"
},
{
"ResourceName": "Render/Disk",
"ListDescriber": "DescribeListByRender(describer.ListDisks)",
"GetDescriber": "DescribeSingleByRender(describer.GetDisk)",
"SteampipeTable": "render_disk",
"Model": "Disk"
},
{
"ResourceName": "Render/EnvGroup",
"ListDescriber": "DescribeListByRender(describer.ListEnvGroups)",
"GetDescriber": "DescribeSingleByRender(describer.GetEnvGroup)",
"SteampipeTable": "render_env_group",
"Model": "EnvGroup"
},
{
"ResourceName": "Render/Environment",
"ListDescriber": "DescribeListByRender(describer.ListEnvironments)",
"GetDescriber": "DescribeSingleByRender(describer.GetEnvironment)",
"SteampipeTable": "render_environment",
"Model": "Environment"
},
{
"ResourceName": "Render/Header",
"ListDescriber": "DescribeListByRender(describer.ListHeaders)",
"GetDescriber": "DescribeSingleByRender(describer.GetHeader)",
"SteampipeTable": "render_header",
"Model": "Header"
},
{
"ResourceName": "Render/Job",
"ListDescriber": "DescribeListByRender(describer.ListJobs)",
"GetDescriber": "DescribeSingleByRender(describer.GetJob)",
"SteampipeTable": "render_job",
"Model": "Job"
},
{
"ResourceName": "Render/PostgresInstance",
"ListDescriber": "DescribeListByRender(describer.ListPostgresInstances)",
"GetDescriber": "DescribeSingleByRender(describer.GetPostgresInstance)",
"SteampipeTable": "render_postgres_instance",
"Model": "Postgres"
},
{
"ResourceName": "Render/Project",
"ListDescriber": "DescribeListByRender(describer.ListProjects)",
"GetDescriber": "DescribeSingleByRender(describer.GetProject)",
"SteampipeTable": "render_project",
"Model": "Project"
},
{
"ResourceName": "Render/Route",
"ListDescriber": "DescribeListByRender(describer.ListRoutes)",
"GetDescriber": "DescribeSingleByRender(describer.GetRoute)",
"SteampipeTable": "render_route",
"Model": "Route"
},
{
"ResourceName": "Render/Service",
"ListDescriber": "DescribeListByRender(describer.ListServices)",
"GetDescriber": "DescribeSingleByRender(describer.GetService)",
"SteampipeTable": "render_service",
"Model": "Service"
}
]
8 changes: 8 additions & 0 deletions steampipe-plugin-render/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Questions
url: https://turbot.com/community/join
about: GitHub issues in this repository are only intended for bug reports and feature requests. Other issues will be closed. Please ask and answer questions through the Steampipe Slack community.
- name: Steampipe CLI Bug Reports and Feature Requests
url: https://github.com/turbot/steampipe/issues/new/choose
about: Steampipe CLI has its own codebase. Bug reports and feature requests for those pieces of functionality should be directed to that repository.
18 changes: 18 additions & 0 deletions steampipe-plugin-render/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
pull-request-branch-name:
separator: "-"
assignees:
- "misraved"
- "madhushreeray30"
labels:
- "dependencies"
12 changes: 12 additions & 0 deletions steampipe-plugin-render/.github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- main
pull_request:

jobs:
golangci_lint_workflow:
uses: turbot/steampipe-workflows/.github/workflows/golangci-lint.yml@main
13 changes: 13 additions & 0 deletions steampipe-plugin-render/.github/workflows/registry-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build and Deploy OCI Image

on:
push:
tags:
- 'v*'

jobs:
registry_publish_workflow_ghcr:
uses: turbot/steampipe-workflows/.github/workflows/registry-publish-ghcr.yml@main
secrets: inherit
with:
releaseTimeout: 60m
17 changes: 17 additions & 0 deletions steampipe-plugin-render/.github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Stale Issues and PRs
on:
schedule:
- cron: "30 23 * * *"
workflow_dispatch:
inputs:
dryRun:
description: Set to true for a dry run
required: false
default: "false"
type: string

jobs:
stale_workflow:
uses: turbot/steampipe-workflows/.github/workflows/stale.yml@main
with:
dryRun: ${{ github.event.inputs.dryRun }}
12 changes: 12 additions & 0 deletions steampipe-plugin-render/.github/workflows/steampipe-anywhere.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Release Steampipe Anywhere Components

on:
push:
tags:
- 'v*'


jobs:
anywhere_publish_workflow:
uses: turbot/steampipe-workflows/.github/workflows/steampipe-anywhere.yml@main
secrets: inherit
9 changes: 9 additions & 0 deletions steampipe-plugin-render/.github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Sync Labels
on:
schedule:
- cron: "30 22 * * 1"
workflow_dispatch:

jobs:
sync_labels_workflow:
uses: turbot/steampipe-workflows/.github/workflows/sync-labels.yml@main
19 changes: 19 additions & 0 deletions steampipe-plugin-render/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Editor cache and lock files
*.swp
*.swo

# 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/
37 changes: 37 additions & 0 deletions steampipe-plugin-render/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
- GO111MODULE=on
- GOPRIVATE=github.com/turbot
goos:
- linux
- darwin

goarch:
- amd64
- arm64

id: "steampipe"
binary: "{{ .ProjectName }}.plugin"
flags:
- -tags=netgo

archives:
- format: gz
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}"
files:
- none*
checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
algorithm: sha256
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
Loading

0 comments on commit d4cc065

Please sign in to comment.