com.pulumi.azure.maintenance.kotlin.MaintenanceFunctions.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.maintenance.kotlin
import com.pulumi.azure.maintenance.MaintenanceFunctions.getConfigurationPlain
import com.pulumi.azure.maintenance.MaintenanceFunctions.getPublicConfigurationsPlain
import com.pulumi.azure.maintenance.kotlin.inputs.GetConfigurationPlainArgs
import com.pulumi.azure.maintenance.kotlin.inputs.GetConfigurationPlainArgsBuilder
import com.pulumi.azure.maintenance.kotlin.inputs.GetPublicConfigurationsPlainArgs
import com.pulumi.azure.maintenance.kotlin.inputs.GetPublicConfigurationsPlainArgsBuilder
import com.pulumi.azure.maintenance.kotlin.outputs.GetConfigurationResult
import com.pulumi.azure.maintenance.kotlin.outputs.GetPublicConfigurationsResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.azure.maintenance.kotlin.outputs.GetConfigurationResult.Companion.toKotlin as getConfigurationResultToKotlin
import com.pulumi.azure.maintenance.kotlin.outputs.GetPublicConfigurationsResult.Companion.toKotlin as getPublicConfigurationsResultToKotlin
public object MaintenanceFunctions {
/**
* Use this data source to access information about an existing Maintenance Configuration.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const existing = azure.maintenance.getConfiguration({
* name: "example-mc",
* resourceGroupName: "example-resources",
* });
* export const id = existingAzurermMaintenanceConfiguration.id;
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* existing = azure.maintenance.get_configuration(name="example-mc",
* resource_group_name="example-resources")
* pulumi.export("id", existing_azurerm_maintenance_configuration["id"])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var existing = Azure.Maintenance.GetConfiguration.Invoke(new()
* {
* Name = "example-mc",
* ResourceGroupName = "example-resources",
* });
* return new Dictionary
* {
* ["id"] = existingAzurermMaintenanceConfiguration.Id,
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := maintenance.LookupConfiguration(ctx, &maintenance.LookupConfigurationArgs{
* Name: "example-mc",
* ResourceGroupName: "example-resources",
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("id", existingAzurermMaintenanceConfiguration.Id)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.maintenance.MaintenanceFunctions;
* import com.pulumi.azure.maintenance.inputs.GetConfigurationArgs;
* 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 existing = MaintenanceFunctions.getConfiguration(GetConfigurationArgs.builder()
* .name("example-mc")
* .resourceGroupName("example-resources")
* .build());
* ctx.export("id", existingAzurermMaintenanceConfiguration.id());
* }
* }
* ```
* ```yaml
* variables:
* existing:
* fn::invoke:
* Function: azure:maintenance:getConfiguration
* Arguments:
* name: example-mc
* resourceGroupName: example-resources
* outputs:
* id: ${existingAzurermMaintenanceConfiguration.id}
* ```
*
* @param argument A collection of arguments for invoking getConfiguration.
* @return A collection of values returned by getConfiguration.
*/
public suspend fun getConfiguration(argument: GetConfigurationPlainArgs): GetConfigurationResult =
getConfigurationResultToKotlin(getConfigurationPlain(argument.toJava()).await())
/**
* @see [getConfiguration].
* @param name Specifies the name of the Maintenance Configuration.
* @param resourceGroupName Specifies the name of the Resource Group where this Maintenance Configuration exists.
* @return A collection of values returned by getConfiguration.
*/
public suspend fun getConfiguration(name: String, resourceGroupName: String):
GetConfigurationResult {
val argument = GetConfigurationPlainArgs(
name = name,
resourceGroupName = resourceGroupName,
)
return getConfigurationResultToKotlin(getConfigurationPlain(argument.toJava()).await())
}
/**
* @see [getConfiguration].
* @param argument Builder for [com.pulumi.azure.maintenance.kotlin.inputs.GetConfigurationPlainArgs].
* @return A collection of values returned by getConfiguration.
*/
public suspend
fun getConfiguration(argument: suspend GetConfigurationPlainArgsBuilder.() -> Unit):
GetConfigurationResult {
val builder = GetConfigurationPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getConfigurationResultToKotlin(getConfigurationPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access information about existing Public Maintenance Configurations.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const existing = azure.maintenance.getPublicConfigurations({
* location: "West Europe",
* scope: "SQLManagedInstance",
* recurEvery: "Monday-Thursday",
* });
* export const name = existing.then(existing => existing.configs?.[0]?.name);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* existing = azure.maintenance.get_public_configurations(location="West Europe",
* scope="SQLManagedInstance",
* recur_every="Monday-Thursday")
* pulumi.export("name", existing.configs[0].name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var existing = Azure.Maintenance.GetPublicConfigurations.Invoke(new()
* {
* Location = "West Europe",
* Scope = "SQLManagedInstance",
* RecurEvery = "Monday-Thursday",
* });
* return new Dictionary
* {
* ["name"] = existing.Apply(getPublicConfigurationsResult => getPublicConfigurationsResult.Configs[0]?.Name),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/maintenance"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* existing, err := maintenance.GetPublicConfigurations(ctx, &maintenance.GetPublicConfigurationsArgs{
* Location: pulumi.StringRef("West Europe"),
* Scope: pulumi.StringRef("SQLManagedInstance"),
* RecurEvery: pulumi.StringRef("Monday-Thursday"),
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("name", existing.Configs[0].Name)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.maintenance.MaintenanceFunctions;
* import com.pulumi.azure.maintenance.inputs.GetPublicConfigurationsArgs;
* 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 existing = MaintenanceFunctions.getPublicConfigurations(GetPublicConfigurationsArgs.builder()
* .location("West Europe")
* .scope("SQLManagedInstance")
* .recurEvery("Monday-Thursday")
* .build());
* ctx.export("name", existing.applyValue(getPublicConfigurationsResult -> getPublicConfigurationsResult.configs()[0].name()));
* }
* }
* ```
* ```yaml
* variables:
* existing:
* fn::invoke:
* Function: azure:maintenance:getPublicConfigurations
* Arguments:
* location: West Europe
* scope: SQLManagedInstance
* recurEvery: Monday-Thursday
* outputs:
* name: ${existing.configs[0].name}
* ```
*
* @param argument A collection of arguments for invoking getPublicConfigurations.
* @return A collection of values returned by getPublicConfigurations.
*/
public suspend fun getPublicConfigurations(argument: GetPublicConfigurationsPlainArgs):
GetPublicConfigurationsResult =
getPublicConfigurationsResultToKotlin(getPublicConfigurationsPlain(argument.toJava()).await())
/**
* @see [getPublicConfigurations].
* @param location The Azure location to filter the list of Public Maintenance Configurations against.
* @param recurEvery The recurring window to filter the list of Public Maintenance Configurations against. Possible values are `Monday-Thursday` and `Friday-Sunday`
* @param scope The scope to filter the list of Public Maintenance Configurations against. Possible values are `Extension`, `Host`, `InGuestPatch`, `OSImage`, `SQLDB` and `SQLManagedInstance`.
* @return A collection of values returned by getPublicConfigurations.
*/
public suspend fun getPublicConfigurations(
location: String? = null,
recurEvery: String? = null,
scope: String? = null,
): GetPublicConfigurationsResult {
val argument = GetPublicConfigurationsPlainArgs(
location = location,
recurEvery = recurEvery,
scope = scope,
)
return getPublicConfigurationsResultToKotlin(getPublicConfigurationsPlain(argument.toJava()).await())
}
/**
* @see [getPublicConfigurations].
* @param argument Builder for [com.pulumi.azure.maintenance.kotlin.inputs.GetPublicConfigurationsPlainArgs].
* @return A collection of values returned by getPublicConfigurations.
*/
public suspend
fun getPublicConfigurations(argument: suspend GetPublicConfigurationsPlainArgsBuilder.() -> Unit):
GetPublicConfigurationsResult {
val builder = GetPublicConfigurationsPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getPublicConfigurationsResultToKotlin(getPublicConfigurationsPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy