
    Vh                         d Z ddlmZmZmZ eZdZdZdZ	ddl
mZ ddlmZ  ej                  d      Zd	Zd
Z G d de      Zd Zd Zd Zd Zd Zd Zd Zd Zd Zedk(  r e        yy)z4Ansible module for Gathering information about Unity    )absolute_importdivisionprint_functiona  
---
module: info

version_added: '1.1.0'

short_description: Gathering information about Unity

description:
- Gathering information about Unity storage system includes
  Get the details of Unity array,
  Get list of Hosts in Unity array,
  Get list of FC initiators in Unity array,
  Get list of iSCSI initiators in Unity array,
  Get list of Consistency groups in Unity array,
  Get list of Storage pools in Unity array,
  Get list of Volumes in Unity array,
  Get list of Snapshot schedules in Unity array,
  Get list of NAS servers in Unity array,
  Get list of File systems in Unity array,
  Get list of Snapshots in Unity array,
  Get list of SMB shares in Unity array,
  Get list of NFS exports in Unity array,
  Get list of User quotas in Unity array,
  Get list of Quota tree in Unity array,
  Get list of NFS Servers in Unity array,
  Get list of CIFS Servers in Unity array.
  Get list of Ethernet ports in Unity array.
  Get list of File interfaces used in Unity array.
  Get list of Replication sessions in Unity array.

extends_documentation_fragment:
  - dellemc.unity.unity

author:
- Rajshree Khare (@kharer5) <ansible.team@dell.com>
- Akash Shendge (@shenda1) <ansible.team@dell.com>
- Meenakshi Dembi (@dembim) <ansible.team@dell.com>

options:
  gather_subset:
    description:
    - List of string variables to specify the Unity storage system entities
      for which information is required.
    choices: [host, fc_initiator, iscsi_initiator, cg, storage_pool, vol,
    snapshot_schedule, nas_server, file_system, snapshot, nfs_export,
    smb_share, user_quota, tree_quota, disk_group, nfs_server, cifs_server, ethernet_port, file_interface, replication_session]
    type: list
    elements: str

notes:
  - The I(check_mode) is supported.
a  
- name: Get detailed list of Unity entities
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - host
      - fc_initiator
      - iscsi_initiator
      - cg
      - storage_pool
      - vol
      - snapshot_schedule
      - nas_server
      - file_system
      - snapshot
      - nfs_export
      - smb_share
      - user_quota
      - tree_quota
      - disk_group
      - nfs_server
      - cifs_server
      - ethernet_port
      - file_interface
      - replication_session

- name: Get information of Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"

- name: Get list of hosts on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - host

- name: Get list of FC initiators on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - fc_initiator

- name: Get list of ISCSI initiators on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - iscsi_initiator

- name: Get list of consistency groups on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - cg

- name: Get list of storage pools on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - storage_pool

- name: Get list of volumes on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - vol

- name: Get list of snapshot schedules on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - snapshot_schedule

- name: Get list of NAS Servers on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - nas_server

- name: Get list of File Systems on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - file_system

- name: Get list of Snapshots on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - snapshot

- name: Get list of NFS exports on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - nfs_export

- name: Get list of SMB shares on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - smb_share

- name: Get list of user quotas on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - user_quota

- name: Get list of quota trees on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - tree_quota

- name: Get list of disk groups on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - disk_group

- name: Get list of NFS Servers on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - nfs_server

- name: Get list of CIFS Servers on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - cifs_server

- name: Get list of ethernet ports on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - ethernet_port

- name: Get list of file interfaces on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - file_interface

- name: Get list of replication sessions on Unity array
  dellemc.unity.info:
    unispherehost: "{{unispherehost}}"
    username: "{{username}}"
    password: "{{password}}"
    validate_certs: "{{validate_certs}}"
    gather_subset:
      - replication_session
aS{  
Array_Details:
    description: Details of the Unity Array.
    returned: always
    type: dict
    contains:
        api_version:
            description: The current api version of the Unity Array.
            type: str
        earliest_api_version:
            description: The earliest api version of the Unity Array.
            type: str
        model:
            description: The model of the Unity Array.
            type: str
        name:
            description: The name of the Unity Array.
            type: str
        software_version:
            description: The software version of the Unity Array.
            type: str
    sample: {
        "api_version": "12.0",
        "earliest_api_version": "4.0",
        "existed": true,
        "hash": 8766644083532,
        "id": "0",
        "model": "Unity 480",
        "name": "APM00213404195",
        "software_version": "5.2.1"
    }

Hosts:
    description: Details of the hosts.
    returned: When hosts exist.
    type: list
    contains:
        id:
            description: The ID of the host.
            type: str
        name:
            description: The name of the host.
            type: str
    sample: [
        {
            "auto_manage_type": "HostManageEnum.UNKNOWN",
            "datastores": null,
            "description": "",
            "existed": true,
            "fc_host_initiators": null,
            "hash": 8762200072289,
            "health": {
                "UnityHealth": {
                    "hash": 8762200072352
                }
            },
            "host_container": null,
            "host_ip_ports": {
                "UnityHostIpPortList": [
                    {
                        "UnityHostIpPort": {
                            "hash": 8762200072361
                        }
                    }
                ]
            },
            "host_luns": null,
            "host_polled_uuid": null,
            "host_pushed_uuid": null,
            "host_uuid": null,
            "host_v_vol_datastore": null,
            "id": "Host_2191",
            "iscsi_host_initiators": null,
            "last_poll_time": null,
            "name": "10.225.2.153",
            "os_type": "Linux",
            "registration_type": null,
            "storage_resources": null,
            "tenant": null,
            "type": "HostTypeEnum.HOST_MANUAL",
            "vms": null
        }
    ]

FC_initiators:
    description: Details of the FC initiators.
    returned: When FC initiator exist.
    type: list
    contains:
        WWN:
            description: The WWN of the FC initiator.
            type: str
        id:
            description: The id of the FC initiator.
            type: str
    sample: [
        {
            "WWN": "20:00:00:0E:1E:E9:B8:FC:21:00:00:0E:1E:E9:B8:FC",
            "id": "HostInitiator_3"
        },
        {
            "WWN": "20:00:00:0E:1E:E9:B8:F7:21:00:00:0E:1E:E9:B8:F7",
            "id": "HostInitiator_4"
        }
    ]

ISCSI_initiators:
    description: Details of the ISCSI initiators.
    returned: When ISCSI initiators exist.
    type: list
    contains:
        IQN:
            description: The IQN of the ISCSI initiator.
            type: str
        id:
            description: The id of the ISCSI initiator.
            type: str
    sample: [
        {
            "IQN": "iqn.1994-05.com.redhat:634d768090f",
            "id": "HostInitiator_1"
        },
        {
            "IQN": "iqn.1994-05.com.redhat:2835ba62cc6d",
            "id": "HostInitiator_2"
        }
    ]

Consistency_Groups:
    description: Details of the Consistency Groups.
    returned: When Consistency Groups exist.
    type: list
    contains:
        id:
            description: The ID of the Consistency Group.
            type: str
        name:
            description: The name of the Consistency Group.
            type: str
    sample: [
        {
            "advanced_dedup_status": "DedupStatusEnum.DISABLED",
            "block_host_access": {
                "UnityBlockHostAccessList": [
                    {
                        "UnityBlockHostAccess": {
                            "hash": 8745385821206
                        }
                    },
                    {
                        "UnityBlockHostAccess": {
                            "hash": 8745386530115
                        }
                    },
                    {
                        "UnityBlockHostAccess": {
                            "hash": 8745386530124
                        }
                    }
                ]
            },
            "data_reduction_percent": 0,
            "data_reduction_ratio": 1.0,
            "data_reduction_size_saved": 0,
            "data_reduction_status": "DataReductionStatusEnum.DISABLED",
            "datastores": null,
            "dedup_status": null,
            "description": "CG has created with all parametres.",
            "esx_filesystem_block_size": null,
            "esx_filesystem_major_version": null,
            "existed": true,
            "filesystem": null,
            "hash": 8745385801328,
            "health": {
                "UnityHealth": {
                    "hash": 8745386647098
                }
            },
            "host_v_vol_datastore": null,
            "id": "res_93",
            "is_replication_destination": false,
            "is_snap_schedule_paused": false,
            "luns": {
                "UnityLunList": [
                    {
                        "UnityLun": {
                            "hash": 8745389830024,
                            "id": "sv_64"
                        }
                    },
                    {
                        "UnityLun": {
                            "hash": 8745386526751,
                            "id": "sv_63"
                        }
                    }
                ]
            },
            "metadata_size": 8858370048,
            "metadata_size_allocated": 7516192768,
            "name": "CG1_Ansible_Test_SS",
            "per_tier_size_used": [
                11811160064,
                0,
                0
            ],
            "pools": {
                "UnityPoolList": [
                    {
                        "UnityPool": {
                            "hash": 8745386552375,
                            "id": "pool_3"
                        }
                    }
                ]
            },
            "relocation_policy": "TieringPolicyEnum.AUTOTIER",
            "replication_type": "ReplicationTypeEnum.NONE",
            "size_allocated": 99418112,
            "size_total": 268435456000,
            "size_used": null,
            "snap_count": 1,
            "snap_schedule": {
                "UnitySnapSchedule": {
                    "hash": 8745386550224,
                    "id": "snapSch_66"
                }
            },
            "snaps_size_allocated": 8888320,
            "snaps_size_total": 108675072,
            "thin_status": "ThinStatusEnum.TRUE",
            "type": "StorageResourceTypeEnum.CONSISTENCY_GROUP",
            "virtual_volumes": null,
            "vmware_uuid": null
        },
    ]

Storage_Pools:
    description: Details of the Storage Pools.
    returned: When Storage Pools exist.
    type: list
    contains:
        id:
            description: The ID of the Storage Pool.
            type: str
        name:
            description: The name of the Storage Pool.
            type: str
    sample: [
        {
            "alert_threshold": 70,
            "creation_time": "2021-10-18 12:45:12+00:00",
            "description": "",
            "existed": true,
            "harvest_state": "UsageHarvestStateEnum.PAUSED_COULD_NOT_REACH_HWM",
            "hash": 8741501012399,
            "health": {
                "UnityHealth": {
                    "hash": 8741501012363
                }
            },
            "id": "pool_2",
            "is_all_flash": false,
            "is_empty": false,
            "is_fast_cache_enabled": false,
            "is_harvest_enabled": true,
            "is_snap_harvest_enabled": false,
            "metadata_size_subscribed": 312458870784,
            "metadata_size_used": 244544700416,
            "name": "fastVP_pool",
            "object_id": 12884901891,
            "pool_fast_vp": {
                "UnityPoolFastVp": {
                    "hash": 8741501228023
                }
            },
            "pool_space_harvest_high_threshold": 95.0,
            "pool_space_harvest_low_threshold": 85.0,
            "pool_type": "StoragePoolTypeEnum.TRADITIONAL",
            "raid_type": "RaidTypeEnum.RAID5",
            "rebalance_progress": null,
            "size_free": 2709855928320,
            "size_subscribed": 2499805044736,
            "size_total": 3291018690560,
            "size_used": 455513956352,
            "snap_size_subscribed": 139720515584,
            "snap_size_used": 66002944,
            "snap_space_harvest_high_threshold": 25.0,
            "snap_space_harvest_low_threshold": 20.0,
            "tiers": {
                "UnityPoolTierList": [
                    {
                        "UnityPoolTier": {
                            "hash": 8741500996410
                        }
                    },
                    {
                        "UnityPoolTier": {
                            "hash": 8741501009430
                        }
                    },
                    {
                        "UnityPoolTier": {
                            "hash": 8741501009508
                        }
                    }
                ]
            }
        },
    ]

Volumes:
    description: Details of the Volumes.
    returned: When Volumes exist.
    type: list
    contains:
        id:
            description: The ID of the Volume.
            type: str
        name:
            description: The name of the Volume.
            type: str
    sample: [
        {
            "current_node": "NodeEnum.SPB",
            "data_reduction_percent": 0,
            "data_reduction_ratio": 1.0,
            "data_reduction_size_saved": 0,
            "default_node": "NodeEnum.SPB",
            "description": null,
            "effective_io_limit_max_iops": null,
            "effective_io_limit_max_kbps": null,
            "existed": true,
            "family_base_lun": {
                "UnityLun": {
                    "hash": 8774260820794,
                    "id": "sv_27"
                }
            },
            "family_clone_count": 0,
            "hash": 8774260854260,
            "health": {
                "UnityHealth": {
                    "hash": 8774260812499
                }
            },
            "host_access": {
                "UnityBlockHostAccessList": [
                    {
                        "UnityBlockHostAccess": {
                            "hash": 8774260826387
                        }
                    }
                ]
            },
            "id": "sv_27",
            "io_limit_policy": null,
            "is_advanced_dedup_enabled": false,
            "is_compression_enabled": null,
            "is_data_reduction_enabled": false,
            "is_replication_destination": false,
            "is_snap_schedule_paused": false,
            "is_thin_clone": false,
            "is_thin_enabled": false,
            "metadata_size": 4294967296,
            "metadata_size_allocated": 4026531840,
            "name": "VSI-UNITY-test-task",
            "per_tier_size_used": [
                111400714240,
                0,
                0
            ],
            "pool": {
                "UnityPool": {
                    "hash": 8774260811427
                }
            },
            "size_allocated": 107374182400,
            "size_total": 107374182400,
            "size_used": null,
            "snap_count": 0,
            "snap_schedule": null,
            "snap_wwn": "60:06:01:60:5C:F0:50:00:94:3E:91:4D:51:5A:4F:97",
            "snaps_size": 0,
            "snaps_size_allocated": 0,
            "storage_resource": {
                "UnityStorageResource": {
                    "hash": 8774267822228
                }
            },
            "tiering_policy": "TieringPolicyEnum.AUTOTIER_HIGH",
            "type": "LUNTypeEnum.VMWARE_ISCSI",
            "wwn": "60:06:01:60:5C:F0:50:00:00:B5:95:61:2E:34:DB:B2"
        },
    ]

Snapshot_Schedules:
    description: Details of the Snapshot Schedules.
    returned: When Snapshot Schedules exist.
    type: list
    contains:
        id:
            description: The ID of the Snapshot Schedule.
            type: str
        name:
            description: The name of the Snapshot Schedule.
            type: str
    sample: [
        {
            "existed": true,
            "hash": 8775599492651,
            "id": "snapSch_1",
            "is_default": true,
            "is_modified": null,
            "is_sync_replicated": false,
            "luns": null,
            "modification_time": "2021-08-18 19:10:33.774000+00:00",
            "name": "CEM_DEFAULT_SCHEDULE_DEFAULT_PROTECTION",
            "rules": {
                "UnitySnapScheduleRuleList": [
                    {
                        "UnitySnapScheduleRule": {
                            "hash": 8775599498593
                        }
                    }
                ]
            },
            "storage_resources": {
                "UnityStorageResourceList": [
                    {
                        "UnityStorageResource": {
                            "hash": 8775599711597,
                            "id": "res_88"
                        }
                    },
                    {
                        "UnityStorageResource": {
                            "hash": 8775599711528,
                            "id": "res_3099"
                        }
                    }
                ]
            },
            "version": "ScheduleVersionEnum.LEGACY"
        },
    ]

NAS_Servers:
    description: Details of the NAS Servers.
    returned: When NAS Servers exist.
    type: list
    contains:
        id:
            description: The ID of the NAS Server.
            type: str
        name:
            description: The name of the NAS Server.
            type: str
    sample: [
        {
            "allow_unmapped_user": null,
            "cifs_server": null,
            "current_sp": {
                "UnityStorageProcessor": {
                    "hash": 8747629920422,
                    "id": "spb"
                }
            },
            "current_unix_directory_service": "NasServerUnixDirectoryServiceEnum.NONE",
            "default_unix_user": null,
            "default_windows_user": null,
            "existed": true,
            "file_dns_server": null,
            "file_interface": {
                "UnityFileInterfaceList": [
                    {
                        "UnityFileInterface": {
                            "hash": 8747626606870,
                            "id": "if_6"
                        }
                    }
                ]
            },
            "filesystems": {
                "UnityFileSystemList": [
                    {
                        "UnityFileSystem": {
                            "hash": 8747625901355,
                            "id": "fs_6892"
                        }
                    },
                ]
            },
            "hash": 8747625900370,
            "health": {
                "UnityHealth": {
                    "hash": 8747625900493
                }
            },
            "home_sp": {
                "UnityStorageProcessor": {
                    "hash": 8747625877420,
                    "id": "spb"
                }
            },
            "id": "nas_1",
            "is_backup_only": false,
            "is_multi_protocol_enabled": false,
            "is_packet_reflect_enabled": false,
            "is_replication_destination": false,
            "is_replication_enabled": false,
            "is_windows_to_unix_username_mapping_enabled": null,
            "name": "lglad072",
            "pool": {
                "UnityPool": {
                    "hash": 8747629920479,
                    "id": "pool_3"
                }
            },
            "preferred_interface_settings": {
                "UnityPreferredInterfaceSettings": {
                    "hash": 8747626625166,
                    "id": "preferred_if_1"
                }
            },
            "replication_type": "ReplicationTypeEnum.NONE",
            "size_allocated": 2952790016,
            "tenant": null,
            "virus_checker": {
                "UnityVirusChecker": {
                    "hash": 8747626604144,
                    "id": "cava_1"
                }
            }
        },
    ]

File_Systems:
    description: Details of the File Systems.
    returned: When File Systems exist.
    type: list
    contains:
        id:
            description: The ID of the File System.
            type: str
        name:
            description: The name of the File System.
            type: str
    sample: [
        {
            "access_policy": "AccessPolicyEnum.UNIX",
            "cifs_notify_on_change_dir_depth": 512,
            "cifs_share": null,
            "data_reduction_percent": 0,
            "data_reduction_ratio": 1.0,
            "data_reduction_size_saved": 0,
            "description": "",
            "existed": true,
            "folder_rename_policy": "FSRenamePolicyEnum.SMB_RENAME_FORBIDDEN",
            "format": "FSFormatEnum.UFS64",
            "hash": 8786518053735,
            "health": {
                "UnityHealth": {
                    "hash": 8786518049091
                }
            },
            "host_io_size": "HostIOSizeEnum.GENERAL_8K",
            "id": "fs_12",
            "is_advanced_dedup_enabled": false,
            "is_cifs_notify_on_access_enabled": false,
            "is_cifs_notify_on_write_enabled": false,
            "is_cifs_op_locks_enabled": true,
            "is_cifs_sync_writes_enabled": false,
            "is_data_reduction_enabled": false,
            "is_read_only": false,
            "is_smbca": false,
            "is_thin_enabled": true,
            "locking_policy": "FSLockingPolicyEnum.MANDATORY",
            "metadata_size": 4294967296,
            "metadata_size_allocated": 3758096384,
            "min_size_allocated": 0,
            "name": "vro-daniel-test",
            "nas_server": {
                "UnityNasServer": {
                    "hash": 8786517296113,
                    "id": "nas_1"
                }
            },
            "nfs_share": null,
            "per_tier_size_used": [
                6442450944,
                0,
                0
            ],
            "pool": {
                "UnityPool": {
                    "hash": 8786518259493,
                    "id": "pool_3"
                }
            },
            "pool_full_policy": "ResourcePoolFullPolicyEnum.FAIL_WRITES",
            "size_allocated": 283148288,
            "size_allocated_total": 4041244672,
            "size_preallocated": 2401206272,
            "size_total": 107374182400,
            "size_used": 1620312064,
            "snap_count": 0,
            "snaps_size": 0,
            "snaps_size_allocated": 0,
            "storage_resource": {
                "UnityStorageResource": {
                    "hash": 8786518044167,
                    "id": "res_20"
                }
            },
            "supported_protocols": "FSSupportedProtocolEnum.NFS",
            "tiering_policy": "TieringPolicyEnum.AUTOTIER_HIGH",
            "type": "FilesystemTypeEnum.FILESYSTEM"
        },
    ]

Snapshots:
    description: Details of the Snapshots.
    returned: When Snapshots exist.
    type: list
    contains:
        id:
            description: The ID of the Snapshot.
            type: str
        name:
            description: The name of the Snapshot.
            type: str
    sample: [
        {
            "access_type": "FilesystemSnapAccessTypeEnum.CHECKPOINT",
            "attached_wwn": null,
            "creation_time": "2022-04-06 11:19:26.818000+00:00",
            "creator_schedule": null,
            "creator_type": "SnapCreatorTypeEnum.REP_V2",
            "creator_user": null,
            "description": "",
            "existed": true,
            "expiration_time": null,
            "hash": 8739100256648,
            "host_access": null,
            "id": "38654716464",
            "io_limit_policy": null,
            "is_auto_delete": false,
            "is_modifiable": false,
            "is_modified": false,
            "is_read_only": true,
            "is_system_snap": true,
            "last_writable_time": null,
            "lun": {
                "UnityLun": {
                    "hash": 8739100148962,
                    "id": "sv_301"
                }
            },
            "name": "42949677504_APM00213404195_0000.ckpt000_9508038064690266.2_238",
            "parent_snap": null,
            "size": 3221225472,
            "snap_group": null,
            "state": "SnapStateEnum.READY",
            "storage_resource": {
                "UnityStorageResource": {
                    "hash": 8739100173002,
                    "id": "sv_301"
                }
            }
        },
    ]

NFS_Exports:
    description: Details of the NFS Exports.
    returned: When NFS Exports exist.
    type: list
    contains:
        id:
            description: The ID of the NFS Export.
            type: str
        name:
            description: The name of the NFS Export.
            type: str
    sample: [
        {
            "anonymous_gid": 4294967294,
            "anonymous_uid": 4294967294,
            "creation_time": "2021-12-01 06:21:48.381000+00:00",
            "default_access": "NFSShareDefaultAccessEnum.NO_ACCESS",
            "description": "",
            "existed": true,
            "export_option": 1,
            "export_paths": [
                "10.230.24.20:/zack_nfs_01"
            ],
            "filesystem": {
                "UnityFileSystem": {
                    "hash": 8747298565566,
                    "id": "fs_67"
                }
            },
            "hash": 8747298565548,
            "host_accesses": null,
            "id": "NFSShare_29",
            "is_read_only": null,
            "min_security": "NFSShareSecurityEnum.SYS",
            "modification_time": "2022-04-01 11:44:17.553000+00:00",
            "name": "zack_nfs_01",
            "nfs_owner_username": null,
            "no_access_hosts": null,
            "no_access_hosts_string": "10.226.198.207,10.226.198.25,10.226.198.44,10.226.198.85,Host1,
Host2,Host4,Host5,Host6,10.10.0.0/255.255.240.0",
            "path": "/",
            "read_only_hosts": null,
            "read_only_hosts_string": "",
            "read_only_root_access_hosts": null,
            "read_only_root_hosts_string": "",
            "read_write_hosts": null,
            "read_write_hosts_string": "",
            "read_write_root_hosts_string": "",
            "role": "NFSShareRoleEnum.PRODUCTION",
            "root_access_hosts": null,
            "snap": null,
            "type": "NFSTypeEnum.NFS_SHARE"
        },
    ]

SMB_Shares:
    description: Details of the SMB Shares.
    returned: When SMB Shares exist.
    type: list
    contains:
        id:
            description: The ID of the SMB Share.
            type: str
        name:
            description: The name of the SMB Share.
            type: str
    sample: [
        {
            "creation_time": "2022-03-17 11:56:54.867000+00:00",
            "description": "",
            "existed": true,
            "export_paths": [
                "\\\\multi-prot-pie.extreme1.com\\multi-prot-hui",
                "\\\\10.230.24.26\\multi-prot-hui"
            ],
            "filesystem": {
                "UnityFileSystem": {
                    "hash": 8741295638110,
                    "id": "fs_140"
                }
            },
            "hash": 8741295638227,
            "id": "SMBShare_20",
            "is_abe_enabled": false,
            "is_ace_enabled": false,
            "is_branch_cache_enabled": false,
            "is_continuous_availability_enabled": false,
            "is_dfs_enabled": false,
            "is_encryption_enabled": false,
            "is_read_only": null,
            "modified_time": "2022-03-17 11:56:54.867000+00:00",
            "name": "multi-prot-hui",
            "offline_availability": "CifsShareOfflineAvailabilityEnum.NONE",
            "path": "/",
            "snap": null,
            "type": "CIFSTypeEnum.CIFS_SHARE",
            "umask": "022"
        },
    ]

User_Quotas:
    description: Details of the user quotas.
    returned: When user quotas exist.
    type: list
    contains:
        id:
            description: The ID of the user quota.
            type: str
        uid:
            description: The UID of the user quota.
            type: str
    sample: [
        {
            "id": "userquota_171798694698_0_60000",
            "uid": 60000
        },
        {
            "id": "userquota_171798694939_0_5001",
            "uid": 5001
        }
    ]

Tree_Quotas:
    description: Details of the quota trees.
    returned: When quota trees exist.
    type: list
    contains:
        id:
            description: The ID of the quota tree.
            type: str
        path:
            description: The path of the quota tree.
            type: str
    sample: [
        {
            "id": "treequota_171798709589_1",
            "path": "/vro-ui-fs-rkKfimmN"
        },
        {
            "id": "treequota_171798709590_1",
            "path": "/vro-ui-fs-mGYXAMqk"
        }
    ]

Disk_Groups:
    description: Details of the disk groups.
    returned: When disk groups exist.
    type: list
    contains:
        id:
            description: The ID of the disk group.
            type: str
        name:
            description: The name of the disk group.
            type: str
        tier_type:
            description: The tier type of the disk group.
            type: str
    sample: [
        {
            "id": "dg_3",
            "name": "400 GB SAS Flash 2",
            "tier_type": "EXTREME_PERFORMANCE"
        },
        {
            "id": "dg_16",
            "name": "600 GB SAS 10K",
            "tier_type": "PERFORMANCE"
        }
    ]

NFS_Servers:
    description: Details of the NFS Servers.
    returned: When NFS Servers exist.
    type: list
    contains:
        id:
            description: The ID of the NFS Servers.
            type: str
    sample: [
        {
            "id": "nfs_3",
        },
        {
            "id": "nfs_4",
        },
        {
            "id": "nfs_9",
        }
    ]
CIFS_Servers:
    description: Details of the CIFS Servers.
    returned: When CIFS Servers exist.
    type: list
    contains:
        id:
            description: The ID of the CIFS Servers.
            type: str
        name:
            description: The name of the CIFS server.
            type: str
    sample: [
        {
            "id": "cifs_3",
            "name": "test_cifs_1"
        },
        {
            "id": "cifs_4",
            "name": "test_cifs_2"
        },
        {
            "id": "cifs_9",
            "name": "test_cifs_3"
        }
    ]
Ethernet_ports:
    description: Details of the ethernet ports.
    returned: When ethernet ports exist.
    type: list
    contains:
        id:
            description: The ID of the ethernet port.
            type: str
        name:
            description: The name of the ethernet port.
            type: str
    sample: [
        {
            "id": "spa_mgmt",
            "name": "SP A Management Port"
        },
        {
            "id": "spa_ocp_0_eth0",
            "name": "SP A 4-Port Card Ethernet Port 0"
        },
        {
            "id": "spa_ocp_0_eth1",
            "name": "SP A 4-Port Card Ethernet Port 1"
        }
    ]
File_interfaces:
    description: Details of the file inetrfaces.
    returned: When file inetrface exist.
    type: list
    contains:
        id:
            description: The ID of the file inetrface.
            type: str
        name:
            description: The name of the file inetrface.
            type: str
        ip_address:
            description: IP address of the file inetrface.
            type: str
    sample: [
        {
            "id": "if_3",
            "ip_address": "xx.xx.xx.xx",
            "name": "1_APMXXXXXXXXXX"
        },
        {
            "id": "if_3",
            "ip_address": "xx.xx.xx.xx",
            "name": "2_APMXXXXXXXXXX"
        },
        {
            "id": "if_3",
            "ip_address": "xx.xx.xx.xx",
            "name": "3_APMXXXXXXXXXX"
        }
    ]
Replication_sessions:
    description: Details of the Replication sessions.
    returned: When Replication sessions exist.
    type: list
    contains:
        id:
            description: The ID of the Replication session.
            type: str
        name:
            description: The name of the Replication session.
            type: str
    sample: [
        {
            "current_transfer_est_remain_time": 0,
            "daily_snap_replication_policy": null,
            "dst_resource_id": "nas_8",
            "dst_spa_interface": {
                "UnityRemoteInterface": {
                    "hash": 8771253398547,
                    "id": "APM00213404195:if_181"
                }
            },
            "dst_spb_interface": {
               "UnityRemoteInterface": {
                   "hash": 8771253424144,
                   "id": "APM00213404195:if_180"
              }
            },
            "dst_status": "ReplicationSessionStatusEnum.OK",
            "existed": true,
            "hash": 8771259012271,
            "health": {
                "UnityHealth": {
                    "hash": 8771253424168
                }
            },
            "hourly_snap_replication_policy": null,
            "id": "103079215114_APM00213404195_0000_103079215274_APM00213404194_0000",
            "last_sync_time": "2023-04-18 10:35:25+00:00",
            "local_role": "ReplicationSessionReplicationRoleEnum.DESTINATION",
            "max_time_out_of_sync": 0,
            "members": null,
            "name": "rep_sess_nas",
            "network_status": "ReplicationSessionNetworkStatusEnum.OK",
            "remote_system": {
                "UnityRemoteSystem": {
                    "hash": 8771253380142
                }
            },
            "replication_resource_type": "ReplicationEndpointResourceTypeEnum.NASSERVER",
            "src_resource_id": "nas_213",
            "src_spa_interface": {
                "UnityRemoteInterface": {
                    "hash": 8771253475010,
                    "id": "APM00213404194:if_195"
                }
            },
            "src_spb_interface": {
                "UnityRemoteInterface": {
                    "hash": 8771253374169,
                    "id": "APM00213404194:if_194"
                }
            },
            "src_status": "ReplicationSessionStatusEnum.OK",
            "status": "ReplicationOpStatusEnum.ACTIVE",
            "sync_progress": 0,
            "sync_state": "ReplicationSessionSyncStateEnum.IN_SYNC"
        },
    ]
)AnsibleModule)utilsinfozSuccessfully listed.zAnsible/1.7.1c                       e Zd ZdZd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)InfozClass with Info operationsc                    t        j                         | _        | j                  j                  t	                      	 t        | j                  d      | _        t        j                  | j                         t        j                  | j                  j                  t              | _        t        j                  d       y)z. Define all parameters required by this moduleT)argument_specsupports_check_modez0Got the unity instance for provisioning on UnityN)r   $get_unity_management_host_parametersmodule_paramsupdateget_info_parametersr   moduleensure_required_libsget_unity_unisphere_connectionparamsapplication_typeunityLOGr   )selfs    f/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/dellemc/unity/plugins/modules/info.py__init__zInfo.__init__  s     #GGI!!"5"78-#$2D2D8<>""4;;/99$++:L:L:JL
CD    c                 b   	 t         j                  d       | j                  j                  }|j                         S # t        j
                  $ r}|j                  dk(  r4d}t         j                  |       | j                  j                  |       nAt        |      }t         j                  |       | j                  j                  |       Y d}~yY d}~yd}~wt        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)P Get the list of snapshot schedules on a given Unity storage
            system zGetting array details i  z(Incorrect username or password provided.msgNz7Get array details from unity array failed with error %s)r   r   r   _get_propertiesr   	HttpErrorhttp_statuserrorr   	fail_jsonstr	Exception)r   array_detailser    s       r   get_array_detailszInfo.get_array_details.  s    	+HH-. JJOOM 0022 	/}}#@		#%%#%.!f		#%%#%..	 /
  	+!$Q)CIIcNKK!!c!**		+s"   := D.A?CD.%?D))D.c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z7 Get the list of hosts on a given Unity storage system zGetting hosts list z4Get hosts list from unity array failed with error %sr   N)
r   r   r   get_hostresult_listr'   r&   r$   r   r%   )r   hostsr)   r    s       r   get_hosts_listzInfo.get_hosts_listF  sw    		+HH*+JJ'')Eu%% 	+!$Q)CIIcNKK!!c!**		+   9< 	B?B		Bc                    	 t         j                  d       t        j                  j                  j                  | j                  j                  t        j                  j                        }t        |      S # t        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z? Get the list of FC Initiators on a given Unity storage system zGetting FC initiators list clitypez<Get FC initiators list from unity array failed with error %sr   N)r   r   r   hostUnityHostInitiatorListgetr   _cliHostInitiatorTypeEnumFCfc_initiators_result_listr'   r&   r$   r   r%   )r   fc_initiatorr)   r    s       r   get_fc_initiators_listzInfo.get_fc_initiators_listT  s    
	+HH23 ::<<u/J/J/M/MN ,\:: 	+!$Q)CIIcNKK!!c!**		+   A6A9 9	C?CCc                    	 t         j                  d       t        j                  j                  j                  | j                  j                  t        j                  j                        }t        |      S # t        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)zN Get the list of ISCSI initiators on a given Unity storage
            system zGetting ISCSI initiators list r2   z?Get ISCSI initiators list from unity array failed with error %sr   N)r   r   r   r5   r6   r7   r   r8   r9   ISCSIiscsi_initiators_result_listr'   r&   r$   r   r%   )r   iscsi_initiatorr)   r    s       r   get_iscsi_initiators_listzInfo.get_iscsi_initiators_listc  s    	+HH56#jj??u/J/JU    0@@ 	+!$Q)CIIcNKK!!c!**		+r>   c                 h   	 t         j                  d       t        j                  j                  j                  | j                  j                        }t        |      S # t        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)zP Get the list of consistency groups on a given Unity storage
            system z Getting consistency groups list zAGet consistency groups list from unity array failed with error %sr   N)r   r   r   cgUnityConsistencyGroupListr7   r   r8   r-   r'   r&   r$   r   r%   )r   consistency_groupsr)   r    s       r   get_consistency_groups_listz Info.get_consistency_groups_listt  s    
	+HH78!&!C!CTZZ__% 122 	+!$Q)CIIcNKK!!c!**		+s   AA 	B1(?B,,B1c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)zK Get the list of storage pools on a given Unity storage
            system zGetting storage pools list z<Get storage pools list from unity array failed with error %sr   N)
