mso_stae_contract: Add EPG contracts (#51383)

This module creates EPG contracts in schema templates.
This commit is contained in:
Dag Wieers 2019-01-28 14:37:30 +01:00 committed by GitHub
commit b595228983
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 276 additions and 0 deletions

View file

@ -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(