com.pulumi.azure.portal.kotlin.PortalFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.portal.kotlin
import com.pulumi.azure.portal.PortalFunctions.getDashboardPlain
import com.pulumi.azure.portal.kotlin.inputs.GetDashboardPlainArgs
import com.pulumi.azure.portal.kotlin.inputs.GetDashboardPlainArgsBuilder
import com.pulumi.azure.portal.kotlin.outputs.GetDashboardResult
import com.pulumi.azure.portal.kotlin.outputs.GetDashboardResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object PortalFunctions {
/**
* Use this data source to access information about an existing shared dashboard in the Azure Portal. This is the data source of the `azure.portal.Dashboard` resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.portal.getDashboard({
* name: "existing-dashboard",
* resourceGroupName: "dashboard-rg",
* });
* export const id = exampleAzurermDashboard.id;
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.portal.get_dashboard(name="existing-dashboard",
* resource_group_name="dashboard-rg")
* pulumi.export("id", example_azurerm_dashboard["id"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Portal.GetDashboard.Invoke(new()
* {
* Name = "existing-dashboard",
* ResourceGroupName = "dashboard-rg",
* });
* return new Dictionary
* {
* ["id"] = exampleAzurermDashboard.Id,
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/portal"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := portal.LookupDashboard(ctx, &portal.LookupDashboardArgs{
* Name: pulumi.StringRef("existing-dashboard"),
* ResourceGroupName: "dashboard-rg",
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("id", exampleAzurermDashboard.Id)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.portal.PortalFunctions;
* import com.pulumi.azure.portal.inputs.GetDashboardArgs;
* 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 = PortalFunctions.getDashboard(GetDashboardArgs.builder()
* .name("existing-dashboard")
* .resourceGroupName("dashboard-rg")
* .build());
* ctx.export("id", exampleAzurermDashboard.id());
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:portal:getDashboard
* Arguments:
* name: existing-dashboard
* resourceGroupName: dashboard-rg
* outputs:
* id: ${exampleAzurermDashboard.id}
* ```
*
* @param argument A collection of arguments for invoking getDashboard.
* @return A collection of values returned by getDashboard.
*/
public suspend fun getDashboard(argument: GetDashboardPlainArgs): GetDashboardResult =
toKotlin(getDashboardPlain(argument.toJava()).await())
/**
* @see [getDashboard].
* @param dashboardProperties JSON data representing dashboard body.
* @param displayName Specifies the display name of the shared Azure Portal Dashboard.
* @param name Specifies the name of the shared Azure Portal Dashboard.
* @param resourceGroupName Specifies the name of the resource group the shared Azure Portal Dashboard is located in.
* @return A collection of values returned by getDashboard.
*/
public suspend fun getDashboard(
dashboardProperties: String? = null,
displayName: String? = null,
name: String? = null,
resourceGroupName: String,
): GetDashboardResult {
val argument = GetDashboardPlainArgs(
dashboardProperties = dashboardProperties,
displayName = displayName,
name = name,
resourceGroupName = resourceGroupName,
)
return toKotlin(getDashboardPlain(argument.toJava()).await())
}
/**
* @see [getDashboard].
* @param argument Builder for [com.pulumi.azure.portal.kotlin.inputs.GetDashboardPlainArgs].
* @return A collection of values returned by getDashboard.
*/
public suspend fun getDashboard(argument: suspend GetDashboardPlainArgsBuilder.() -> Unit): GetDashboardResult {
val builder = GetDashboardPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getDashboardPlain(builtArgument.toJava()).await())
}
}