Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/netapp/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZdefd��YZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
module: netapp_e_facts
short_description: NetApp E-Series retrieve facts about NetApp E-Series storage arrays
description:
    - The netapp_e_facts module returns a collection of facts regarding NetApp E-Series storage arrays.
    - When contacting a storage array directly the collection includes details about the array, controllers, management
      interfaces, hostside interfaces, driveside interfaces, disks, storage pools, volumes, snapshots, and features.
    - When contacting a web services proxy the collection will include basic information regarding the storage systems
      that are under its management.
version_added: '2.2'
author:
    - Kevin Hulquest (@hulquest)
    - Nathan Swartz (@ndswartz)
extends_documentation_fragment:
    - netapp.eseries
s�
---
- name: Get array facts
  netapp_e_facts:
      ssid: "{{ netapp_array_id }}"
      api_url: "https://{{ netapp_e_api_host }}:8443/devmgr/v2"
      api_username: "{{ netapp_api_username }}"
      api_password: "{{ netapp_api_password }}"
      validate_certs: "{{ netapp_api_validate_certs }}"
- name: Get array facts
  netapp_e_facts:
      ssid: 1
      api_url: https://192.168.1.100:8443/devmgr/v2
      api_username: myApiUser
      api_password: myApiPass
      validate_certs: true
s�(
    msg:
        description: Success message
        returned: on success
        type: str
        sample:
            - Gathered facts for storage array. Array ID [1].
            - Gathered facts for web services proxy.
    storage_array_facts:
        description: provides details about the array, controllers, management interfaces, hostside interfaces,
                     driveside interfaces, disks, storage pools, volumes, snapshots, and features.
        returned: on successful inquiry from from embedded web services rest api
        type: complex
        contains:
            netapp_controllers:
                description: storage array controller list that contains basic controller identification and status
                type: complex
                sample:
                    - [{"name": "A", "serial": "021632007299", "status": "optimal"},
                       {"name": "B", "serial": "021632007300", "status": "failed"}]
            netapp_disks:
                description: drive list that contains identification, type, and status information for each drive
                type: complex
                sample:
                    - [{"available": false,
                        "firmware_version": "MS02",
                        "id": "01000000500003960C8B67880000000000000000",
                        "media_type": "ssd",
                        "product_id": "PX02SMU080      ",
                        "serial_number": "15R0A08LT2BA",
                        "status": "optimal",
                        "tray_ref": "0E00000000000000000000000000000000000000",
                        "usable_bytes": "799629205504" }]
            netapp_driveside_interfaces:
                description: drive side interface list that contains identification, type, and speed for each interface
                type: complex
                sample:
                    - [{ "controller": "A", "interface_speed": "12g", "interface_type": "sas" }]
                    - [{ "controller": "B", "interface_speed": "10g", "interface_type": "iscsi" }]
            netapp_enabled_features:
                description: specifies the enabled features on the storage array.
                returned: on success
                type: complex
                sample:
                    - [ "flashReadCache", "performanceTier", "protectionInformation", "secureVolume" ]
            netapp_host_groups:
                description: specifies the host groups on the storage arrays.
                returned: on success
                type: complex
                sample:
                    - [{ "id": "85000000600A098000A4B28D003610705C40B964", "name": "group1" }]
            netapp_hosts:
                description: specifies the hosts on the storage arrays.
                returned: on success
                type: complex
                sample:
                    - [{ "id": "8203800000000000000000000000000000000000",
                         "name": "host1",
                         "group_id": "85000000600A098000A4B28D003610705C40B964",
                         "host_type_index": 28,
                         "ports": [{ "type": "fc", "address": "1000FF7CFFFFFF01", "label": "FC_1" },
                                   { "type": "fc", "address": "1000FF7CFFFFFF00", "label": "FC_2" }]}]
            netapp_host_types:
                description: lists the available host types on the storage array.
                returned: on success
                type: complex
                sample:
                    - [{ "index": 0, "type": "FactoryDefault" },
                       { "index": 1, "type": "W2KNETNCL"},
                       { "index": 2, "type": "SOL" },
                       { "index": 5, "type": "AVT_4M" },
                       { "index": 6, "type": "LNX" },
                       { "index": 7, "type": "LnxALUA" },
                       { "index": 8, "type": "W2KNETCL" },
                       { "index": 9, "type": "AIX MPIO" },
                       { "index": 10, "type": "VmwTPGSALUA" },
                       { "index": 15, "type": "HPXTPGS" },
                       { "index": 17, "type": "SolTPGSALUA" },
                       { "index": 18, "type": "SVC" },
                       { "index": 22, "type": "MacTPGSALUA" },
                       { "index": 23, "type": "WinTPGSALUA" },
                       { "index": 24, "type": "LnxTPGSALUA" },
                       { "index": 25, "type": "LnxTPGSALUA_PM" },
                       { "index": 26, "type": "ONTAP_ALUA" },
                       { "index": 27, "type": "LnxTPGSALUA_SF" },
                       { "index": 28, "type": "LnxDHALUA" },
                       { "index": 29, "type": "ATTOClusterAllOS" }]
            netapp_hostside_interfaces:
                description: host side interface list that contains identification, configuration, type, speed, and
                             status information for each interface
                type: complex
                sample:
                    - [{"iscsi":
                        [{ "controller": "A",
                            "current_interface_speed": "10g",
                            "ipv4_address": "10.10.10.1",
                            "ipv4_enabled": true,
                            "ipv4_gateway": "10.10.10.1",
                            "ipv4_subnet_mask": "255.255.255.0",
                            "ipv6_enabled": false,
                            "iqn": "iqn.1996-03.com.netapp:2806.600a098000a81b6d0000000059d60c76",
                            "link_status": "up",
                            "mtu": 9000,
                            "supported_interface_speeds": [ "10g" ] }]}]
            netapp_management_interfaces:
                description: management interface list that contains identification, configuration, and status for
                             each interface
                type: complex
                sample:
                    - [{"alias": "ict-2800-A",
                        "channel": 1,
                        "controller": "A",
                        "dns_config_method": "dhcp",
                        "dns_servers": [],
                        "ipv4_address": "10.1.1.1",
                        "ipv4_address_config_method": "static",
                        "ipv4_enabled": true,
                        "ipv4_gateway": "10.113.1.1",
                        "ipv4_subnet_mask": "255.255.255.0",
                        "ipv6_enabled": false,
                        "link_status": "up",
                        "mac_address": "00A098A81B5D",
                        "name": "wan0",
                        "ntp_config_method": "disabled",
                        "ntp_servers": [],
                        "remote_ssh_access": false }]
            netapp_storage_array:
                description: provides storage array identification, firmware version, and available capabilities
                type: dict
                sample:
                    - {"chassis_serial": "021540006043",
                       "firmware": "08.40.00.01",
                       "name": "ict-2800-11_40",
                       "wwn": "600A098000A81B5D0000000059D60C76",
                       "cacheBlockSizes": [4096,
                                           8192,
                                           16384,
                                           32768],
                       "supportedSegSizes": [8192,
                                             16384,
                                             32768,
                                             65536,
                                             131072,
                                             262144,
                                             524288]}
            netapp_storage_pools:
                description: storage pool list that contains identification and capacity information for each pool
                type: complex
                sample:
                    - [{"available_capacity": "3490353782784",
                        "id": "04000000600A098000A81B5D000002B45A953A61",
                        "name": "Raid6",
                        "total_capacity": "5399466745856",
                        "used_capacity": "1909112963072" }]
            netapp_volumes:
                description: storage volume list that contains identification and capacity information for each volume
                type: complex
                sample:
                    - [{"capacity": "5368709120",
                        "id": "02000000600A098000AAC0C3000002C45A952BAA",
                        "is_thin_provisioned": false,
                        "name": "5G",
                        "parent_storage_pool_id": "04000000600A098000A81B5D000002B45A953A61" }]
            netapp_workload_tags:
                description: workload tag list
                type: complex
                sample:
                    - [{"id": "87e19568-43fb-4d8d-99ea-2811daaa2b38",
                        "name": "ftp_server",
                        "workloadAttributes": [{"key": "use",
                                                "value": "general"}]}]
            netapp_volumes_by_initiators:
                description: list of available volumes keyed by the mapped initiators.
                type: complex
                sample:
                   - {"192_168_1_1": [{"id": "02000000600A098000A4B9D1000015FD5C8F7F9E",
                                       "meta_data": {"filetype": "xfs", "public": true},
                                       "name": "some_volume",
                                       "workload_name": "test2_volumes",
                                       "wwn": "600A098000A4B9D1000015FD5C8F7F9E"}]}
            snapshot_images:
                description: snapshot image list that contains identification, capacity, and status information for each
                             snapshot image
                type: complex
                sample:
                    - [{"active_cow": true,
                        "creation_method": "user",
                        "id": "34000000600A098000A81B5D00630A965B0535AC",
                        "pit_capacity": "5368709120",
                        "reposity_cap_utilization": "0",
                        "rollback_source": false,
                        "status": "optimal" }]
(tmatch(tpformat(tNetAppESeriesModuletFactscB`s,eZd�Zd�Zd�Zd�ZRS(cC`s/d}tt|�jdid|dt�dS(Ns02.00.0000.0000tansible_optionstweb_services_versiontsupports_check_mode(tsuperRt__init__tTrue(tselfR
((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pyR�scC`s�t�}y |jd|j�\}}Wn9tk
rd}|jjdd|jt|�f�nX|j�i}td�}x.|D]&}t	|�}|||<|d7}q�W|S(s<Retrieve a mapping of controller references to their labels.s:storage-systems/%s/graph/xpath-filter?query=/controller/idtmsgs>Failed to retrieve controller list! Array Id [%s]. Error [%s].tAi(
tlisttrequesttssidt	Exceptiontmodulet	fail_jsontstrtsorttordtchr(Rtcontrollerstrcterrtcontrollers_dicttit
controllertlabel((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pytget_controllers�s	 


c'C`s)tdtd|j�}|j�}t}y |jd|j�\}}Wn9tk
r�}|jjdd|jt	|�f�nXtd|ddd	d
|dddd|ddd
d|ddddd|dddd|ddd�|d<g|dD]7}td||dd|dj
�d|d�^q|d<g|ddD]#}td|dd|d�^q^|d <g|dd!D]K}td"|d#d$|d%d|dd|dd&|d'd(|d)�^q�|d*<g|dd+D]?}	d,|	j�ko|	d,r=td-|	d,d.|	d.�^q�|d/<g|d0d1D]U}
td|
dd|
dd2|
d3d4|
d5d6|
d7d8|
d9d:|
d;�^qV|d<<g|d=D]s}td|dd>|d>d?|d@d|ddA|dBdC|dDdEdF|dGdH|dIdJ|dj��	^q�|dK<g|dD]x}|dLD]g}td||dd|dMdNdO|dMdOdP|dMdPdQ|dMdRdS|dMdTdU|dMdVdW|dMdXdY|dMdZj
�jd[d\�d]|dMd^d_|dMd`da|dMdbdc|dMddde|dMdfdgdhdi|dMdfdgdjrl|dMdfdgdjngdk|dMdldgdmdn|dMdldgdor�|dMdldgdong�^qVqH|dp<tdqg|dD]�}|drD]q}|dsdqkrZtd||ddP|dtdPdU|dtdVdut|dtdv�dwt|dtdx��^q�q�dyg|dD]�}|drD]}|dsdykr�td||ddP|dydPdU|dydzd{|dyd|dut|dyd}�dwt|dyd~��^q|qndg|dD]}|drD]�}|dsdkrtd||dd�|dd�dU|dd�d�dVdW|ddXd]|dd�d�d^d_|dd�d�d`da|dd�d�dbdc|dddd{|dd�d�d�dut|dd�d�dv�d�t|dd�d�d���^qqd�g|dD]�}|drD]u}|dsd�kr�td||ddP|d�dPdut|d�dv�dwt|d�dx�dU|d�d�d��^q<q.�g|d�<g|dD]�}|d�D]�}
td||dd�|
dsd�t|
dsd�kp1|
dsd�kp1|
dsdtkrF|
|
dsdxnK|
dsdykrh|
|
dsd}n)|
dsdkr�|
|
dsd�dxnd���^q�q�|d�<g|d�D]A}td|dd|dd�|d�d�|d�d�|d��^q�|d�<t|d��}g|D]K}td|dd|dd�|d�d�|d�d�|d�d�|d��^q	|d�<t}y |jd�|j�\}}Wn-tk
r�	}|jjdd�|j�nXg|D]-}td|dd|dd�|d��^q�	|d�<t�|d�<x�|dd�D]�}x�|d*D]v}|d�|d$kpU
|d�|d"kr�|d|d�j�kr�
|d�jig|d6�nx	|D]}|dg|d�D]}|d^q�
kr�d\}t�}xu|d�D]i}|d�d�krLxM|d�D]A}|d�|dkrE|d}td��|d�D��}nqWnq�
W|d�|djtd|dd|dd|dd�|d�|��nq�
Wnq*
Wq
Wg|dd�D]}|^q�}|jg|dd�D]}|d�r�|d�^q��tt|��}|j�||d�<|S(�s5Extract particular facts from the storage array graphtfacts_from_proxyRsstorage-systems/%s/graphRsBFailed to obtain facts from storage array with id [%s]. Error [%s]tnametsatsaDatatstorageArrayLabeltchassis_serialtchassisSerialNumbertfirmwaret	fwVersiontwwntsaIdt
worldWideNamet
segment_sizestfeatureParameterstsupportedSegSizestcache_block_sizestcacheBlockSizestnetapp_storage_arrayR$t
controllerReftserialtserialNumberRtnetapp_controllerststoragePoolBundletclustertidtnetapp_host_groupsthosttgroup_idt
clusterRefthosts_referencethostRefthost_type_indext
hostTypeIndextpostst
hostSidePortstnetapp_hoststhostSpecificValsthostTypettypetindextnetapp_host_typesthighLevelVolBundletpittpit_capacitytpitCapacitytcreation_methodtcreationMethodtreposity_cap_utilizationtrepositoryCapacityUtilizationt
active_cowt	activeCOWtrollback_sourcetisRollbackSourcetsnapshot_imagestdrivet	availablet
media_typetdriveMediaTypetusable_bytestusableCapacityttray_reftphysicalLocationttrayReft
product_idt	productIDtfirmware_versiontfirmwareVersiont
serial_numbertnetapp_diskst
netInterfacestethernett
interfaceNametaliastchanneltmac_addresstmacAddrtremote_ssh_accesst
rloginEnabledtlink_statust
linkStatustipv4_enabledtipv4Enabledtipv4_address_config_methodtipv4AddressConfigMethodtconfigttipv4_addresstipv4Addresstipv4_subnet_masktipv4SubnetMasktipv4_gatewaytipv4GatewayAddresstipv6_enabledtipv6Enabledtdns_config_methodt
dnsPropertiestacquisitionPropertiestdnsAcquisitionTypetdns_serverst
dnsServerstntp_config_methodt
ntpPropertiestntpAcquisitionTypetntp_serverst
ntpServerstnetapp_management_interfacestfcthostInterfacest
interfaceTypetfibretcurrent_interface_speedtcurrentInterfaceSpeedtmaximum_interface_speedtmaximumInterfaceSpeedtibt	linkStatetmtutmaximumTransmissionUnittcurrentSpeedtsupportedSpeedtiscsitiqnt
interfaceDatatethernetDatatipv4Datatipv4AddressDatatmaximumFramePayloadSizetsupported_interface_speedstsupportedInterfaceSpeedstsastiocPorttstatetnetapp_hostside_interfacestdriveInterfacestinterface_typetinterface_speedtsatatunknowntnetapp_driveside_interfacestvolumeGrouptavailable_capacityt	freeSpacettotal_capacityttotalRaidedSpacet
used_capacityt	usedSpacetnetapp_storage_poolstvolumetparent_storage_pool_idtvolumeGroupReftcapacitytis_thin_provisionedtthinProvisionedtworkloadtmetadatatnetapp_volumessstorage-systems/%s/workloadss-Failed to retrieve workload tags. Array [%s].t
attributestworkloadAttributestnetapp_workload_tagstnetapp_volumes_by_initiatorst
lunMappingtmapReftlistOfMappingstkeyt
workloadIdtvaluecs`s3|])}|ddkr|d|dfVqdS(R�t	profileIdR�N((t.0tentry((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pys	<genexpr>�st
workload_namet	meta_datatcapabilitiestpremiumFeaturest	isEnabledt
capabilitytnetapp_enabled_features(tdicttFalseRR&tNoneRRRRRtstriptkeystlstriptlowertreplacetstrip_interface_speedRtupdatetappendtextendtsetR(Rtfactstcontroller_reference_labeltarray_factsR terrorR$tgroupRAt	host_typetsnapshottdisktifacet	interfacetstorage_pooltall_volumestvt
workload_tagstworkload_tagtmappingR�tvolume_mappingR�R�t
volume_tagtfeaturetfeatures((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pytget_array_factss� I9aCk
���t����SY ;
(
+	
	

!

cC`s`|j�}|jjd|j��|jjt|��|jjdd|jd|�dS(s3Get the embedded or web services proxy information.sisEmbedded: %sRs1Gathered facts for storage array. Array ID: [%s].tstorage_array_factsN(R�Rtlogtis_embeddedR	t	exit_jsonR(RR�((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pyt	get_factss
(t__name__t
__module__RR&R�R�(((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pyR�s			�cC`s�t|t�r�g|D]}td|�^q}g|D]0}|r8|rb|j�jdd�nd^q8}g|D]!}td|�r�dn|^qu}nTtd|�}|r�|j�jdd�nd}td|j��r�dn|}|S(sZConverts symbol interface speeds to a more common notation. Example: 'speed10gig' -> '10g'sspeed[0-9]{1,3}[gm]tspeedR|R�tauto(t
isinstanceRRR�R�R�(Rtsptresult((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pyR�s"=1$!cC`st�}|j�dS(N(RR�(R�((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pytmains	t__main__N(t
__future__RRRRMt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtreRtpprintR	tansible.module_utils.netappR
RR�RR�(((sQ/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/netapp_e_facts.pyt<module>s 


��	
	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]