com.pulumi.azure.search.kotlin.SearchFunctions.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.search.kotlin
import com.pulumi.azure.search.SearchFunctions.getServicePlain
import com.pulumi.azure.search.kotlin.inputs.GetServicePlainArgs
import com.pulumi.azure.search.kotlin.inputs.GetServicePlainArgsBuilder
import com.pulumi.azure.search.kotlin.outputs.GetServiceResult
import com.pulumi.azure.search.kotlin.outputs.GetServiceResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object SearchFunctions {
/**
* Manages a Search Service.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const exampleResourceGroup = new azure.core.ResourceGroup("example", {
* name: "example-resources",
* location: "West Europe",
* });
* const example = azure.search.getServiceOutput({
* name: "example-search-service",
* resourceGroupName: exampleResourceGroup.name,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example_resource_group = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example = azure.search.get_service_output(name="example-search-service",
* resource_group_name=example_resource_group.name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
* {
* Name = "example-resources",
* Location = "West Europe",
* });
* var example = Azure.Search.GetService.Invoke(new()
* {
* Name = "example-search-service",
* ResourceGroupName = exampleResourceGroup.Name,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/search"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
* Name: pulumi.String("example-resources"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* _ = search.LookupServiceOutput(ctx, search.GetServiceOutputArgs{
* Name: pulumi.String("example-search-service"),
* ResourceGroupName: exampleResourceGroup.Name,
* }, nil)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.search.SearchFunctions;
* import com.pulumi.azure.search.inputs.GetServiceArgs;
* 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) {
* var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
* final var example = SearchFunctions.getService(GetServiceArgs.builder()
* .name("example-search-service")
* .resourceGroupName(exampleResourceGroup.name())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleResourceGroup:
* type: azure:core:ResourceGroup
* name: example
* properties:
* name: example-resources
* location: West Europe
* variables:
* example:
* fn::invoke:
* Function: azure:search:getService
* Arguments:
* name: example-search-service
* resourceGroupName: ${exampleResourceGroup.name}
* ```
*
* @param argument A collection of arguments for invoking getService.
* @return A collection of values returned by getService.
*/
public suspend fun getService(argument: GetServicePlainArgs): GetServiceResult =
toKotlin(getServicePlain(argument.toJava()).await())
/**
* @see [getService].
* @param name The Name of the Search Service.
* @param resourceGroupName The name of the Resource Group where the Search Service exists.
* @return A collection of values returned by getService.
*/
public suspend fun getService(name: String, resourceGroupName: String): GetServiceResult {
val argument = GetServicePlainArgs(
name = name,
resourceGroupName = resourceGroupName,
)
return toKotlin(getServicePlain(argument.toJava()).await())
}
/**
* @see [getService].
* @param argument Builder for [com.pulumi.azure.search.kotlin.inputs.GetServicePlainArgs].
* @return A collection of values returned by getService.
*/
public suspend fun getService(argument: suspend GetServicePlainArgsBuilder.() -> Unit):
GetServiceResult {
val builder = GetServicePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getServicePlain(builtArgument.toJava()).await())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy