@datadog/datadog-api-client
Version:
OpenAPI client for Datadog APIs
75 lines (74 loc) • 3.07 kB
TypeScript
import { BaseAPIRequestFactory } from "../../datadog-api-client-common/baseapi";
import { Configuration } from "../../datadog-api-client-common/configuration";
import { RequestContext, ResponseContext } from "../../datadog-api-client-common/http/http";
import { GraphSnapshot } from "../models/GraphSnapshot";
export declare class SnapshotsApiRequestFactory extends BaseAPIRequestFactory {
getGraphSnapshot(start: number, end: number, metricQuery?: string, eventQuery?: string, graphDef?: string, title?: string, height?: number, width?: number, _options?: Configuration): Promise<RequestContext>;
}
export declare class SnapshotsApiResponseProcessor {
/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getGraphSnapshot
* @throws ApiException if the response code was not in [200, 299]
*/
getGraphSnapshot(response: ResponseContext): Promise<GraphSnapshot>;
}
export interface SnapshotsApiGetGraphSnapshotRequest {
/**
* The POSIX timestamp of the start of the query in seconds.
* @type number
*/
start: number;
/**
* The POSIX timestamp of the end of the query in seconds.
* @type number
*/
end: number;
/**
* The metric query.
* @type string
*/
metricQuery?: string;
/**
* A query that adds event bands to the graph.
* @type string
*/
eventQuery?: string;
/**
* A JSON document defining the graph. `graph_def` can be used instead of `metric_query`.
* The JSON document uses the [grammar defined here](https://docs.datadoghq.com/graphing/graphing_json/#grammar)
* and should be formatted to a single line then URL encoded.
* @type string
*/
graphDef?: string;
/**
* A title for the graph. If no title is specified, the graph does not have a title.
* @type string
*/
title?: string;
/**
* The height of the graph. If no height is specified, the graph's original height is used.
* @type number
*/
height?: number;
/**
* The width of the graph. If no width is specified, the graph's original width is used.
* @type number
*/
width?: number;
}
export declare class SnapshotsApi {
private requestFactory;
private responseProcessor;
private configuration;
constructor(configuration: Configuration, requestFactory?: SnapshotsApiRequestFactory, responseProcessor?: SnapshotsApiResponseProcessor);
/**
* Take graph snapshots. Snapshots are PNG images generated by rendering a specified widget in a web page and capturing it once the data is available. The image is then uploaded to cloud storage.
*
* **Note**: When a snapshot is created, there is some delay before it is available.
* @param param The request object
*/
getGraphSnapshot(param: SnapshotsApiGetGraphSnapshotRequest, options?: Configuration): Promise<GraphSnapshot>;
}