Back to Ansible Reference

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

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

  List ASA access rules from your SCC Firewall Manager tenant.
  Supports pagination via `limit' and `offset'.
  Supports Lucene query filtering via `query'.

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.
        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 access rules
- name: List all access rules
  cisco.sccfm.list_access_rules:
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"
  register: result

- name: Display access rules
  ansible.builtin.debug:
    var: result.access_rules

# Example 2: Search with pagination using module_defaults
- name: List access rules
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ lookup('env', 'SCCFM_API_TOKEN') }}"
  tasks:
    - name: List first page of access rules
      cisco.sccfm.list_access_rules:
        limit: 10
        offset: 0
      register: result

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

RETURN VALUES:

- access_rules  List of access rules returned by the API.
        elements: dict
        returned: success
        type: list
        contains:

        - destination_network  Destination network details.
          type: dict

        - index  Position in the rule list.
          type: int

        - rule_action  PERMIT or DENY.
          type: str

        - source_network  Source network details.
          type: dict

        - uid  Unique identifier of the access rule.
          type: str

- count   Total number of matching access rules.
        returned: success
        type: int

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

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