@@ -0,0 +1,1241 @@
+#!/usr/bin/env python%0Aimport spiff%0Afrom getpass import getpass%0Aimport sys%0Aimport logging%0Aimport json%0A%0Aapi = spiff.API(sys.argv%5B1%5D, verify=False)%0Aapi.login(raw_input(%22Username: %22), getpass())%0A%0Acmd = sys.argv%5B2%5D%0A%0Adef printObj(obj, formats=%5B%5D):%0A  if len(formats) == 0:%0A    print %22%25s:%22%25(obj.resource_uri)%0A    for attr in obj.attributes:%0A      print %22%5Ct%25s: %25s%22%25(attr, getattr(obj, attr))%0A  else:%0A    attrs = %7B%7D%0A    for attr in obj.attributes:%0A      attrs%5Battr%5D = getattr(obj, attr)%0A    for fmt in formats:%0A      print fmt%25attrs%0A%0Aif cmd == %22list%22:%0A  objType = sys.argv%5B3%5D%0A  filters = %7B%7D%0A  formats = %5B%5D%0A  for filterParam in sys.argv%5B4:%5D:%0A    if %22=%22 in filterParam:%0A      param, value = filterParam.split('=')%0A      filters%5Bparam%5D = value%0A    else:%0A      formats.append(filterParam)%0A  for obj in api.getList(objType, **filters):%0A    printObj(obj, formats)%0Aelif cmd == %22get%22:%0A  objType = sys.argv%5B3%5D%0A  id = sys.argv%5B4%5D%0A  formats = sys.argv%5B5:%5D%0A  printObj(api.getOne(%22v1/%25s/%22%25(objType), id), formats)%0Aelif cmd == %22update%22:%0A  objType = sys.argv%5B3%5D%0A  id = sys.argv%5B4%5D%0A  obj = api.getOne(%22v1/%25s/%22%25(objType), id)%0A  props = %7B%7D%0A  for propParam in sys.argv%5B5:%5D:%0A    param, value = propParam.split('=')%0A    setattr(obj, param, json.loads(value))%0A  obj.save()%0A

Add a rough CLI