Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZd
ZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiont
deprecatedtstatust	communitytsupported_bys	
---
module: purefb_facts
version_added: '2.7'
deprecated:
  removed_in: '2.13'
  why: Deprecated in favor of C(_info) module.
  alternative: Use M(purefb_info) instead.
short_description: Collect facts from Pure Storage FlashBlade
description:
  - Collect facts information from a Pure Storage FlashBlade running the
    Purity//FB operating system. By default, the module will collect basic
    fact information including hosts, host groups, protection
    groups and volume counts. Additional fact information can be collected
    based on the configured set of arguments.
author:
  - Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
  gather_subset:
    description:
      - When supplied, this argument will define the facts to be collected.
        Possible values for this include all, minimum, config, performance,
        capacity, network, subnets, lags, filesystems and snapshots.
    required: false
    type: list
    default: minimum
extends_documentation_fragment:
  - purestorage.fb
s�
- name: collect default set of facts
  purefb_facts:
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: collect configuration and capacity facts
  purefb_facts:
    gather_subset:
      - config
      - capacity
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641

- name: collect all facts
  purefb_facts:
    gather_subset:
      - all
    fb_url: 10.10.10.2
    api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
s�$
ansible_facts:
  description: Returns the facts collected from the FlashBlade
  returned: always
  type: complex
  sample: {
        "capacity": {
            "aggregate": {
                "data_reduction": 1.1179228,
                "snapshots": 0,
                "total_physical": 17519748439,
                "unique": 17519748439,
                "virtual": 19585726464
            },
            "file-system": {
                "data_reduction": 1.3642412,
                "snapshots": 0,
                "total_physical": 4748219708,
                "unique": 4748219708,
                "virtual": 6477716992
            },
            "object-store": {
                "data_reduction": 1.0263462,
                "snapshots": 0,
                "total_physical": 12771528731,
                "unique": 12771528731,
                "virtual": 6477716992
            },
            "total": 83359896948925
        },
        "config": {
            "alert_watchers": {
                "enabled": true,
                "name": "[email protected]"
            },
            "array_management": {
                "base_dn": null,
                "bind_password": null,
                "bind_user": null,
                "enabled": false,
                "name": "management",
                "services": [
                    "management"
                ],
                "uris": []
            },
            "directory_service_roles": {
                "array_admin": {
                    "group": null,
                    "group_base": null
                },
                "ops_admin": {
                    "group": null,
                    "group_base": null
                },
                "readonly": {
                    "group": null,
                    "group_base": null
                },
                "storage_admin": {
                    "group": null,
                    "group_base": null
                }
            },
            "dns": {
                "domain": "demo.acmestorage.com",
                "name": "demo-fb-1",
                "nameservers": [
                    "8.8.8.8"
                ],
                "search": [
                    "demo.acmestorage.com"
                ]
            },
            "nfs_directory_service": {
                "base_dn": null,
                "bind_password": null,
                "bind_user": null,
                "enabled": false,
                "name": "nfs",
                "services": [
                    "nfs"
                ],
                "uris": []
            },
            "ntp": [
                "0.ntp.pool.org"
            ],
            "smb_directory_service": {
                "base_dn": null,
                "bind_password": null,
                "bind_user": null,
                "enabled": false,
                "name": "smb",
                "services": [
                    "smb"
                ],
                "uris": []
            },
            "smtp": {
                "name": "demo-fb-1",
                "relay_host": null,
                "sender_domain": "acmestorage.com"
            },
            "ssl_certs": {
                "certificate": "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----",
                "common_name": "Acme Storage",
                "country": "US",
                "email": null,
                "intermediate_certificate": null,
                "issued_by": "Acme Storage",
                "issued_to": "Acme Storage",
                "key_size": 4096,
                "locality": null,
                "name": "global",
                "organization": "Acme Storage",
                "organizational_unit": "Acme Storage",
                "passphrase": null,
                "private_key": null,
                "state": null,
                "status": "self-signed",
                "valid_from": "1508433967000",
                "valid_to": "2458833967000"
            }
        },
        "default": {
            "blades": 15,
            "buckets": 7,
            "filesystems": 2,
            "flashblade_name": "demo-fb-1",
            "object_store_accounts": 1,
            "object_store_users": 1,
            "purity_version": "2.2.0",
            "snapshots": 1,
            "total_capacity": 83359896948925
        },
        "filesystems": {
            "k8s-pvc-d24b1357-579e-11e8-811f-ecf4bbc88f54": {
                "destroyed": false,
                "fast_remove": false,
                "hard_limit": true,
                "nfs_rules": "*(rw,no_root_squash)",
                "provisioned": 21474836480,
                "snapshot_enabled": false
            },
            "z": {
                "destroyed": false,
                "fast_remove": false,
                "hard_limit": false,
                "provisioned": 1073741824,
                "snapshot_enabled": false
            }
        },
        "lag": {
            "uplink": {
                "lag_speed": 0,
                "port_speed": 40000000000,
                "ports": [
                    {
                        "name": "CH1.FM1.ETH1.1"
                    },
                    {
                        "name": "CH1.FM1.ETH1.2"
                    },
                ],
                "status": "healthy"
            }
        },
        "network": {
            "fm1.admin0": {
                "address": "10.10.100.6",
                "gateway": "10.10.100.1",
                "mtu": 1500,
                "netmask": "255.255.255.0",
                "services": [
                    "support"
                ],
                "type": "vip",
                "vlan": 2200
            },
            "fm2.admin0": {
                "address": "10.10.100.7",
                "gateway": "10.10.100.1",
                "mtu": 1500,
                "netmask": "255.255.255.0",
                "services": [
                    "support"
                ],
                "type": "vip",
                "vlan": 2200
            },
            "nfs1": {
                "address": "10.10.100.4",
                "gateway": "10.10.100.1",
                "mtu": 1500,
                "netmask": "255.255.255.0",
                "services": [
                    "data"
                ],
                "type": "vip",
                "vlan": 2200
            },
            "vir0": {
                "address": "10.10.100.5",
                "gateway": "10.10.100.1",
                "mtu": 1500,
                "netmask": "255.255.255.0",
                "services": [
                    "management"
                ],
                "type": "vip",
                "vlan": 2200
            }
        },
        "performance": {
            "aggregate": {
                "bytes_per_op": 0,
                "bytes_per_read": 0,
                "bytes_per_write": 0,
                "read_bytes_per_sec": 0,
                "reads_per_sec": 0,
                "usec_per_other_op": 0,
                "usec_per_read_op": 0,
                "usec_per_write_op": 0,
                "write_bytes_per_sec": 0,
                "writes_per_sec": 0
            },
            "http": {
                "bytes_per_op": 0,
                "bytes_per_read": 0,
                "bytes_per_write": 0,
                "read_bytes_per_sec": 0,
                "reads_per_sec": 0,
                "usec_per_other_op": 0,
                "usec_per_read_op": 0,
                "usec_per_write_op": 0,
                "write_bytes_per_sec": 0,
                "writes_per_sec": 0
            },
            "nfs": {
                "bytes_per_op": 0,
                "bytes_per_read": 0,
                "bytes_per_write": 0,
                "read_bytes_per_sec": 0,
                "reads_per_sec": 0,
                "usec_per_other_op": 0,
                "usec_per_read_op": 0,
                "usec_per_write_op": 0,
                "write_bytes_per_sec": 0,
                "writes_per_sec": 0
            },
            "s3": {
                "bytes_per_op": 0,
                "bytes_per_read": 0,
                "bytes_per_write": 0,
                "read_bytes_per_sec": 0,
                "reads_per_sec": 0,
                "usec_per_other_op": 0,
                "usec_per_read_op": 0,
                "usec_per_write_op": 0,
                "write_bytes_per_sec": 0,
                "writes_per_sec": 0
            }
        },
        "snapshots": {
            "z.188": {
                "destroyed": false,
                "source": "z",
                "source_destroyed": false,
                "suffix": "188"
            }
        },
        "subnet": {
            "new-mgmt": {
                "gateway": "10.10.100.1",
                "interfaces": [
                    {
                        "name": "fm1.admin0"
                    },
                    {
                        "name": "fm2.admin0"
                    },
                    {
                        "name": "nfs1"
                    },
                    {
                        "name": "vir0"
                    }
                ],
                "lag": "uplink",
                "mtu": 1500,
                "prefix": "10.10.100.0/24",
                "services": [
                    "data",
                    "management",
                    "support"
                ],
                "vlan": 2200
            }
        }
    }
(t
AnsibleModule(t	get_bladetpurefb_argument_specs1.3s1.4cC`s�i}|jj�jd}|j|d<|j|d<t|jj�j�|d<t|jj	�j�|d<t|j
j�j�|d<t|jj
�j�|d<t|jj�j�|d<t|jj�j�|d	<|jj�jdj|d
<|S(Nitflashblade_nametpurity_versiontfilesystemst	snapshotstbucketstobject_store_userstobject_store_accountstbladesttotal_capacity(tarraystlist_arraystitemstnametversiontlentfile_systemstlist_file_systemstfile_system_snapshotstlist_file_system_snapshotsRtlist_bucketsRtlist_object_store_usersRtlist_object_store_accountstbladetlist_bladestlist_arrays_spacetcapacity(R!t
default_factstdefaults((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_default_dict{s

cC`s(i}|jj�}|jjdd�}|jjdd�}|jjdd�}i
|jdjd6|jdjd6|jdjd6|jdjd	6|jdjd
6|jdjd6|jdj	d6|jdj
d
6|jdjd6|jdjd6|d<i
|jdjd6|jdjd6|jdjd6|jdjd	6|jdjd
6|jdjd6|jdj	d6|jdj
d
6|jdjd6|jdjd6|d<i
|jdjd6|jdjd6|jdjd6|jdjd	6|jdjd
6|jdjd6|jdj	d6|jdj
d
6|jdjd6|jdjd6|d<i
|jdjd6|jdjd6|jdjd6|jdjd	6|jdjd
6|jdjd6|jdj	d6|jdj
d
6|jdjd6|jdjd6|d<|S(Ntprotocolthttpts3tnfsitbytes_per_optbytes_per_readtbytes_per_writetread_bytes_per_sect
reads_per_sectusec_per_other_optusec_per_read_optusec_per_write_optwrite_bytes_per_sectwrites_per_sect	aggregate(
Rtlist_arrays_performanceRR,R-R.R/R0R1R2R3R4R5(R!t
perf_factst
total_perft	http_perfts3_perftnfs_perf((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_perf_dict�sdcC`s�i}|jj�jdj�|d<|jj�jdj�|d<|jj�jdj�|d<|jj	�j
}t|kr,|jj
ddg�jdj�|d<i|d<|jj�}xctdt|j��D]F}|j|j}i|j|jd	6|j|jd
6|d|<q�Wn|jj
ddg�jdj�|d<|jj
dd
g�jdj�|d<|jj�jdj|d<|jj�jdj�|d<|S(Nitdnstsmtptalert_watcherstnamest
managementtarray_managementtdirectory_service_rolestgroupt
group_baseR+tnfs_directory_servicetsmbtsmb_directory_servicetntpt	ssl_certs(R>tlist_dnsRtto_dictR?t	list_smtpR@tlist_alert_watcherstapi_versiont
list_versionstversionstHARD_LIMIT_API_VERSIONtdirectory_servicestlist_directory_servicestlist_directory_services_rolestrangeRRRERFRRtntp_serverstcertificatestlist_certificates(R!tconfig_factsRPtrolestrolet	role_name((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_config_dict�s&   )
#)) cC`s>i}|jj�}x"tdt|j��D]}|j|j}|j|jr.i|j|jd6|j|jd6|j|j	d6|j|j
d6|j|jd6||<|j|jj||d<g||d<xWtdt|j|j
��D]3}||dji|j|j
|jd	6�q�Wq.q.W|S(
Nitgatewaytmtutvlantprefixtservicestlagt
interfacesR(tsubnetstlist_subnetsRWRRRtenabledR`RaRbRcRdtlink_aggregation_groupRftappend(R!t	sub_factsRgtsubtsub_nametiface((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_subnet_dict�s &8cC`s�i}|jj�}x�tdt|j��D]�}|j|j}i|j|jd6|j|jd6|j|jd6||<g||d<xTtdt|j|j	��D]3}||dj
i|j|j	|jd6�q�Wq.W|S(Nit	lag_speedt
port_speedRtportsR(tlink_aggregation_groupstlist_link_aggregation_groupsRWRRRRqRrRRsRk(R!t	lag_factstgroupstgroupcnttlag_nametport((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_lag_dict�s&5cC`s�i}|jj�}x�tdt|j��D]�}|j|j}|j|jr.i|j|jd6|j|jd6|j|j	d6|j|j
d6|j|jd6|j|jd6|j|j
d6||<q.q.W|S(	NittypeRaRbtaddressRdR`tnetmask(tnetwork_interfacestlist_network_interfacesRWRRRRiR|RaRbR}RdR`R~(R!t	net_factsRstportcnttint_name((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_network_dict	scC`s�i}|jj�}|jjdd�}|jjdd�}|jdj|d<i|jdjjd6|jdjjd6|jdjjd6|jdjjd	6|jdjj	d
6|d<i|jdjjd6|jdjjd6|jdjjd6|jdjjd	6|jdjj	d
6|d<i|jdjjd6|jdjjd6|jdjjd6|jdjjd	6|jdjj	d
6|d<|S(NR|sfile-systemsobject-storeittotaltdata_reductionRttotal_physicaltuniquetvirtualR6(
RR#RR$tspaceR�RR�R�R�(R!tcapacity_factst	total_captfile_capt
object_cap((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_capacity_dicts0cC`s�i}|jj�}x~tdt|j��D]d}|j|j}i|j|jd6|j|jd6|j|jd6|j|j	d6||<q.W|S(Nit	destroyedtsourcetsuffixtsource_destroyed(
RRRWRRRR�R�R�R�(R!t
snap_factstsnapstsnaptsnapshot((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_snap_dict:scC`sfi}|jj�}xJtdt|j��D]0}|j|j}i|j|jd6|j|jd6|j|jd6|j|j	d6||<|j|j
jr�|j|j
j||d<n|j|jjr�|j|jj
||d<n|j|jjr%|j|jj||d<n|jj�j}t|kr.|j|j||d	<q.q.W|S(
Nitfast_removetsnapshot_enabledtprovisionedR�R)tsmb_modet	nfs_rulest
hard_limit(RRRWRRRtfast_remove_directory_enabledtsnapshot_directory_enabledR�R�R)RiRHtacl_modeR+trulesRPRQRRRSthard_limit_enabled(R!tfs_factstfsystfsystemtshareRP((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytgenerate_fs_dictHs&c`s�t�}|jtdtdddd���t|dt�}t|�}|jj�j}t	|kr�|j
ddjt	��ng|jdD]}|j
�^q�}d��fd�|D�}t|�s|j
dddj��dj|�f�ni}d|ks!d	|kr4t|�|d<nd|ksLd	|kr_t|�|d<nd
|kswd	|kr�t|�|d
<nd|ks�d	|kr�t|�|d<nd|ks�d	|kr�t|�|d<nd
|ks�d	|krt|�|d
<nd|ks#d	|kr6t|�|d<nd|ksNd	|krat|�|d<nd|ksyd	|kr�t|�|d<n|jdi|d6�dS(Nt
gather_subsettdefaulttminimumR|tlisttsupports_check_modetmsgsDFlashBlade REST version not supported. Minimum version required: {0}talltconfigtperformanceR$tnetworkRgtlagsR
Rc3`s|]}|�kVqdS(N((t.0ttest(t
valid_subsets(sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pys	<genexpr>rss<value must gather_subset must be one or more of: %s, got: %st,Retsubnett
ansible_factstansible_purefb_facts(
sallR�sconfigR�scapacityR�ssubnetsR�sfilesystemss	snapshots(R
tupdatetdictRtTrueR	RPRQRRtMIN_REQUIRED_API_VERSIONt	fail_jsontformattparamstlowerR�tjoinR'R=R_R�R{R�RpR�R�t	exit_json(t
argument_spectmoduleR!RRR�tsubsettsubset_testtfacts((R�sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pytmain`sH	&#t__main__N(t
__future__RRRR|t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.pureR	R
R�RSR'R=R_RpR{R�R�R�R�R�t__name__(((sU/usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pyt<module>s0


�0		:								/

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