All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.databasemigration.kotlin.DatabasemigrationFunctions.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.databasemigration.kotlin

import com.pulumi.azure.databasemigration.DatabasemigrationFunctions.getProjectPlain
import com.pulumi.azure.databasemigration.DatabasemigrationFunctions.getServicePlain
import com.pulumi.azure.databasemigration.kotlin.inputs.GetProjectPlainArgs
import com.pulumi.azure.databasemigration.kotlin.inputs.GetProjectPlainArgsBuilder
import com.pulumi.azure.databasemigration.kotlin.inputs.GetServicePlainArgs
import com.pulumi.azure.databasemigration.kotlin.inputs.GetServicePlainArgsBuilder
import com.pulumi.azure.databasemigration.kotlin.outputs.GetProjectResult
import com.pulumi.azure.databasemigration.kotlin.outputs.GetServiceResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.azure.databasemigration.kotlin.outputs.GetProjectResult.Companion.toKotlin as getProjectResultToKotlin
import com.pulumi.azure.databasemigration.kotlin.outputs.GetServiceResult.Companion.toKotlin as getServiceResultToKotlin

public object DatabasemigrationFunctions {
    /**
     * Use this data source to access information about an existing Database Migration Project.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.databasemigration.getProject({
     *     name: "example-dbms-project",
     *     resourceGroupName: "example-rg",
     *     serviceName: "example-dbms",
     * });
     * export const name = example.then(example => example.name);
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.databasemigration.get_project(name="example-dbms-project",
     *     resource_group_name="example-rg",
     *     service_name="example-dbms")
     * pulumi.export("name", example.name)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.DatabaseMigration.GetProject.Invoke(new()
     *     {
     *         Name = "example-dbms-project",
     *         ResourceGroupName = "example-rg",
     *         ServiceName = "example-dbms",
     *     });
     *     return new Dictionary
     *     {
     *         ["name"] = example.Apply(getProjectResult => getProjectResult.Name),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		example, err := databasemigration.LookupProject(ctx, &databasemigration.LookupProjectArgs{
     * 			Name:              "example-dbms-project",
     * 			ResourceGroupName: "example-rg",
     * 			ServiceName:       "example-dbms",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("name", example.Name)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.databasemigration.DatabasemigrationFunctions;
     * import com.pulumi.azure.databasemigration.inputs.GetProjectArgs;
     * 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 = DatabasemigrationFunctions.getProject(GetProjectArgs.builder()
     *             .name("example-dbms-project")
     *             .resourceGroupName("example-rg")
     *             .serviceName("example-dbms")
     *             .build());
     *         ctx.export("name", example.applyValue(getProjectResult -> getProjectResult.name()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:databasemigration:getProject
     *       Arguments:
     *         name: example-dbms-project
     *         resourceGroupName: example-rg
     *         serviceName: example-dbms
     * outputs:
     *   name: ${example.name}
     * ```
     * 
     * @param argument A collection of arguments for invoking getProject.
     * @return A collection of values returned by getProject.
     */
    public suspend fun getProject(argument: GetProjectPlainArgs): GetProjectResult =
        getProjectResultToKotlin(getProjectPlain(argument.toJava()).await())

    /**
     * @see [getProject].
     * @param name Name of the database migration project.
     * @param resourceGroupName Name of the resource group where resource belongs to.
     * @param serviceName Name of the database migration service where resource belongs to.
     * @return A collection of values returned by getProject.
     */
    public suspend fun getProject(
        name: String,
        resourceGroupName: String,
        serviceName: String,
    ): GetProjectResult {
        val argument = GetProjectPlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
            serviceName = serviceName,
        )
        return getProjectResultToKotlin(getProjectPlain(argument.toJava()).await())
    }

    /**
     * @see [getProject].
     * @param argument Builder for [com.pulumi.azure.databasemigration.kotlin.inputs.GetProjectPlainArgs].
     * @return A collection of values returned by getProject.
     */
    public suspend fun getProject(argument: suspend GetProjectPlainArgsBuilder.() -> Unit): GetProjectResult {
        val builder = GetProjectPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getProjectResultToKotlin(getProjectPlain(builtArgument.toJava()).await())
    }

    /**
     * Use this data source to access information about an existing Database Migration Service.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.databasemigration.getService({
     *     name: "example-dms",
     *     resourceGroupName: "example-rg",
     * });
     * export const azurermDmsId = example.then(example => example.id);
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.databasemigration.get_service(name="example-dms",
     *     resource_group_name="example-rg")
     * pulumi.export("azurermDmsId", example.id)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.DatabaseMigration.GetService.Invoke(new()
     *     {
     *         Name = "example-dms",
     *         ResourceGroupName = "example-rg",
     *     });
     *     return new Dictionary
     *     {
     *         ["azurermDmsId"] = example.Apply(getServiceResult => getServiceResult.Id),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/databasemigration"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		example, err := databasemigration.LookupService(ctx, &databasemigration.LookupServiceArgs{
     * 			Name:              "example-dms",
     * 			ResourceGroupName: "example-rg",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("azurermDmsId", 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.databasemigration.DatabasemigrationFunctions;
     * import com.pulumi.azure.databasemigration.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) {
     *         final var example = DatabasemigrationFunctions.getService(GetServiceArgs.builder()
     *             .name("example-dms")
     *             .resourceGroupName("example-rg")
     *             .build());
     *         ctx.export("azurermDmsId", example.applyValue(getServiceResult -> getServiceResult.id()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:databasemigration:getService
     *       Arguments:
     *         name: example-dms
     *         resourceGroupName: example-rg
     * outputs:
     *   azurermDmsId: ${example.id}
     * ```
     * 
     * @param argument A collection of arguments for invoking getService.
     * @return A collection of values returned by getService.
     */
    public suspend fun getService(argument: GetServicePlainArgs): GetServiceResult =
        getServiceResultToKotlin(getServicePlain(argument.toJava()).await())

    /**
     * @see [getService].
     * @param name Specify the name of the database migration service.
     * @param resourceGroupName Specifies the Name of the Resource Group within which the database migration 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 getServiceResultToKotlin(getServicePlain(argument.toJava()).await())
    }

    /**
     * @see [getService].
     * @param argument Builder for [com.pulumi.azure.databasemigration.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 getServiceResultToKotlin(getServicePlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy