Back to Ansible Reference

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

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

  List network objects 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_OBJECT and NETWORK_GROUP types.

OPTIONS (= indicates it is required):

- api_token  API token for SCCFM.
        set_via:
          env:
          - name: SCCFM_API_TOKEN
        default: null
        no_log: true
        type: str

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

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

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

- region  SCCFM region (int, us, eu, apj, au, uae, in, or ci).
        set_via:
          env:
          - name: SCCFM_REGION
        default: null
        type: str

AUTHOR: Cisco SCCFM Team

EXAMPLES:
# Example 1: List all network objects
- name: List all network objects
  cisco.sccfm.list_network_objects:
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"
  register: result

- name: Display network objects
  ansible.builtin.debug:
    var: result.network_objects

# Example 2: Search with a query and pagination using module_defaults
- name: List network objects
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ lookup('env', 'SCCFM_API_TOKEN') }}"
  tasks:
    - name: Find web-related network objects
      cisco.sccfm.list_network_objects:
        query: "name:web*"
        limit: 10
        offset: 0
      register: result

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

# Example 3: Using environment variables (SCCFM_REGION and SCCFM_API_TOKEN)
- name: List first page of network objects
  cisco.sccfm.list_network_objects:
    limit: 25
  register: result

RETURN VALUES:

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

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

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

        - labels  Labels attached to the object.
          type: list

        - literal  Literal value of the network object.
          type: str

        - name  Name of the network object.
          type: str

        - object_type  Type of the object.
          type: str

        - tags  Tags attached to the object.
          type: dict

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

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