python3 - 2to3 + miscell obvious tweaks
[sfa.git] / sfa / dummy / dummy_testbed_api_client.py
1
2
3 from datetime import datetime
4 import time
5 from sfa.util.py23 import xmlrpc_client
6
7 dummy_url = "http://localhost:8080"
8 dummy_api = xmlrpc_client.ServerProxy(dummy_url)
9
10 # Add a user:
11 my_user_id = dummy_api.AddUser({'email': 'john.doe@test.net', 'user_name': 'john.doe', 'keys': [
12                                'copy here your ssh-rsa public key']})
13 # Attach the user with the slice named : slice2 :
14 dummy_api.AddUserToSlice({'slice_id': 2, 'user_id': my_user_id})
15
16 # Display the list of users
17 print(dummy_api.GetUsers())
18 # Display the list of slices
19 print(dummy_api.GetSlices())