Skip to content

Commit

Permalink
Update insights endpoints to clarify optional/required params [INS-17…
Browse files Browse the repository at this point in the history
…7] (#3023)

* Update insights endpoints to clarify optional/required params

adding note to two endpoints that did not have information about XOR on start/end or time_range

* start/end/time_range consistency updates 

updating copy for start/end/time_range and parameter sorting for 

- /v1/analytics/tests                 
- /v1/analytics/insights/test-metrics 
- /v1/analytics/trends/tests          
- /v1/analytics/trends/builds_tests

* update interval parameter for all endpoints
  • Loading branch information
adam-saucelabs authored Nov 25, 2024
1 parent d313391 commit 66914c0
Showing 1 changed file with 57 additions and 52 deletions.
109 changes: 57 additions & 52 deletions docs/dev/api/insights.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,29 @@ Return run data for all tests that match the request criteria.

#### Parameters

:::note
This call requires <code>start</code> and <code>end</code> parameters OR the <code>time_range</code> parameter.
:::

<table id="table-api">
<tbody>
<tr>
<td><code>start</code></td>
<td><p><small>| QUERY | REQUIRED | DATE |</small></p><p>The starting date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>end</code></td>
<td><p><small>| QUERY | REQUIRED | DATE |</small></p><p>The ending date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>time_range</code></td>
<td><p><small>| QUERY | REQUIRED | DURATION + UNIT |</small></p><p>The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include <code>d</code> (day); <code>h</code> (hour); <code>m</code> (minute); <code>s</code> (second).</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>build</code></td>
Expand All @@ -43,12 +65,6 @@ Return run data for all tests that match the request criteria.
<td><p><small>| QUERY | OPTIONAL | BOOLEAN |</small></p><p>Sort results by test creation time. Default value is <code>true</code>.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>end</code></td>
<td><p><small>| QUERY | OPTIONAL | DATE |</small></p><p>The ending date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>error</code></td>
Expand Down Expand Up @@ -95,12 +111,6 @@ Return run data for all tests that match the request criteria.
<td><p><small>| QUERY | OPTIONAL | INTEGER |</small></p><p>The maximum number of results to return. Default value is <code>10</code></p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>start</code></td>
<td><p><small>| QUERY | OPTIONAL | DATE |</small></p><p>The starting date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>status</code></td>
Expand All @@ -118,15 +128,6 @@ Return run data for all tests that match the request criteria.
</td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>time_range</code></td>
<td>
<p><small>| QUERY | OPTIONAL | STRING |</small></p>
<p>The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include <code>d</code> (day); <code>h</code> (hour); <code>m</code> (minute); <code>s</code> (second).</p>
</td>
</tr>
</tbody>
</table>

<Tabs
Expand Down Expand Up @@ -412,7 +413,29 @@ Return a set of data "buckets" representing tests that were run in each time int

#### Parameters

:::note
This call requires <code>start</code> and <code>end</code> parameters OR the <code>time_range</code> parameter.
:::

<table id="table-api">
<tbody>
<tr>
<td><code>start</code></td>
<td><p><small>| QUERY | REQUIRED | DATE |</small></p><p>The starting date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>end</code></td>
<td><p><small>| QUERY | REQUIRED | DATE |</small></p><p>The ending date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>time_range</code></td>
<td><p><small>| QUERY | REQUIRED | DURATION + UNIT |</small></p><p>The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include <code>d</code> (day); <code>h</code> (hour); <code>m</code> (minute); <code>s</code> (second).</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>scope</code></td>
Expand All @@ -434,28 +457,10 @@ Return a set of data "buckets" representing tests that were run in each time int
<td><code>interval</code></td>
<td>
<p><small>| QUERY | OPTIONAL | STRING |</small></p>
<p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p>
<p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>time_range</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>The amount of time backward from the current time that represents the period during which the test runs are executed. Acceptable units include <code>d</code> (day); <code>h</code> (hour); <code>m</code> (minute); <code>s</code> (second).</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>start</code></td>
<td><p><small>| QUERY | OPTIONAL | DATE |</small></p><p>The starting date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>end</code></td>
<td><p><small>| QUERY | OPTIONAL | DATE |</small></p><p>The ending date of the period during which the test runs executed, in <code>YYYY-MM-DDTHH:mm:ssZ</code> (UTC) format.</p></td>
</tr>
</tbody>
<tbody>
<tr>
<td><code>browser</code></td>
Expand Down Expand Up @@ -1798,8 +1803,8 @@ Return an array of errors with occurrence count on all tests run in the specifie
<p><small>| QUERY | OPTIONAL | STRING |</small></p>
<p>
Relative date filter. Available values are: <ul>
<li><code>1m</code> (1 month)</li>
<li><code>15m</code> (15 months)</li>
<li><code>1m</code> (1 minute)</li>
<li><code>15m</code> (15 minutes)</li>
<li><code>1h</code> (1 hour)</li>
<li><code>6h</code> (6 hours)</li>
<li><code>12h</code> (12 hours)</li>
Expand Down Expand Up @@ -1965,7 +1970,7 @@ Return past and current data about errors for comparison.
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -2590,7 +2595,7 @@ Return an array of test cases (grouped by name) with statistical details.
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -2806,7 +2811,7 @@ Return an array of test cases (grouped by name) with statistical details as a CS
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -3002,7 +3007,7 @@ Return an array of test cases (grouped by name) with statistical details.
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -3516,7 +3521,7 @@ Return information about tests coverage for the specified <code>coverage_field</
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -3800,7 +3805,7 @@ Return information about tests coverage for the specified `coverage_field` in a
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -4036,7 +4041,7 @@ Return an array of buckets with aggregations, such as number of tests run on a s
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -4322,7 +4327,7 @@ Return an array of buckets with aggregations, such as the number of tests from a
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -4620,7 +4625,7 @@ Return statistics for errors that occurred in tests run in the specified period.
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down Expand Up @@ -5004,7 +5009,7 @@ Return information about builds and tests run included in the build. Also, it pr
<tbody>
<tr>
<td><code>interval</code></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 month)</li><li><code>15m</code> (15 months)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
<td><p><small>| QUERY | OPTIONAL | STRING |</small></p><p>Relative date filter. Available values are: <ul><li><code>1m</code> (1 minute)</li><li><code>15m</code> (15 minutes)</li><li><code>1h</code> (1 hour)</li><li><code>6h</code> (6 hours)</li><li><code>12h</code> (12 hours)</li><li><code>1d</code> (1 day)</li><li><code>7d</code> (7 days)</li><li><code>30d</code> (30 days)</li></ul>Default value is <code>1d</code></p></td>
</tr>
</tbody>
<tbody>
Expand Down

0 comments on commit 66914c0

Please sign in to comment.