com.pulumi.azure.connections.kotlin.ConnectionsFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.connections.kotlin
import com.pulumi.azure.connections.ConnectionsFunctions.getManagedApiPlain
import com.pulumi.azure.connections.kotlin.inputs.GetManagedApiPlainArgs
import com.pulumi.azure.connections.kotlin.inputs.GetManagedApiPlainArgsBuilder
import com.pulumi.azure.connections.kotlin.outputs.GetManagedApiResult
import com.pulumi.azure.connections.kotlin.outputs.GetManagedApiResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object ConnectionsFunctions {
/**
* Uses this data source to access information about an existing Managed API.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.connections.getManagedApi({
* name: "servicebus",
* location: "West Europe",
* });
* export const id = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.connections.get_managed_api(name="servicebus",
* location="West Europe")
* 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.Connections.GetManagedApi.Invoke(new()
* {
* Name = "servicebus",
* Location = "West Europe",
* });
* return new Dictionary
* {
* ["id"] = example.Apply(getManagedApiResult => getManagedApiResult.Id),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/connections"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := connections.GetManagedApi(ctx, &connections.GetManagedApiArgs{
* Name: "servicebus",
* Location: "West Europe",
* }, 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.connections.ConnectionsFunctions;
* import com.pulumi.azure.connections.inputs.GetManagedApiArgs;
* 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 = ConnectionsFunctions.getManagedApi(GetManagedApiArgs.builder()
* .name("servicebus")
* .location("West Europe")
* .build());
* ctx.export("id", example.applyValue(getManagedApiResult -> getManagedApiResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:connections:getManagedApi
* Arguments:
* name: servicebus
* location: West Europe
* outputs:
* id: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking getManagedApi.
* @return A collection of values returned by getManagedApi.
*/
public suspend fun getManagedApi(argument: GetManagedApiPlainArgs): GetManagedApiResult =
toKotlin(getManagedApiPlain(argument.toJava()).await())
/**
* @see [getManagedApi].
* @param location The Azure location for this Managed API.
* @param name Specifies the name of the Managed API.
* @return A collection of values returned by getManagedApi.
*/
public suspend fun getManagedApi(location: String, name: String): GetManagedApiResult {
val argument = GetManagedApiPlainArgs(
location = location,
name = name,
)
return toKotlin(getManagedApiPlain(argument.toJava()).await())
}
/**
* @see [getManagedApi].
* @param argument Builder for [com.pulumi.azure.connections.kotlin.inputs.GetManagedApiPlainArgs].
* @return A collection of values returned by getManagedApi.
*/
public suspend fun getManagedApi(argument: suspend GetManagedApiPlainArgsBuilder.() -> Unit):
GetManagedApiResult {
val builder = GetManagedApiPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getManagedApiPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy