Skip to content

Commit

Permalink
api: Expose vSphere API to evict subscribed content library
Browse files Browse the repository at this point in the history
Closes: #3400
Signed-off-by: Sreeja Acharya <acharyasreej@vmware.com>
  • Loading branch information
acharyasreej committed Apr 8, 2024
1 parent 007b3cd commit f671048
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion vapi/library/library.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2018-2023 VMware, Inc. All Rights Reserved.
Copyright (c) 2018-2024 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -322,3 +322,11 @@ func (c *Manager) DeleteSubscriber(ctx context.Context, library *Library, subscr
url := c.Resource(internal.Subscriptions).WithID(library.ID).WithAction("delete")
return c.Do(ctx, url.Request(http.MethodPost, &id), nil)
}

// EvictSubscribedLibrary evicts the cached content of an on-demand subscribed library.
// This operation allows the cached content of a subscribed library to be removed to free up storage capacity.
func (c *Manager) EvictSubscribedLibrary(ctx context.Context, library *Library) error {
path := internal.SubscribedLibraryPath
url := c.Resource(path).WithID(library.ID).WithAction("evict")
return c.Do(ctx, url.Request(http.MethodPost), nil)
}

0 comments on commit f671048

Please sign in to comment.