clever-tools icon indicating copy to clipboard operation
clever-tools copied to clipboard

[Draft] Access add-on shells through clever-tools

Open RemiBardon opened this issue 4 years ago • 6 comments

To access add-ons CLIs, we currently need to use the add-on provider specific command like psql -h <redacted>-postgresql.services.clever-cloud.com -p 5432 -U <redacted> -d <redacted>.

Proposition

It could be useful to have a more generic clever command like clever shell <addon_id> (name to discuss).

Expected behaviors

  • Depending on the add-on provider (PostgreSQL, MongoDB, Redis…), the new clever command would launch the appropriate shell.
  • This command would not require a linked application. It would read ~/.config/clever-cloud to authorize the user and read necessary add-on details.
  • If appropriate commands (mysql, psql…) are not available, clever-tools would not install or bundle them, but rather display an OS-specific message explaining the user how to install it. This message would be displayed when running clever shell <addon_id> (or whatever name is chosen), not during clever-tools installation.

Related issues

  • #267

RemiBardon avatar Feb 01 '21 11:02 RemiBardon

Since the discussed command relates to add-ons exclusively (and not apps), I think it would fit best inside clever addon.

The result would be clever addon shell <addon_id> instead of clever shell <addon_id>.

RemiBardon avatar Feb 03 '21 17:02 RemiBardon

The API doesn't currently provide a way for us to fetch such informations. It's a Work In Progress but hasn't been merged yet. We'll come back to this issue when the API will be ready.

  • [ ] API ready

RemiBardon avatar Feb 08 '21 10:02 RemiBardon

Which information do you need from the API ?

waxzce avatar Feb 08 '21 10:02 waxzce

:ballot_box_with_check: I'm ok with clever addon shell <addon_id>

hsablonniere avatar Feb 08 '21 16:02 hsablonniere

Which information do you need from the API ?

At least connection details (user / password / hostname / port)

BlackYoup avatar Feb 08 '21 18:02 BlackYoup

It's on exposed env... Will be ok to use it

waxzce avatar Feb 09 '21 09:02 waxzce