com.pulumi.azure.hybrid.kotlin.HybridFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.hybrid.kotlin
import com.pulumi.azure.hybrid.HybridFunctions.getComputeMachinePlain
import com.pulumi.azure.hybrid.kotlin.inputs.GetComputeMachinePlainArgs
import com.pulumi.azure.hybrid.kotlin.inputs.GetComputeMachinePlainArgsBuilder
import com.pulumi.azure.hybrid.kotlin.outputs.GetComputeMachineResult
import com.pulumi.azure.hybrid.kotlin.outputs.GetComputeMachineResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object HybridFunctions {
/**
* Use this data source to access information about an existing Hybrid Compute.
* ## Disclaimers
* > **Note:** The Data Source `azure.hybrid.getComputeMachine` is deprecated will be removed in v4.0 of the Azure Provider - a replacement can be found in the form of the `azure.arcmachine.get` Data Source.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.hybrid.getComputeMachine({
* name: "existing-hcmachine",
* resourceGroupName: "existing-rg",
* });
* export const id = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.hybrid.get_compute_machine(name="existing-hcmachine",
* resource_group_name="existing-rg")
* pulumi.export("id", example.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Hybrid.GetComputeMachine.Invoke(new()
* {
* Name = "existing-hcmachine",
* ResourceGroupName = "existing-rg",
* });
* return new Dictionary
* {
* ["id"] = example.Apply(getComputeMachineResult => getComputeMachineResult.Id),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/hybrid"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := hybrid.GetComputeMachine(ctx, &hybrid.GetComputeMachineArgs{
* Name: "existing-hcmachine",
* ResourceGroupName: "existing-rg",
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("id", example.Id)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.hybrid.HybridFunctions;
* import com.pulumi.azure.hybrid.inputs.GetComputeMachineArgs;
* 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 = HybridFunctions.getComputeMachine(GetComputeMachineArgs.builder()
* .name("existing-hcmachine")
* .resourceGroupName("existing-rg")
* .build());
* ctx.export("id", example.applyValue(getComputeMachineResult -> getComputeMachineResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:hybrid:getComputeMachine
* Arguments:
* name: existing-hcmachine
* resourceGroupName: existing-rg
* outputs:
* id: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking getComputeMachine.
* @return A collection of values returned by getComputeMachine.
*/
public suspend fun getComputeMachine(argument: GetComputeMachinePlainArgs): GetComputeMachineResult = toKotlin(getComputeMachinePlain(argument.toJava()).await())
/**
* @see [getComputeMachine].
* @param name The name of this hybrid compute machine.
* @param resourceGroupName The name of the Resource Group where the Hybrid Compute exists.
* @return A collection of values returned by getComputeMachine.
*/
public suspend fun getComputeMachine(name: String, resourceGroupName: String): GetComputeMachineResult {
val argument = GetComputeMachinePlainArgs(
name = name,
resourceGroupName = resourceGroupName,
)
return toKotlin(getComputeMachinePlain(argument.toJava()).await())
}
/**
* @see [getComputeMachine].
* @param argument Builder for [com.pulumi.azure.hybrid.kotlin.inputs.GetComputeMachinePlainArgs].
* @return A collection of values returned by getComputeMachine.
*/
public suspend fun getComputeMachine(argument: suspend GetComputeMachinePlainArgsBuilder.() -> Unit): GetComputeMachineResult {
val builder = GetComputeMachinePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getComputeMachinePlain(builtArgument.toJava()).await())
}
}