mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-19 08:07:58 +02:00
Codex implementation of restart
This commit is contained in:
@@ -88,6 +88,18 @@ func (service *VMsService) Delete(ctx context.Context, name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (service *VMsService) Restart(ctx context.Context, name string) (*v1.VM, error) {
|
||||
var vm v1.VM
|
||||
|
||||
err := service.client.request(ctx, http.MethodPost, fmt.Sprintf("vms/%s/restart", url.PathEscape(name)),
|
||||
nil, &vm, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &vm, nil
|
||||
}
|
||||
|
||||
func (service *VMsService) PortForward(
|
||||
ctx context.Context,
|
||||
name string,
|
||||
|
||||
@@ -63,6 +63,8 @@ type VM struct {
|
||||
RestartPolicy RestartPolicy `json:"restart_policy,omitempty"`
|
||||
RestartedAt time.Time `json:"restarted_at,omitempty"`
|
||||
RestartCount uint64 `json:"restart_count,omitempty"`
|
||||
// RestartRequested indicates that the worker should restart the VM in-place.
|
||||
RestartRequested bool `json:"restart_requested,omitempty"`
|
||||
|
||||
// RandomSerial controls whether the worker will run the
|
||||
// "tart set --random-serial" when instantiating this VM.
|
||||
|
||||
Reference in New Issue
Block a user