baseurl='https://serviceregistry.test.surfconext.nl/janus/app.php/api') #foo.list(); #foo.list(entityid='http://ste.test.iqualify.nl/SAML2') print("\nFetching basic record\n\n") basic = foo.get('bazo:test', ) pprint(basic) id = basic['id'] print("Found entity with id=%u\n" % id) print("\nFetching full record\n\n") extended = foo.get(id) extended['metadata']['OrganizationName'] = {"en": "Bas is erg tof"} pprint(extended) print("\nUpdating record\n\n") foo.update(id, extended) print("\nAdding record\n\n") extended['name'] = 'bazo:test3' newentity = foo.add(extended) print("\nFetching full new record\n\n") extended2 = foo.get(newentity['id']) pprint(extended2) print("\nRemoving entity\n\n") foo.delete(newentity['id'])
continue klant = klanten[inst] if 'institution_guid' in entity['metadata']['coin'] and entity['metadata']['coin']['institution_guid']==klant['guid']: True #print("guid=%s already present" % klant['guid']) else: print("----------------") print("eid=%u needs institution_guid for klant=%s" % (eid, inst)) print("no guid or wrong guid, setting it to %s" % klant['guid']) entity['metadata']['coin']['institution_guid'] = klant['guid']; try: result = sr.update(eid,entity,note="Automatically adding coin:institution_guid [BaZo]") except ServiceRegistryError as error: print("Request failed: %u (%s)" % (error.status,error.msg)) exit(1) #pprint(result) sleep(1) #break print("----------------") exit(0)
klant = klanten[inst] if 'institution_guid' in entity['metadata']['coin'] and entity['metadata'][ 'coin']['institution_guid'] == klant['guid']: True #print("guid=%s already present" % klant['guid']) else: print("----------------") print("eid=%u needs institution_guid for klant=%s" % (eid, inst)) print("no guid or wrong guid, setting it to %s" % klant['guid']) entity['metadata']['coin']['institution_guid'] = klant['guid'] try: result = sr.update( eid, entity, note="Automatically adding coin:institution_guid [BaZo]") except ServiceRegistryError as error: print("Request failed: %u (%s)" % (error.status, error.msg)) exit(1) #pprint(result) sleep(1) #break print("----------------") exit(0)
foo = ServiceRegistry(username='******',password='******',baseurl='https://serviceregistry.test.surfconext.nl/janus/app.php/api') #foo.list(); #foo.list(entityid='http://ste.test.iqualify.nl/SAML2') print("\nFetching basic record\n\n") basic = foo.get('bazo:test',) pprint(basic) id = basic['id'] print("Found entity with id=%u\n" % id) print("\nFetching full record\n\n") extended = foo.get(id) extended['metadata']['OrganizationName'] = {"en": "Bas is erg tof"} pprint(extended) print("\nUpdating record\n\n") foo.update(id,extended) print("\nAdding record\n\n") extended['name'] = 'bazo:test3' newentity = foo.add(extended) print("\nFetching full new record\n\n") extended2 = foo.get(newentity['id']) pprint(extended2) print("\nRemoving entity\n\n") foo.delete(newentity['id'])