Back to Ansible Reference

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

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

  List access policies available on the cloud-delivered FMC for a
  given domain.
  Use `list_managers' first to obtain the `fmc_domain_uid' of the
  cdFMC.

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

= domain_uid  The FMC domain UID to query. Obtain this from the
               `fmc_domain_uid' field returned by the `list_managers'
               module.
        type: str

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

- offset  Pagination offset.
        default: 0
        type: int

- 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 access policies for a domain
- name: List cdFMC access policies
  cisco.sccfm.list_cdfmc_access_policies:
    domain_uid: "e276abec-e0f2-11e3-8169-6d9ed49b625f"
    region: "{{ sccfm_region }}"
    api_token: "{{ sccfm_api_token }}"
  register: result

- name: Show access policies
  ansible.builtin.debug:
    var: result.access_policies

# Example 2: Using module_defaults (recommended)
- name: List cdFMC access policies
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      region: "{{ sccfm_region }}"
      api_token: "{{ sccfm_api_token }}"
  tasks:
    - name: List access policies for a domain
      cisco.sccfm.list_cdfmc_access_policies:
        domain_uid: "e276abec-e0f2-11e3-8169-6d9ed49b625f"
        limit: 50
        offset: 0

RETURN VALUES:

- access_policies  List of FMC access policies in the given domain.
        elements: dict
        returned: success
        type: list
        contains:

        - name  Name of the access policy.
          type: str

        - uid  Unique identifier of the access policy. Use as
                `fmc_access_policy_uid'.
          type: str

- count   Number of access policies returned.
        returned: success
        type: int

- limit   Maximum number of access policies requested.
        returned: success
        type: int

- offset  Pagination offset requested.
        returned: success
        type: int