UNPKG

@pulumi/ns1

Version:

A Pulumi package for creating and managing ns1 cloud resources.

213 lines (212 loc) 7.49 kB
import * as pulumi from "@pulumi/pulumi"; import * as outputs from "./types/output"; /** * Provides billing usage details about a NS1 account. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as ns1 from "@pulumi/ns1"; * * // Get query usage data for the given timeframe * const queries = ns1.getBillingUsage({ * metricType: "queries", * from: 1738368000, * to: 1740787199, * }); * // Get account limits data for the given timeframe * const limits = ns1.getBillingUsage({ * metricType: "limits", * from: 1738368000, * to: 1740787199, * }); * // Get RUM decisions usage data for the given timeframe * const decisions = ns1.getBillingUsage({ * metricType: "decisions", * from: 1738368000, * to: 1740787199, * }); * // Get filter chains usage data * const filterChains = ns1.getBillingUsage({ * metricType: "filter-chains", * }); * // Get monitoring jobs usage data * const monitors = ns1.getBillingUsage({ * metricType: "monitors", * }); * // Get records usage data * const records = ns1.getBillingUsage({ * metricType: "records", * }); * export const totalQueries = queries.then(queries => queries.cleanQueries); * export const totalDdosQueries = queries.then(queries => queries.ddosQueries); * export const totalNxdResponses = queries.then(queries => queries.nxdResponses); * export const queriesLimit = limits.then(limits => limits.queriesLimit); * export const totalDecisions = decisions.then(decisions => decisions.totalUsage); * export const decisionsLimit = limits.then(limits => limits.decisionsLimit); * export const totalFilterChains = filterChains.then(filterChains => filterChains.totalUsage); * export const filterChainsLimit = limits.then(limits => limits.filterChainsLimit); * export const totalMonitors = monitors.then(monitors => monitors.totalUsage); * export const monitorsLimit = limits.then(limits => limits.monitorsLimit); * export const totalRecords = records.then(records => records.totalUsage); * export const recordsLimit = limits.then(limits => limits.recordsLimit); * ``` */ export declare function getBillingUsage(args: GetBillingUsageArgs, opts?: pulumi.InvokeOptions): Promise<GetBillingUsageResult>; /** * A collection of arguments for invoking getBillingUsage. */ export interface GetBillingUsageArgs { /** * The start timestamp for the data range in Unix epoch format. */ from?: number; /** * The type of billing metric to retrieve. Must be one of: `queries`, `limits`, `decisions`, `filter-chains`, `monitors`, `records`. */ metricType: string; /** * The end timestamp for the data range in Unix epoch format. */ to?: number; } /** * A collection of values returned by getBillingUsage. */ export interface GetBillingUsageResult { /** * (Computed) A list of network-specific query data containing: */ readonly byNetworks: outputs.GetBillingUsageByNetwork[]; /** * (Computed) The queries limit for the China network. */ readonly chinaQueriesLimit: number; /** * Clean queries for this day. */ readonly cleanQueries: number; /** * (Computed) Whether DDoS Protection is enabled. */ readonly ddosProtectionEnabled: boolean; /** * DDoS queries for this day. */ readonly ddosQueries: number; /** * (Computed) The RUM decisions limit for this billing cycle. */ readonly decisionsLimit: number; /** * (Computed) The filter chains limit for this billing cycle. */ readonly filterChainsLimit: number; readonly from?: number; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * (Computed) Whether dedicated DNS usage counts towards managed DNS usage. */ readonly includeDedicatedDnsNetworkInManagedDnsUsage: boolean; readonly metricType: string; /** * (Computed) The monitoring jobs limit for this billing cycle. */ readonly monitorsLimit: number; /** * (Computed) Whether NXD Protection is enabled. */ readonly nxdProtectionEnabled: boolean; /** * NXD responses for this day. */ readonly nxdResponses: number; /** * (Computed) The queries limit for this billing cycle. */ readonly queriesLimit: number; /** * (Computed) The records limit for this billing cycle. */ readonly recordsLimit: number; readonly to?: number; /** * (Computed) The total usage count for the metric. Available for `decisions`, `filter-chains`, `monitors`, and `records` metrics. */ readonly totalUsage: number; } /** * Provides billing usage details about a NS1 account. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as ns1 from "@pulumi/ns1"; * * // Get query usage data for the given timeframe * const queries = ns1.getBillingUsage({ * metricType: "queries", * from: 1738368000, * to: 1740787199, * }); * // Get account limits data for the given timeframe * const limits = ns1.getBillingUsage({ * metricType: "limits", * from: 1738368000, * to: 1740787199, * }); * // Get RUM decisions usage data for the given timeframe * const decisions = ns1.getBillingUsage({ * metricType: "decisions", * from: 1738368000, * to: 1740787199, * }); * // Get filter chains usage data * const filterChains = ns1.getBillingUsage({ * metricType: "filter-chains", * }); * // Get monitoring jobs usage data * const monitors = ns1.getBillingUsage({ * metricType: "monitors", * }); * // Get records usage data * const records = ns1.getBillingUsage({ * metricType: "records", * }); * export const totalQueries = queries.then(queries => queries.cleanQueries); * export const totalDdosQueries = queries.then(queries => queries.ddosQueries); * export const totalNxdResponses = queries.then(queries => queries.nxdResponses); * export const queriesLimit = limits.then(limits => limits.queriesLimit); * export const totalDecisions = decisions.then(decisions => decisions.totalUsage); * export const decisionsLimit = limits.then(limits => limits.decisionsLimit); * export const totalFilterChains = filterChains.then(filterChains => filterChains.totalUsage); * export const filterChainsLimit = limits.then(limits => limits.filterChainsLimit); * export const totalMonitors = monitors.then(monitors => monitors.totalUsage); * export const monitorsLimit = limits.then(limits => limits.monitorsLimit); * export const totalRecords = records.then(records => records.totalUsage); * export const recordsLimit = limits.then(limits => limits.recordsLimit); * ``` */ export declare function getBillingUsageOutput(args: GetBillingUsageOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetBillingUsageResult>; /** * A collection of arguments for invoking getBillingUsage. */ export interface GetBillingUsageOutputArgs { /** * The start timestamp for the data range in Unix epoch format. */ from?: pulumi.Input<number>; /** * The type of billing metric to retrieve. Must be one of: `queries`, `limits`, `decisions`, `filter-chains`, `monitors`, `records`. */ metricType: pulumi.Input<string>; /** * The end timestamp for the data range in Unix epoch format. */ to?: pulumi.Input<number>; }