import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * This data source provides the list of Metric Data in Oracle Cloud Infrastructure Monitoring service. * * Returns aggregated data that match the criteria specified in the request. Compartment OCID required. * For more information, see * [Querying Metric Data](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/query-metric-landing.htm) * and * [Creating a Query](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/query-metric.htm). * For important limits information, see * [Limits on Monitoring](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits). * * Transactions Per Second (TPS) per-tenancy limit for this operation: 10. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as oci from "@pulumi/oci"; * * const testMetricData = oci.monitoring.getMetricData({ * compartmentId: compartmentId, * namespace: metricDataNamespace, * query: metricDataQuery, * compartmentIdInSubtree: metricDataCompartmentIdInSubtree === "true", * endTime: metricDataEndTime, * resolution: metricDataResolution, * resourceGroup: metricDataResourceGroup, * startTime: metricDataStartTime, * }); * ``` */ export declare function getMetricData(args: GetMetricDataArgs, opts?: pulumi.InvokeOptions): Promise; /** * A collection of arguments for invoking getMetricData. */ export interface GetMetricDataArgs { /** * The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the resources monitored by the metric that you are searching for. Use tenancyId to search in the root compartment. Example: `ocid1.compartment.oc1..exampleuniqueID` */ compartmentId: string; /** * When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, returns resources from only the compartment specified in compartmentId. Default is false. */ compartmentIdInSubtree?: boolean; /** * The end of the time range to use when searching for metric data points. Format is defined by RFC3339. The response excludes metric data points for the endTime. Default value: the timestamp representing when the call was sent. Example: `2023-02-01T02:02:29.600Z` */ endTime?: string; filters?: inputs.Monitoring.GetMetricDataFilter[]; /** * The source service or application to use when searching for metric data points to aggregate. Example: `ociComputeagent` */ namespace: string; /** * The Monitoring Query Language (MQL) expression to use when searching for metric data points to aggregate. The query must specify a metric, statistic, and interval. Supported values for interval depend on the specified time range. More interval values are supported for smaller time ranges. You can optionally specify dimensions and grouping functions. When specifying a dimension value, surround it with double quotes, and escape each double quote with a backslash (`\`) character. Supported grouping functions: `grouping()`, `groupBy()`. * * Construct your query to avoid exceeding limits on returned data. See [MetricData Reference](https://docs.cloud.oracle.com/iaas/api/#/en/monitoring/20180401/MetricData). * * For details about Monitoring Query Language (MQL), see [Monitoring Query Language (MQL) Reference](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). For available dimensions, review the metric definition for the supported service. See [Supported Services](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). * * Example 1: `CpuUtilization[1m].sum()` * * Example 2 (escaped double quotes for value string): `CpuUtilization[1m]{resourceId = \"<instance_OCID>\"}.max()` */ query: string; /** * The time between calculated aggregation windows. Use with the query interval to vary the frequency for returning aggregated data points. For example, use a query interval of 5 minutes with a resolution of 1 minute to retrieve five-minute aggregations at a one-minute frequency. The resolution must be equal or less than the interval in the query. The default resolution is 1m (one minute). Supported values: `1m`-`60m`, `1h`-`24h`, `1d`. Example: `5m` */ resolution?: string; /** * Resource group that you want to match. A null value returns only metric data that has no resource groups. The specified resource group must exist in the definition of the posted metric. Only one resource group can be applied per metric. A valid resourceGroup value starts with an alphabetical character and includes only alphanumeric characters, periods (.), underscores (_), hyphens (-), and dollar signs ($). Example: `frontend-fleet` */ resourceGroup?: string; /** * The beginning of the time range to use when searching for metric data points. Format is defined by RFC3339. The response includes metric data points for the startTime. Default value: the timestamp 3 hours before the call was sent. Example: `2023-02-01T01:02:29.600Z` */ startTime?: string; } /** * A collection of values returned by getMetricData. */ export interface GetMetricDataResult { /** * The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the resources that the aggregated data was returned from. */ readonly compartmentId: string; readonly compartmentIdInSubtree?: boolean; readonly endTime?: string; readonly filters?: outputs.Monitoring.GetMetricDataFilter[]; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * The list of metric_data. */ readonly metricDatas: outputs.Monitoring.GetMetricDataMetricData[]; /** * The reference provided in a metric definition to indicate the source service or application that emitted the metric. Example: `ociComputeagent` */ readonly namespace: string; readonly query: string; /** * The time between calculated aggregation windows. Use with the query interval to vary the frequency for returning aggregated data points. For example, use a query interval of 5 minutes with a resolution of 1 minute to retrieve five-minute aggregations at a one-minute frequency. The resolution must be equal or less than the interval in the query. The default resolution is 1m (one minute). Supported values: `1m`-`60m`, `1h`-`24h`, `1d`. Example: `5m` */ readonly resolution?: string; /** * Resource group provided with the posted metric. A resource group is a custom string that you can match when retrieving custom metrics. Only one resource group can be applied per metric. A valid resourceGroup value starts with an alphabetical character and includes only alphanumeric characters, periods (.), underscores (_), hyphens (-), and dollar signs ($). Example: `frontend-fleet` */ readonly resourceGroup?: string; readonly startTime?: string; } /** * This data source provides the list of Metric Data in Oracle Cloud Infrastructure Monitoring service. * * Returns aggregated data that match the criteria specified in the request. Compartment OCID required. * For more information, see * [Querying Metric Data](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/query-metric-landing.htm) * and * [Creating a Query](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Tasks/query-metric.htm). * For important limits information, see * [Limits on Monitoring](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#limits). * * Transactions Per Second (TPS) per-tenancy limit for this operation: 10. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as oci from "@pulumi/oci"; * * const testMetricData = oci.monitoring.getMetricData({ * compartmentId: compartmentId, * namespace: metricDataNamespace, * query: metricDataQuery, * compartmentIdInSubtree: metricDataCompartmentIdInSubtree === "true", * endTime: metricDataEndTime, * resolution: metricDataResolution, * resourceGroup: metricDataResourceGroup, * startTime: metricDataStartTime, * }); * ``` */ export declare function getMetricDataOutput(args: GetMetricDataOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output; /** * A collection of arguments for invoking getMetricData. */ export interface GetMetricDataOutputArgs { /** * The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the resources monitored by the metric that you are searching for. Use tenancyId to search in the root compartment. Example: `ocid1.compartment.oc1..exampleuniqueID` */ compartmentId: pulumi.Input; /** * When true, returns resources from all compartments and subcompartments. The parameter can only be set to true when compartmentId is the tenancy OCID (the tenancy is the root compartment). A true value requires the user to have tenancy-level permissions. If this requirement is not met, then the call is rejected. When false, returns resources from only the compartment specified in compartmentId. Default is false. */ compartmentIdInSubtree?: pulumi.Input; /** * The end of the time range to use when searching for metric data points. Format is defined by RFC3339. The response excludes metric data points for the endTime. Default value: the timestamp representing when the call was sent. Example: `2023-02-01T02:02:29.600Z` */ endTime?: pulumi.Input; filters?: pulumi.Input[] | undefined>; /** * The source service or application to use when searching for metric data points to aggregate. Example: `ociComputeagent` */ namespace: pulumi.Input; /** * The Monitoring Query Language (MQL) expression to use when searching for metric data points to aggregate. The query must specify a metric, statistic, and interval. Supported values for interval depend on the specified time range. More interval values are supported for smaller time ranges. You can optionally specify dimensions and grouping functions. When specifying a dimension value, surround it with double quotes, and escape each double quote with a backslash (`\`) character. Supported grouping functions: `grouping()`, `groupBy()`. * * Construct your query to avoid exceeding limits on returned data. See [MetricData Reference](https://docs.cloud.oracle.com/iaas/api/#/en/monitoring/20180401/MetricData). * * For details about Monitoring Query Language (MQL), see [Monitoring Query Language (MQL) Reference](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Reference/mql.htm). For available dimensions, review the metric definition for the supported service. See [Supported Services](https://docs.cloud.oracle.com/iaas/Content/Monitoring/Concepts/monitoringoverview.htm#SupportedServices). * * Example 1: `CpuUtilization[1m].sum()` * * Example 2 (escaped double quotes for value string): `CpuUtilization[1m]{resourceId = \"<instance_OCID>\"}.max()` */ query: pulumi.Input; /** * The time between calculated aggregation windows. Use with the query interval to vary the frequency for returning aggregated data points. For example, use a query interval of 5 minutes with a resolution of 1 minute to retrieve five-minute aggregations at a one-minute frequency. The resolution must be equal or less than the interval in the query. The default resolution is 1m (one minute). Supported values: `1m`-`60m`, `1h`-`24h`, `1d`. Example: `5m` */ resolution?: pulumi.Input; /** * Resource group that you want to match. A null value returns only metric data that has no resource groups. The specified resource group must exist in the definition of the posted metric. Only one resource group can be applied per metric. A valid resourceGroup value starts with an alphabetical character and includes only alphanumeric characters, periods (.), underscores (_), hyphens (-), and dollar signs ($). Example: `frontend-fleet` */ resourceGroup?: pulumi.Input; /** * The beginning of the time range to use when searching for metric data points. Format is defined by RFC3339. The response includes metric data points for the startTime. Default value: the timestamp 3 hours before the call was sent. Example: `2023-02-01T01:02:29.600Z` */ startTime?: pulumi.Input; } //# sourceMappingURL=getMetricData.d.ts.map