Skip to content

Latest commit

 

History

History
117 lines (88 loc) · 6.96 KB

DomainInspectorHistoricalApi.md

File metadata and controls

117 lines (88 loc) · 6.96 KB

fastly.DomainInspectorHistoricalApi

Note

All URIs are relative to https://api.fastly.com

Method HTTP request Description
get_domain_inspector_historical GET /metrics/domains/services/{service_id} Get historical domain data for a service

get_domain_inspector_historical

HistoricalDomainsResponse get_domain_inspector_historical(service_id)

Get historical domain data for a service

Fetches historical domain metrics for a given Fastly service, optionally filtering and grouping the results by domain, region, or POP.

Example

  • Api Key Authentication (token):
import time
import fastly
from fastly.api import domain_inspector_historical_api
from fastly.model.historical_domains_response import HistoricalDomainsResponse
from pprint import pprint
# Defining the host is optional and defaults to https://api.fastly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = fastly.Configuration(
    host = "https://api.fastly.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: token
configuration.api_key['token'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['token'] = 'Bearer'

# Enter a context with an instance of the API client
with fastly.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = domain_inspector_historical_api.DomainInspectorHistoricalApi(api_client)
    service_id = "SU1Z0isxPaozGVKXdv0eY" # str | Alphanumeric string identifying the service.
    start = "2021-08-01T00:00:00.000Z" # str | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional)
    end = "2020-08-02T00:00:00.000Z" # str | A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided `downsample` value. (optional)
    downsample = "hour" # str | Duration of sample windows. (optional) if omitted the server will use the default value of "hour"
    metric = "resp_body_bytes,status_2xx" # str | The metrics to retrieve. Multiple values should be comma-separated. (optional) if omitted the server will use the default value of "edge_requests"
    group_by = "domain" # str | Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, `group_by=domain` will return one timeseries for every domain, as a total across all datacenters (POPs).  (optional)
    limit = "100" # str | Number of results per page. The maximum is 200. (optional) if omitted the server will use the default value of "100"
    cursor = "cursor_example" # str | Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. (optional)
    region = "usa" # str | Limit query to one or more specific geographic regions. Values should be comma-separated.  (optional)
    datacenter = "SJC,STP" # str | Limit query to one or more specific POPs. Values should be comma-separated. (optional)
    domain = "domain_1.com,domain_2.com" # str | Limit query to one or more specific domains. Values should be comma-separated. (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get historical domain data for a service
        api_response = api_instance.get_domain_inspector_historical(service_id)
        pprint(api_response)
    except fastly.ApiException as e:
        print("Exception when calling DomainInspectorHistoricalApi->get_domain_inspector_historical: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get historical domain data for a service
        api_response = api_instance.get_domain_inspector_historical(service_id, start=start, end=end, downsample=downsample, metric=metric, group_by=group_by, limit=limit, cursor=cursor, region=region, datacenter=datacenter, domain=domain)
        pprint(api_response)
    except fastly.ApiException as e:
        print("Exception when calling DomainInspectorHistoricalApi->get_domain_inspector_historical: %s\n" % e)

Parameters

Name Type Description Notes
service_id str Alphanumeric string identifying the service.
start str A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the inclusive start of the query time range. If not provided, a default is chosen based on the provided downsample value. [optional]
end str A valid ISO-8601-formatted date and time, or UNIX timestamp, indicating the exclusive end of the query time range. If not provided, a default is chosen based on the provided downsample value. [optional]
downsample str Duration of sample windows. [optional] if omitted the server will use the default value of "hour"
metric str The metrics to retrieve. Multiple values should be comma-separated. [optional] if omitted the server will use the default value of "edge_requests"
group_by str Dimensions to return in the query. Multiple dimensions may be separated by commas. For example, group_by=domain will return one timeseries for every domain, as a total across all datacenters (POPs). [optional]
limit str Number of results per page. The maximum is 200. [optional] if omitted the server will use the default value of "100"
cursor str Cursor value from the next_cursor field of a previous response, used to retrieve the next page. To request the first page, this should be empty. [optional]
region str Limit query to one or more specific geographic regions. Values should be comma-separated. [optional]
datacenter str Limit query to one or more specific POPs. Values should be comma-separated. [optional]
domain str Limit query to one or more specific domains. Values should be comma-separated. [optional]

Return type

HistoricalDomainsResponse

Authorization

token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK -

[Back to top] [Back to API list] [Back to Model list] [Back to README]