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

add name flag for describe connection #31

Merged
merged 2 commits into from
Aug 14, 2020
Merged

Conversation

terrancej
Copy link
Contributor

@terrancej terrancej commented Aug 14, 2020

Description of change

The change adds the ability to describe a connection by name

Fixes MEROXA-38

Type of change

  • [] New feature
  • Bug fix
  • Refactor
  • Documentation

How was this tested?

  • Unit Tests
  • Deployed to staging
  • Manually against staging (tests below)

Additional references

Any additional links (if appropriate)

➜  cli git:(describe_connection_name) ✗ ./dist/meroxa-v0.1.12-1-g62b1c2b-darwin-amd64 describe connection -n mypg-164-9270-jdbc-source
== CONNECTION ==
{
  "id": 283,
  "type": "jdbc",
  "name": "mypg-164-9270-jdbc-source",
  "config": {
    "connection.password": "abcd1234abcd1234!!",
    "connection.url": "jdbc:postgresql://tj-test.cpogugw245ge.us-east-1.rds.amazonaws.com:5432/tjdb?OpenSourceSubProtocolOverride=true\u0026defaultRowFetchSize=1000",
    "connection.user": "postgres",
    "connector.class": "io.aiven.connect.jdbc.JdbcSourceConnector",
    "incrementing.column.name": "id",
    "mode": "incrementing",
    "name": "mypg-164-9270-jdbc-source",
    "table.whitelist": "bar,foo",
    "tasks.max": "1",
    "timestamp.delay.interval.ms": "1000",
    "topic.prefix": "mypg-164-9270-"
  },
  "metadata": null,
  "streams": {
    "dynamic": false,
    "output": [
      "mypg-164-9270-bar",
      "mypg-164-9270-foo"
    ]
  },
  "state": "running"
} 
➜  cli git:(describe_connection_name) ✗ ./dist/meroxa-v0.1.12-1-g62b1c2b-darwin-amd64 describe connection -i 283       
== CONNECTION ==
{
  "id": 283,
  "type": "jdbc",
  "name": "mypg-164-9270-jdbc-source",
  "config": {
    "connection.password": "abcd1234abcd1234!!",
    "connection.url": "jdbc:postgresql://tj-test.cpogugw245ge.us-east-1.rds.amazonaws.com:5432/tjdb?OpenSourceSubProtocolOverride=true\u0026defaultRowFetchSize=1000",
    "connection.user": "postgres",
    "connector.class": "io.aiven.connect.jdbc.JdbcSourceConnector",
    "incrementing.column.name": "id",
    "mode": "incrementing",
    "name": "mypg-164-9270-jdbc-source",
    "table.whitelist": "bar,foo",
    "tasks.max": "1",
    "timestamp.delay.interval.ms": "1000",
    "topic.prefix": "mypg-164-9270-"
  },
  "metadata": null,
  "streams": {
    "dynamic": false,
    "output": [
      "mypg-164-9270-bar",
      "mypg-164-9270-foo"
    ]
  },
  "state": "running"
} 
➜  cli git:(describe_connection_name) ✗ ./dist/meroxa-v0.1.12-1-g62b1c2b-darwin-amd64 describe connection -i 283 -n mypg-164-9270-jdbc-source
INFO: Only 1 flag can be set
Usage:
  meroxa describe connection [flags]

Flags:
  -h, --help          help for connection
  -i, --id int        connection id (default -1)
  -n, --name string   connection name
➜  cli git:(describe_connection_name) ✗ 

@ahmeroxa
Copy link
Member

ahmeroxa commented Aug 14, 2020

I think by default it should expect a name and support providing an ID via a flag, to be consistent with the describe resource command.

@terrancej terrancej merged commit 54cdaff into master Aug 14, 2020
@terrancej terrancej deleted the describe_connection_name branch August 14, 2020 22:25
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

Successfully merging this pull request may close these issues.

2 participants