|
TestingServiceAPI
API Standards for The Testing Service
Featured IntroductionThese are the interfaces that need to be supported by a service that implements Web Performance Testing. OperationsThese are the operations that the interfaces will need to support Location/Configuration EnumerationWe need a way to query for the different test machine configurations and capabilities. This will need to be a filterable query for a flat list rather than a hierarchy because some models may make sense to say "give me all of the physical locations" and then list the configurations in each location but it is also possible to build a UI that would want the list of tester pools that have a particular browser or that are on a particular carrier. There will need to be a collection of entry-points: - Query for the list of parameters that can be used for filtering and their possible values - Query for the actual tester pools (and identify fields of data you'd like back about each pool) Script RegistrationFor complex or larger test scripts there needs to be an interface for registering a script bundle (including any referenced external files) and referencing it in the actual test request. Method: POST URI: script Parameters: Response: Example: Request POST http://www.webpagetest.org/wtf/test multipart-form script_file=... Response Test SubmissionThe ability to submit a test request to a given tester pool/configuration. If a test can be completed synchronously then the results are returned directly in the response, otherwise the status of the test is returned (the response is the same as the Status Check API). Not all features will be supported by all services so be sure to check the capabilities of a service before assuming it can support the features you are requesting (particularly when requesting multiple iterations, urls, etc). Method: POST URI: test Parameters:
Response: Example: Request POST http://www.webpagetest.org/wtf/test url=... Response Check Status/Retrieve Test ResultReturns the details of a test. If the test isn't complete yet then the status would be returned Method: GET URI: test/<id>
Parameters: Response: Example: Request GET http://www.webpagetest.org/wtf/test/20110325_XX_YYYSA Response Cancel/Delete Test ResultThe testing service isn't expected to provide long-term storage of results. At a minimum you'll need to be able to cancel a pending test but it wouldn't hurt to allow for an explicit delete of ephemeral results as well. Method: DELETE URI: test/<id>
Parameters: Response: Example: Request DELETE http://www.webpagetest.org/wtf/test/20110325_XX_YYYSA Response Notification/Beaconing of ResultsIn addition to polling for status/result we should allow for the testing service to push results (or just notification of results being available) using a standard interface (HTTP Post to a supplied URL). |
I would like to propose to support both "real-time" tests and "polling for result" type of tests. In a real-time test the test result will be part of the response of the "Test submission" call. So maybe we can add a flag in "Test submission" for that (or make it part of the response for that call).
Mark
Not an expert on REST interfaces, but from what I've seen aren't id's typically passed in via the URI? Eg:
GET http://www.webpagetest.org/wtf/test/20110325_XX_YYYSA
I also agree that we should distinguish between time sensitive/real time tests and best effort requests. There will be some requests that if that can't be completed right away aren't needed. In theory on the back-end these requests will be handled by different equipment and possibly billed for at a different rate by providers.
This could be done with a separate call or simply a variable though.
This also raises the issue of scheduled tests, i.e. do a test at or as close to a specific day and time in the future. Taking this a step further there is the issue of scheduling recurring tests. Sounds like we need a position on whether or not that is in scope here.
Finally perhaps it's best to tackle this near the end, but there is the small matter of error handling.
Ian
@ian, I'd prefer not to tackle scheduled tests directly as part of this API (or at least this iteration) because I think the consumption model is different enough that it justifies it's own interface. I expect you'd want to managed the schedules and "jobs" but the result access would be more through something like the data api. For most users I expect they'll be using a vendor's UI for managing the schedules and then use the data API as the integration point for the results.
@adrian - thx, I'll adjust the interface appropriately.