All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.hdinsight.kotlin.HdinsightFunctions.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.hdinsight.kotlin

import com.pulumi.azure.hdinsight.HdinsightFunctions.getClusterPlain
import com.pulumi.azure.hdinsight.kotlin.inputs.GetClusterPlainArgs
import com.pulumi.azure.hdinsight.kotlin.inputs.GetClusterPlainArgsBuilder
import com.pulumi.azure.hdinsight.kotlin.outputs.GetClusterResult
import com.pulumi.azure.hdinsight.kotlin.outputs.GetClusterResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object HdinsightFunctions {
    /**
     * Use this data source to access information about an existing HDInsight Cluster.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.hdinsight.getCluster({
     *     name: "example",
     *     resourceGroupName: "example-resources",
     * });
     * export const httpsEndpoint = example.then(example => example.httpsEndpoint);
     * export const clusterId = example.then(example => example.clusterId);
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.hdinsight.get_cluster(name="example",
     *     resource_group_name="example-resources")
     * pulumi.export("httpsEndpoint", example.https_endpoint)
     * pulumi.export("clusterId", example.cluster_id)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.HDInsight.GetCluster.Invoke(new()
     *     {
     *         Name = "example",
     *         ResourceGroupName = "example-resources",
     *     });
     *     return new Dictionary
     *     {
     *         ["httpsEndpoint"] = example.Apply(getClusterResult => getClusterResult.HttpsEndpoint),
     *         ["clusterId"] = example.Apply(getClusterResult => getClusterResult.ClusterId),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hdinsight"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		example, err := hdinsight.GetCluster(ctx, &hdinsight.GetClusterArgs{
     * 			Name:              "example",
     * 			ResourceGroupName: "example-resources",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("httpsEndpoint", example.HttpsEndpoint)
     * 		ctx.Export("clusterId", example.ClusterId)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.hdinsight.HdinsightFunctions;
     * import com.pulumi.azure.hdinsight.inputs.GetClusterArgs;
     * import java.util.List;
     * import java.util.ArrayList;
     * import java.util.Map;
     * import java.io.File;
     * import java.nio.file.Files;
     * import java.nio.file.Paths;
     * public class App {
     *     public static void main(String[] args) {
     *         Pulumi.run(App::stack);
     *     }
     *     public static void stack(Context ctx) {
     *         final var example = HdinsightFunctions.getCluster(GetClusterArgs.builder()
     *             .name("example")
     *             .resourceGroupName("example-resources")
     *             .build());
     *         ctx.export("httpsEndpoint", example.applyValue(getClusterResult -> getClusterResult.httpsEndpoint()));
     *         ctx.export("clusterId", example.applyValue(getClusterResult -> getClusterResult.clusterId()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:hdinsight:getCluster
     *       Arguments:
     *         name: example
     *         resourceGroupName: example-resources
     * outputs:
     *   httpsEndpoint: ${example.httpsEndpoint}
     *   clusterId: ${example.clusterId}
     * ```
     * 
     * @param argument A collection of arguments for invoking getCluster.
     * @return A collection of values returned by getCluster.
     */
    public suspend fun getCluster(argument: GetClusterPlainArgs): GetClusterResult =
        toKotlin(getClusterPlain(argument.toJava()).await())

    /**
     * @see [getCluster].
     * @param name Specifies the name of this HDInsight Cluster.
     * @param resourceGroupName Specifies the name of the Resource Group in which this HDInsight Cluster exists.
     * @return A collection of values returned by getCluster.
     */
    public suspend fun getCluster(name: String, resourceGroupName: String): GetClusterResult {
        val argument = GetClusterPlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
        )
        return toKotlin(getClusterPlain(argument.toJava()).await())
    }

    /**
     * @see [getCluster].
     * @param argument Builder for [com.pulumi.azure.hdinsight.kotlin.inputs.GetClusterPlainArgs].
     * @return A collection of values returned by getCluster.
     */
    public suspend fun getCluster(argument: suspend GetClusterPlainArgsBuilder.() -> Unit): GetClusterResult {
        val builder = GetClusterPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getClusterPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy