Skip to content

Commit

Permalink
start/stop eng
Browse files Browse the repository at this point in the history
  • Loading branch information
rsulli-rai committed Sep 13, 2023
1 parent bb851e1 commit cfb0d69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ func run(opts *Options) error {

switch rsp.State {
case "PROVISIONED":
err := client.SuspendEngine(opts.Engine)
err := client.StopEngine(opts.Engine)
if err != nil {
return err
}
case "SUSPENDED":
err := client.ResumeEngine(opts.Engine)
err := client.StartEngine(opts.Engine)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions rai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ func (c *Client) ListEngines(filters ...interface{}) ([]Engine, error) {
return result.Engines, nil
}

func (c *Client) ResumeEngine(engineName string) error {
func (c *Client) StartEngine(engineName string) error {
var result interface{}
data := &SuspendEngineRequest{Suspend: false}
uri := makePath(PathEngine, engineName)
Expand All @@ -612,7 +612,7 @@ func (c *Client) ResumeEngine(engineName string) error {
return nil
}

func (c *Client) SuspendEngine(engineName string) error {
func (c *Client) StopEngine(engineName string) error {
var result interface{}
data := &SuspendEngineRequest{Suspend: true}
uri := makePath(PathEngine, engineName)
Expand Down
4 changes: 2 additions & 2 deletions rai/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func TestEngine(t *testing.T) {
assert.Nil(t, engine)

// resume the test engine
err = client.SuspendEngine(test.engineName)
err = client.StopEngine(test.engineName)
assert.Nil(t, err)

waitOrFail := func(state string) {
Expand All @@ -244,7 +244,7 @@ func TestEngine(t *testing.T) {
assert.Equal(t, "SUSPENDED", engine.State)

// suspend the test engine
err = client.ResumeEngine(test.engineName)
err = client.StartEngine(test.engineName)
assert.Nil(t, err)

waitOrFail("PROVISIONED")
Expand Down

0 comments on commit cfb0d69

Please sign in to comment.