
    Vh                     r    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 d Zedk(  r e        yy)    )absolute_importdivisionprint_functionz1.1preview	community)metadata_versionstatussupported_bya  
---
module: mso_schema
short_description: Manage schemas
description:
- Manage schemas on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
- Akini Ross (@akinross)
options:
  schema:
    description:
    - The name of the schema.
    type: str
    aliases: [ name ]
  id:
    description:
    - The id of the schema.
    - This parameter is required when the C(schema) needs to be updated.
    type: str
  description:
    description:
    - The description of the schema.
    type: str
  state:
    description:
    - Use C(absent) for removing.
    - Use C(query) for listing an object or multiple objects.
    - Use C(present) for creating or updating. Only supported on versions of MSO that are 4.1 or greater.
    type: str
    choices: [ absent, query, present ]
    default: query
notes:
- Due to restrictions of the MSO REST API this module can only create empty schemas (i.e. schemas without templates) on versions of MSO that are 4.1 or greater.
  Use the M(cisco.mso.mso_schema_template) to automatically create schemas with templates.
seealso:
- module: cisco.mso.mso_schema_site
- module: cisco.mso.mso_schema_template
extends_documentation_fragment: cisco.mso.modules
a  
- name: Create schema
  cisco.mso.mso_schema:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema 1
    state: present
  delegate_to: localhost

- name: Remove schemas
  cisco.mso.mso_schema:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema 1
    state: absent

- name: Query a schema
  cisco.mso.mso_schema:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    schema: Schema 1
    state: query
  register: query_result

- name: Query all schemas
  cisco.mso.mso_schema:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    state: query
  register: query_result

)AnsibleModule)	MSOModulemso_argument_specc                     t               } | j                  t        ddg      t        d      t        d      t        ddg 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
      }t        |      }d}|ro|r|j                  ||      |_        n|j                  ||      |_        |j                  rF|s|j                  j                  d      }dj                  |      }n|j                  |      |_        |j                  |_        |dk(  r|j                  t        |||      d	       |j                  rg }|j                  j                  d      |k7  r|j                  t        dd|             |j                  j                  d      |k7  r||j                  t        dd|             |j                  s@|j                  |d|       n+|j                  s|j                  |dt        ||             |j                   |_        nN|dk(  rI|j                  |_        |j                  r,|j                  ri |_        n|j                  |d !      |_        |j#                          y )"Nstrname)typealiases)r   query)absentr   present)r   defaultchoices)schemaiddescriptionstateTr   r   r   r   )argument_specsupports_check_moderequired_ifr   r   schemas)r   )displayNamezschemas/{id})r!   r   r   )collater!   replacez/displayName)oppathvaluez/descriptionPATCH)methoddataPOST)r!   r   DELETE)r(   )r   updatedictr   paramsgetr   get_objexistingformat
query_objsprevioussanitizeappend
check_moderequestproposed	exit_json)	r   moduler   	schema_idr   r   msor%   opss	            h/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/cisco/mso/plugins/modules/mso_schema.pymainr@   c   sm   %'M1Ue$w8VW	   # h
+i(,
F ]]x(F!!$'I--##M2KMMg&E
F
CD ;;t	;:CL;;t;@CL<<LL,,T2	!((I(6D~~d+<<CL	TfT^bc<<C||.&8

49>PQ||.+=+BY

49>UV$$Ds;$$Ddv[f6gh||	(	||<<  !"{{4{AMMO    __main__N)
__future__r   r   r   r   __metaclass__ANSIBLE_METADATADOCUMENTATIONEXAMPLESRETURNansible.module_utils.basicr   6ansible_collections.cisco.mso.plugins.module_utils.msor   r   r@   __name__ rA   r?   <module>rM      s]    A @(-)Vab 'R"H
 5 _AH zF rA   