com.pulumi.gcp.alloydb.kotlin.AlloydbFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.gcp.alloydb.kotlin
import com.pulumi.gcp.alloydb.AlloydbFunctions.getLocationsPlain
import com.pulumi.gcp.alloydb.AlloydbFunctions.getSupportedDatabaseFlagsPlain
import com.pulumi.gcp.alloydb.kotlin.inputs.GetLocationsPlainArgs
import com.pulumi.gcp.alloydb.kotlin.inputs.GetLocationsPlainArgsBuilder
import com.pulumi.gcp.alloydb.kotlin.inputs.GetSupportedDatabaseFlagsPlainArgs
import com.pulumi.gcp.alloydb.kotlin.inputs.GetSupportedDatabaseFlagsPlainArgsBuilder
import com.pulumi.gcp.alloydb.kotlin.outputs.GetLocationsResult
import com.pulumi.gcp.alloydb.kotlin.outputs.GetSupportedDatabaseFlagsResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.alloydb.kotlin.outputs.GetLocationsResult.Companion.toKotlin as getLocationsResultToKotlin
import com.pulumi.gcp.alloydb.kotlin.outputs.GetSupportedDatabaseFlagsResult.Companion.toKotlin as getSupportedDatabaseFlagsResultToKotlin
public object AlloydbFunctions {
/**
* Use this data source to get information about the available locations. For more details refer the [API docs](https://cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const qa = gcp.alloydb.getLocations({});
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* qa = gcp.alloydb.get_locations()
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var qa = Gcp.Alloydb.GetLocations.Invoke();
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/alloydb"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := alloydb.GetLocations(ctx, nil, 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.alloydb.AlloydbFunctions;
* import com.pulumi.gcp.alloydb.inputs.GetLocationsArgs;
* 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 qa = AlloydbFunctions.getLocations();
* }
* }
* ```
* ```yaml
* variables:
* qa:
* fn::invoke:
* Function: gcp:alloydb:getLocations
* Arguments: {}
* ```
*
* @param argument A collection of arguments for invoking getLocations.
* @return A collection of values returned by getLocations.
*/
public suspend fun getLocations(argument: GetLocationsPlainArgs): GetLocationsResult =
getLocationsResultToKotlin(getLocationsPlain(argument.toJava()).await())
/**
* @see [getLocations].
* @param project The ID of the project.
* @return A collection of values returned by getLocations.
*/
public suspend fun getLocations(project: String? = null): GetLocationsResult {
val argument = GetLocationsPlainArgs(
project = project,
)
return getLocationsResultToKotlin(getLocationsPlain(argument.toJava()).await())
}
/**
* @see [getLocations].
* @param argument Builder for [com.pulumi.gcp.alloydb.kotlin.inputs.GetLocationsPlainArgs].
* @return A collection of values returned by getLocations.
*/
public suspend fun getLocations(argument: suspend GetLocationsPlainArgsBuilder.() -> Unit): GetLocationsResult {
val builder = GetLocationsPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getLocationsResultToKotlin(getLocationsPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to get information about the supported alloydb database flags in a location.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const qa = gcp.alloydb.getSupportedDatabaseFlags({
* location: "us-central1",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* qa = gcp.alloydb.get_supported_database_flags(location="us-central1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var qa = Gcp.Alloydb.GetSupportedDatabaseFlags.Invoke(new()
* {
* Location = "us-central1",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/alloydb"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := alloydb.GetSupportedDatabaseFlags(ctx, &alloydb.GetSupportedDatabaseFlagsArgs{
* Location: "us-central1",
* }, 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.alloydb.AlloydbFunctions;
* import com.pulumi.gcp.alloydb.inputs.GetSupportedDatabaseFlagsArgs;
* 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 qa = AlloydbFunctions.getSupportedDatabaseFlags(GetSupportedDatabaseFlagsArgs.builder()
* .location("us-central1")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* qa:
* fn::invoke:
* Function: gcp:alloydb:getSupportedDatabaseFlags
* Arguments:
* location: us-central1
* ```
*
* @param argument A collection of arguments for invoking getSupportedDatabaseFlags.
* @return A collection of values returned by getSupportedDatabaseFlags.
*/
public suspend fun getSupportedDatabaseFlags(argument: GetSupportedDatabaseFlagsPlainArgs): GetSupportedDatabaseFlagsResult =
getSupportedDatabaseFlagsResultToKotlin(getSupportedDatabaseFlagsPlain(argument.toJava()).await())
/**
* @see [getSupportedDatabaseFlags].
* @param location The canonical id of the location. For example: `us-east1`.
* @param project The ID of the project.
* @return A collection of values returned by getSupportedDatabaseFlags.
*/
public suspend fun getSupportedDatabaseFlags(location: String, project: String? = null): GetSupportedDatabaseFlagsResult {
val argument = GetSupportedDatabaseFlagsPlainArgs(
location = location,
project = project,
)
return getSupportedDatabaseFlagsResultToKotlin(getSupportedDatabaseFlagsPlain(argument.toJava()).await())
}
/**
* @see [getSupportedDatabaseFlags].
* @param argument Builder for [com.pulumi.gcp.alloydb.kotlin.inputs.GetSupportedDatabaseFlagsPlainArgs].
* @return A collection of values returned by getSupportedDatabaseFlags.
*/
public suspend fun getSupportedDatabaseFlags(argument: suspend GetSupportedDatabaseFlagsPlainArgsBuilder.() -> Unit): GetSupportedDatabaseFlagsResult {
val builder = GetSupportedDatabaseFlagsPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getSupportedDatabaseFlagsResultToKotlin(getSupportedDatabaseFlagsPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy