Add ability to remove virtual-machine
This commit is contained in:
parent
cdbabd262a
commit
e6298e598a
2 changed files with 20 additions and 0 deletions
2
.gitconfig
Normal file
2
.gitconfig
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
[core]
|
||||||
|
sshCommand = "/usr/bin/ssh"
|
|
@ -194,3 +194,21 @@ func (s *VirtualMachinesService) Create(ctx context.Context, c *NewVirtualMachin
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete a virtual-machine
|
||||||
|
func (s *VirtualMachinesService) Delete(ctx context.Context, i string) error {
|
||||||
|
var err error
|
||||||
|
var req *http.Request
|
||||||
|
|
||||||
|
req, err = s.client.newRequest(ctx, "DELETE", virtualMachinesPath+"/"+i+"/", "", nil)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to create request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.client.do(req, nil)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to do request: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue