Usage

GET /v6/usage Obtaining usage details

This endpoint returns usage for the current period. This endpoint requires the View Billing permission (a management permission), and provides visibility across all account groups within the organization. For users who have access to view billing in multiple organizations, query the endpoint using an aid querystring parameter (see optional parameters, below) from each organization.

Billing information (for past months) is not available via this endpoint; this will be implemented as a separate endpoint.

Optional Parameters

  • format=json|xml optional, specifies the format of output requested. See Output Formats for more information
  • aid={aid} optional, changes the account group context of the current request. If an invalid account group ID is specified as a parameter, the response will come back as an HTTP/400 error.

Request

  • There is no request body for this request.

Example

$ curl https://api.thousandeyes.com/v6/usage.json \ -u noreply@thousandeyes.com:g351mw5xqhvkmh1vq6zfm51c62wyzib2

Response

Sends back detailed usage information about the organization. Users in roles with insufficient permissions will receive an HTTP/403 response.

HTTP/1.1 200 OK Server: nginx Date: Mon, 09 May 2016 16:04:24 GMT Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Cache-Control: no-store X-Organization-Rate-Limit-Limit: 240 X-Organization-Rate-Limit-Remaining: 234 X-Organization-Rate-Limit-Reset: 1493731080 X-Server-Name: 1-2

Body

{ "usage": { "quota": { "monthStart": "2016-04-28 00:00:00", "monthEnd": "2016-05-28 00:00:00", "cloudUnitsIncluded": 4320000000, "enterpriseAgentsIncluded": 25 }, "cloudUnitsUsed": 8500489, "cloudUnitsProjected": 20993812, "enterpriseAgentsUsed": 8, "tests": [ { "aid": 315, "testId": 1158, "accountGroupName": "Documentation", "testName": "https://app.thousandeyes.com", "testType": "Web - Page Load", "cloudUnitsUsed": 140540, "cloudUnitsProjected": 340674 }, { "aid": 315, "testId": 1159, "accountGroupName": "Documentation", "testName": "https://support.thousandeyes.com", "testType": "Web - HTTP Server", "cloudUnitsUsed": 64390, "cloudUnitsProjected": 164457 } [...] ], "enterpriseAgents": [ { "aid": 7625, "accountGroupName": "Support", "enterpriseAgentsUsed": 7 }, { "aid": 315, "accountGroupName": "Documentation", "enterpriseAgentsUsed": 1 } ] } }

For more information on our HTTP response status codes, see the response status codes documentation.

Usage metadata

Usage metadata is used in the /usage endpoint. Field types are shown in the table below, along with information about each field returned.

Fields are listed (as they appear in the data) in the table below. Where a complex object is used, the field will be prefixed with the object name.

ObjectFieldData TypeExampleNotes
quotamonthStartdateTime"monthStart": "2016-04-28 17:00:00 PDT"Beginning of usage period in YYYY-mm-dd HH:MM:SS format. As with other endpoints, dateTime values are shown in UTC.
quotamonthEnddateTime"monthEnd": "2016-04-28 17:00:00 PDT"End of usage period in YYYY-mm-dd HH:MM:SS format. As with other endpoints, dateTime values are shown in UTC.
quotacloudUnitsIncludedinteger"cloudUnitsIncluded": 4320000000Monthly number of cloud units allocated, as part of the contract.
quotaenterpriseAgentsIncludedinteger"enterpriseAgentsIncluded": 25Monthly number of enterprise agents allocated, as part of the contract.
n/acloudUnitsUsedinteger"cloudUnitsUsed": 8500489Number of cloud units consumed thus far in the usage period.
n/acloudUnitsProjectedinteger"cloudUnitsProjected": 8500489Number of cloud units projected in the current usage period, based on units consumed to date and configuration of enabled tests. This value is updated hourly.
n/aenterpriseAgentsUsedinteger"enterpriseAgentsUsed": 8Number of enterprise agents used thus far in the current usage period. This number is calculated by taking the maximum number of agents enabled for any one-hour period in the usage period. Disabled agents are excluded from this calculation.
n/atestsarray of test objectssee individual fieldsTest-by-test breakdown of unit consumption in the current monthly period; Each entry includes both current and projected usage.
testaidinteger"aid": 1234Unique ID of the account group which owns the test
testaccountGroupNamestring"accountGroupName": "Support"Name of the account group which owns the test
testtestIdinteger"testId": 26030Unique ID of the test generating usage
testtestNamestring"testName": "my test name"Name of the test generating usage
testtestTypestring"testType": "Web - HTTP Server"Type of test generating usage. Note that this is a friendly testType entry (so it shouldn’t be parsed to discover the correct endpoint to query for configuration details).
testcloudUnitsUsedinteger"cloudUnitsUsed": 8500489Number of cloud units consumed thus far by the test in the usage period.
testcloudUnitsProjectedinteger"cloudUnitsProjected": 253012Number of cloud units projected to be consumed by the test in the usage period, based on units consumed to date and configuration of the test. This value is updated hourly. New tests have no cloudUnitsProjected parameter until projection is calculated.
n/aenterpriseAgentsarray of enterpriseAgent objectssee individual fieldsEnterprise agents used by account group.
enterpriseAgentaidinteger"aid": 1234Unique ID of the account group owning the enterprise agents
enterpriseAgentaccountGroupNamestring"accountGroupName": "sample account group name"Name of the account group which owns the enterprise agents
enterpriseAgententerpriseAgentsUsedinteger"enterpriseAgentsUsed": 7Number of enterprise agents owned by the specific account group in the usage period.