parser.add_option("-f", "--format", dest="format", type="choice",
help="display format ([xml]|dns|ip)", default="xml",
choices=("xml", "dns", "ip"))
+ #panos: a new option to define the type of information about resources a user is interested in
+ parser.add_option("-i", "--info", dest="info",
+ help="optional component information", default=None)
+
if command in ("resources", "show", "list"):
parser.add_option("-o", "--output", dest="file",
if args:
cred = self.get_slice_cred(args[0]).save_to_string(save_parents=True)
hrn = args[0]
- call_options = {'geni_slice_urn': hrn_to_urn(hrn, 'slice')}
+ call_options = {'geni_slice_urn': hrn_to_urn(hrn, 'slice')}
else:
cred = user_cred
hrn = None
creds.append(delegated_cred)
if opts.rspec_version:
call_options['rspec_version'] = opts.rspec_version
+ #panos add info options
+ if opts.info:
+ call_options['info'] = opts.info
result = server.ListResources(creds, call_options,unique_call_id())
format = opts.format
if opts.file is None:
-#!/usr/bin/python
+
import datetime
import time
def __init__(self, api, user_options={}):
self.api = api
- #panos
- self.user_options = user_options
- print "[aggregate] options = ",self.user_options
+ self.user_options = user_options
def prepare_sites(self, force=False):
if not self.sites or force:
self.prepared = True
- def get_rspec(self, slice_xrn=None, version = None):
+ def get_rspec(self, slice_xrn=None, version = None, type=None):
self.prepare()
rspec = None
rspec_version = RSpecVersion(version)
if rspec_version['type'].lower() == 'protogeni':
- rspec = PGRSpec()
+ rspec = PGRSpec(type=type)
#panos pass user options to SfaRSpec
elif rspec_version['type'].lower() == 'sfa':
- rspec = SfaRSpec("",{},self.user_options)
+ rspec = SfaRSpec(type=type, user_options=self.user_options)
else:
- rspec = SfaRSpec("",{},self.user_options)
+ rspec = SfaRSpec(type=type, user_options=self.user_options)
rspec.add_nodes(self.nodes.values())
xml = None
type = None
version = None
- namespaces = None
+ namespaces = None
+ user_options = {}
- def __init__(self, rspec="", namespaces={}, type=None):
+ def __init__(self, rspec="", namespaces={}, type=None, user_options={}:
self.type = type
+ self.user_options = user_options
if rspec:
self.parse_rspec(rspec, namespaces)
else:
out_rspec.xml = rspec.xml
else:
#out_rspec = PGRSpec(in_rspec)
+ # TODO: determine if this is an ad or request
out_rspec = PGRSpec()
out_rspec.xml = rspec.xml
return out_rspec