MCPcopy
hub / github.com/kopia/kopia / SetPolicy

Function SetPolicy

internal/serverapi/client_wrappers.go:182–189  ·  view source on GitHub ↗

SetPolicy sets the policy.

(ctx context.Context, c *apiclient.KopiaAPIClient, si snapshot.SourceInfo, pol *policy.Policy)

Source from the content-addressed store, hash-verified

180
181// SetPolicy sets the policy.
182func SetPolicy(ctx context.Context, c *apiclient.KopiaAPIClient, si snapshot.SourceInfo, pol *policy.Policy) error {
183 resp := &Empty{}
184 if err := c.Put(ctx, "policy?"+policyTargetURLParameters(si), pol, resp); err != nil {
185 return errors.Wrap(err, "SetPolicy")
186 }
187
188 return nil
189}
190
191// ResolvePolicy resolves the policy.
192func ResolvePolicy(ctx context.Context, c *apiclient.KopiaAPIClient, si snapshot.SourceInfo, req *ResolvePolicyRequest) (*ResolvePolicyResponse, error) {

Callers 1

mustSetPolicyFunction · 0.92

Calls 2

PutMethod · 0.65

Tested by 1

mustSetPolicyFunction · 0.74