r   r   r   get_poolr-   r'   r&   r$   r   r%   )r   storage_poolsr)   r    s       r   get_storage_pools_listzInfo.get_storage_pools_list  sw    		+HH23 JJ//1M}-- 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)zE Get the list of volumes on a given Unity storage
            system zGetting volumes list z6Get volumes list from unity array failed with error %sr   N)
r   r   r   get_lunr-   r'   r&   r$   r   r%   )r   volumesr)   r    s       r   get_volumes_listzInfo.get_volumes_list  sw    		+HH,-jj((*Gw'' 	+!$Q)CIIcNKK!!c!**		+r0   c                 j   	 t         j                  d       t        j                  j                  j                  | j                  j                        }t        |      S # t        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)r   z Getting snapshot schedules list r3   zAGet snapshot schedules list from unity array failed with error %sr   N)r   r   r   snap_scheduleUnitySnapScheduleListr7   r   r8   r-   r'   r&   r$   r   r%   )r   snapshot_schedulesr)   r    s       r   get_snapshot_schedules_listz Info.get_snapshot_schedules_list  s    
	+HH78!&!4!4!J!J) 122 	+!$Q)CIIcNKK!!c!**		+s   AA   	B2)?B--B2c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z;Get the list of NAS servers on a given Unity storage systemzGetting NAS servers listz:Get NAS servers list from unity array failed with error %sr   N)
