+
+ @args('-x', '--xrn', dest='xrn', metavar='<xrn>', help='object hrn/urn (mandatory)')
+ @args('-t', '--type', dest='type', metavar='<type>', help='object type', default=None)
+ @args('-e', '--email', dest='email', default="",
+ help="email (mandatory for users)")
+ @args('-u', '--url', dest='url', metavar='<url>', default=None,
+ help="URL, useful for slices")
+ @args('-d', '--description', dest='description', metavar='<description>',
+ help='Description, useful for slices', default=None)
+ @args('-k', '--key', dest='key', metavar='<key>', help='public key string or file',
+ default=None)
+ @args('-s', '--slices', dest='slices', metavar='<slices>', help='Set/replace slice xrns',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ @args('-r', '--researchers', dest='researchers', metavar='<researchers>', help='Set/replace slice researchers',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ @args('-p', '--pis', dest='pis', metavar='<PIs>',
+ help='Set/replace Principal Investigators/Project Managers',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ @args('-X','--extra',dest='extras',default={},type='str',metavar="<EXTRA_ASSIGNS>", action="callback", callback=optparse_dictvalue_callback, nargs=1, help="set extra/testbed-dependent flags, e.g. --extra enabled=true")
+ def register(self, xrn, type=None, url=None, description=None, key=None, slices='',
+ pis='', researchers='',email='', extras={}):
+ """Create a new Registry record"""
+ record_dict = self._record_dict(xrn=xrn, type=type, url=url, key=key,
+ slices=slices, researchers=researchers, email=email, pis=pis, extras=extras)
+ self.api.manager.Register(self.api, record_dict)
+
+
+ @args('-x', '--xrn', dest='xrn', metavar='<xrn>', help='object hrn/urn (mandatory)')
+ @args('-t', '--type', dest='type', metavar='<type>', help='object type', default=None)
+ @args('-u', '--url', dest='url', metavar='<url>', help='URL', default=None)
+ @args('-d', '--description', dest='description', metavar='<description>',
+ help='Description', default=None)
+ @args('-k', '--key', dest='key', metavar='<key>', help='public key string or file',
+ default=None)
+ @args('-s', '--slices', dest='slices', metavar='<slices>', help='Set/replace slice xrns',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ @args('-r', '--researchers', dest='researchers', metavar='<researchers>', help='Set/replace slice researchers',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ @args('-p', '--pis', dest='pis', metavar='<PIs>',
+ help='Set/replace Principal Investigators/Project Managers',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ @args('-X','--extra',dest='extras',default={},type='str',metavar="<EXTRA_ASSIGNS>", action="callback", callback=optparse_dictvalue_callback, nargs=1, help="set extra/testbed-dependent flags, e.g. --extra enabled=true")
+ def update(self, xrn, type=None, url=None, description=None, key=None, slices='',
+ pis='', researchers='', extras={}):
+ """Update an existing Registry record"""
+ print 'incoming PIS',pis
+ record_dict = self._record_dict(xrn=xrn, type=type, url=url, description=description,
+ key=key, slices=slices, researchers=researchers, pis=pis, extras=extras)
+ self.api.manager.Update(self.api, record_dict)