Back to Ansible Reference

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

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

  Retrieve the full details of an object by UID.
  Returns the default value, all device-specific overrides, and the
  list of attached devices.

OPTIONS (= indicates it is required):

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

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

= uid     Unique identifier (UID) of the object to retrieve.
        type: str

AUTHOR: Cisco SCCFM Team (@CiscoDevNet)

EXAMPLES:
# Example 1: Get object details by UID
- name: Get object
  cisco.sccfm.get_object:
    uid: "fd526e22-12ff-4fa0-a88d-7375c5d1e144"
    profile: default
  register: obj

- name: Show object
  ansible.builtin.debug:
    var: obj.object

# Example 2: Using module_defaults
- name: Inspect object before modifying overrides
  hosts: localhost
  gather_facts: false
  module_defaults:
    group/cisco.sccfm.all:
      profile: default
  tasks:
    - name: Get object details
      cisco.sccfm.get_object:
        uid: "{{ object_uid }}"
      register: obj_result

    - name: Show default value
      ansible.builtin.debug:
        msg: "Default value: {{ obj_result.object.default_value }}"

RETURN VALUES:

- object  Full details of the object.
           Returned keys include `uid', `name', `description',
           `object_type', `default_value', `overrides', and `targets'.
        returned: success
        type: dict
        contains:

        - default_value  The default content value of the object.
          type: str

        - name  Name of the object.
          type: str

        - object_type  Type of the object (e.g., NETWORK_OBJECT,
                        URL_OBJECT).
          type: str

        - overrides  List of device-specific overrides.
          elements: dict
          type: list
          contains:

          - target_id  UID of the target device.
            type: str

          - value  Override value for that device.
            type: str

        - targets  List of devices the object is attached to.
                    Each target can include `id', `display_name', and
                    `type'.
          elements: dict
          type: list
          contains:

          - display_name  Display name of the device.
            type: str

          - id  UID of the device.
            type: str

        - uid  Unique identifier of the object.
          type: str