pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.3k stars 613 forks source link

Allow adding/updating/removing servers via RESTful API (RM #5796) #3790

Open dpage opened 3 years ago

dpage commented 3 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/5796 Originally created by Stephan Austermühle at 2020-09-01 17:45:42 UTC.

Please consider adding a RESTful interface to pgAdmin that allows the addition, removal, and updating of Postgres server connections.

While there is a way to import/export servers and provide password files, this is a hard way when running pgAdmin in a Kubernetes cluster orchestrated and managed by Ansible. Shelling into the container and copying data into the container is not really considered best practice. REST calls would make it easy to maintain the server connections from CI/CD pipelines, too.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/5796#note-1 Originally created by Dave Page at 2020-09-02 08:10:17 UTC.

No objection to adding RESTful (well, technically they'd be REST-like I suspect) APIs for this.

However, the container will automatically load server definitions when it's instantiated, and they can be stored on a mapped file on the host. See the /pgadmin4/servers.json entry in https://www.pgadmin.org/docs/pgadmin4/4.25/container_deployment.html#mapped-files-and-directories. Maybe that will make things easier for you in the meantime?

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/5796#note-2 Originally created by Stephan Austermühle at 2020-09-02 10:09:05 UTC.

I've already reviewed /pgadmin4/servers.json but that is really of limited used in a highly dynamic environment where database instances come and go.

And, well, yes, I had REST-like in my mind.

dpage commented 3 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/5796#note-3 Originally created by Pradip Parkale at 2020-09-11 10:46:52 UTC.

Redmine ticket header update:

Name Old Value New Value
Sprint changed Ready
sumanthkumarc commented 2 months ago

This would be a very useful feature to have.