api_insights_route_stats
Creates, updates, deletes, gets or lists an api_insights_route_stats resource.
Overview
| Name | api_insights_route_stats |
| Type | Resource |
| Id | github.orgs.api_insights_route_stats |
Fields
The following fields are returned by SELECT queries:
- get_route_stats_by_actor
Response
| Name | Datatype | Description |
|---|---|---|
api_route | string | The API path's route template |
http_method | string | The HTTP method |
last_rate_limited_timestamp | string | |
last_request_timestamp | string | |
rate_limited_request_count | integer (int64) | The total number of requests that were rate limited within the queried time period |
total_request_count | integer (int64) | The total number of requests within the queried time period |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_route_stats_by_actor | select | org, actor_type, actor_id, min_timestamp | max_timestamp, page, per_page, direction, sort, api_route_substring | Get API request count statistics for an actor broken down by route within a specified time frame. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
actor_id | integer | The ID of the actor |
actor_type | string | The type of the actor |
min_timestamp | string | The minimum timestamp to query for stats. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
org | string | The organization name. The name is not case sensitive. |
api_route_substring | string | Providing a substring will filter results where the API route contains the substring. This is a case-insensitive search. |
direction | string | The direction to sort the results by. |
max_timestamp | string | The maximum timestamp to query for stats. Defaults to the time 30 days ago. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
sort | array | The property to sort the results by. |
SELECT examples
- get_route_stats_by_actor
Get API request count statistics for an actor broken down by route within a specified time frame.
SELECT
api_route,
http_method,
last_rate_limited_timestamp,
last_request_timestamp,
rate_limited_request_count,
total_request_count
FROM github.orgs.api_insights_route_stats
WHERE org = '{{ org }}' -- required
AND actor_type = '{{ actor_type }}' -- required
AND actor_id = '{{ actor_id }}' -- required
AND min_timestamp = '{{ min_timestamp }}' -- required
AND max_timestamp = '{{ max_timestamp }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND direction = '{{ direction }}'
AND sort = '{{ sort }}'
AND api_route_substring = '{{ api_route_substring }}'
;