Forum Discussion

dominique_lafla's avatar
3 years ago

Get-PFA2ProtectionGroup returns an object with a "IsLocal"

Get-PFA2ProtectionGroup returns an object with a "IsLocal" binary property, and the cmdlet has a -filter option that _looks_ like it should support something like "IsLocal = False", but I can't work out the syntax, and the examples from the "Sorting, Filtering, and Pagination" section of the API 1.0 guide are all comparisons, not T/F checks. <insert snark about lack of such heading in API 2.0 reference> Help, please? Thanks, Nick

4 Replies

  • Thanks, Barkz. I was missing the quotes on 'False,' and it hadn't occurred to me to use Verbose. I'll have to remember that. N
  • dominique.laflamme can you use something like this? ```Get-Pfa2ProtectionGroup -Array $FlashArray | Where-Object { $_.IsLocal -ne 'True' }```
  • If you want to use filtering here is an example of IsLocal = False. Notice Is_Local vs IsLocal. Some properties are not what you would expect in terms of naming. Using -Verbose on cmdlets you can see the actual prop name return. ```Get-Pfa2ProtectionGroup -Array $FlashArray -Filter "Is_Local='False'"``` Example below shows the return payload and you'll see in there is_local. ```PS C:\Users\barkz> Get-Pfa2ProtectionGroup -Array $FlashArray -Filter "Name='test-pg-2'" -Verbose VERBOSE: PureStorage.Rest Verbose: 13 : 2022-08-31T1826.5622518Z 10.21.219.50: Get-Pfa2ProtectionGroup (__AllParameterSets) Array=10.21.219.50 Filter=Name='test-pg-2' Verbose=True VERBOSE: PureStorage.Rest Verbose: 10 : 2022-08-31T1826.5872537Z GET https://10.21.219.50/api/2.15/protection-groups?filter=Name%3d'test-pg-2' <no body> VERBOSE: PureStorage.Rest Verbose: 11 : 2022-08-31T1826.6281559Z GET https://10.21.219.50/api/2.15/protection-groups 200 41ms {"continuation_token":,"items":[{"source":{"name":"sn1-x70r3-f04-27","id": },"is_local":true,"name":"test-pg-2","space":{"data_reduction":,"shared":,"snapshots":40640550095,"system":,"thin_provisioning":,"total_physical":,"total_provisioned":,"total_reduction":nu ll,"unique":,"virtual":},"pod":{"name":,"id":},"time_remaining":,"destroyed":false,"retention_lock":"unlocked","host_count":0,"host_group_count":2,"target_count":0,"target_retention":{"all_for _sec":86400,"days":7,"per_day":4},"snapshot_schedule":{"enabled":false,"at":,"frequency":3600000},"replication_schedule":{"enabled":false,"at":,"frequency":14400000,"blackout":{"start":,"end":}}," source_retention":{"all_for_sec":86400,"days":7,"per_day":4},"volume_count":0,"eradication_config":{"manual_eradication":"disabled"}}],"more_items_remaining":false,"total":[{"source":{"name":,"id":},"is_l ocal":,"name":,"space":{"data_reduction":,"shared":,"snapshots":40640550095,"system":,"thin_provisioning":,"total_physical":,"total_provisioned":,"total_reduction":,"unique":nu ll,"virtual":},"pod":{"name":,"id":},"time_remaining":,"destroyed":,"retention_lock":,"host_count":,"host_group_count":,"target_count":,"target_retention":{"all_for_sec":," days":,"per_day":},"snapshot_schedule":{"enabled":,"at":,"frequency":},"replication_schedule":{"enabled":,"at":,"frequency":,"blackout":{"start":,"end":}},"source_retention ":{"all_for_sec":,"days":,"per_day":},"volume_count":,"eradication_config":{"manual_eradication":}}],"total_item_count":}```