-
Notifications
You must be signed in to change notification settings - Fork 37
Create database route, endpoint and service #288
Conversation
ffd2bbb
to
736e9a5
Compare
736e9a5
to
949a8dc
Compare
UpdateUpon @alex-kovoy 's suggestion, the type and protocol fields are now combined. If {
name: 'aurora',
desc: 'PostgreSQL 11.6: AWS Aurora ',
protocol: 'postgres',
type: 'rds',
uri: 'postgres-aurora-instance-1.c1xpjrob56xs.us-west-1.rds.amazonaws.com:5432',
labels: [
{ name: 'cluster', value: 'root' },
{ name: 'env', value: 'aws' },
],
} it will return: {
name: 'aurora',
desc: 'PostgreSQL 11.6: AWS Aurora ',
type: 'RDS/PostgreSQL',
uri: 'postgres-aurora-instance-1.c1xpjrob56xs.us-west-1.rds.amazonaws.com:5432',
tags: ['cluster: root', 'env: aws']
} Screenshot of new table |
@rudream @kimlisa I think combining type/protocol is a good idea. A couple of suggestions:
|
@rudream @kimlisa Also, didn't we agree not to include the database endpoint (URI) in the table? I don't think it has much value for the user - e.g. Instead, we should have a Connect button on the very right of each row which would bring up a dialog with instructions for a user how to connect to the database. |
UpdateAfter implementing @r0mant 's suggestions: The If {
name: 'aurora',
desc: 'PostgreSQL 11.6: AWS Aurora ',
protocol: 'postgres',
type: 'rds',
uri: 'postgres-aurora-instance-1.c1xpjrob56xs.us-west-1.rds.amazonaws.com:5432',
labels: [
{ name: 'cluster', value: 'root' },
{ name: 'env', value: 'aws' },
],
} it will return: {
name: 'aurora',
desc: 'PostgreSQL 11.6: AWS Aurora ',
type: 'RDS PostgreSQL',
uri: 'postgres-aurora-instance-1.c1xpjrob56xs.us-west-1.rds.amazonaws.com:5432',
tags: ['cluster: root', 'env: aws']
} Screenshot of new table |
UpdateAfter removing the If {
name: 'aurora',
desc: 'PostgreSQL 11.6: AWS Aurora ',
protocol: 'postgres',
type: 'rds',
uri: 'postgres-aurora-instance-1.c1xpjrob56xs.us-west-1.rds.amazonaws.com:5432',
labels: [
{ name: 'cluster', value: 'root' },
{ name: 'env', value: 'aws' },
],
} it will return: {
name: 'aurora',
desc: 'PostgreSQL 11.6: AWS Aurora ',
type: 'RDS PostgreSQL',
tags: ['cluster: root', 'env: aws']
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small nit: rename services/database/
to services/databases/
and you're good to go!
Purpose
This PR resolves #271
Create a route and endpoint to for fetching databases. Process the response so that all fields are properly set up and formatted for front-end displaying and searching.
Implementation
Define an api endpoint in
config.ts
to be used by our database service for fetching databases for a given:clusterId
. CreatemakeDatabase.ts
to process the response data such that:labels
field defaults to an empty array[]
[{name: value}]
are turned to["name: value"]
Call this
makeDatabase()
to process the response when fetching databases in the database service.The route and route getter I defined in
config.ts
will be used in the next issue when registering the feature.Demo
If
makeDatabase()
is given the following data:it will return: