Cloud Music Player for Distributed Systems Coursework. Just a README for now.
The web interface can be used by visiting http://shell1.doc.ic.ac.uk:53231/CourseWork/
Returns all the available playlists
Method | GET | |
Endpoint | MusicManagementService?action=get-playlists | |
Example Call |
curl -X GET \ "http://shell1.doc.ic.ac.uk:53231/CourseWork/MusicManagementService?action=get-playlists" |
|
Response |
{"playlists":["ph-test"]} |
Creates a playlist with the given name
Method | POST | |
Endpoint | MusicManagementService?action=create-playlist | |
URL Params | playlist-name |
The name of the playlist to create |
Example Call |
curl -X POST \ "http://shell1.doc.ic.ac.uk:53231/CourseWork/MusicManagementService?action=create-playlist &playlist-name=ph-npl" |
|
Response |
{"result":"Playlist Created"} Or, if an error occurred (duplicates etc), returns HTTP response code 400 Bad Requestand response content: {"result":"Playlist Couldn't be Created"} |
Deletes a playlist and all it's music
Method | DELETE | |
Endpoint | MusicManagementService?action=delete-playlist | |
URL Params | playlist-name |
The name of the playlist to delete |
Example Call |
curl -X DELETE \ "http://shell1.doc.ic.ac.uk:53231/CourseWork/MusicManagementService?action=delete-playlist &playlist-name=ph-npl" |
|
Response |
{"result":"Playlist Deleted"} Or, if the playlist doesn't exist, a 400 Bad Requestand response: {"result":"Playlist Couldn't be Found"} |
Creates a playlist with the given name
Method | GET | |
Endpoint | MusicManagementService?action=get-tracks | |
URL Params | playlist-name |
The name of the playlist to get tracks from |
Example Call |
curl -X GET \ "http://shell1.doc.ic.ac.uk:53231/CourseWork/MusicManagementService?action=get-tracks &playlist-name=ph-test" |
|
Response |
{"tracks":["sample.mp3"]} Or, if the playlist doesn't exist, a 400 Bad Requestand response: {"result":"Playlist Couldn't be Found"} |
Deletes a track in a specified playlist
Method | DELETE | |
Endpoint | MusicManagementService?action=delete-track | |
URL Params | playlist-name |
The name of the playlist the track belongs to |
file-name |
The name of the track file | |
Example Call |
curl -X DELETE \ "http://shell1.doc.ic.ac.uk:53231/CourseWork/MusicManagementService?action=delete-track &playlist-name=ph-test &file-name=sample.mp3" |
|
Response |
{"result":"Deleted Music File"} Or, if the playlist doesn't exist, a 400 Bad Requestand response: {"result":"Playlist Couldn't be Found"} |
Streams a track to the browser
Method | GET | |
Endpoint | MusicStreamServer | |
URL Params | playlist-name |
The name of the playlist the track belongs to |
file-name |
The name of the track file | |
Example Call |
curl -X GET \ "http://shell1.doc.ic.ac.uk:53231/CourseWork/MusicStreamServer ?playlist-name=ph-test &file-name=sample.mp3" |
|
Response | The music stream |
On a lab machine: mktomcat6 TOMCAT_TARGET_DIR
Change the port by editing conf/server.xml
, changing the value in the Connector tag but not in the Server tag.
cp WAR_FILE TOMCAT_TARGET_DIR/webapps
cd TOMCAT_TARGET_DIR
tomcat6 start