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

com.pulumi.gcp.apphub.kotlin.ApphubFunctions.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.apphub.kotlin

import com.pulumi.gcp.apphub.ApphubFunctions.getApplicationPlain
import com.pulumi.gcp.apphub.ApphubFunctions.getDiscoveredServicePlain
import com.pulumi.gcp.apphub.ApphubFunctions.getDiscoveredWorkloadPlain
import com.pulumi.gcp.apphub.kotlin.inputs.GetApplicationPlainArgs
import com.pulumi.gcp.apphub.kotlin.inputs.GetApplicationPlainArgsBuilder
import com.pulumi.gcp.apphub.kotlin.inputs.GetDiscoveredServicePlainArgs
import com.pulumi.gcp.apphub.kotlin.inputs.GetDiscoveredServicePlainArgsBuilder
import com.pulumi.gcp.apphub.kotlin.inputs.GetDiscoveredWorkloadPlainArgs
import com.pulumi.gcp.apphub.kotlin.inputs.GetDiscoveredWorkloadPlainArgsBuilder
import com.pulumi.gcp.apphub.kotlin.outputs.GetApplicationResult
import com.pulumi.gcp.apphub.kotlin.outputs.GetDiscoveredServiceResult
import com.pulumi.gcp.apphub.kotlin.outputs.GetDiscoveredWorkloadResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.apphub.kotlin.outputs.GetApplicationResult.Companion.toKotlin as getApplicationResultToKotlin
import com.pulumi.gcp.apphub.kotlin.outputs.GetDiscoveredServiceResult.Companion.toKotlin as getDiscoveredServiceResultToKotlin
import com.pulumi.gcp.apphub.kotlin.outputs.GetDiscoveredWorkloadResult.Companion.toKotlin as getDiscoveredWorkloadResultToKotlin

public object ApphubFunctions {
    /**
     * Application is a functional grouping of Services and Workloads that helps achieve a desired end-to-end business functionality. Services and Workloads are owned by the Application.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const application = gcp.apphub.getApplication({
     *     project: "project-id",
     *     applicationId: "application",
     *     location: "location",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * application = gcp.apphub.get_application(project="project-id",
     *     application_id="application",
     *     location="location")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var application = Gcp.Apphub.GetApplication.Invoke(new()
     *     {
     *         Project = "project-id",
     *         ApplicationId = "application",
     *         Location = "location",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apphub"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := apphub.LookupApplication(ctx, &apphub.LookupApplicationArgs{
     * 			Project:       "project-id",
     * 			ApplicationId: "application",
     * 			Location:      "location",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.apphub.ApphubFunctions;
     * import com.pulumi.gcp.apphub.inputs.GetApplicationArgs;
     * 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 application = ApphubFunctions.getApplication(GetApplicationArgs.builder()
     *             .project("project-id")
     *             .applicationId("application")
     *             .location("location")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   application:
     *     fn::invoke:
     *       Function: gcp:apphub:getApplication
     *       Arguments:
     *         project: project-id
     *         applicationId: application
     *         location: location
     * ```
     * 
     * @param argument A collection of arguments for invoking getApplication.
     * @return A collection of values returned by getApplication.
     */
    public suspend fun getApplication(argument: GetApplicationPlainArgs): GetApplicationResult =
        getApplicationResultToKotlin(getApplicationPlain(argument.toJava()).await())

    /**
     * @see [getApplication].
     * @param applicationId
     * @param location
     * @param project
     * @return A collection of values returned by getApplication.
     */
    public suspend fun getApplication(
        applicationId: String,
        location: String,
        project: String,
    ): GetApplicationResult {
        val argument = GetApplicationPlainArgs(
            applicationId = applicationId,
            location = location,
            project = project,
        )
        return getApplicationResultToKotlin(getApplicationPlain(argument.toJava()).await())
    }

    /**
     * @see [getApplication].
     * @param argument Builder for [com.pulumi.gcp.apphub.kotlin.inputs.GetApplicationPlainArgs].
     * @return A collection of values returned by getApplication.
     */
    public suspend fun getApplication(argument: suspend GetApplicationPlainArgsBuilder.() -> Unit): GetApplicationResult {
        val builder = GetApplicationPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getApplicationResultToKotlin(getApplicationPlain(builtArgument.toJava()).await())
    }

    /**
     * Get information about a discovered service from its uri.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const my-service = gcp.apphub.getDiscoveredService({
     *     location: "my-location",
     *     serviceUri: "my-service-uri",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * my_service = gcp.apphub.get_discovered_service(location="my-location",
     *     service_uri="my-service-uri")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var my_service = Gcp.Apphub.GetDiscoveredService.Invoke(new()
     *     {
     *         Location = "my-location",
     *         ServiceUri = "my-service-uri",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apphub"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := apphub.GetDiscoveredService(ctx, &apphub.GetDiscoveredServiceArgs{
     * 			Location:   "my-location",
     * 			ServiceUri: "my-service-uri",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.apphub.ApphubFunctions;
     * import com.pulumi.gcp.apphub.inputs.GetDiscoveredServiceArgs;
     * 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 my-service = ApphubFunctions.getDiscoveredService(GetDiscoveredServiceArgs.builder()
     *             .location("my-location")
     *             .serviceUri("my-service-uri")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   my-service:
     *     fn::invoke:
     *       Function: gcp:apphub:getDiscoveredService
     *       Arguments:
     *         location: my-location
     *         serviceUri: my-service-uri
     * ```
     * 
     * @param argument A collection of arguments for invoking getDiscoveredService.
     * @return A collection of values returned by getDiscoveredService.
     */
    public suspend fun getDiscoveredService(argument: GetDiscoveredServicePlainArgs): GetDiscoveredServiceResult =
        getDiscoveredServiceResultToKotlin(getDiscoveredServicePlain(argument.toJava()).await())

