mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 14:01:42 -07:00
mso_stae_contract: Add EPG contracts (#51383)
This module creates EPG contracts in schema templates.
This commit is contained in:
parent
9336281a60
commit
b595228983
2 changed files with 276 additions and 0 deletions
|
@ -105,6 +105,15 @@ def mso_subnet_spec():
|
|||
)
|
||||
|
||||
|
||||
def mso_contractref_spec():
|
||||
return dict(
|
||||
name=dict(type='str', required=True),
|
||||
schema=dict(type='str'),
|
||||
template=dict(type='str'),
|
||||
type=dict(type='str', required=True, choices=['consumer', 'provider']),
|
||||
)
|
||||
|
||||
|
||||
class MSOModule(object):
|
||||
|
||||
def __init__(self, module):
|
||||
|
@ -384,6 +393,10 @@ class MSOModule(object):
|
|||
ids.append(l['id'])
|
||||
return ids
|
||||
|
||||
def contract_ref(self, contract):
|
||||
''' Create contractRef string '''
|
||||
return '/schemas/{schema_id}/templates/{template}/contracts/{name}'.format(**contract)
|
||||
|
||||
def filter_ref(self, schema_id, template, filter_name):
|
||||
''' Create a filterRef string '''
|
||||
data = dict(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue