mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
client: Add RepairInstance
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
This commit is contained in:
parent
593775c736
commit
99792b5556
@ -3284,6 +3284,26 @@ func (r *ProtocolIncus) CreateInstanceBitmap(name string, bitmap api.StorageVolu
|
||||
return nil
|
||||
}
|
||||
|
||||
// RepairInstance requests that Incus runs a low-level repair action on the instance.
|
||||
func (r *ProtocolIncus) RepairInstance(name string, repair api.InstanceDebugRepairPost) error {
|
||||
if !r.HasExtension("instances_debug_repair") {
|
||||
return errors.New("The server is missing the required \"instances_debug_repair\" API extension")
|
||||
}
|
||||
|
||||
path, _, err := r.instanceTypeToPath(api.InstanceTypeAny)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Send the request
|
||||
_, _, err = r.query("POST", fmt.Sprintf("%s/%s/debug/repair", path, url.PathEscape(name)), repair, "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *ProtocolIncus) getInstanceNVRAM(name string, guid string, varName string, accept string) (*http.Response, error) {
|
||||
path, _, err := r.instanceTypeToPath(api.InstanceTypeVM)
|
||||
if err != nil {
|
||||
|
||||
@ -178,6 +178,7 @@ type InstanceServer interface {
|
||||
DeleteInstanceTemplateFile(name string, templateName string) (err error)
|
||||
|
||||
GetInstanceDebugMemory(name string, format string) (rc io.ReadCloser, err error)
|
||||
RepairInstance(name string, repair api.InstanceDebugRepairPost) (err error)
|
||||
GetInstanceNVRAM(name string) (vars map[string]map[string]*api.InstanceNVRAMVariable, err error)
|
||||
GetInstanceNVRAMGUID(name string, guid string) (vars map[string]*api.InstanceNVRAMVariable, err error)
|
||||
GetRawInstanceNVRAMGUIDVar(name string, guid string, varName string) (resp []byte, err error)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user