    /**
     * @see [getDiscoveredService].
     * @param location The location of the discovered service.
     * @param project The host project of the discovered service.
     * @param serviceUri The uri of the service.
     * @return A collection of values returned by getDiscoveredService.
     */
    public suspend fun getDiscoveredService(
        location: String,
        project: String? = null,
        serviceUri: String,
    ): GetDiscoveredServiceResult {
        val argument = GetDiscoveredServicePlainArgs(
            location = location,
            project = project,
            serviceUri = serviceUri,
        )
        return getDiscoveredServiceResultToKotlin(getDiscoveredServicePlain(argument.toJava()).await())
    }

    /**
     * @see [getDiscoveredService].
     * @param argument Builder for [com.pulumi.gcp.apphub.kotlin.inputs.GetDiscoveredServicePlainArgs].
     * @return A collection of values returned by getDiscoveredService.
     */
    public suspend fun getDiscoveredService(argument: suspend GetDiscoveredServicePlainArgsBuilder.() -> Unit): GetDiscoveredServiceResult {
        val builder = GetDiscoveredServicePlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getDiscoveredServiceResultToKotlin(getDiscoveredServicePlain(builtArgument.toJava()).await())
    }

    /**
     * Get information about a discovered workload from its uri.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const my-workload = gcp.apphub.getDiscoveredWorkload({
     *     location: "us-central1",
     *     workloadUri: "my-workload-uri",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * my_workload = gcp.apphub.get_discovered_workload(location="us-central1",
     *     workload_uri="my-workload-uri")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var my_workload = Gcp.Apphub.GetDiscoveredWorkload.Invoke(new()
     *     {
     *         Location = "us-central1",
     *         WorkloadUri = "my-workload-uri",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apphub"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := apphub.GetDiscoveredWorkload(ctx, &apphub.GetDiscoveredWorkloadArgs{
     * 			Location:    "us-central1",
     * 			WorkloadUri: "my-workload-uri",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.apphub.ApphubFunctions;
     * import com.pulumi.gcp.apphub.inputs.GetDiscoveredWorkloadArgs;
     * 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 my-workload = ApphubFunctions.getDiscoveredWorkload(GetDiscoveredWorkloadArgs.builder()
     *             .location("us-central1")
     *             .workloadUri("my-workload-uri")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   my-workload:
     *     fn::invoke:
     *       Function: gcp:apphub:getDiscoveredWorkload
     *       Arguments:
     *         location: us-central1
     *         workloadUri: my-workload-uri
     * ```
     * 
     * @param argument A collection of arguments for invoking getDiscoveredWorkload.
     * @return A collection of values returned by getDiscoveredWorkload.
     */
    public suspend fun getDiscoveredWorkload(argument: GetDiscoveredWorkloadPlainArgs): GetDiscoveredWorkloadResult =
        getDiscoveredWorkloadResultToKotlin(getDiscoveredWorkloadPlain(argument.toJava()).await())

    /**
     * @see [getDiscoveredWorkload].
     * @param location The location of the discovered workload.
     * @param project The host project of the discovered workload.
     * @param workloadUri The uri of the workload (instance group managed by the Instance Group Manager). Example: "//compute.googleapis.com/projects/1/regions/us-east1/instanceGroups/id1"
     * @return A collection of values returned by getDiscoveredWorkload.
     */
    public suspend fun getDiscoveredWorkload(
        location: String,
        project: String? = null,
        workloadUri: String,
    ): GetDiscoveredWorkloadResult {
        val argument = GetDiscoveredWorkloadPlainArgs(
            location = location,
            project = project,
            workloadUri = workloadUri,
        )
        return getDiscoveredWorkloadResultToKotlin(getDiscoveredWorkloadPlain(argument.toJava()).await())
    }

    /**
     * @see [getDiscoveredWorkload].
     * @param argument Builder for [com.pulumi.gcp.apphub.kotlin.inputs.GetDiscoveredWorkloadPlainArgs].
     * @return A collection of values returned by getDiscoveredWorkload.
     */
    public suspend fun getDiscoveredWorkload(argument: suspend GetDiscoveredWorkloadPlainArgsBuilder.() -> Unit): GetDiscoveredWorkloadResult {
        val builder = GetDiscoveredWorkloadPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getDiscoveredWorkloadResultToKotlin(getDiscoveredWorkloadPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy