@pulumi/sumologic
Version:
A Pulumi package for creating and managing sumologic cloud resources.
126 lines • 5.39 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetricsSearch = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* (Deprecated) Please use Metrics Search V2 instead.
* Provides a [Sumologic Metrics Search](https://help.sumologic.com/docs/metrics/metrics-queries/metrics-explorer/).
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sumologic from "@pulumi/sumologic";
*
* const personalFolder = sumologic.getPersonalFolder({});
* const exampleMetricsSearch = new sumologic.MetricsSearch("example_metrics_search", {
* title: "Demo Metrics Search",
* description: "Demo search description",
* parentId: personalFolder.then(personalFolder => personalFolder.id),
* metricsQueries: [{
* rowId: "A",
* query: "metric=cpu_idle | avg",
* }],
* desiredQuantizationInSecs: 0,
* timeRange: {
* beginBoundedTimeRange: {
* from: {
* relativeTimeRange: {
* relativeTime: "-30m",
* },
* },
* },
* },
* });
* ```
*
* ## Attributes reference
*
* In addition to all arguments above, the following attributes are exported:
*
* - `id` - The ID of the log search.
*
* ## Import
*
* A metrics search can be imported using it's identifier, e.g.:
*
* hcl
*
* ```sh
* $ pulumi import sumologic:index/metricsSearch:MetricsSearch example_search 0000000007FFD79D
* ```
*
* [1]: https://help.sumologic.com/docs/metrics/metrics-queries/metrics-explorer/
*/
class MetricsSearch extends pulumi.CustomResource {
/**
* Get an existing MetricsSearch resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new MetricsSearch(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MetricsSearch. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === MetricsSearch.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["desiredQuantizationInSecs"] = state ? state.desiredQuantizationInSecs : undefined;
resourceInputs["logQuery"] = state ? state.logQuery : undefined;
resourceInputs["metricsQueries"] = state ? state.metricsQueries : undefined;
resourceInputs["parentId"] = state ? state.parentId : undefined;
resourceInputs["timeRange"] = state ? state.timeRange : undefined;
resourceInputs["title"] = state ? state.title : undefined;
}
else {
const args = argsOrState;
if ((!args || args.description === undefined) && !opts.urn) {
throw new Error("Missing required property 'description'");
}
if ((!args || args.metricsQueries === undefined) && !opts.urn) {
throw new Error("Missing required property 'metricsQueries'");
}
if ((!args || args.parentId === undefined) && !opts.urn) {
throw new Error("Missing required property 'parentId'");
}
if ((!args || args.timeRange === undefined) && !opts.urn) {
throw new Error("Missing required property 'timeRange'");
}
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["desiredQuantizationInSecs"] = args ? args.desiredQuantizationInSecs : undefined;
resourceInputs["logQuery"] = args ? args.logQuery : undefined;
resourceInputs["metricsQueries"] = args ? args.metricsQueries : undefined;
resourceInputs["parentId"] = args ? args.parentId : undefined;
resourceInputs["timeRange"] = args ? args.timeRange : undefined;
resourceInputs["title"] = args ? args.title : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MetricsSearch.__pulumiType, name, resourceInputs, opts);
}
}
exports.MetricsSearch = MetricsSearch;
/** @internal */
MetricsSearch.__pulumiType = 'sumologic:index/metricsSearch:MetricsSearch';
//# sourceMappingURL=metricsSearch.js.map