r   r   r   get_nas_serverr-   r'   r&   r$   r   r%   )r   nas_serversr)   r    s       r   get_nas_servers_listzInfo.get_nas_servers_list  sw    		+HH/0**335K{++ 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z<Get the list of file systems on a given Unity storage systemzGetting file systems listz;Get file systems list from unity array failed with error %sr   N)
r   r   r   get_filesystemr-   r'   r&   r$   r   r%   )r   file_systemsr)   r    s       r   get_file_systems_listzInfo.get_file_systems_list  sw    		+HH01::446L|,, 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z9Get the list of snapshots on a given Unity storage systemzGetting snapshots listz3Get snapshots from unity array failed with error %sr   N)
r   r   r   get_snapr-   r'   r&   r$   r   r%   )r   	snapshotsr)   r    s       r   get_snapshots_listzInfo.get_snapshots_list  sw    		+HH-.

++-Iy)) 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z;Get the list of NFS exports on a given Unity storage systemzGetting NFS exports listz5Get NFS exports from unity array failed with error %sr   N)
r   r   r   get_nfs_sharer-   r'   r&   r$   r   r%   )r   nfs_exportsr)   r    s       r   get_nfs_exports_listzInfo.get_nfs_exports_list  sw    		+HH/0**224K{++ 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z:Get the list of SMB shares on a given Unity storage systemzGetting SMB shares listz4Get SMB shares from unity array failed with error %sr   N)
r   r   r   get_cifs_sharer-   r'   r&   r$   r   r%   )r   
smb_sharesr)   r    s       r   get_smb_shares_listzInfo.get_smb_shares_list  sw    		+HH./224Jz** 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z;Get the list of user quotas on a given Unity storage systemzGetting user quota listz5Get user quotas from unity array failed with error %sr   N)
r   r   r   get_user_quotauser_quota_result_listr'   r&   r$   r   r%   )r   user_quotasr)   r    s       r   get_user_quota_listzInfo.get_user_quota_list  w    		+HH./**335K)+66 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z;Get the list of quota trees on a given Unity storage systemzGetting quota tree listz5Get quota trees from unity array failed with error %sr   N)
r   r   r   get_tree_quotatree_quota_result_listr'   r&   r$   r   r%   )r   tree_quotasr)   r    s       r   get_tree_quota_listzInfo.get_tree_quota_list  rp   r0   c                    	 t         j                  d       g }t        j                  | j                  j
                        }|rF|D ]A  }|j                  |j                  |j                  j                  d}|j                  |       C |S # t        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)zBGet the list of disk group details on a given Unity storage systemzGetting disk group listrR   )idname	tier_typez4Get disk group from unity array failed with error %sr   N)r   r   r   UnityDiskGroupListr   r8   rw   rx   ry   appendr'   r&   r$   r   r%   )r   pool_disk_listdisk_instancesdisk	pool_diskr)   r    s          r   get_disk_groups_listzInfo.get_disk_groups_list  s    	+HH./N"55$**//JN* 5D'+ww		.2nn.A.A!CI")))45 "! 	+!$Q)CIIcNKK!!c!**		+s   B
