Skip to content

Update-PfbLegalHoldEntity -Name is a mandatory but unusable selector: a held entity has no name, and the array rejects a request selected only by it #139

Description

Update-PfbLegalHoldEntity makes -Name mandatory and sends it as names on PATCH /legal-holds/held-entities. A held entity has no name. The array does not accept names as a selector for this operation, and the parameter's mandatory-ness makes it look like the primary one.

The spec says the key is declared

Unlike the New-PfbNlmReclamation case, names is not an undeclared key here — PATCH /legal-holds/held-entities genuinely declares names (query, optional) in every version from REST 2.17 through 2.28, alongside ids, file_system_names, file_system_ids, paths and recursive.

But the object it would select has no name to match. #/components/schemas/LegalHoldHeldEntity declares exactly four properties in 2.26:

file_system, legal_hold, path, status

No name, no id. A held entity is identified by the combination of the hold, the file system and the path — which is why the operation carries file_system_names and paths as separate keys rather than a single composite selector.

This is already known for the read side: Tests/Fixtures/PfbSelectorWaivers.psd1 waives GET /legal-holds/held-entities in the selector rail with the note "its items carry no name (file_system, legal_hold, path, status)." The waiver covers the read; the write side inherited the same declared-but-unusable key with a mandatory parameter in front of it.

Measured on a live array

FB-A, Purity//FB 4.8.2, REST 2.26, against a harness-created file system with a harness-created hold applied to it.

Naming only the hold — which is what a caller following the cmdlet's mandatory -Name would do:

Update-PfbLegalHoldEntity -Name <hold> -Released $true
  → 400  Either names or ids query parameter is required.

Note what that error is not. It is not "no such entity" and not "invalid name" — the array reports the selector as absent, having been sent names=<hold>. That is consistent with FlashBlade dropping a key it cannot apply and then finding itself with no selector at all.

Adding the file system and path but omitting the recursive flag:

Update-PfbLegalHoldEntity -Name <hold> -FileSystemNames <fs> -Paths '/' -Released $true
  → 400  Can't apply or release legal holds to directories without the recursive flag provided.

The form that actually works:

Update-PfbLegalHoldEntity -Name <hold> -FileSystemNames <fs> -Paths '/' -Recursive $true -Released $true
  → 200

So the real selector is file_system_names + paths + recursive, and -Name contributes nothing to it. The release proved synchronous — the hold deleted immediately afterwards with no status read-back needed.

The error text on the third form is identical to the one New-PfbLegalHoldEntity (the apply direction) produces for the same omission, so release is symmetric with apply rather than special-cased.

Why the mandatory parameter is the defect

names being declared-but-inapplicable is the array's business and matches the existing read-side waiver. What this repo owns is the signature. -Name mandatory says: this is how you address the thing you are changing. It is not. A caller supplying only -Name — the one parameter the cmdlet forces them to supply — gets a 400 whose text points at the selector rather than at their mistake.

Scope

Decide what -Name should be on this cmdlet. Options, in rough order of preference:

  1. Drop -Name/names and make the real selector explicit — the file system plus path plus recursive triple the array actually uses.
  2. Keep -Name as optional and documented as ineffective, and add a preflight check that a usable selector was supplied.

Either way the help should state the working form, since it is not inferable from the parameter list.

Note that -Name is currently mandatory, so removing it or demoting it is a breaking change for any caller passing it positionally. That call belongs to the maintainer.

Relationship to other issues

This is the same family of defect as #124 (a declared query key whose response items carry no such field) and shares its interface consequence with the New-PfbNlmReclamation -Name issue filed alongside this one. It is distinct from the released requiredness defect that #106 Part 2 identified on this same cmdlet — that one is a missing required input and is being fixed directly; this one is an unusable selector and is not.

Found while live-verifying the #106 Part 2 released fix, using the legal-holds live-test gate opened for that purpose.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:wire-contractWhat a shipped cmdlet actually sends: dead keys, selectors, missing required keys, ID rules.needs:live-testCannot close on mocked tests alone. Requires live verification against an array.priority:P0Can damage a customer array or breaks the module outright. Drop other work.size:SOne sitting. Single file or a mechanical change.source:livetestOpened from evidence measured against a real array.status:design-approvedDesign reviewed and approved by the maintainer. Implementation may start.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions