Service-Level Agreement API Resources

The SLA API provides programmatic access to SLA test configurations and the resulting reports.

API Summary

Operation Method Endpoint
Quotas
List Test Configuration Quotas GET /sla-api/v1/test-quotas
Create Test
Create a New Test Configuration POST /sla-api/v1/tests
Tests
List Test Configurations GET /sla-api/v1/tests{?slaTestIds}
Delete a Test Configuration DELETE /sla-api/v1/tests/{id}
Update a Test Configuration PUT /sla-api/v1/tests/{id}
Get a Test Configuration GET /sla-api/v1/tests/{id}
Agent Groups
List Agent Groups GET /sla-api/v1/agent-groups
Reports
List Performance Reports GET /sla-api/v1/tests/{slaTestId}/reports/performance{?start,end}
List Availability Reports GET /sla-api/v1/tests/{slaTestId}/reports/availability{?start,end}

List Test Configuration Quotas

GET /sla-api/v1/test-quotas

Status 200 application/json

Response:

[
  {
    "contractId": "1-2ABCD",
    "availabilitySlaCounts": {
      "used": 0,
      "max": 1
    },
    "performanceSlaCounts": {
       "used": 0,
       "max": 1
    }
  }
]

Create a New Test Configuration

POST /sla-api/v1/tests

Content-Type: application/json

Request:

{
  "groupId": 1,
  "contractId": "1-2ABCD",
  "agentGroupId": 123,
  "name": "My Test Name",
  "type": "PERFORMANCE",
  "performanceSlaTarget": 1.1,
  "testDetails": {
    "originUrl": "http://www.example.com/testObject.txt",
    "akamaiUrl": "http://www.example.com/testObject.txt",
    "originDnsHostnameOverride": "unpredictablestring-www.example.com"
  }
}

Status 201 application/json

Response:

{ "slaTestId": 82 }

List Test Configurations

GET /sla-api/v1/tests{?slaTestIds}

Example: /sla-api/v1/tests?slaTestIds=82,83

Parameter Type Sample Description
Optional
slaTestIds String 82,83 One or more IDs of SLA tests, comma separated.

Status 200 application/json

Response:

[
  {
    "slaTestId": 82,
    "contractId": "1-2ABCD",
    "agentGroupId": 123,
    "name": "My Test Name",
    "type": "PERFORMANCE",
    "performanceSlaTarget": 1.1,
    "testDetails": {
      "originUrl": "http://www.example.com/testObject.txt",
      "akamaiUrl": "http://www.example.com/testObject.txt",
      "originDnsHostnameOverride": "unpredictablestring-www.example.com"
    }
  },
  {
    "slaTestId": 83,
    "contractId": "1-2ABCD",
    "agentGroupId": 124,
    "name": "My Second Test Name",
    "type": "PERFORMANCE",
    "performanceSlaTarget": 1.1,
    "testDetails": {
      "originUrl": "http://www.example.com/testObject.txt",
      "akamaiUrl": "http://www.example.com/testObject.txt",
      "originDnsHostnameOverride": "unpredictablestring-www.example.com"
    }
  }
]

Delete a Test Configuration

DELETE /sla-api/v1/tests/{id}

Example: /sla-api/v1/tests/1

Parameter Type Sample Description
Required
id Number 1 The test’s unique identifier.

Status 200

Update a Test Configuration

PUT /sla-api/v1/tests/{id}

Example: /sla-api/v1/tests/1

Content-Type: application/json

Request:

{
  "contractId": "1-2ABCD",
  "agentGroupId": 123,
  "name": "My Test Name",
  "type": "PERFORMANCE",
  "performanceSlaTarget": 1.1,
  "testDetails": {
    "originUrl": "http://www.example.com/testObject.txt",
    "akamaiUrl": "http://www.example.com/testObject.txt",
    "originDnsHostnameOverride": "unpredictablestring-www.example.com"
  }
}

Parameter Type Sample Description
Required
id Number 1 The test’s unique identifier.

Status 200

Get a Test Configuration

GET /sla-api/v1/tests/{id}

Example: /sla-api/v1/tests/1

Parameter Type Sample Description
Required
id Number 1 The test’s unique identifier.

Status 200 application/json

Response:

{
    "slaTestId": 82,
    "contractId": "1-2ABCD",
    "agentGroupId": 123,
    "name": "My Test Name",
    "type": "performance",
    "performanceSlaTarget": 1.1,
    "testDetails": {
      "originUrl": "http://www.example.com/testObject.txt",
      "akamaiUrl": "http://www.example.com/testObject.txt",
      "originDnsHostnameOverride": "unpredictablestring-www.example.com"
    }
}

List Agent Groups

GET /sla-api/v1/agent-groups

Status 200 application/json

Response:

[
  {
    "agentGroupId": 1,
    "name": "Australia SLA"
  },
  {
    "agentGroupId": 5,
    "name": "North American SLA"
  }
]

List Performance Reports

GET /sla-api/v1/tests/{slaTestId}/reports/performance{?start,end}

Example: /sla-api/v1/tests/123123/reports/performance?start=2016–03–09T00:00:00Z&end=2016–03–12T01:00:00Z

Parameter Type Sample Description
Required
end String 2016-03-12T01:00:00Z Timestamp for the end of the data window, in UTC 8601 format.
slaTestId Number 123123 Unique identifier for the test you wish to run a report on.
start String 2016-03-09T00:00:00Z Timestamp for the start of the data window, in UTC 8601 format.

Status 200 application/json

Response:

{
  "data": [
    {
      "date": "2016-03-09",
      "averageAkamaiPerformanceGain": 1.2573270808909731,
      "numberOfAkamaiTests": 1385,
      "numberOfOriginTests": 1385,
      "averageResponseTimeOrigin": 2145,
      "averageResponseTimeAkamai": 1706
    },
    {
      "date": "2016-03-10",
      "averageAkamaiPerformanceGain": 1.1373414230557088,
      "numberOfAkamaiTests": 1329,
      "numberOfOriginTests": 1329,
      "averageResponseTimeOrigin": 2062,
      "averageResponseTimeAkamai": 1813
    },
    {
      "date": "2016-03-11",
      "averageAkamaiPerformanceGain": 1.3577405857740585,
      "numberOfAkamaiTests": 1245,
      "numberOfOriginTests": 1245,
      "averageResponseTimeOrigin": 1947,
      "averageResponseTimeAkamai": 1434
    }
  ]
}

List Availability Reports

GET /sla-api/v1/tests/{slaTestId}/reports/availability{?start,end}

Example: /sla-api/v1/tests/123123/reports/availability?start=2016–03–09T00:00:00Z&end=2016–03–12T01:00:00Z

Parameter Type Sample Description
Required
end String 2016-03-12T01:00:00Z Timestamp for the end of data window, in UTC 8601 format.
slaTestId Number 123123 Unique identifier for the test you wish to run a report on.
start String 2016-03-09T00:00:00Z Timestamp for the start of the data window, in UTC 8601 format.

Status 200 application/json

Response:

{
  "estimatedAvailabilityPercentage": 1,
  "originTestErrors": [
    {
      "agentName": "Frankfurt, Germany",
      "agentIp": "192.168.1.1",
      "time": "2016-03-09T03:29:25Z"
    },
    {
      "agentName": "Berlin, Germany",
      "agentIp": "192.168.1.2",
      "time": "2016-03-09T08:20:11Z"
    },
    {
      "agentName": "Paris, France",
      "agentIp": "192.168.1.3",
      "time": "2016-03-09T09:31:37Z"
    }
  ],
   "akamaiTestErrors": [
    {
      "agentName": "Frankfurt, Germany",
      "agentIp": "192.168.1.1",
      "time": "2016-03-09T03:29:25Z"
    },
    {
      "agentName": "Berlin, Germany",
      "agentIp": "192.168.1.2",
      "time": "2016-03-09T08:20:11Z"
    },
    {
      "agentName": "Paris, France",
      "agentIp": "192.168.1.3",
      "time": "2016-03-09T09:31:37Z"
    }
  ]
}


Last modified: 12/12/2016