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

com.pulumi.azure.stack.kotlin.StackFunctions.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.21.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.stack.kotlin

import com.pulumi.azure.stack.StackFunctions.getHciClusterPlain
import com.pulumi.azure.stack.kotlin.inputs.GetHciClusterPlainArgs
import com.pulumi.azure.stack.kotlin.inputs.GetHciClusterPlainArgsBuilder
import com.pulumi.azure.stack.kotlin.outputs.GetHciClusterResult
import com.pulumi.azure.stack.kotlin.outputs.GetHciClusterResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object StackFunctions {
    /**
     * Use this data source to access information about an existing Azure Stack HCI Cluster instance.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.stack.getHciCluster({
     *     name: "existing",
     *     resourceGroupName: "existing",
     * });
     * export const id = example.then(example => example.id);
     * export const location = example.then(example => example.location);
     * export const clientId = example.then(example => example.clientId);
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.stack.get_hci_cluster(name="existing",
     *     resource_group_name="existing")
     * pulumi.export("id", example.id)
     * pulumi.export("location", example.location)
     * pulumi.export("clientId", example.client_id)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.Stack.GetHciCluster.Invoke(new()
     *     {
     *         Name = "existing",
     *         ResourceGroupName = "existing",
     *     });
     *     return new Dictionary
     *     {
     *         ["id"] = example.Apply(getHciClusterResult => getHciClusterResult.Id),
     *         ["location"] = example.Apply(getHciClusterResult => getHciClusterResult.Location),
     *         ["clientId"] = example.Apply(getHciClusterResult => getHciClusterResult.ClientId),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/stack"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		example, err := stack.LookupHciCluster(ctx, &stack.LookupHciClusterArgs{
     * 			Name:              "existing",
     * 			ResourceGroupName: "existing",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("id", example.Id)
     * 		ctx.Export("location", example.Location)
     * 		ctx.Export("clientId", example.ClientId)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.stack.StackFunctions;
     * import com.pulumi.azure.stack.inputs.GetHciClusterArgs;
     * 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 = StackFunctions.getHciCluster(GetHciClusterArgs.builder()
     *             .name("existing")
     *             .resourceGroupName("existing")
     *             .build());
     *         ctx.export("id", example.applyValue(getHciClusterResult -> getHciClusterResult.id()));
     *         ctx.export("location", example.applyValue(getHciClusterResult -> getHciClusterResult.location()));
     *         ctx.export("clientId", example.applyValue(getHciClusterResult -> getHciClusterResult.clientId()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:stack:getHciCluster
     *       Arguments:
     *         name: existing
     *         resourceGroupName: existing
     * outputs:
     *   id: ${example.id}
     *   location: ${example.location}
     *   clientId: ${example.clientId}
     * ```
     * 
     * @param argument A collection of arguments for invoking getHciCluster.
     * @return A collection of values returned by getHciCluster.
     */
    public suspend fun getHciCluster(argument: GetHciClusterPlainArgs): GetHciClusterResult =
        toKotlin(getHciClusterPlain(argument.toJava()).await())

    /**
     * @see [getHciCluster].
     * @param name The name of the Azure Stack HCI Cluster.
     * @param resourceGroupName The name of the Resource Group where the Azure Stack HCI Cluster exists.
     * @return A collection of values returned by getHciCluster.
     */
    public suspend fun getHciCluster(name: String, resourceGroupName: String): GetHciClusterResult {
        val argument = GetHciClusterPlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
        )
        return toKotlin(getHciClusterPlain(argument.toJava()).await())
    }

    /**
     * @see [getHciCluster].
     * @param argument Builder for [com.pulumi.azure.stack.kotlin.inputs.GetHciClusterPlainArgs].
     * @return A collection of values returned by getHciCluster.
     */
    public suspend fun getHciCluster(argument: suspend GetHciClusterPlainArgsBuilder.() -> Unit):
        GetHciClusterResult {
        val builder = GetHciClusterPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getHciClusterPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy