com.pulumi.azure.arcmachine.kotlin.ArcmachineFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.arcmachine.kotlin
import com.pulumi.azure.arcmachine.ArcmachineFunctions.getPlain
import com.pulumi.azure.arcmachine.kotlin.inputs.GetPlainArgs
import com.pulumi.azure.arcmachine.kotlin.inputs.GetPlainArgsBuilder
import com.pulumi.azure.arcmachine.kotlin.outputs.GetResult
import com.pulumi.azure.arcmachine.kotlin.outputs.GetResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object ArcmachineFunctions {
/**
* Use this data source to access information about an existing Azure Arc machine.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.arcmachine.get({
* name: "existing-hcmachine",
* resourceGroupName: "existing-rg",
* });
* export const id = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.arcmachine.get(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.ArcMachine.Get.Invoke(new()
* {
* Name = "existing-hcmachine",
* ResourceGroupName = "existing-rg",
* });
* return new Dictionary
* {
* ["id"] = example.Apply(getResult => getResult.Id),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/arcmachine"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := arcmachine.Get(ctx, &arcmachine.GetArgs{
* 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.arcmachine.ArcmachineFunctions;
* import com.pulumi.azure.arcmachine.inputs.GetArgs;
* 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 = ArcmachineFunctions.get(GetArgs.builder()
* .name("existing-hcmachine")
* .resourceGroupName("existing-rg")
* .build());
* ctx.export("id", example.applyValue(getResult -> getResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:arcmachine:get
* Arguments:
* name: existing-hcmachine
* resourceGroupName: existing-rg
* outputs:
* id: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking get.
* @return A collection of values returned by get.
*/
public suspend fun `get`(argument: GetPlainArgs): GetResult =
toKotlin(getPlain(argument.toJava()).await())
/**
* @see [get].
* @param name The name of this Azure Arc machine.
* @param resourceGroupName The name of the Resource Group where the Hybrid Compute exists.
* @return A collection of values returned by get.
*/
public suspend fun `get`(name: String, resourceGroupName: String): GetResult {
val argument = GetPlainArgs(
name = name,
resourceGroupName = resourceGroupName,
)
return toKotlin(getPlain(argument.toJava()).await())
}
/**
* @see [get].
* @param argument Builder for [com.pulumi.azure.arcmachine.kotlin.inputs.GetPlainArgs].
* @return A collection of values returned by get.
*/
public suspend fun `get`(argument: suspend GetPlainArgsBuilder.() -> Unit): GetResult {
val builder = GetPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getPlain(builtArgument.toJava()).await())
}
}