Skip to main content

Usage Analytics API Endpoints

Use the Usage Analytics API methods to retrieve information about your concurrency usage that you can then use to populate a dashboard that is meaningful for your organization.

Refer to Getting Started for Authentication and Server information.

Organization Concurrency

GET/usage-analytics/v1/concurrency/org

Return information about concurrency usage for organization:
  • maximum, minimum concurrency for given granularity (monthly, weekly, daily, hourly),
  • teams' share for the organization maximum concurrency for given granularity (in percentage),
  • current limits.
Concurrency data is broken down by resource types for:
  • Virtual Cloud:
    • virtual machines,
    • mac virtual machines,
    • mac arm virtual machines,
    • total virtial machines, combining all resource types.
  • Real Device Cloud:
    • private devices,
    • public devices,
    • total virtial machines, combining all resource types.

Parameters

note

This call requires org_id parameter.

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: vdc
granularity

| QUERY | OPTIONAL | STRING |

Return results grouped by given granularity:

  • hourly
  • weekly
  • daily
  • monthly

Default value is: daily
resource_type

| QUERY | OPTIONAL | STRING |

Return results only for given resource type

For the Virtual Could tests:
  • virtual_machine
  • mac_virtual_machine
  • mac_arm_virtual_machine
  • total_virtual_machine
For the Real Devices Could tests:
  • private_real_device
  • public_real_device
  • total_real_device
start_date

| QUERY | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end_date

| QUERY | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/usage-analytics/v1/concurrency/org?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"by_org": {
"org_id": "string",
"data": [
{
"time": "string",
"values": [
{
"resource_type": "virtual_machine",
"concurrency": {
"max": 0,
"min": 0,
"max_org_concurrency_team_share": [
{
"team_id": "string",
"pct": 0,
"avg_concurrency": 0
}
]
},
"limits": {
"total": 0,
"resource": 0,
"total_original": 0,
"resource_original": 0
}
}
]
}
]
}
}

Teams Concurrency

GET/usage-analytics/v1/concurrency/teams

Return information about concurrency usage for teams:
  • maximum, minimum concurrency for given granularity (monthly, weekly, daily, hourly),
  • current limits.
Concurrency data is broken down by resource types for:
  • Virtual Cloud:
    • virtual machines,
    • mac virtual machines,
    • mac arm virtual machines,
    • total virtial machines, combining all resource types.
  • Real Device Cloud:
    • private devices,
    • public devices,
    • total virtial machines, combining all resource types.

Parameters

note

This call requires org_id and team_id parameters.

org_id

| QUERY| REQUIRED | STRING |

Return results only for the specified org_id.

team_id

| QUERY| REQUIRED | STRING |

Return results only for the specified team_id.

source

| QUERY | OPTIONAL | ARRAY |

Return results only for tests run in virtual device cloud or real device cloud. Supported values are:

  • rdc - Real Device Cloud
  • vdc - Virtual Device Cloud

Default value is: vdc
granularity

| QUERY | OPTIONAL | STRING |

Return results grouped by given granularity:

  • hourly
  • weekly
  • daily
  • monthly

Default value is: daily
resource_type

| QUERY | OPTIONAL | STRING |

Return results only for given resource type

For the Virtual Could tests:
  • virtual_machine
  • mac_virtual_machine
  • mac_arm_virtual_machine
  • total_virtual_machine
For the Real Devices Could tests:
  • private_real_device
  • public_real_device
  • total_real_device
start_date

| QUERY | DATE |

The starting date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

end_date

| QUERY | DATE |

The ending date of the period during which the test runs executed, in YYYY-MM-DDTHH:mm:ssZ (UTC) format.

Sample Request
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \
--request GET "https://api.us-west-1.saucelabs.com/usage-analytics/v1/concurrency/teams?org_id=<org_id>" | json_pp

Responses

200Success.
422Validation Error.
Sample Response
{
"by_team": [
{
"team_id": "string",
"data": [
{
"time": "string",
"values": [
{
"resource_type": "virtual_machine",
"concurrency": {
"max": 0,
"min": 0,
"max_org_concurrency_team_share": [
{
"team_id": "string",
"pct": 0,
"avg_concurrency": 0
}
]
},
"limits": {
"total": 0,
"resource": 0,
"total_original": 0,
"resource_original": 0
}
}
]
}
]
}
]
}