Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add filter option based on freeform_tags #278

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

valkiriaaquatica
Copy link

SUMMARY
This change helps the user to filter when listing snapshots based on the freeform_tags values of the snapshots. With this change the user doesen't need to 1 List all the snapshots 2 Filter for the snapshots they want based on the freeform_tags values.

ISSUE TYPE

  • Feature request in module

COMPONENT NAME

  • oci_blockstorage_boot_volume_backup_facts

ADDITIONAL INFORMATION

Before when a user wanted to jsut get the snapshots that have certains values in their freeform tags they had to do this:
Before

- name: List boot_volume_backups
  oci_blockstorage_boot_volume_backup_facts:
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    register: backups

- name: Filter snapshots based on their tags
   set_fact:
      filtered_backups: "{{ backups.boot_volume_backups | json_query(query) }}"
    vars:
      query: "[?freeform_tags.department== 'biology']"

AFTER

- name: List all boot volume bakcups that match the freeform tags
    oracle.oci.oci_blockstorage_boot_volume_backup_facts:
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    freeform_tags_filter:
        department: biology
   register: backups

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant