示例#1
0
#!/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'
示例#2
0
		'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']))
	if eid>200: exit(0)
	continue

	#if not entity['state']=='testaccepted':
	#	continue

	try:
		inst = entity['metadata']['coin']['institution_id']
示例#3
0
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']))
    if eid > 200: exit(0)
    continue

    #if not entity['state']=='testaccepted':
    #	continue
示例#4
0
#!/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")