Skip to content

Connectors start stop#1633

Merged
wtrocki merged 3 commits intoconnectors-v2from
connectors-start-stop
Jul 11, 2022
Merged

Connectors start stop#1633
wtrocki merged 3 commits intoconnectors-v2from
connectors-start-stop

Conversation

@jackdelahunt
Copy link
Contributor

This pr adds two new commads for connectors, start and stop. Use to toggle connector instance on and off.

Verification Steps

Create any connector instance and make sure it is working and in the ready state.

  1. run rhoas context set-connector to set that connector to the current connector in the context
  2. run rhoas connector stop then check in the UI if the state of the connector is stopped
  3. run rhoas connector start then check in the UI if the state of the connector is started again
  4. if you have multiple connectors try use rhoas connector start/stop --id=... to toggle the state of any connector without using context

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

@jackdelahunt jackdelahunt changed the base branch from main to connectors-v2 July 11, 2022 11:43
@jackdelahunt jackdelahunt force-pushed the connectors-start-stop branch 2 times, most recently from 471fa00 to 6db32ad Compare July 11, 2022 12:01
@jackdelahunt jackdelahunt requested a review from wtrocki July 11, 2022 12:05
api := conn.API()

patch := make(map[string]interface{})
patch["desired_state"] = "ready"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace ready with SDK enum

api := conn.API()

patch := make(map[string]interface{})
patch["desired_state"] = "stopped"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace "stopped" with enum from SDK

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried looking for this and just can't find it not saying it doesn't exist just not sure how to effectively to search for it.

Copy link
Collaborator

@wtrocki wtrocki Jul 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is big issue for SDKs visibility. If we cannot effectively discover types in editor others would have the same problem with our sdks :(

See this: https://github.com/redhat-developer/app-services-sdk-go/blob/main/connectormgmt/apiv1/client/docs/ConnectorDesiredState.md

There is example how to use it etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay thats fine, the string for each field in the bosy of the request doesn't seem to be anywhere either so might just need to hard code "desired_state"...

Copy link
Collaborator

@wtrocki wtrocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor docs issues and constants to change. Otherwise looks good

@wtrocki wtrocki merged commit 7543b41 into connectors-v2 Jul 11, 2022
@wtrocki wtrocki deleted the connectors-start-stop branch July 11, 2022 20:11
wtrocki pushed a commit that referenced this pull request Jul 18, 2022
wtrocki pushed a commit that referenced this pull request Jul 18, 2022
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