Benchmark Factory provides a REST API that can be used to create and run Standard Benchmark tests without the need to interact with the Benchmark Factory Console (user interface). Use a script, command-line tool, or custom application to interface with Benchmark Factory and to automate your load testing tasks.
The URIs for the Benchmark Factory REST API have the following basic structure:
http://{server}:{port}/api/{resource}
{server} is the Benchmark Factory server, {port} is the port number, and {resource} is the name of the resource.
Example
http://bmfserver:30100/api/jobs
The following represents the object structure for the resources in the REST API.
The Benchmark Factory REST API provides the following resources.
Resource | Supported Methods | Example URI |
---|---|---|
Jobs | GET, POST | http://bmfserver:30100/api/jobs |
Job | GET, PUT, DELETE |
http://bmfserver:30100/api/jobs/1 |
Tests | GET, POST | http://bmfserver:30100/api/jobs/1/tests |
Test | GET, PUT, DELETE | http://bmfserver:30100/api/jobs/1/tests/1 |
TestRuns | GET | http://bmfserver:30100/api/testruns |
TestRun | GET, PUT, DELETE |
http://bmfserver:30100/api/testruns/1 http://bmfserver:30100/api/testruns/1/connection http://bmfserver:30100/api/testruns/1/test |
Connections | GET, POST | http://bmfserver:30100/api/connections |
Connection | GET, PUT, DELETE | http://bmfserver:30100/api/connections/1 |
The Jobs resource represents the collection of all jobs currently created in Benchmark Factory.
Supported Methods: GET, POST
Retrieves a list of all jobs.
Example: curl GET http://bmfserver:30100/api/jobs
None
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there are other issues.
Code | Description |
---|---|
200 | The retrieval of the jobs collection succeeded. |
Creates a new job using the data stored in the content-data.
Example: curl POST http://bmfserver:30100/api/jobs
This contains the XML describing the job to be created.
When creating a job to replay a captured workload, use the following format to specify the capture file (.mse or .cpj) location.
Example XML: <Capture>C:\MyCaptures\MyCaptures.mse</Capture>
If the "Perform export as part of capture process" option was selected for the capture, use the following format to specify the location of the export file.
Example XML: <Capture ExportLocation="c:\capture\MyCapture">C:\MyCaptures\MyCaptures.mse</Capture>
Note: The ExportLocation value should be a database server folder where the exported file is located. Ensure the database can access this folder. If the export during capture option was selected for the specified capture, then you must supply this attribute, otherwise the attribute is ignored.
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there are other issues.
Code | Description |
---|---|
204 | The creation of the job succeeded. |
The Location field in the response header contains the reference to the newly created job.
The Job resource represents the Benchmark Factory job, which is the top resource to be executed/run.
Supported Methods: GET, PUT, DELETE
Retrieves the properties and child objects of the specified job.
A request URI for the Job resource has the following structure:
{base url}/api/jobs/{id|name}
{id} is the zero based index of the job and {name} is the name of the job.
Example request: curl GET http://bmfserver:30100/api/jobs/1
None
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there are other issues.
Code | Description |
---|---|
200 | The retrieval of the job resource succeeded. |
Updates properties or child resources, like Tests or Connection, for the specified job.
Example: curl PUT http://bmfserver:30100/api/jobs/1
This contains the data describing the single or multiple properties/child resources to update.
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there are other issues.
Code | Description |
---|---|
200 | The update of the properties/child resource succeeded. |
Executing or stopping a job can be done by changing the job status. The following table contains the valid state changes for a job.
Complete | Running | Ready | Hold | Stopping | |
---|---|---|---|---|---|
Currently Complete | --- | Runs job (if possible) | Readies a job to execute by schedule | Prevents a job from running | not valid |
Currently Running | Stops the running job | --- | Stops the running job | Stops the running job | Stops the running job |
Currently Ready | not valid | Runs job (if possible) | --- | Prevents a job from running | not valid |
Currently Hold | not valid | Runs job (if possible) | Readies a job to execute by schedule | --- | not valid |
Currently Stopping | not valid | not valid | not valid | not valid | --- |
Code | Description |
---|---|
204 | The creation of the child resource succeeded. |
Deletes a Test collection or Connection.
Example: curl DELETE http://bmfserver:30100/api/jobs/1
None
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there are other issues.
Code | Description |
---|---|
204 | The deletion of the child resource succeeded. |
The Test resource represents the collection of all tests.
Supported Methods: GET, POST
Retrieves a list of all tests.
Example: curl GET http://bmfserver:30100/api/jobs/1/tests
None
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there are other issues.
Code | Description |
---|---|
200 | The retrieval of the list of tests succeeded. |
Creates a new test using the data stored in the content-data.
Example: curl POST http://bmfserver:30100/api/jobs/1/tests
This will contain the XML describing the test to be created.
These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there are other issues.
Code | Description |
---|---|
204 | The creation of the test succeeded. |
The Location field in the response header contains the reference to the newly created test.
© 2024 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Conditions d’utilisation Confidentialité Cookie Preference Center