You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"A more robust approach to delete the 'Owner' tag is to send the following PATCH request. This is more robust because the removal is independent of the element numerical index, which can help in the case of concurrent modifications for the same document.
Invoke-IntersightPatchDocument: The remote server returned an error: (400) Bad Request.
{"code":"InvalidRequest","message":"The HTTP 'PATCH' body failed validation. Error: error in remove for path: '/Tags[Key='location']': unable to remove nonexistent key: Tags[Key='location']: missing value","messageId":"barcelona_request_json_patch_validation_failed","messageParams":{"1":{}},"traceId":"K2REzRyJyz6kH26nqFxzJCSbGdLFrZ9_ROaQHhNGqOg097DTHQtO-w=="}
PS> $chassisprofile | Select-Object -Expand Tags
Key Value AdditionalProperties
env dev {}
location CA {}
Version used
1.0.11.7766
SaaS
Expected behavior
Being able to remove specific objects by value instead of index as specified in the API documentation
Additional context
Removal by index works fine only when trying to reference by value it fails
The text was updated successfully, but these errors were encountered:
Describe the bug
Invoke-IntersightPatchDocument json-patch remove operation not working with pointer
According to https://intersight.com/apidocs/introduction/methods/#contenttype-applicationjsonpatchjson we should be able to reference values instead of the index:
"A more robust approach to delete the 'Owner' tag is to send the following PATCH request. This is more robust because the removal is independent of the element numerical index, which can help in the case of concurrent modifications for the same document.
PATCH https://intersight.com/api/v1/Server/Profiles/5a5f30237a6d67337212e705
Content-Type: application/json-patch+json
Body:
[
{ "op": "remove", "path": "/Tags[Key='Environment']" },
]"
To Reproduce
PS> $chassisprofile = Get-IntersightChassisProfile -Name 'IMM-FI-LOAN-2' -Organization $defaultorg
PS> $removetag = '[{ "op": "remove", "path": "/Tags[Key=''location'']" }]'
PS> $chassisprofile | Invoke-IntersightPatchDocument -JsonPatchDocument $removetag
Invoke-IntersightPatchDocument: The remote server returned an error: (400) Bad Request.
{"code":"InvalidRequest","message":"The HTTP 'PATCH' body failed validation. Error: error in remove for path: '/Tags[Key='location']': unable to remove nonexistent key: Tags[Key='location']: missing value","messageId":"barcelona_request_json_patch_validation_failed","messageParams":{"1":{}},"traceId":"K2REzRyJyz6kH26nqFxzJCSbGdLFrZ9_ROaQHhNGqOg097DTHQtO-w=="}
PS> $chassisprofile | Select-Object -Expand Tags
Key Value AdditionalProperties
env dev {}
location CA {}
Version used
1.0.11.7766
SaaS
Expected behavior
Being able to remove specific objects by value instead of index as specified in the API documentation
Additional context
Removal by index works fine only when trying to reference by value it fails
The text was updated successfully, but these errors were encountered: