Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/cmd/connector/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/redhat-developer/app-services-cli/pkg/shared/connection"
"github.com/redhat-developer/app-services-cli/pkg/shared/contextutil"
"github.com/redhat-developer/app-services-cli/pkg/shared/factory"
connectormgmtclient "github.com/redhat-developer/app-services-sdk-go/connectormgmt/apiv1/client"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -69,7 +70,7 @@ func runUpdateCommand(opts *options) error {
api := conn.API()

patch := make(map[string]interface{})
patch["desired_state"] = "ready"
patch["desired_state"] = connectormgmtclient.CONNECTORDESIREDSTATE_READY
a := api.ConnectorsMgmt().ConnectorsApi.PatchConnector(f.Context, opts.connectorID).Body(patch)

response, httpRes, err := a.Execute()
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/connector/stop/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/redhat-developer/app-services-cli/pkg/shared/connection"
"github.com/redhat-developer/app-services-cli/pkg/shared/contextutil"
"github.com/redhat-developer/app-services-cli/pkg/shared/factory"
connectormgmtclient "github.com/redhat-developer/app-services-sdk-go/connectormgmt/apiv1/client"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -69,7 +70,7 @@ func runUpdateCommand(opts *options) error {
api := conn.API()

patch := make(map[string]interface{})
patch["desired_state"] = "stopped"
patch["desired_state"] = connectormgmtclient.CONNECTORDESIREDSTATE_STOPPED
a := api.ConnectorsMgmt().ConnectorsApi.PatchConnector(f.Context, opts.connectorID).Body(patch)

response, httpRes, err := a.Execute()
Expand Down
20 changes: 13 additions & 7 deletions pkg/core/localize/locales/en/cmd/connectors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ cat myconnector.json | rhoas connector update

# Delete a Connectors instance with ID c9b71ucotd37bufoamkg
rhoas connector delete --id=c9b71ucotd37bufoamkg

# Start a Connectors instance with ID c9b71ucotd37bufoamkg
rhoas connector start --id=c9b71ucotd37bufoamkg

# Start the Connectors instance in the current context
rhoas connector stop
'''

[connector.create.cmd.shortDescription]
Expand All @@ -144,32 +150,32 @@ cat myconnector.json | rhoas connector create
'''

[connector.stop.cmd.shortDescription]
one = 'Stop a Connectors instance'
one = 'Stop a connector instance'

[connector.stop.cmd.longDescription]
one = 'Stop a Connectors instance, pass an id or use the instance in the current context'
one = 'Stop a connectorc instance, pass an id or use the instance in the current context'
Comment thread
wtrocki marked this conversation as resolved.
Outdated

[connector.stop.cmd.example]
one = '''
# Stop a Connectors instance
# Stop a connector instance
rhoas connector stop

# Stop a Connectors instance
# Stop a connector instance
rhoas connector stop --id=IJD76DUH675234
'''

[connector.start.cmd.shortDescription]
one = 'Start a Connectors instance'
one = 'Start a connector instance'

[connector.start.cmd.longDescription]
one = 'Start a Connectors instance, pass an id or use the instance in the current context'

[connector.start.cmd.example]
one = '''
# Start a Connectors instance
# Start a connector instance
rhoas connector start

# Start a Connectors instance
# Start a connector instance
rhoas connector start --id=IJD76DUH675234
'''

Expand Down