Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨feat: Add DeleteContent method for storage #117

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@
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

Check warning on line 121 in storage.go

View check run for this annotation

Codecov / codecov/patch

storage.go#L115-L121

Added lines #L115 - L121 were not covered by tests
}

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
Loading