
    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_byao  
---
module: mso_label
short_description: Manage labels
description:
- Manage labels on Cisco ACI Multi-Site.
author:
- Dag Wieers (@dagwieers)
options:
  label:
    description:
    - The name of the label.
    type: str
    aliases: [ name ]
  type:
    description:
    - The type of the label.
    type: str
    choices: [ site ]
    default: site
  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: cisco.mso.modules
a  
- name: Add a new label
  cisco.mso.mso_label:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    label: Belgium
    type: site
    state: present

- name: Remove a label
  cisco.mso.mso_label:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    label: Belgium
    state: absent

- name: Query a label
  cisco.mso.mso_label:
    host: mso_host
    username: admin
    password: SomeSecretPassword
    label: Belgium
    state: query
  register: query_result

- name: Query all labels
  cisco.mso.mso_label:
    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ddg      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
      }t        |      }d }d}|rR|j                  ||      |_        |j                  rD|j                  j                  d      }dj                  |      }n|j                  |      |_        |dk(  rn&|dk(  rK|j                  |_        |j                  r|j                  ri |_        n|j                  |d      |_        n|dk(  r|j                  |_        t        |||      }|j                  |d	       |j                  rR|j                         r|j                  r|j                   |_        ne|j                  |d|j"                        |_        nA|j                  r|j                   |_        n#|j                  |d|j"                        |_        |j%                          y )Nstrname)typealiasessite)r   defaultchoicespresent)absentr   query)labelr   stateTr   r   r   )argument_specsupports_check_moderequired_ifr   labels)displayNameidzlabels/{id})r!   r   DELETE)method)r!   r    r   )collatePUT)r#   dataPOST)r   updatedictr   paramsgetr   get_objexistingformat
query_objsprevious
check_moderequestsanitizecheck_changedproposedsent	exit_json)	r   moduler   
label_typer   msolabel_idpathpayloads	            g/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/cisco/mso/plugins/modules/mso_label.pymainr?   V   s   %'Mx0ufvh?y:XY   # h	*i'+
F MMg&E""6*JMMg&E
F
CHD {{4U{;<<||''-H ''8'4D~~d+	(	||<<  !"{{4{A	)	||
 	Wd+<<  "$$#&<<CL#&;;tE;#QCL  "||"{{4SXX{N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__ r@   r>   <module>rL      s\    A @(-)Vab <"H
 5 _FR zF r@   