コード例 #1
0
    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'])
コード例 #2
0
ファイル: kis_guid.py プロジェクト: baszoetekouw/janus-py
		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)
コード例 #3
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)
コード例 #4
0
ファイル: test.py プロジェクト: baszoetekouw/janus-py
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'])