|
|
|
@ -97,7 +97,7 @@ def mso_reference_spec():
|
|
|
|
|
|
|
|
|
|
def mso_subnet_spec():
|
|
|
|
|
return dict(
|
|
|
|
|
ip=dict(type='str', required=True),
|
|
|
|
|
subnet=dict(type='str', required=True, aliases=['ip']),
|
|
|
|
|
description=dict(type='str'),
|
|
|
|
|
scope=dict(type='str', choices=['private', 'public']),
|
|
|
|
|
shared=dict(type='bool'),
|
|
|
|
@ -393,19 +393,33 @@ class MSOModule(object):
|
|
|
|
|
ids.append(l['id'])
|
|
|
|
|
return ids
|
|
|
|
|
|
|
|
|
|
def contract_ref(self, contract):
|
|
|
|
|
def anp_ref(self, **data):
|
|
|
|
|
''' Create anpRef string '''
|
|
|
|
|
return '/schemas/{schema_id}/templates/{template}/anps/{anp}'.format(**data)
|
|
|
|
|
|
|
|
|
|
def epg_ref(self, **data):
|
|
|
|
|
''' Create epgRef string '''
|
|
|
|
|
return '/schemas/{schema_id}/templates/{template}/anps/{anp}/epgs/{epg}'.format(**data)
|
|
|
|
|
|
|
|
|
|
def bd_ref(self, **data):
|
|
|
|
|
''' Create bdRef string '''
|
|
|
|
|
return '/schemas/{schema_id}/templates/{template}/bds/{bd}'.format(**data)
|
|
|
|
|
|
|
|
|
|
def contract_ref(self, **data):
|
|
|
|
|
''' Create contractRef string '''
|
|
|
|
|
return '/schemas/{schema_id}/templates/{template}/contracts/{name}'.format(**contract)
|
|
|
|
|
# Support the contract argspec
|
|
|
|
|
if 'name' in data:
|
|
|
|
|
data['contract'] = data['name']
|
|
|
|
|
return '/schemas/{schema_id}/templates/{template}/contracts/{contract}'.format(**data)
|
|
|
|
|
|
|
|
|
|
def filter_ref(self, schema_id, template, filter_name):
|
|
|
|
|
def filter_ref(self, **data):
|
|
|
|
|
''' Create a filterRef string '''
|
|
|
|
|
data = dict(
|
|
|
|
|
schema_id=schema_id,
|
|
|
|
|
template=template,
|
|
|
|
|
filter=filter_name,
|
|
|
|
|
)
|
|
|
|
|
return '/schemas/{schema_id}/templates/{template}/filters/{filter}'.format(**data)
|
|
|
|
|
|
|
|
|
|
def vrf_ref(self, **data):
|
|
|
|
|
''' Create vrfRef string '''
|
|
|
|
|
return '/schemas/{schema_id}/templates/{template}/vrfs/{vrf}'.format(**data)
|
|
|
|
|
|
|
|
|
|
def make_reference(self, data, reftype, schema_id, template):
|
|
|
|
|
''' Create a reference from a dictionary '''
|
|
|
|
|
# Removes entry from payload
|
|
|
|
|