Skip to content

Commit

Permalink
✨feat: Add DeleteContent method for storage (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
alperencelik authored Feb 24, 2024
1 parent 76b0664 commit bbc658b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ func (s *Storage) GetContent(ctx context.Context) (content []*StorageContent, er
return content, err
}

func (s *Storage) DeleteContent(ctx context.Context, content string) (*Task, error) {
var upid UPID
err := s.client.Delete(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s", s.Node, s.Name, content), &upid)
if err != nil {
return nil, err
}
return NewTask(upid, s.client), nil
}

func (s *Storage) ISO(ctx context.Context, name string) (iso *ISO, err error) {
err = s.client.Get(ctx, fmt.Sprintf("/nodes/%s/storage/%s/content/%s:%s/%s", s.Node, s.Name, s.Name, "iso", name), &iso)
if err != nil {
Expand Down

0 comments on commit bbc658b

Please sign in to comment.