X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fdummy%2Fdummy_testbed_api_client.py;h=57a048254d465bf9720c7b88305d974e817383ba;hb=06768bd605e5d47fadfc90a35c74e30f267226a5;hp=e32c15b94ac4814c0cb0cb8fd86114b17def6b76;hpb=6717f88d0c48628d749af8c73939f1ddfcfba5b9;p=sfa.git diff --git a/sfa/dummy/dummy_testbed_api_client.py b/sfa/dummy/dummy_testbed_api_client.py index e32c15b9..57a04825 100644 --- a/sfa/dummy/dummy_testbed_api_client.py +++ b/sfa/dummy/dummy_testbed_api_client.py @@ -1,15 +1,18 @@ -import xmlrpclib +from __future__ import print_function + from datetime import datetime import time +from sfa.util.py23 import xmlrpc_client dummy_url = "http://localhost:8080" -dummy_api = xmlrpclib.ServerProxy(dummy_url) +dummy_api = xmlrpc_client.ServerProxy(dummy_url) -# Edit the parameters with your user info: +# Add a user: my_user_id = dummy_api.AddUser({'email': 'john.doe@test.net', 'user_name': 'john.doe', 'keys': ['copy here your ssh-rsa public key']}) -# Your user will be attached with the slice named : slice2 : +# Attach the user with the slice named : slice2 : dummy_api.AddUserToSlice({'slice_id': 2, 'user_id': my_user_id}) - -print dummy_api.GetUsers()[-1] -print dummy_api.GetSlices()[-1] +# Display the list of users +print(dummy_api.GetUsers()) +# Display the list of slices +print(dummy_api.GetSlices())