UNPKG

@pulumiverse/dynatrace

Version:

A Pulumi package for creating and managing Dynatrace cloud resources.

219 lines 9.2 kB
"use strict"; // *** 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.Document = 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: **Create and edit documents** (`document:documents:write`), **View documents** (`document:documents:read`) and **Delete documents** (`document:documents:delete`). * * > This resource is excluded by default in the export utility, please explicitly specify the resource to retrieve existing configuration. * * ## Dynatrace Documentation * * - Dynatrace Documents - https://########.apps.dynatrace.com/platform/swagger-ui/index.html?urls.primaryName=Document%20Service * * ## Resource Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as dynatrace from "@pulumiverse/dynatrace"; * * const _this = new dynatrace.Document("this", { * type: "dashboard", * content: JSON.stringify({ * version: 13, * variables: [], * tiles: { * "0": { * type: "markdown", * title: "", * content: "![Image of a Dashboard](https://dt-cdn.net/wp-content/uploads/2022/09/pic1____Dashboard-Preset___PNG.png)", * }, * "1": { * type: "data", * title: "", * query: "timeseries avg(dt.host.cpu.user)", * queryConfig: { * additionalFilters: {}, * version: "4.3.1", * datatype: "metrics", * metricKey: "dt.host.cpu.user", * aggregation: "avg", * by: [], * }, * subType: "dql-builder-metrics", * visualization: "lineChart", * visualizationSettings: { * thresholds: [], * chartSettings: { * gapPolicy: "connect", * circleChartSettings: { * groupingThresholdType: "relative", * groupingThresholdValue: 0, * valueType: "relative", * }, * categoryOverrides: {}, * fieldMapping: { * timestamp: "timeframe", * leftAxisValues: ["avg(dt.host.cpu.user)"], * leftAxisDimensions: [], * fields: [], * values: [], * }, * }, * singleValue: { * showLabel: true, * label: "", * prefixIcon: "", * autoscale: true, * alignment: "center", * colorThresholdTarget: "value", * }, * table: { * rowDensity: "condensed", * enableSparklines: false, * hiddenColumns: [], * lineWrapIds: [], * columnWidths: {}, * }, * }, * }, * "2": { * type: "data", * title: "", * query: "timeseries avg(dt.host.memory.used)", * queryConfig: { * additionalFilters: {}, * version: "4.3.1", * datatype: "metrics", * metricKey: "dt.host.memory.used", * aggregation: "avg", * by: [], * }, * subType: "dql-builder-metrics", * visualization: "lineChart", * visualizationSettings: { * thresholds: [], * chartSettings: { * gapPolicy: "connect", * circleChartSettings: { * groupingThresholdType: "relative", * groupingThresholdValue: 0, * valueType: "relative", * }, * categoryOverrides: {}, * fieldMapping: { * timestamp: "timeframe", * leftAxisValues: ["avg(dt.host.memory.used)"], * leftAxisDimensions: [], * fields: [], * values: [], * }, * categoricalBarChartSettings: {}, * }, * singleValue: { * showLabel: true, * label: "", * prefixIcon: "", * autoscale: true, * alignment: "center", * colorThresholdTarget: "value", * }, * table: { * rowDensity: "condensed", * enableSparklines: false, * hiddenColumns: [], * lineWrapIds: [], * columnWidths: {}, * }, * }, * }, * }, * layouts: { * "0": { * x: 0, * y: 0, * w: 24, * h: 14, * }, * "1": { * x: 0, * y: 14, * w: 9, * h: 6, * }, * "2": { * x: 15, * y: 14, * w: 9, * h: 6, * }, * }, * }), * }); * ``` */ class Document extends pulumi.CustomResource { /** * Get an existing Document 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 Document(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Document. 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'] === Document.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["actor"] = state ? state.actor : undefined; resourceInputs["content"] = state ? state.content : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["owner"] = state ? state.owner : undefined; resourceInputs["private"] = state ? state.private : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["version"] = state ? state.version : undefined; } else { const args = argsOrState; if ((!args || args.content === undefined) && !opts.urn) { throw new Error("Missing required property 'content'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["actor"] = args ? args.actor : undefined; resourceInputs["content"] = args ? args.content : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["owner"] = args ? args.owner : undefined; resourceInputs["private"] = args ? args.private : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["version"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Document.__pulumiType, name, resourceInputs, opts); } } exports.Document = Document; /** @internal */ Document.__pulumiType = 'dynatrace:index/document:Document'; //# sourceMappingURL=document.js.map