B 	C?CCc                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z;Get the list of NFS servers on a given Unity storage systemzGetting NFS servers listz:Get NFS servers list from unity array failed with error %sr   N)
r   r   r   get_nfs_servernfs_server_result_listr'   r&   r$   r   r%   )r   nfs_serversr)   r    s       r   get_nfs_server_listzInfo.get_nfs_server_list'  sw    		+HH/0**335K)+66 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z<Get the list of CIFS servers on a given Unity storage systemzGetting CIFS servers listz;Get CIFS servers list from unity array failed with error %sr   N)
r   r   r   get_cifs_serverr-   r'   r&   r$   r   r%   )r   cifs_serversr)   r    s       r   get_cifs_server_listzInfo.get_cifs_server_list5  sw    		+HH01::557L|,, 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z>Get the list of ethernet ports on a given Unity storage systemzGetting ethernet ports listz<Get ethernet port list from unity array failed with error %sr   N)
r   r   r   get_ethernet_portr-   r'   r&   r$   r   r%   )r   ethernet_portr)   r    s       r   get_ethernet_port_listzInfo.get_ethernet_port_listC  sw    		+HH23 JJ88:M}-- 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)z?Get the list of file interfaces on a given Unity storage systemzGetting file interfaces listz=Get file interface list from unity array failed with error %sr   N)
r   r   r   get_file_interfacefile_interface_result_listr'   r&   r$   r   r%   )r   file_interfacer)   r    s       r   get_file_interface_listzInfo.get_file_interface_listQ  sw    		+HH34!ZZ::<N-n== 	+!$Q)CIIcNKK!!c!**		+r0   c                 "   	 t         j                  d       | j                  j                         }t	        |      S # t
        $ rI}dt        |      z  }t         j                  |       | j                  j                  |       Y d}~yd}~ww xY w)zDGet the list of replication sessions on a given Unity storage systemz!Getting replication sessions listzBGet replication session list from unity array failed with error %sr   N)
r   r   r   get_replication_sessionr-   r'   r&   r$   r   r%   )r   replication_sessionsr)   r    s       r   get_replication_session_listz!Info.get_replication_session_list_  sy    		+HH89#'::#E#E#G 344 	+!$Q)CIIcNKK!!c!**		+r0   c                 .   	 | j                         }g }g }g }g }g }g }g }g }	g }
g }g }g }g }g }g }g }g }g }g }g }| j                  j                  d   }|d|v r| j                         }d|v r| j	                         }d|v r| j                         }d|v r| j                         }d|v r| j                         }d|v r| j                         }d	|v r| j                         }d
|v r| j                         }	d|v r| j                         }
d|v r| j                         }d|v r| j                         }d|v r| j                         }d|v r| j                         }d|v r| j!                         }d|v r| j#                         }d|v r| j%                         }d|v r| j'                         }d|v r| j)                         }d|v r| j+                         }d|v r| j-                         }| j                  j/                  |||||||||	|
|||||||||||       y)zZ Perform different actions on Info based on user parameter
            chosen in playbook gather_subsetNr5   r<   rB   rE   storage_poolvolsnapshot_schedule
nas_serverfile_systemsnapshot
nfs_export	smb_share
user_quota
tree_quota
disk_group
nfs_servercifs_serverr   r   replication_session)Array_DetailsHostsFC_initiatorsISCSI_initiatorsConsistency_GroupsStorage_PoolsVolumesSnapshot_SchedulesNAS_ServersFile_Systems	SnapshotsNFS_Exports
SMB_SharesUser_QuotasTree_QuotasDisk_GroupsNFS_ServersCIFS_ServersEthernet_portsFile_interfacesReplication_sessions)r*   r   r   r/   r=   rC   rH   rL   rP   rV   rZ   r^   rb   rf   rj   ro   ru   r   r   r   r   r   r   	exit_json)r   r(   r5   r<   rB   rE   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   subsets                          r   perform_module_operationzInfo.perform_module_operationm  s    	C..0

	



 ##O4**,'#::< F*"&"@"@"Bv~557'#::<++-"f,$($D$D$F!v%!668
&"88:V#224v%!668
f$ 446	v%!557
v%!557
v%!668
v%!557
&"779&( $ ; ; =6)!%!=!=!?$.&*&G&G&I#'&,!&0"$" """"$(*!4+ 	 	
r   N)__name__
__module____qualname____doc__r   r*   r/   r=   rC   rH   rL   rP   rV   rZ   r^   rb   rf   rj   ro   ru   r   r   r   r   r   r   r    r   r   r
   r
     sz    $E+0+++"+ +++ ++++++++&+++++]
r   r
   c                     g }| rAt         j                  t               | D ]!  }|j                  |j	                                # |S y)z8 Get the name and id associated with the Unity entities Nr   r   SUCCESSFULL_LISTED_MSGr{   r!   entityresultitems      r   r-   r-     H    F'( 	DMM$$&	 r   c                     g }| rJt         j                  t               | D ]*  }|j                  |j                  |j
                  d       , |S y)z< Get the WWN and id associated with the Unity FC initiators )WWNrw   Nr   r   r   r{   initiator_idrw   r   s      r   r;   r;     Q    F'( 	DMM,,''	 r   c                     g }| rJt         j                  t               | D ]*  }|j                  |j                  |j
                  d       , |S y)z? Get the IQN and id associated with the Unity ISCSI initiators )IQNrw   Nr   r   s      r   rA   rA     r   r   c                     g }| rJt         j                  t               | D ]*  }|j                  |j                  |j
                  d       , |S y)z: Get the id and uid associated with the Unity user quotas )uidrw   N)r   r   r   r{   r   rw   r   s      r   rm   rm      sO    F'( 	DMM88''	 r   c                     g }| rJt         j                  t               | D ]*  }|j                  |j                  |j
                  d       , |S y)z; Get the id and path associated with the Unity quota trees )pathrw   N)r   r   r   r{   r   rw   r   s      r   rs   rs     sO    F'( 	DMM II''	 r   c                     g }| rAt         j                  t               | D ]!  }|j                  |j	                                # |S y)z Get the id of NFS Server Nr   r   s      r   r   r   $  r   r   c                     g }| rAt         j                  t               | D ]!  }|j                  |j	                                # |S y)z, Get the id, name and IP of File Interfaces Nr   r   s      r   r   r   3  r   r   c            	      8    t        t        dddg d            S )zQThis method provides parameters required for the ansible
    info module on UnitylistFr&   )r5   r<   rB   rE   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r4   requiredelementschoices)r   )dictr   r   r   r   r   B  s(     d,1,f	g 	h 	hr   c                  8    t               } | j                          y)z\ Create Unity Info object and perform action on it
        based on user input from playbookN)r
   r   )objs    r   mainr   Q  s     &C  "r   __main__N)r   
__future__r   r   r   r4   __metaclass__DOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   Cansible_collections.dellemc.unity.plugins.module_utils.storage.dellr   
get_loggerr   r   r   objectr
   r-   r;   rA   rm   rs   r   r   r   r   r   r   r   r   <module>r      s    ; @ @4lWru
n 5 ev/ " n
6 n
b$$$$h# zF r   