@pulumiverse/dynatrace
Version:
A Pulumi package for creating and managing Dynatrace cloud resources.
118 lines • 6.3 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.RpcBasedSampling = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* > This resource requires the API token scopes **Read settings** (`settings.read`) and **Write settings** (`settings.write`)
*
* ## Dynatrace Documentation
*
* - Trace sampling - https://docs.dynatrace.com/docs/shortlink/url-sampling
*
* - Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:rpc-based-sampling`)
*
* ## Resource Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as dynatrace from "@pulumiverse/dynatrace";
*
* const _name_ = new dynatrace.RpcBasedSampling("#name#", {
* enabled: false,
* endpointName: "#name#-endpoint",
* endpointNameComparisonType: "DOES_NOT_END_WITH",
* ignore: true,
* remoteOperationName: "#name#-operation",
* remoteOperationNameComparisonType: "CONTAINS",
* remoteServiceName: "#name#-service",
* remoteServiceNameComparisonType: "STARTS_WITH",
* scope: "environment",
* wireProtocolType: "8",
* });
* ```
*/
class RpcBasedSampling extends pulumi.CustomResource {
/**
* Get an existing RpcBasedSampling 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 RpcBasedSampling(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of RpcBasedSampling. 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'] === RpcBasedSampling.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["endpointName"] = state ? state.endpointName : undefined;
resourceInputs["endpointNameComparisonType"] = state ? state.endpointNameComparisonType : undefined;
resourceInputs["factor"] = state ? state.factor : undefined;
resourceInputs["ignore"] = state ? state.ignore : undefined;
resourceInputs["insertAfter"] = state ? state.insertAfter : undefined;
resourceInputs["remoteOperationName"] = state ? state.remoteOperationName : undefined;
resourceInputs["remoteOperationNameComparisonType"] = state ? state.remoteOperationNameComparisonType : undefined;
resourceInputs["remoteServiceName"] = state ? state.remoteServiceName : undefined;
resourceInputs["remoteServiceNameComparisonType"] = state ? state.remoteServiceNameComparisonType : undefined;
resourceInputs["scope"] = state ? state.scope : undefined;
resourceInputs["wireProtocolType"] = state ? state.wireProtocolType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.enabled === undefined) && !opts.urn) {
throw new Error("Missing required property 'enabled'");
}
if ((!args || args.endpointNameComparisonType === undefined) && !opts.urn) {
throw new Error("Missing required property 'endpointNameComparisonType'");
}
if ((!args || args.ignore === undefined) && !opts.urn) {
throw new Error("Missing required property 'ignore'");
}
if ((!args || args.remoteOperationNameComparisonType === undefined) && !opts.urn) {
throw new Error("Missing required property 'remoteOperationNameComparisonType'");
}
if ((!args || args.remoteServiceNameComparisonType === undefined) && !opts.urn) {
throw new Error("Missing required property 'remoteServiceNameComparisonType'");
}
if ((!args || args.wireProtocolType === undefined) && !opts.urn) {
throw new Error("Missing required property 'wireProtocolType'");
}
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["endpointName"] = args ? args.endpointName : undefined;
resourceInputs["endpointNameComparisonType"] = args ? args.endpointNameComparisonType : undefined;
resourceInputs["factor"] = args ? args.factor : undefined;
resourceInputs["ignore"] = args ? args.ignore : undefined;
resourceInputs["insertAfter"] = args ? args.insertAfter : undefined;
resourceInputs["remoteOperationName"] = args ? args.remoteOperationName : undefined;
resourceInputs["remoteOperationNameComparisonType"] = args ? args.remoteOperationNameComparisonType : undefined;
resourceInputs["remoteServiceName"] = args ? args.remoteServiceName : undefined;
resourceInputs["remoteServiceNameComparisonType"] = args ? args.remoteServiceNameComparisonType : undefined;
resourceInputs["scope"] = args ? args.scope : undefined;
resourceInputs["wireProtocolType"] = args ? args.wireProtocolType : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(RpcBasedSampling.__pulumiType, name, resourceInputs, opts);
}
}
exports.RpcBasedSampling = RpcBasedSampling;
/** @internal */
RpcBasedSampling.__pulumiType = 'dynatrace:index/rpcBasedSampling:RpcBasedSampling';
//# sourceMappingURL=rpcBasedSampling.js.map