#!/usr/bin/env python # vim:ts=4:noexpandtab:sw=4 from sr.sr import ServiceRegistry from pprint import pprint 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'
klanten = dict() for k in kisklanten.Output[0]: klanten[k.Organisatiecode] = { 'iafk': k.Organisatiecode, 'guid': k.OrganisatieGUID, 'dg_code': k.DoelgroepCode, 'dg_val': k.DoelgroepValue, 'naam': k.Organisatienaam, } pprint(klanten) exit(0) # check entities in ServiceRegistry one by one sr = ServiceRegistry( username='******', password='******', baseurl='https://serviceregistry.surfconext.nl/janus/app.php/api') eids = sr.list_eids() for eid in eids: #print("fetching eid=%u" % eid) entity = sr.get(eid) # check if this entity had an institution_id if not 'metadata' in entity: continue if not 'coin' in entity['metadata']: continue if not 'institution_id' in entity['metadata']['coin']: continue print(
from time import sleep from sr.sr import ServiceRegistry, ServiceRegistryError import suds.client from suds.transport.https import HttpAuthenticated import logging #logging.basicConfig(level=logging.DEBUG) #logging.getLogger('suds.client').setLevel(logging.DEBUG) #logging.getLogger('suds.transport').setLevel(logging.DEBUG) #logging.getLogger('suds.xsd.schema').setLevel(logging.DEBUG) #logging.getLogger('suds.wsdl').setLevel(logging.DEBUG) # check entities in ServiceRegistry one by one sr = ServiceRegistry(username='******',password='******',baseurl='https://serviceregistry.surfconext.nl/janus/app.php/api') eids = sr.list_eids() for eid in eids: #print("fetching eid=%u" % eid) entity = sr.get(eid) # check state if not entity['state']=="testaccepted": continue # check if this entity had an institution_id if not 'metadata' in entity : continue if not 'coin' in entity['metadata'] : continue if not 'institution_guid' in entity['metadata']['coin']: continue;
kisklanten = kis.service.getKlantenByDienst('SURFconext') klanten = dict() for k in kisklanten.Output[0]: klanten[k.Organisatiecode] = { 'iafk' : k.Organisatiecode, 'guid' : k.OrganisatieGUID, 'dg_code': k.DoelgroepCode, 'dg_val' : k.DoelgroepValue, 'naam' : k.Organisatienaam, } pprint(klanten); exit(0) # check entities in ServiceRegistry one by one sr = ServiceRegistry(username='******',password='******',baseurl='https://serviceregistry.surfconext.nl/janus/app.php/api') eids = sr.list_eids() for eid in eids: #print("fetching eid=%u" % eid) entity = sr.get(eid) # check if this entity had an institution_id if not 'metadata' in entity : continue if not 'coin' in entity['metadata'] : continue if not 'institution_id' in entity['metadata']['coin']: continue; print("https://serviceregistry.surfconext.nl/simplesaml/module.php/janus/editentity.php?eid=%-2u %s %s" % (eid,entity['state'],entity['type']))
#!/usr/bin/env python # vim:ts=4:noexpandtab:sw=4 from sr.sr import ServiceRegistry from pprint import pprint 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")