Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial plugin suggestions #4

Open
LalitLab opened this issue Feb 4, 2022 · 1 comment
Open

Initial plugin suggestions #4

LalitLab opened this issue Feb 4, 2022 · 1 comment

Comments

@LalitLab
Copy link

LalitLab commented Feb 4, 2022

Thanks, @SvenTo for the Cloud Foundry plugin! I took a look today and left some suggestions/questions below, please let me know if you have any questions on them.

  1. We would love to change the repo name + plugin name from cf to cloudfoundry to remove any ambiguity around what cf is
    Tables names too perhaps, e.g. table_cf_org_v2 to table_cloudfoundry_org_v2
    Also, we should make the respective changes everywhere in the plugin

  2. Plugin config filesteampipe-plugin-cf/config/cf.spc to steampipe-plugin-cf/config/cloudfoundry.spc
    could you please update plugin to svento/cf instead of hub.steampipe.io/plugins/svento/cf@latest

    cloudfoundary.spc
      connection "cloudfoundary" {
        plugin = "svento/cloudfoundary"
      
        # You may connect to the Cloud Foundry API using more than one option:
        #
        # 1. Empty configuration: The plugin is using the access token from the
        # cf CLI configuration file (typically ``~/.cf/config.json``) in default.
        #
        # Run ``cf login`` before Steampipe to get an access token for the plugin.
      
        # 2. Credentials from the config.json in the directory specified by the ``cf_home_dir`` parameter.
        # cf_home_dir         = "/path/to/my/cf/home/directory"
      
        # 3. Use credentials explicitly set in a Steampipe config file by setting the option:
        # api_url = "https://api.cf.example.com"
        # 
        # and either one of the following authentication mechanisms:
        # 
        # 3.1. with username and password:
        # user = "user@example.com"
        # password = "example"
      
        # 3.2. with client_id / client_secret:
        # client_id = "myclientid"
        # client_secret = "38df0e66e4904a75ac951720e4b9df02"
      
        # 3.3. auth_token:
        # auth_token = "ey[...]"
      
        # Misc options:
        # skip_ssl_validation = false
        # user_agent = "Steampipe"
      }
    
  3. Tables
    Steampipe Table & Column Standards

    • The descriptions should start with a capital letter, and end with a period.
    • Formatting of columns in the table should be either of the below formats. It seems like both formats are used in the tables(For instance in cf_app).
      The above does not affect the plugin functionality, just helps in the standardization of the code.
    {
     Name:        "guid",
     Type:        proto.ColumnType_STRING,
     Description: "Unique identifier for the organization.",
     Transform:   transform.FromField("Guid"),
    }
    

    OR

     {Name: "guid", Type: proto.ColumnType_STRING, Description: "Unique identifier for the organization.", Transform: transform.FromField("Guid")},
    
  4. Docs

    • The ### Explicit credentials in Steampipe config file in index.md should match the cloudfoundry.spc exactly.
    • Table docs, like for cf_buildpack_v2, cf_info_v2, cf_private_domain_v2, cf_security_group_v2, and cf_shared_domain_v2 are light on examples. Can you please add a few more so each table doc has at least 3-4 examples? These really help users get started and jump right into using your plugin. Writing Example Queries
    • For the doc filenames, we strongly encourage plugins to keep these consistent with the table names, so for table docs, can you please rename these to match the updated table names, e.g., cloudfoundry_org_v3.md, cloudfoundry_app_v3.md
  5. Readme.md
    If you could also update ## Quick start section to install plugin from steampipe hub

## Quick start

Install the plugin with [Steampipe](https://steampipe.io):

```shell
steampipe plugin install svento/cloudfoundry
```
Run a query:

```sql
select
  a.name,
  a.state,
  s.name as space_name,
  o.name as org_name
from
  cf_app as a,
  cf_space as s,
  cf_org as o
where
  s.org_guid = o.guid and
  a.space_guid = s.guid;
```
@cbruno10
Copy link

cbruno10 commented Feb 4, 2022

Hey @SvenTo , to expand on a few points by @LalitTurbot above:

  • We generally follow the Terraform provider's naming standards for plugin, tables, columns, etc., (with some exceptions), so that's the basis for expanding instances of cf to cloudfoundry.
  • For the doc filenames, we strongly encourage plugins to keep these consistent with the table filenames, so for table docs, can you please rename these to match the updated table names, e.g., cloudfoundry_org_v3.md, cloudfoundry_app_v3.md?
  • In the config file, can you please align the equal signs for consecutive lines, which matches Terraform's HCL style conventions , e.g.,
  connection "cloudfoundary" {
    plugin = "svento/cloudfoundary"
  
    # You may connect to the Cloud Foundry API using more than one option:
    #
    # 1. Empty configuration: The plugin is using the access token from the
    # cf CLI configuration file (typically ``~/.cf/config.json``) in default.
    #
    # Run ``cf login`` before Steampipe to get an access token for the plugin.
  
    # 2. Credentials from the config.json in the directory specified by the ``cf_home_dir`` parameter.
    # cf_home_dir = "/path/to/my/cf/home/directory"
  
    # 3. Use credentials explicitly set in a Steampipe config file by setting the option:
    # api_url = "https://api.cf.example.com"
    # 
    # and either one of the following authentication mechanisms:
    # 
    # 3.1. with username and password:
    # user          = "user@example.com"
    # password = "example"
  
    # 3.2. with client_id / client_secret:
    # client_id        = "myclientid"
    # client_secret = "38df0e66e4904a75ac951720e4b9df02"
  
    # 3.3. auth_token:
    # auth_token = "ey[...]"
  
    # Misc options:
    # skip_ssl_validation = false
    # user_agent              = "Steampipe"
  }

If you have any questions, please let us know, and thanks again for creating this plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants