Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/aci/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/aci/mso_schema_template_anp_epg_contract.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZmZmZd
�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	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	MSOModuletmso_argument_spectmso_contractref_spectissubsetcC`s�t�}|jdtdddt�dtdddt�dtdddt�dtdddt�dtdd	d
t��dtdddd
ddd
dg��td|dtddddggdd
dggg�}|jd}|jd}|jd}|jd}|jd}|jd}t|�}|r�|jd�dkr^||d<n|j
|d�|d<|jd�dkr�||d<q�n|jdd|�}	|	r�|	d}
n|jddj
|��dj
|	�}g|	dD]}|d^q�}
||
kr?|jddj
|dj|
���n|
j|�}g|	d|dD]}|d^qa}||kr�|jdd j
|dj|���n|j|�}g|	d|d|d!D]}|d^q�}||kr%|jdd"j
d|d!dj|���n|j|�}|rg|	d|d|d!|d#D]}|d$|d%f^q]}|j|�}||df|kr|j||df�}d&j
||||�}|	d|d|d!|d#||_qn|dkrn|s<|	d|d|d!|d#|_n%|jsa|jdd'j
|��n|j�nd(j
|||�}g}|j|_|dkr�|jr�i|_|_|jtd)d*d+|��q�n�|d
kr�td%|dd$td,|dd-|dd.|d��}|j|d/t�|jrf|jtd)d0d+|d1|j��n)|jtd)d2d+|d3d1|j��|j|_n|js�|j|d4d5d6|�n|j�dS(7Ntschemattypetstrtrequiredttemplatetanptepgtcontracttdicttoptionststatetdefaulttpresenttchoicestabsenttqueryt
argument_spectsupports_check_modetrequired_ift	schema_idtschemastdisplayNametidtmsgs$Provided schema '{0}' does not existsschemas/{id}t	templatestnames?Provided template '{0}' does not exist. Existing templates: {1}s, tanpss5Provided anp '{0}' does not exist. Existing anps: {1}tepgss:Provided epg '{epg}' does not exist. Existing epgs: {epgs}tcontractRelationshipstcontractReftrelationshipTypes:/templates/{0}/anps/{1}/epgs/{2}/contractRelationships/{3}sContract '{0}' not founds6/templates/{0}/anps/{1}/epgs/{2}/contractRelationshipstoptremovetpathtcontractNamettemplateNametschemaIdtcollatetreplacetvaluetadds/-tmethodtPATCHtdata(RtupdateRtTrueRR	tparamsR
tgettNonet
lookup_schematget_objt	fail_jsontformattjointindextcontract_reftexistingt	exit_jsontprevioustsenttappendtsanitizetproposedt
check_modetrequest(RtmoduleRRRRRRtmsot
schema_objR!tschema_pathttR&ttemplate_idxtaR(tanp_idxteR)tepg_idxtct	contractsREtcontract_idxt
contract_pathtcontracts_pathtopstpayload((sd/usr/lib/python2.7/site-packages/ansible/modules/network/aci/mso_schema_template_anp_epg_contract.pytmain�s�		%







!()(1.@/(	
	"


	()	t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicR	t$ansible.module_utils.network.aci.msoR
RRR
R`t__name__(((sd/usr/lib/python2.7/site-packages/ansible/modules/network/aci/mso_schema_template_anp_epg_contract.pyt<module>s


D:"	r

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]