Interface description: REST Books Web

User related commands
// Get all users 
[GET]	/bookdata/v1.0/users

Book related commands
// Get specific Suite Book
[GET]	/bookdata/v1.0/book/<int:book_id>
// Get all books in the DB for a specific author
[GET]	/bookdata/v1.0/authors/<int:author_id>/books
// Get specific book's summary
[GET]	/bookdata/v1.0/books/<int:book_id>/summary
// Create a new book (Post)
[POST]	/bookdata/v1.0/books
// Update an existing Suite Run (Put)
[PUT]	/bookdata/v1.0/books
Author related commands
// Get specific book
[GET]	/bookdata/v1.0/books/<int:book_id>
// Get specific book's summary
[GET]	/bookdata/v1.0/books/<int:book_id>/summary
// Get specific book's author
[GET]	/bookdata/v1.0/books/<int:book_id>/author
// Create a new author (Post)
[POST]	/bookdata/v1.0/author
// Update an existing author (Put)
[PUT]	/bookdata/v1.0/author

Test Command related commands
// Get specific book chapter
[GET]	/bookdata/v1.0/chapters/<int:chapter_id>
$ curl -i http://localhost:5000/bookdata/v1.0/chapters/33
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   240  100   240    0     0    118      0  0:00:02  0:00:02 --:--:--   119HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 240
Server: Werkzeug/0.9.4 Python/2.7.5
Date: Wed, 25 Sep 2013 12:35:35 GMT

{
  "chapter": {
    "start_page": "1",
    "id": 33,
    "meta": null,
    "stop_page": “12”,
    "title": "A Long-Expected Party",
    "book_id": 3,
  }
}

// Get specific book’s sample
[GET]	/bookdata/v1.0/books/<int:book_id>/sample
$ curl -i http://localhost:5000/bookdata/v1.0/books/1/samples
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   261  100   261    0     0    128      0  0:00:02  0:00:02 --:--:--   128HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 261
Server: Werkzeug/0.9.4 Python/2.7.5
Date: Wed, 25 Sep 2013 12:36:30 GMT

{
  "sample": [
    [
      {
        "name": "The Hobbit",
        "Publication_Year": “September 21, 1937”,
        "author": 10,
        "book_id": 3,
        "language": 1,
        "Sample": 	“When Mr. Bilbo Baggins of Bag End announced that he would shortly be 
celebrating his eleventy-first birthday with a party of special 
magnificence, there was much talk and excitement in Hobbiton.
Bilbo was very rich and very peculiar, and had been the 
wonder of the Shire for sixty years, ever since his remarkable 
disappearance and unexpected return. The riches he had brought back 
from his travels had now become a local legend, and it was popularly 
believed, whatever the old folk might say, that the Hill at Bag End 
was full of tunnels stuffed with treasure. And if that was not enough 
for fame, there was also his prolonged vigour to marvel at. Time wore 
on, but it seemed to have little effect on Mr. Baggins. At ninety he 
was much the same as at fifty. At ninety-nine they began to call him 
well-preserved; but unchanged would have been nearer the mark. There 
were some that shook their heads and thought this was too much of a 
good thing; it seemed unfair that anyone should possess (apparently) 
perpetual youth as well as (reputedly) inexhaustible wealth.
"It will have to be paid for," they said. "It isn"t natural, 
and trouble will come of it!"”
      }
    ]
  ]
}

// Create a new sample (Post)
[POST]	/bookdata/v1.0/samples
$ curl -i -H "Content-Type: application/json" -X POST -d '{"type":"UFO-X1", "target_host":"TARGETX", "book_id":1}' http://localhost:5000/bookdata/v1.0/test_commands
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   178  100   118  100    60     57     29  0:00:02  0:00:02 --:--:--    57HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 118
Server: Werkzeug/0.9.4 Python/2.7.5
Date: Wed, 25 Sep 2013 12:29:59 GMT

{
  "sample": {
    "name": "TARGETX",
    "book_id": 1,
    "language": 1,
    “Publication_Year": 1,
    "author": "UFO-X1",
“Sample”:	“Fara smiled indulgently. "Your taste in epigrams is amusing, Hardin, but out of place. As a matter of fact, I think you remember my line of argument concerning the vault three weeks ago."
"Yes, I remember it. I don't deny that it was anything but a stupid idea from the standpoint of deductive logic alone. You said - stop me when I make a mistake - that Hari Seldon was the greatest psychologist in the System; that, hence, he could foresee the right and uncomfortable spot we're in now; that, hence, he established the Vault as a method of telling us the way out."”
  }
}
// Update an existing sample (Put)
[PUT]	/bookdata/v1.0/samples
$ curl -i -H "Content-Type: application/json" -X PUT -d '{"start_time":"2013-10-13 12:56:55", "end_time":"2165-10-13 16:56:55", "id":33}' http://localhost:5000/bookdata/v1.0/test_commands
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   319  100   240  100    79    115     38  0:00:02  0:00:02 --:--:--   115HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 240
Server: Werkzeug/0.9.4 Python/2.7.5
Date: Wed, 25 Sep 2013 12:30:20 GMT

{
  "test_command": {
    "end_time": "2165-10-13 16:56:55",
    "id": 33,
    "meta": null,
    "result": null,
    "start_time": "2013-10-13 12:56:55",
    "target_host": "TARGETX",
    "book_id": 1,
    "type": "UFO-X1"
  }
}