import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * Data source for looking up chaos experiments * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * // ============================================================================ * // Harness Chaos Experiment Data Source Examples * // ============================================================================ * // * // The harness_chaos_experiment data source retrieves information about * // existing chaos experiments. * // * // Lookup Methods: * // 1. By identity (fast, direct GET) - RECOMMENDED * // 2. By name (slower, uses LIST + filter) * // ============================================================================ * // ---------------------------------------------------------------------------- * // Example 1: Lookup by Identity (Recommended) * // ---------------------------------------------------------------------------- * // Fast lookup using the experiment's unique identity * const byIdentity = harness.chaos.getExperiment({ * orgId: "my_org", * projectId: "my_project", * identity: "my-chaos-experiment", * }); * export const experimentId = byIdentity.then(byIdentity => byIdentity.experimentId); * export const experimentInfraType = byIdentity.then(byIdentity => byIdentity.infraType); * export const experimentTemplateName = byIdentity.then(byIdentity => byIdentity.templateDetails?.[0]?.templateName); * // ---------------------------------------------------------------------------- * // Example 2: Lookup by Name * // ---------------------------------------------------------------------------- * // Lookup using the experiment's display name (slower than identity lookup) * const byName = harness.chaos.getExperiment({ * orgId: "my_org", * projectId: "my_project", * name: "My Chaos Experiment", * }); * export const experimentIdentity = byName.then(byName => byName.identity); * // ---------------------------------------------------------------------------- * // Example 3: Use in Other Resources * // ---------------------------------------------------------------------------- * // Reference experiment data in other resources * const existing = harness.chaos.getExperiment({ * orgId: "my_org", * projectId: "my_project", * identity: "prod-experiment", * }); * // Example: Create monitoring based on experiment * const chaosMonitor = new harness.platform.MonitoredService("chaos_monitor", { * orgIdentifier: existing.then(existing => existing.orgId), * projectIdentifier: existing.then(existing => existing.projectId), * identifier: existing.then(existing => `monitor-${existing.identity}`), * name: existing.then(existing => `Monitor for ${existing.name}`), * description: existing.then(existing => `Monitoring for: ${existing.description}`), * }); * ``` */ export declare function getExperiment(args: GetExperimentArgs, opts?: pulumi.InvokeOptions): Promise; /** * A collection of arguments for invoking getExperiment. */ export interface GetExperimentArgs { /** * Experiment identity to lookup */ identity?: string; /** * Experiment name to lookup */ name?: string; /** * Organization identifier */ orgId: string; /** * Project identifier */ projectId: string; } /** * A collection of values returned by getExperiment. */ export interface GetExperimentResult { /** * Creation timestamp (Unix) */ readonly createdAt: number; /** * Username of the creator */ readonly createdBy: string; /** * Cron expression for scheduled execution */ readonly cronSyntax: string; /** * Description of the chaos experiment */ readonly description: string; /** * Full experiment ID */ readonly experimentId: string; /** * Type of the experiment */ readonly experimentType: string; /** * List of fault IDs used in the experiment */ readonly faultIds: string[]; /** * Identity of the hub where template resides */ readonly hubIdentity: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * Experiment identity to lookup */ readonly identity?: string; /** * Import type (REFERENCE or LOCAL) */ readonly importType: string; /** * Resolved infrastructure ID */ readonly infraId: string; /** * Infrastructure reference */ readonly infraRef: string; /** * Infrastructure type */ readonly infraType: string; /** * Whether cron scheduling is enabled */ readonly isCronEnabled: boolean; /** * Whether this is a custom experiment */ readonly isCustomExperiment: boolean; /** * Whether single-run cron is enabled */ readonly isSingleRunCronEnabled: boolean; /** * Timestamp of last execution */ readonly lastExecutedAt: number; /** * Experiment name to lookup */ readonly name?: string; /** * Organization identifier */ readonly orgId: string; /** * Project identifier */ readonly projectId: string; /** * Template revision used */ readonly revision: string; /** * Tags to categorize the experiment */ readonly tags: string[]; /** * Target network map ID */ readonly targetNetworkMapId: string; /** * Template details for REFERENCE imports */ readonly templateDetails: outputs.chaos.GetExperimentTemplateDetail[]; /** * Identity of the experiment template */ readonly templateIdentity: string; /** * Total number of experiment runs */ readonly totalExperimentRuns: number; /** * Last update timestamp (Unix) */ readonly updatedAt: number; /** * Username of the last updater */ readonly updatedBy: string; } /** * Data source for looking up chaos experiments * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as harness from "@pulumi/harness"; * * // ============================================================================ * // Harness Chaos Experiment Data Source Examples * // ============================================================================ * // * // The harness_chaos_experiment data source retrieves information about * // existing chaos experiments. * // * // Lookup Methods: * // 1. By identity (fast, direct GET) - RECOMMENDED * // 2. By name (slower, uses LIST + filter) * // ============================================================================ * // ---------------------------------------------------------------------------- * // Example 1: Lookup by Identity (Recommended) * // ---------------------------------------------------------------------------- * // Fast lookup using the experiment's unique identity * const byIdentity = harness.chaos.getExperiment({ * orgId: "my_org", * projectId: "my_project", * identity: "my-chaos-experiment", * }); * export const experimentId = byIdentity.then(byIdentity => byIdentity.experimentId); * export const experimentInfraType = byIdentity.then(byIdentity => byIdentity.infraType); * export const experimentTemplateName = byIdentity.then(byIdentity => byIdentity.templateDetails?.[0]?.templateName); * // ---------------------------------------------------------------------------- * // Example 2: Lookup by Name * // ---------------------------------------------------------------------------- * // Lookup using the experiment's display name (slower than identity lookup) * const byName = harness.chaos.getExperiment({ * orgId: "my_org", * projectId: "my_project", * name: "My Chaos Experiment", * }); * export const experimentIdentity = byName.then(byName => byName.identity); * // ---------------------------------------------------------------------------- * // Example 3: Use in Other Resources * // ---------------------------------------------------------------------------- * // Reference experiment data in other resources * const existing = harness.chaos.getExperiment({ * orgId: "my_org", * projectId: "my_project", * identity: "prod-experiment", * }); * // Example: Create monitoring based on experiment * const chaosMonitor = new harness.platform.MonitoredService("chaos_monitor", { * orgIdentifier: existing.then(existing => existing.orgId), * projectIdentifier: existing.then(existing => existing.projectId), * identifier: existing.then(existing => `monitor-${existing.identity}`), * name: existing.then(existing => `Monitor for ${existing.name}`), * description: existing.then(existing => `Monitoring for: ${existing.description}`), * }); * ``` */ export declare function getExperimentOutput(args: GetExperimentOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output; /** * A collection of arguments for invoking getExperiment. */ export interface GetExperimentOutputArgs { /** * Experiment identity to lookup */ identity?: pulumi.Input; /** * Experiment name to lookup */ name?: pulumi.Input; /** * Organization identifier */ orgId: pulumi.Input; /** * Project identifier */ projectId: pulumi.Input; } //# sourceMappingURL=getExperiment.d.ts.map