Chat now with support
Chat with Support

Benchmark Factory for Database 7.6 - User Guide

Getting Started Overview of Benchmark Factory Benchmark Factory Components Agents Connections Create and Edit Tests and Jobs Test Results and Run Reports Troubleshooting Licensing REST API

REST API

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.

URI Structure

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

Object Structure

The following represents the object structure for the resources in the REST API.

  • Jobs
    • Job
      • Tests
        • Test
      • Connection
  • TestRuns
    • TestRun
      • Connection
      • Test
  • Connections
    • Connection

Resources

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

 

Jobs

The Jobs resource represents the collection of all jobs currently created in Benchmark Factory.

Supported Methods: GET, POST

Method: GET

Retrieves a list of all jobs.

Request

Example: curl GET http://bmfserver:30100/api/jobs

Content-Data

None

Status Codes

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.

Method: POST

Creates a new job using the data stored in the content-data.

Request

Example: curl POST http://bmfserver:30100/api/jobs

Content-Data

This contains the XML describing the job to be created.

Replay Captured Workload

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.

Status Codes

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.

Response Header

The Location field in the response header contains the reference to the newly created job.

Job

The Job resource represents the Benchmark Factory job, which is the top resource to be executed/run.

Supported Methods: GET, PUT, DELETE

Method: GET

Retrieves the properties and child objects of the specified job.

Request

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

Content-Data

None

Status Codes

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.

Method: PUT

Updates properties or child resources, like Tests or Connection, for the specified job.

Request

Example: curl PUT http://bmfserver:30100/api/jobs/1

Content-Data

This contains the data describing the single or multiple properties/child resources to update.

Status Codes

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.

Change Job Status

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.

Method: DELETE

Deletes a Test collection or Connection.

Request

Example: curl DELETE http://bmfserver:30100/api/jobs/1

Content-Data

None

Status Codes

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.

Tests

The Test resource represents the collection of all tests.

Supported Methods: GET, POST

Method: GET

Retrieves a list of all tests.

Request

Example: curl GET http://bmfserver:30100/api/jobs/1/tests

Content-Data

None

Status Codes

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.

Method: POST

Creates a new test using the data stored in the content-data.

Request

Example: curl POST http://bmfserver:30100/api/jobs/1/tests

Content-Data

This will contain the XML describing the test to be created.

Status Codes

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.

Response Header

The Location field in the response header contains the reference to the newly created test.

Related Documents