Back to Ansible Reference

$ ansible-doc -t module cisco.sccfm.list_network_groups

> MODULE cisco.sccfm.list_network_groups (sccfm-ansible/plugins/modules/list_network_groups.py)

  List network groups from your SCC Firewall Manager tenant.
  Supports pagination via `limit' and `offset'.
  Supports Lucene query filtering via `query' (searchable fields:
  name, content).
  Only returns NETWORK_GROUP types.

OPTIONS (= indicates it is required):

- config_path  Optional path to the canonical SCCFM profile
                configuration file.
        default: null
        type: path

- limit   Maximum number of results to return.
        default: 50
        type: int

- offset  Pagination offset (number of results to skip).
        default: 0
        type: int

- profile  Named SCCFM profile configured by `sccfm-cli configure'.
        default: default
        type: str

- query   Optional Lucene query string to filter results. Searchable
           fields include `name' and `content'. Example: `name:web*'
           to find groups whose name starts with "web".
        default: null
        type: str

AUTHOR: Cisco SCCFM Team (@CiscoDevNet)

EXAMPLES:
# Example 1: List all network groups
- name: List all network groups
  cisco.sccfm.list_network_groups:
    profile: default
  register: result

- name: Display network groups
  ansible.builtin.debug:
    var: result.network_groups

# Example 2: Search with a query and pagination using module_defaults
- name: List network groups
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      profile: default
  tasks:
    - name: Find web-related network groups
      cisco.sccfm.list_network_groups:
        query: "name:web*"
        limit: 10
        offset: 0
      register: result

    - name: Show results
      ansible.builtin.debug:
        msg: "Found {{ result.count }} groups"

# Example 3: Using the default configured profile
- name: List first page of network groups
  cisco.sccfm.list_network_groups:
    limit: 25
  register: result

RETURN VALUES:

- count   Total number of matching network groups.
        returned: success
        type: int

- limit   The limit used in the request.
        returned: success
        type: int

- network_groups  List of network groups returned by the API.
                   Each item can include `uid', `name', `description',
                   `elements', `labels', `tags', `object_type',
                   `literals', and `referenced_object_uids'.
        elements: dict
        returned: success
        type: list
        contains:

        - labels  Labels attached to the group.
          type: list

        - literals  Literal values in the network group.
          type: list

        - name  Name of the network group.
          type: str

        - object_type  Type of the object.
          type: str

        - referenced_object_uids  UIDs of referenced objects in the
                                   group.
          type: list

        - tags  Tags attached to the group.
          type: dict

        - uid  Unique identifier of the network group.
          type: str

- offset  The offset used in the request.
        returned: success
        type: int