Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/aci/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/aci/aci_config_snapshot.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZd
�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys8
---
module: aci_config_snapshot
short_description: Manage Config Snapshots (config:Snapshot, config:ExportP)
description:
- Manage Config Snapshots on Cisco ACI fabrics.
- Creating new Snapshots is done using the configExportP class.
- Removing Snapshots is done using the configSnapshot class.
version_added: '2.4'
options:
  description:
    description:
    - The description for the Config Export Policy.
    type: str
    aliases: [ descr ]
  export_policy:
    description:
    - The name of the Export Policy to use for Config Snapshots.
    type: str
    aliases: [ name ]
  format:
    description:
    - Sets the config backup to be formatted in JSON or XML.
    - The APIC defaults to C(json) when unset.
    type: str
    choices: [ json, xml ]
  include_secure:
    description:
    - Determines if secure information should be included in the backup.
    - The APIC defaults to C(yes) when unset.
    type: bool
  max_count:
    description:
    - Determines how many snapshots can exist for the Export Policy before the APIC starts to rollover.
    - Accepted values range between C(1) and C(10).
    - The APIC defaults to C(3) when unset.
    type: int
  snapshot:
    description:
    - The name of the snapshot to delete.
    type: str
  state:
    description:
    - Use C(present) or C(absent) for adding or removing.
    - Use C(query) for listing an object or multiple objects.
    type: str
    choices: [ absent, present, query ]
    default: present
extends_documentation_fragment: aci
notes:
- The APIC does not provide a mechanism for naming the snapshots.
- 'Snapshot files use the following naming structure: ce_<config export policy name>-<yyyy>-<mm>-<dd>T<hh>:<mm>:<ss>.<mss>+<hh>:<mm>.'
- 'Snapshot objects use the following naming structure: run-<yyyy>-<mm>-<dd>T<hh>-<mm>-<ss>.'
seealso:
- module: aci_config_rollback
- name: APIC Management Information Model reference
  description: More information about the internal APIC classes B(config:Snapshot) and B(config:ExportP).
  link: https://developer.cisco.com/docs/apic-mim-ref/
author:
- Jacob McGill (@jmcgill298)
s�
- name: Create a Snapshot
  aci_config_snapshot:
    host: apic
    username: admin
    password: SomeSecretPassword
    state: present
    export_policy: config_backup
    max_count: 10
    description: Backups taken before new configs are applied.
  delegate_to: localhost

- name: Query all Snapshots
  aci_config_snapshot:
    host: apic
    username: admin
    password: SomeSecretPassword
    state: query
  delegate_to: localhost
  register: query_result

- name: Query Snapshots associated with a particular Export Policy
  aci_config_snapshot:
    host: apic
    username: admin
    password: SomeSecretPassword
    export_policy: config_backup
    state: query
  delegate_to: localhost
  register: query_result

- name: Delete a Snapshot
  aci_config_snapshot:
    host: apic
    username: admin
    password: SomeSecretPassword
    export_policy: config_backup
    snapshot: run-2017-08-24T17-20-05
    state: absent
  delegate_to: localhost
s�

current:
  description: The existing configuration from the APIC after the module has finished
  returned: success
  type: list
  sample:
    [
        {
            "fvTenant": {
                "attributes": {
                    "descr": "Production environment",
                    "dn": "uni/tn-production",
                    "name": "production",
                    "nameAlias": "",
                    "ownerKey": "",
                    "ownerTag": ""
                }
            }
        }
    ]
error:
  description: The error information as returned from the APIC
  returned: failure
  type: dict
  sample:
    {
        "code": "122",
        "text": "unknown managed object class foo"
    }
raw:
  description: The raw output returned by the APIC REST API (xml or json)
  returned: parse error
  type: str
  sample: '<?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata>'
sent:
  description: The actual/minimal configuration pushed to the APIC
  returned: info
  type: list
  sample:
    {
        "fvTenant": {
            "attributes": {
                "descr": "Production environment"
            }
        }
    }
previous:
  description: The original configuration from the APIC before the module has started
  returned: info
  type: list
  sample:
    [
        {
            "fvTenant": {
                "attributes": {
                    "descr": "Production",
                    "dn": "uni/tn-production",
                    "name": "production",
                    "nameAlias": "",
                    "ownerKey": "",
                    "ownerTag": ""
                }
            }
        }
    ]
proposed:
  description: The assembled configuration from the user-provided parameters
  returned: info
  type: dict
  sample:
    {
        "fvTenant": {
            "attributes": {
                "descr": "Production environment",
                "name": "production"
            }
        }
    }
filter_string:
  description: The filter string used for the request
  returned: failure or debug
  type: str
  sample: ?rsp-prop-include=config-only
method:
  description: The HTTP method used for the request to the APIC
  returned: failure or debug
  type: str
  sample: POST
response:
  description: The HTTP response from the APIC
  returned: failure or debug
  type: str
  sample: OK (30 bytes)
status:
  description: The HTTP status from the APIC
  returned: failure or debug
  type: int
  sample: 200
url:
  description: The HTTP url used for the request to the APIC
  returned: failure or debug
  type: str
  sample: https://10.11.12.13/api/mo/uni/tn-production.json
(t
AnsibleModule(t	ACIModuletaci_argument_specc
C`snt�}|jdtddddg�dtddddg�dtddd	d
dg�dtdd
�dtdd�dtdd�dtddd	dddgdd��td|dtdddddggdddggg�}t|�}|jd}|jd}|jd}|j|jd�}|jd}|dk	r�|t	dd�krqt
|�}q�|jdd�n|jd}|dk	r�|jd�r�d|}n|jd}	|	dkru|j
dtdd d!d"j|�d#|d$i|d6��|j�|jdd d%td&d'd|d|d(|d)|d|dd*��|jd �|j�n�|dk	r�d+j|�}n|j
dtdd,d!d-j|�d#|d$i|d6�d.tdd/d!d0j|�d#|d$i|d6��|j�|	dkr`|jdd/d%td|d1d*��|jr`|jd/�|j�q`n|j�dS(2Ntdescriptionttypetstrtaliasestdescrt
export_policytnametformattchoicestjsontxmltinclude_securetboolt	max_counttinttsnapshottstatetabsenttpresenttquerytdefaultt
argument_spectsupports_check_modetrequired_ifiitmsgs7Parameter 'max_count' must be a number between 1 and 10srun-t
root_classt	aci_classt
configExportPtaci_rnsfabric/configexp-{0}t
module_objectt
target_filtertclass_configtadminStt	triggeredtincludeSecureFieldstmaxSnapshotCounttyessuni/fabric/configexp-{0}tconfigSnapshotContsbackupst/snapshots-[{0}]t
subclass_1tconfigSnapshotssnapshot-{0}tretire(R
tupdatetdictRtFalseR	tparamstbooleantNonetrangeR
t	fail_jsont
startswitht
construct_urlRtget_existingtpayloadtget_difftpost_configtexistingt	exit_json(
R tmoduletaciRRtfile_formatRRRR((sS/usr/lib/python2.7/site-packages/ansible/modules/network/aci/aci_config_snapshot.pytmain�s�		%






	
	


	
	
	
t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt$ansible.module_utils.network.aci.aciR	R
RGt__name__(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/aci/aci_config_snapshot.pyt<module>s


>*i	m

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