Giter Site home page Giter Site logo

ajmaradiaga / steampipe-plugin-btp Goto Github PK

View Code? Open in Web Editor NEW
7.0 6.0 1.0 3.69 MB

Steampipe plugin to access SAP Business Technology Platform

License: Apache License 2.0

Makefile 0.24% Go 93.11% PLSQL 6.65%
api btp sap sql postgresql postgresql-fdw steampipe steampipe-plugin

steampipe-plugin-btp's People

Contributors

ajmaradiaga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

8to5

steampipe-plugin-btp's Issues

Initial suggestions for plugin release. Continue on issue #1

Hey @ajmaradiaga Few things that we are missing out on this plugin are listed out, can you please work on them and then we can get it on the hub as soon as possible :

  1. Can you remove the //Endpoints and //username comments as the variables are good enough to understand >
  2. Why have we kept the required : false in access_token? Is it not a required parameter? >
  3. Does this fetch a single result ? >
    func getGlobalAccount(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) {
    why do we have a get call in a list config?. Since you are streamlisting I believe this gives all teh global accounts, so can you please rename it to listGlobalAccounts
  4. Instead of using * can you please mention the important columns>
  1. I don't think we need the connection name to be mentioned here just the table name (btp_accounts_directory) would be good as the connection name may vary depending on the number of connections someone is using >
  1. I think we can have 1-2 more example queries for the table btp_accounts_global_account like eg : List the global accounts create din the last 7 days, List the consumption-based global accounts, List all suspended global accounts, etc.
  2. What does the distinct do here is it only on the parent_guid? If so then we should put it in the second column, But why do we need it? >
  3. Please remove this extra line >
  4. We do not need an alias when we have only one table with no joins >
  1. Why do we need the distinct here? Again can you please write it in the next line as distinct business_category ->> 'id' as bc_id if the distinct is needed. >
  2. Please change the WHERE to lower case >
  3. Is the query output correct? The created_date and modified_date is not in date format >
  1. The credential section should have all 4 > Credentials, Permissions, Radius, Resolution.>
    | Item | Description |
  2. The get involved section should contain - Community: Join #steampipe on Slack โ†’ as well >
    ## Get involved
  3. The install command is incorrect it should be > steampipe plugin install ajmaradiaga/btp
  1. The community link is missing after documentation - Community: Slack Channel > https://github.com/ajmaradiaga/steampipe-plugin-btp/blob/316ef2c211838a9d58ce9fcbde038b59e2c10042/README.md?plain=1#L6C1-L6C1

Please reach out to us in case of any don't, thanks!

Initial suggestions for plugin release

Thanks @ajmaradiaga for this new plugin. Great work ๐ŸŽ‰ !!

The basic structure looks good so far. While using the plugin, we did come up with a few suggestions based on our best practices:

config/btp.spc

  • We should have a single file named btp.spc under the config folder that will contain a basic connection for the plugin (see namecheap plugin for reference)
  • Could you please update the btp.spc file to follow the format of the namecheap plugin
  • Can you mention which of these parameters are required and which are optional as done in the namecheap plugin
  • We should mention values for all the config arguments however commented out and the values should be in the format of the actual values (however incorrect)
  • We should also add details to set these parameters via the environment variable (if any)

docs/tables/*

  • We should have a folder called docs under which we will have a single file called index.md (reference) and individual table docs for each table
  • The table docs should be named as eg > btp_datacenter.md (note: The table names should be singular)
  • Each table doc should have the following parts >
    • A heading in the format > # Table: btp_datacenter
    • A description of the table
    • A number of queries which will have the title followed by the query (Note: We do not include the query outputs in the docs)

docs/index.md

btp/*

  • Please add the configuration for setting the config arguments via the environment variable
  • The table file names should be in singular and in snake_case for example : table_btp_accounts_directories.go
  • The table file name should be in sync with the table name in the code
  • It is better to print the type of error when we encounter any like connection_error or api_error for easier debugging if needed

btp/table_btp_datacenter

  • The name of the file should be table_btp_datacenter.go
  • The function name should be tableBTPDatacenter
  • The name of the table should be btp_datacenter
  • The column descriptions should end with a .
  • The geo_access column does not have a description we should add it
  • It is better to use d.EqualsQualString["region"] instead of equalQuals["region"].GetStringValue()

btp/table_btp_directory

  • The name of the file should be table_btp_directory.go
  • The function name should be tableBTPDirectory
  • The name of the table should be btp_directory
  • The column descriptions should end with a .
  • The directory_type and parent_guid1 columns do not have a description we should add it
  • It is better to use d.EqualsQualString["region"] instead of equalQuals["region"].GetStringValue()

btp/table_btp_global_account

  • The name of the file should be table_btp_global_account.go
  • The name of the table should be btp_global_account
  • The name of the list call should be listGlobalAccounts
  • The column descriptions should end with a .

btp/table_btp_subaccount

  • The name of the file should be table_btp_subaccount.go
  • The name of the table should be btp_subaccount
  • The name of the list call should be listSubaccounts
  • The column descriptions should end with a .
  • The parent_type column does not have a description we should add it

btp/plugin.go

  • The list of tables should be sorted in ascending order

btp/utils.go

  • Please rename the btp.go file to utils.go

bt/types.go

  • Rename to types.go

README.md

  • Please update the file to follow the format of the namecheap plugin
  • Please include all the necessary sections as mentioned above

CHANGELOG.md

  • Please draft an initial Changelog for the plugin release, an example would be as follows:
## v0.0.1 [TBD]

_What's new?_

- New tables added
  - [btp_datacenter](https://github.com/ajmaradiaga/steampipe-plugin-btp/blob/main/btp/table_btp_datacenter.go)
  - [btp_directory](https://github.com/ajmaradiaga/steampipe-plugin-btp/blob/main/btp/table_btp_directory.go)
  - [btp_global_account](https://github.com/ajmaradiaga/steampipe-plugin-btp/blob/main/btp/table_btp_global_account.go)
  - [btp_subaccount](https://github.com/ajmaradiaga/steampipe-plugin-btp/blob/main/btp/table_btp_subaccount.go)

Please note that the example contains the name in singular assuming that the changelog will be added after updating the table names.

Makefile

  • The path is incorrect please update it to
go build -o ~/.steampipe/plugins/hub.steampipe.io/plugins/ajmaradiaga/btp@latest/teampipe-plugin-btp.plugin *.go

Follow-up questions

  • A couple of follow-up questions:
    • How are we handling the resource not found errors?
    • Do the APIs support pagination? I did not find any reference to it, but I want to make sure that we have checked that box before releasing it.
    • While working with the APIs did you encounter rate limit errors?
    • Please refer to https://steampipe.io/docs/develop/plugin-release-checklist#data-ingestion for more information

Please let us know if you have questions, happy to help ๐Ÿ‘

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.