@pulumi/signalfx
Version:
A Pulumi package for creating and managing SignalFx resources.
127 lines • 5.93 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.MetricRuleset = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides an Observability Cloud resource for managing metric rulesets.
*
* > **NOTE** When managing metric rulesets to drop data use a session token for an administrator to authenticate the Splunk Observability Cloud provider. See [Operations that require a session token for an administrator](https://dev.splunk.com/observability/docs/administration/authtokens#Operations-that-require-a-session-token-for-an-administrator). Otherwise you'll receive a 4xx error.
*
* ## Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as signalfx from "@pulumi/signalfx";
*
* const cpuUtilizationMetricRuleset = new signalfx.MetricRuleset("cpu_utilization_metric_ruleset", {
* metricName: "cpu.utilization",
* description: "Routing ruleset for cpu.utilization",
* aggregationRules: [{
* name: "cpu.utilization by service rule",
* description: "Aggregates cpu.utilization data by service",
* enabled: true,
* matchers: [{
* type: "dimension",
* filters: [{
* property: "realm",
* propertyValues: ["us-east-1"],
* not: false,
* }],
* }],
* aggregators: [{
* type: "rollup",
* dimensions: ["service"],
* dropDimensions: false,
* outputName: "cpu.utilization.by.service.agg",
* }],
* }],
* exceptionRules: [{
* name: "Exception rule us-east-2",
* description: "Routes us-east-2 data to real-time",
* enabled: true,
* matchers: [{
* type: "dimension",
* filters: [{
* property: "realm",
* propertyValues: ["us-east-2"],
* not: false,
* }],
* }],
* }],
* routingRules: [{
* destination: "Archived",
* }],
* });
* ```
*/
class MetricRuleset extends pulumi.CustomResource {
/**
* Get an existing MetricRuleset 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 MetricRuleset(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MetricRuleset. 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'] === MetricRuleset.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["aggregationRules"] = state ? state.aggregationRules : undefined;
resourceInputs["created"] = state ? state.created : undefined;
resourceInputs["creator"] = state ? state.creator : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["exceptionRules"] = state ? state.exceptionRules : undefined;
resourceInputs["lastUpdated"] = state ? state.lastUpdated : undefined;
resourceInputs["lastUpdatedBy"] = state ? state.lastUpdatedBy : undefined;
resourceInputs["lastUpdatedByName"] = state ? state.lastUpdatedByName : undefined;
resourceInputs["metricName"] = state ? state.metricName : undefined;
resourceInputs["routingRules"] = state ? state.routingRules : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.metricName === undefined) && !opts.urn) {
throw new Error("Missing required property 'metricName'");
}
if ((!args || args.routingRules === undefined) && !opts.urn) {
throw new Error("Missing required property 'routingRules'");
}
resourceInputs["aggregationRules"] = args ? args.aggregationRules : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["exceptionRules"] = args ? args.exceptionRules : undefined;
resourceInputs["metricName"] = args ? args.metricName : undefined;
resourceInputs["routingRules"] = args ? args.routingRules : undefined;
resourceInputs["created"] = undefined /*out*/;
resourceInputs["creator"] = undefined /*out*/;
resourceInputs["lastUpdated"] = undefined /*out*/;
resourceInputs["lastUpdatedBy"] = undefined /*out*/;
resourceInputs["lastUpdatedByName"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MetricRuleset.__pulumiType, name, resourceInputs, opts);
}
}
exports.MetricRuleset = MetricRuleset;
/** @internal */
MetricRuleset.__pulumiType = 'signalfx:index/metricRuleset:MetricRuleset';
//# sourceMappingURL=metricRuleset.js.map