@pulumiverse/dynatrace
Version:
A Pulumi package for creating and managing Dynatrace cloud resources.
105 lines • 4.69 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.PlatformSlo = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > **Dynatrace SaaS only**
*
* > To utilize this resource, please define the environment variables `DT_CLIENT_ID`, `DT_CLIENT_SECRET`, `DT_ACCOUNT_ID` with an OAuth client including the following permissions: **View SLOs** (`slo:slos:read`) and **Create and edit SLOs** (`slo:slos:write`).
*
* > This resource is excluded by default in the export utility, please explicitly specify the resource to retrieve existing configuration.
*
* ## Dynatrace Documentation
*
* - Service-Level Objectives overview - hhttps://docs.dynatrace.com/docs/deliver/service-level-objectives
*
* - SLO Service Public API - https://########.apps.dynatrace.com/platform/swagger-ui/index.html?urls.primaryName=Service-Level+Objectives
*
* ## Resource Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumiverse/dynatrace";
*
* const _name_ = new dynatrace.PlatformSlo("#name#", {
* criteria: {
* criteriaDetails: [{
* target: 96,
* timeframeFrom: "now-30d",
* timeframeTo: "now",
* warning: 99,
* }],
* },
* customSli: {
* indicator: ` timeseries { total=sum(dt.service.request.count) ,failures=sum(dt.service.request.failure_count) }, by: { dt.entity.service }
* | fieldsAdd tags=entityAttr(dt.entity.service, "tags")
* | filter in(tags, "criticality:Gold")
* | fieldsAdd entityName = entityName(dt.entity.service)
* | fieldsAdd sli=(((total[]-failures[])/total[])*(100))
* | fieldsRemove total, failures, tags
*
* `,
* },
* description: "Sample custom SLO",
* tags: ["ExampleKey:ExampleValue"],
* });
* ```
*/
class PlatformSlo extends pulumi.CustomResource {
/**
* Get an existing PlatformSlo 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 PlatformSlo(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of PlatformSlo. 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'] === PlatformSlo.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["criteria"] = state ? state.criteria : undefined;
resourceInputs["customSli"] = state ? state.customSli : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["sliReference"] = state ? state.sliReference : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
}
else {
const args = argsOrState;
if ((!args || args.criteria === undefined) && !opts.urn) {
throw new Error("Missing required property 'criteria'");
}
resourceInputs["criteria"] = args ? args.criteria : undefined;
resourceInputs["customSli"] = args ? args.customSli : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["sliReference"] = args ? args.sliReference : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PlatformSlo.__pulumiType, name, resourceInputs, opts);
}
}
exports.PlatformSlo = PlatformSlo;
/** @internal */
PlatformSlo.__pulumiType = 'dynatrace:index/platformSlo:PlatformSlo';
//# sourceMappingURL=platformSlo.js.map