�
�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 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_bys�
---
module: mso_schema
short_description: Manage schemas
description:
- Manage schemas 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
aliases: [ name ]
templates:
description:
- A list of templates for this schema.
type: list
sites:
description:
- A list of sites mapped to templates in this schema.
type: list
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
notes:
- Due to restrictions of the MSO REST API this module cannot create empty schemas (i.e. schemas without templates).
Use the M(mso_schema_template) to automatically create schemas with templates.
seealso:
- module: mso_schema_site
- module: mso_schema_template
extends_documentation_fragment: mso
s�
- name: Add a new schema
mso_schema:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
state: present
templates:
- name: Template1
displayName: Template 1
tenantId: north_europe
anps:
<...>
- name: Template2
displayName: Template 2
tenantId: nort_europe
anps:
<...>
delegate_to: localhost
- name: Remove schemas
mso_schema:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
state: absent
delegate_to: localhost
- name: Query a schema
mso_schema:
host: mso_host
username: admin
password: SomeSecretPassword
schema: Schema 1
state: query
delegate_to: localhost
register: query_result
- name: Query all schemas
mso_schema:
host: mso_host
username: admin
password: SomeSecretPassword
state: query
delegate_to: localhost
register: query_result
t
( t
AnsibleModule( t MSOModulet mso_argument_spect issubsetc
C` s� t � } | j d t d d d d g � d t d d � d t d d � d t d d d
d d d
d d g � � t d | d t d d d
d g g d d d d g g g � } | j d } | j d } | j d } | j d } t | � } d } d } | rA| j | d | �| _ | j rS| j d } d j
d | � } qSn | j | � | _ | d k rbn9| d
k r�| j | _ | j r�| j
r�i | _ q�| j | d d �| _ q�n� | d k r�| j | _ t d | d | d | d | � } | j | d t �| j r_t | j | j � s�| j
r8| j | _ q\| j | d d d | j �| _ q�q�| j
rw| j | _ q�| j | d d d | j �| _ n | j � d S( Nt schemat typet strt aliasest namet templatest listt sitest statet defaultt presentt choicest absentt queryt
argument_spect supports_check_modet required_ift schemast displayNamet ids schemas/{id}t methodt DELETEt collatet PUTt datat POST( R t updatet dictR t Truet paramsR
t Nonet get_objt existingt formatt
query_objst previoust
check_modet requestt sanitizeR t sentt proposedt exit_json(
R t moduleR
R R R t msot schema_idt patht payload( ( sJ /usr/lib/python2.7/site-packages/ansible/modules/network/aci/mso_schema.pyt maino sb %
' $t __main__N( t
__future__R R R R t
__metaclass__t ANSIBLE_METADATAt
DOCUMENTATIONt EXAMPLESt RETURNt ansible.module_utils.basicR t$ ansible.module_utils.network.aci.msoR
R R R<