�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z 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 � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysk
---
module: mso_schema_template_anp_epg_contract
short_description: Manage EPG contracts in schema templates
description:
- Manage EPG contracts in schema templates on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
version_added: '2.8'
options:
schema:
description:
- The name of the schema.
type: str
required: yes
template:
description:
- The name of the template to change.
type: str
required: yes
anp:
description:
- The name of the ANP.
type: str
required: yes
epg:
description:
- The name of the EPG to manage.
type: str
required: yes
contract:
description:
- A contract associated to this EPG.
type: dict
suboptions:
name:
description:
- The name of the COntract to associate with.
required: true
type: str
schema:
description:
- The schema that defines the referenced BD.
- If this parameter is unspecified, it defaults to the current schema.
type: str
template:
description:
- The template that defines the referenced BD.
type: str
type:
description:
- The type of contract.
type: str
required: true
choices: [ consumer, provider ]
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
seealso:
- module: mso_schema_template_anp_epg
- module: mso_schema_template_contract_filter
extends_documentation_fragment: mso
s�
- name: Add a contract to an EPG
mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contract:
name: Contract 1
type: consumer
state: present
delegate_to: localhost
- name: Remove a Contract
mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contract:
name: Contract 1
state: absent
delegate_to: localhost
- name: Query a specific Contract
mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
epg: EPG 1
contract:
name: Contract 1
state: query
delegate_to: localhost
register: query_result
- name: Query all Contracts
mso_schema_template_anp_epg_contract:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
template: Template 1
anp: ANP 1
state: query
delegate_to: localhost
register: query_result
t
( t
AnsibleModule( t MSOModulet mso_argument_spect mso_contractref_spect issubsetc C` s� t � } | j d t d d d t � d t d d d t � d t d d d t � d t d d d t � d t d d d
t � � d t d d d d
d d d
d g � � t d | d t d d d d g g d d
d g g g � } | j d } | j d } | j d } | j d } | j d } | j d } t | � } | r�| j d � d k r^| | d <n | j
| d � | d <| j d � d k r�| | d <q�n | j d d | �} | r�| d }
n | j d d j
| � � d j
| � } g | d D] } | d ^ q�}
| |
k r?| j d d j
| d j |
� � � n |
j | � } g | d | d D] } | d ^ qa} | | k r�| j d d j
| d j | � � � n | j | � } g | d | d | d! D] } | d ^ q�} | | k r%| j d d"