Skip to content

Commit 9bb8661

Browse files
Update libhoclient with Restart method
1 parent 90bdf29 commit 9bb8661

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

frontend/src/libhoclient/fake_host_orchestrator_client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ func (c *FakeHostOrchestratorClient) Powerwash(groupName, instanceName string) e
132132

133133
func (c *FakeHostOrchestratorClient) Stop(groupName, instanceName string) error { return nil }
134134

135+
func (c *FakeHostOrchestratorClient) Restart(groupName, instanceName string) error { return nil }
136+
135137
func (c *FakeHostOrchestratorClient) Start(groupName, instanceName string, req *hoapi.StartCVDRequest) error {
136138
return nil
137139
}

frontend/src/libhoclient/host_orchestrator_client.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ type InstanceOperationsClient interface {
136136
Powerwash(groupName, instanceName string) error
137137
// Stop the device.
138138
Stop(groupName, instanceName string) error
139+
// Restart the device.
140+
Restart(groupName, instanceName string) error
139141
// Press power button.
140142
Powerbtn(groupName, instanceName string) error
141143
// Start the device.
@@ -489,6 +491,12 @@ func (c *HostOrchestratorClientImpl) Stop(groupName, instanceName string) error
489491
return c.doEmptyResponseRequest(rb)
490492
}
491493

494+
func (c *HostOrchestratorClientImpl) Restart(groupName, instanceName string) error {
495+
path := fmt.Sprintf("/cvds/%s/%s/:restart", groupName, instanceName)
496+
rb := c.HTTPHelper.NewPostRequest(path, nil)
497+
return c.doEmptyResponseRequest(rb)
498+
}
499+
492500
func (c *HostOrchestratorClientImpl) Start(groupName, instanceName string, req *hoapi.StartCVDRequest) error {
493501
path := fmt.Sprintf("/cvds/%s/%s/:start", groupName, instanceName)
494502
rb := c.HTTPHelper.NewPostRequest(path, req)

0 commit comments

Comments
 (0)