- # user specifies remote aggregate/sm/component
- if command in ("resources", "slices", "create", "delete", "start", "stop",
- "restart", "shutdown", "get_ticket", "renew", "status"):
- parser.add_option("-d", "--delegate", dest="delegate", default=None,
- action="store_true",
- help="Include a credential delegated to the user's root"+\
- "authority in set of credentials for this call")
-
+ if command in ("add", "update"):
+ parser.add_option('-x', '--xrn', dest='xrn', metavar='<xrn>', help='object hrn/urn (mandatory)')
+ parser.add_option('-t', '--type', dest='type', metavar='<type>', help='object type', default=None)
+ parser.add_option('-e', '--email', dest='email', default="", help="email (mandatory for users)")
+ parser.add_option('-k', '--key', dest='key', metavar='<key>', help='public key string or file',
+ default=None)
+ parser.add_option('-s', '--slices', dest='slices', metavar='<slices>', help='Set/replace slice xrns',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ parser.add_option('-r', '--researchers', dest='researchers', metavar='<researchers>',
+ help='Set/replace slice researchers', default='', type="str", action='callback',
+ callback=optparse_listvalue_callback)
+ parser.add_option('-p', '--pis', dest='pis', metavar='<PIs>', help='Set/replace Principal Investigators/Project Managers',
+ default='', type="str", action='callback', callback=optparse_listvalue_callback)
+ parser.add_option ('-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")
+
+ # show_credential option
+ if command in ("list","resources","create","add","update","remove","slices","delete","status","renew"):
+ parser.add_option("-C","--credential",dest='show_credential',action='store_true',default=False,
+ help="show credential(s) used in human-readable form")