@pulumiverse/dynatrace
Version:
A Pulumi package for creating and managing Dynatrace cloud resources.
227 lines • 9.19 kB
JavaScript
"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.DirectShares = 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: **Read direct-shares** (`document:direct-shares:read`), **Write direct-shares** (`document:direct-shares:write`), and **Delete direct-shares** (`document:direct-shares:delete`).
*
* > This resource is currently not covered by the export utility.
*
* ## 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 thisDocument = new dynatrace.Document("thisDocument", {
* type: "dashboard",
* content: JSON.stringify({
* version: 13,
* variables: [],
* tiles: {
* "0": {
* type: "markdown",
* title: "",
* content: "",
* },
* "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,
* },
* },
* }),
* });
* const thisDirectShares = new dynatrace.DirectShares("thisDirectShares", {
* documentId: thisDocument.id,
* access: "read-write",
* recipients: {
* recipients: [
* {
* id: "441664f0-23c9-40ef-b344-18c02c23d787",
* type: "user",
* },
* {
* id: "441664f0-23c9-40ef-b344-18c02c23d788",
* type: "group",
* },
* ],
* },
* });
* ```
*/
class DirectShares extends pulumi.CustomResource {
/**
* Get an existing DirectShares 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 DirectShares(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of DirectShares. 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'] === DirectShares.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["access"] = state ? state.access : undefined;
resourceInputs["documentId"] = state ? state.documentId : undefined;
resourceInputs["recipients"] = state ? state.recipients : undefined;
}
else {
const args = argsOrState;
if ((!args || args.documentId === undefined) && !opts.urn) {
throw new Error("Missing required property 'documentId'");
}
if ((!args || args.recipients === undefined) && !opts.urn) {
throw new Error("Missing required property 'recipients'");
}
resourceInputs["access"] = args ? args.access : undefined;
resourceInputs["documentId"] = args ? args.documentId : undefined;
resourceInputs["recipients"] = args ? args.recipients : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DirectShares.__pulumiType, name, resourceInputs, opts);
}
}
exports.DirectShares = DirectShares;
/** @internal */
DirectShares.__pulumiType = 'dynatrace:index/directShares:DirectShares';
//# sourceMappingURL=directShares.js.map