# BenchmarkController Resource

This controller is responsible for handling cloud benchmark tests like sysbench

### GET /user/v1.0/benchmark/

Returns sysbench results only. Not supported yet

Security Roles Allowed
  ADMIN, USER

Response Codes
code | condition
--- | ---
200 | Successful query
401 | Bad credentials

Response Body
media type | data type
--- | ---
application/json | array of BenchmarkResult (JSON)
application/json | array of BenchmarkResult (JSON)
application/xml | list of benchmarkResult (XML)

#### Example

##### Request

    GET /user/v1.0/benchmark/
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    [ {
      "host" : "147.228.242.58",
      "end" : 12345,
      "delta" : 12345,
      "vmType" : "...",
      "start" : 12345,
      "cloudDeploymentDomain" : "us-east-1",
      "owner" : "user1",
      "id" : "58e3946e0fb4f562d84ba1ad",
      "timestamp" : 1499793079011
    } ]

### DELETE /user/v1.0/benchmark/all

Deletes all entries. Use with caution !

Security Roles Allowed
  ADMIN

Response Codes
code | condition
--- | ---
200 | Successful delete
401 | Bad credentials

Response Body
media type | data type
--- | ---
application/json | string (JSON)
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    DELETE /user/v1.0/benchmark/all
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    ...

### GET /user/v1.0/benchmark/ids

Returns the ids of stored objects. Empty list if non stored

Security Roles Allowed
  ADMIN, USER

Response Codes
code | condition
--- | ---
200 | Successful query
401 | Bad credentials

Response Body
media type | data type
--- | ---
application/json | array of string (JSON)
application/json | array of string (JSON)
application/xml | list of string (XML)

#### Example

##### Request

    GET /user/v1.0/benchmark/ids
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    ...

### DELETE /user/v1.0/benchmark/{id}

Deletes object

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
id | path |  | required

Response Codes
code | condition
--- | ---
200 | Successful delete
404 | Non existing id
401 | Bad credentials

Response Body
media type | data type
--- | ---
application/json | string (JSON)
application/json | string (JSON)
application/xml | string (XML)

#### Example

##### Request

    DELETE /user/v1.0/benchmark/{id}
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    ...

### GET /user/v1.0/benchmark/{id}

Returns a BenchmarkResult

Security Roles Allowed
  ADMIN, USER

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
id | path |  | required

Response Codes
code | condition
--- | ---
404 | BenchmarkResult not found
200 | BenchmarkResult exists
401 | Bad credentials

Response Body
media type | data type
--- | ---
application/json | BenchmarkResult (JSON)
application/json | BenchmarkResult (JSON)
application/xml | benchmarkResult (XML)

#### Example

##### Request

    GET /user/v1.0/benchmark/{id}
    Accept: application/json

##### Response

    HTTP/1.1 200 Looks Good
    Content-Type: application/json

    {
      "host" : "147.228.242.58",
      "end" : 12345,
      "delta" : 12345,
      "vmType" : "...",
      "start" : 12345,
      "cloudDeploymentDomain" : "us-east-1",
      "owner" : "user1",
      "id" : "58e3946e0fb4f562d84ba1ad",
      "timestamp" : 1499793079011
    }