Add ability to remove interfaces
This commit is contained in:
parent
2bd3658b60
commit
170fde8a31
1 changed files with 18 additions and 0 deletions
|
@ -268,3 +268,21 @@ func (s *InterfacesService) Create(ctx context.Context, c *NewInterface) (*Inter
|
||||||
|
|
||||||
return &nic, nil
|
return &nic, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete a interface
|
||||||
|
func (s *InterfacesService) Delete(ctx context.Context, i string) error {
|
||||||
|
var err error
|
||||||
|
var req *http.Request
|
||||||
|
|
||||||
|
req, err = s.client.newRequest(ctx, "DELETE", interfacesPath+"/"+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