Development Intro
|
API reference can be found at http://www.mcs.anl.gov/fl/research/accessgrid/documentation/developer/api_2_4
|
Example
1 - Run the GetClients.py program
|
- Download GetClients.py.
- Run the program:
python GetClients.py https://vv2.mcs.anl.gov:9000/Venues/default
Note: OSX users will first need to source the file
/Applications/AccessGridToolkit.app/Contents/Resources/setupenv.sh
- Examine the GetClients.log file
Windows: %APPDATA%\AccessGrid\Logs\GetClients.log
Otherwise: ~/.AccessGrid/Logs/GetClients.log
|
Exercise
1 - Retrieve streams from a Venue
|
- Copy GetClients.py to GetStreams.py
- Modify GetStreams.py to get streams from Venue instead of clients
(review Venue.VenueIW API)
- Run the program:
python GetStreams.py https://vv2.mcs.anl.gov:9000/Venues/default
- Modify the code to print only the important parts of the returned
StreamDescriptions:
- stream.capability.type, stream.location.host, stream.location.port
- Run the program:
python GetStreams.py https://vv2.mcs.anl.gov:9000/Venues/default
Solution: GetStreams.py
|
Exercise
2 - Retrieve streams from a VenueClient
|
- Copy GetClients.py to GetUsers.py
- Modify code to retrieve list of users from the VenueClient
instead of clients from Venue (review VenueClient.VenueClientIW API)
- Make sure you have a VenueClient running, and you have entered a
venue
- Run the program:
python GetUsers.py https://localhost:11000/VenueClient
Solution: GetUsers.py
|
Exercise 3 –
Build web facade to VenueServer
|
- Download VenueServerHTTPFacade.py
- Run the program:
python VenueServerHTTPFacade.py
- Access http://localhost:8080
in a web browser; note minimal return.
- Modify code to retrieve Venues from
VenueServer and return venue names and URLs, on incoming GET request
- (optional) Modify server to return additional
Venue data: streams, clients, connections, data
- (optional) Modify server to return .vv2d files
for the listed Venues, which can be used to launch VenueClient from
webpage
Solution: �VenueServerHTTPFacade_Solution.py
|
Additional Example
- Add Argument Processing
|
- Download GetUsers_Args.py
- Run the program:
python GetUsers_Args.py --url=https://localhost:11000/VenueClient
|
Additional Example
- Locate running VenueClient
|
- Download GetUsers_Locate.py
- Run the program:
python GetUsers_Locate.py –locate
|
Additional Example - Add Logging
|
- Download GetUsers_Logging.py
- Run the program:
python GetUsers_Logging.py
|