
    Vh                     z    d dl mZmZmZ eZddgddZdZdZdZ	d d	l
mZ d d
lmZmZmZmZ d Zedk(  r e        yy)    )absolute_importdivisionprint_functionz1.1preview	certified)metadata_versionstatussupported_bya  
---
module: aci_aep
short_description: Manage attachable Access Entity Profile (AEP) objects (infra:AttEntityP and infra:ProvAcc)
description:
- Connect to external virtual and physical domains by using
  attachable Access Entity Profiles (AEP) on Cisco ACI fabrics.
options:
  aep:
    description:
    - The name of the Attachable Access Entity Profile.
    type: str
    aliases: [ aep_name, name ]
  description:
    description:
    - Description for the AEP.
    type: str
    aliases: [ descr ]
  infra_vlan:
    description:
    - Enable infrastructure VLAN.
    - The hypervisor functions of the AEP.
    - C(false) will disable the infrastructure vlan if it is enabled.
    type: bool
    aliases: [ infrastructure_vlan ]
  state:
    description:
    - Use C(present) or C(absent) for adding or removing.
    - Use C(query) for listing an object or multiple objects.
    type: str
    default: present
    choices: [ absent, present, query ]
  name_alias:
    description:
    - The alias for the current object. This relates to the nameAlias field in ACI.
    type: str
extends_documentation_fragment:
- cisco.aci.aci
- cisco.aci.annotation
- cisco.aci.owner

seealso:
- module: cisco.aci.aci_aep_to_domain
- name: APIC Management Information Model reference
  description: More information about the internal APIC classes B(infra:AttEntityP) and B(infra:ProvAcc).
  link: https://developer.cisco.com/docs/apic-mim-ref/
author:
- Swetha Chunduri (@schunduri)
- Shreyas Srish (@shrsr)
a  
- name: Add a new AEP
  cisco.aci.aci_aep:
    host: apic
    username: admin
    password: SomeSecretPassword
    aep: ACI-AEP
    description: default
    infra_vlan: true
    state: present
  delegate_to: localhost

- name: Remove an existing AEP
  cisco.aci.aci_aep:
    host: apic
    username: admin
    password: SomeSecretPassword
    aep: ACI-AEP
    state: absent
  delegate_to: localhost

- name: Query all AEPs
  cisco.aci.aci_aep:
    host: apic
    username: admin
    password: SomeSecretPassword
    state: query
  delegate_to: localhost
  register: query_result

- name: Query a specific AEP
  cisco.aci.aci_aep:
    host: apic
    username: admin
    password: SomeSecretPassword
    aep: ACI-AEP
    state: query
  delegate_to: localhost
  register: query_result
a
  
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
)AnsibleModule)	ACIModuleaci_argument_specaci_annotation_specaci_owner_specc                     t               } | j                  t                      | j                  t                      | j                  t	        dddg      t	        ddg      t	        ddg      t	        ddg d	
      t	        d             t        | ddddggdddggg      }|j                  j                  d      }|j                  j                  d      }|j                  j                  d      }|j                  j                  d      }|j                  j                  d      }|r"t	        t	        t	        d                  g}n)|du r#t	        t	        t	        dd                  g}ng }t        |      }|j                  t	        ddj                  |      |d|i      dg        |j                          	 t        |j                  d!   d         d"k(  r|du rg }|dk(  rC|j                  dt	        |||#      |$       |j!                  d%       |j#                          n|dk(  r|j%                          |j'                          y # t        $ r Y yw xY w)&Nstrnameaep_name)typealiasesdescrboolinfrastructure_vlanpresent)absentr   query)r   defaultchoices)r   )aepdescription
infra_vlanstate
name_aliasTr!   r   r   )argument_specsupports_check_moderequired_ifr   r    r"   provacc)r   )
attributes)infraProvAccFdeleted)r   r	   infraAttEntityPzinfra/attentp-{0})	aci_classaci_rnmodule_objecttarget_filterr(   )
root_classchild_classesr      )r   r   	nameAlias)r+   class_configchild_configs)r+   )r   updater   r   dictr   paramsgetr   construct_urlformatget_existinglenexisting	Exceptionpayloadget_diffpost_configdelete_config	exit_json)	r#   moduler   r   r    r!   r"   r4   acis	            e/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/cisco/aci/plugins/modules/aci_aep.pymainrG      sV   %'M,./)*efj%9:egY7V.C-DEy:XYU#   # h(i%)
F --

E
"C--##M2K""<0JMMg&E""<0J44Y;O+PQR	u	44YW`;a+bcd
F
C'&--c2!3-	
 &&   s||A012a7J%<OM 	'!$
 ( 	 	
 	01	(	MMO+  s   
$I 	I('I(__main__N)
__future__r   r   r   r   __metaclass__ANSIBLE_METADATADOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   6ansible_collections.cisco.aci.plugins.module_utils.acir   r   r   r   rG   __name__     rF   <module>rT      sh    A @(-)Vab 1f'Rg
R 5 E  EFR zF rS   