Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azurenative.netapp.kotlin.SnapshotPolicyArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.netapp.kotlin
import com.pulumi.azurenative.netapp.SnapshotPolicyArgs.builder
import com.pulumi.azurenative.netapp.kotlin.inputs.DailyScheduleArgs
import com.pulumi.azurenative.netapp.kotlin.inputs.DailyScheduleArgsBuilder
import com.pulumi.azurenative.netapp.kotlin.inputs.HourlyScheduleArgs
import com.pulumi.azurenative.netapp.kotlin.inputs.HourlyScheduleArgsBuilder
import com.pulumi.azurenative.netapp.kotlin.inputs.MonthlyScheduleArgs
import com.pulumi.azurenative.netapp.kotlin.inputs.MonthlyScheduleArgsBuilder
import com.pulumi.azurenative.netapp.kotlin.inputs.WeeklyScheduleArgs
import com.pulumi.azurenative.netapp.kotlin.inputs.WeeklyScheduleArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Snapshot policy information
* Azure REST API version: 2022-11-01. Prior API version in Azure Native 1.x: 2020-12-01.
* Other available API versions: 2022-11-01-preview, 2023-05-01, 2023-05-01-preview, 2023-07-01, 2023-07-01-preview, 2023-11-01, 2023-11-01-preview, 2024-01-01, 2024-03-01, 2024-03-01-preview.
* ## Example Usage
* ### SnapshotPolicies_Create
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var snapshotPolicy = new AzureNative.NetApp.SnapshotPolicy("snapshotPolicy", new()
* {
* AccountName = "account1",
* DailySchedule = new AzureNative.NetApp.Inputs.DailyScheduleArgs
* {
* Hour = 14,
* Minute = 30,
* SnapshotsToKeep = 4,
* },
* Enabled = true,
* HourlySchedule = new AzureNative.NetApp.Inputs.HourlyScheduleArgs
* {
* Minute = 50,
* SnapshotsToKeep = 2,
* },
* Location = "eastus",
* MonthlySchedule = new AzureNative.NetApp.Inputs.MonthlyScheduleArgs
* {
* DaysOfMonth = "10,11,12",
* Hour = 14,
* Minute = 15,
* SnapshotsToKeep = 5,
* },
* ResourceGroupName = "myRG",
* SnapshotPolicyName = "snapshotPolicyName",
* WeeklySchedule = new AzureNative.NetApp.Inputs.WeeklyScheduleArgs
* {
* Day = "Wednesday",
* Hour = 14,
* Minute = 45,
* SnapshotsToKeep = 3,
* },
* });
* });
* ```
* ```go
* package main
* import (
* netapp "github.com/pulumi/pulumi-azure-native-sdk/netapp/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := netapp.NewSnapshotPolicy(ctx, "snapshotPolicy", &netapp.SnapshotPolicyArgs{
* AccountName: pulumi.String("account1"),
* DailySchedule: &netapp.DailyScheduleArgs{
* Hour: pulumi.Int(14),
* Minute: pulumi.Int(30),
* SnapshotsToKeep: pulumi.Int(4),
* },
* Enabled: pulumi.Bool(true),
* HourlySchedule: &netapp.HourlyScheduleArgs{
* Minute: pulumi.Int(50),
* SnapshotsToKeep: pulumi.Int(2),
* },
* Location: pulumi.String("eastus"),
* MonthlySchedule: &netapp.MonthlyScheduleArgs{
* DaysOfMonth: pulumi.String("10,11,12"),
* Hour: pulumi.Int(14),
* Minute: pulumi.Int(15),
* SnapshotsToKeep: pulumi.Int(5),
* },
* ResourceGroupName: pulumi.String("myRG"),
* SnapshotPolicyName: pulumi.String("snapshotPolicyName"),
* WeeklySchedule: &netapp.WeeklyScheduleArgs{
* Day: pulumi.String("Wednesday"),
* Hour: pulumi.Int(14),
* Minute: pulumi.Int(45),
* SnapshotsToKeep: pulumi.Int(3),
* },
* })
* 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.azurenative.netapp.SnapshotPolicy;
* import com.pulumi.azurenative.netapp.SnapshotPolicyArgs;
* import com.pulumi.azurenative.netapp.inputs.DailyScheduleArgs;
* import com.pulumi.azurenative.netapp.inputs.HourlyScheduleArgs;
* import com.pulumi.azurenative.netapp.inputs.MonthlyScheduleArgs;
* import com.pulumi.azurenative.netapp.inputs.WeeklyScheduleArgs;
* 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 snapshotPolicy = new SnapshotPolicy("snapshotPolicy", SnapshotPolicyArgs.builder()
* .accountName("account1")
* .dailySchedule(DailyScheduleArgs.builder()
* .hour(14)
* .minute(30)
* .snapshotsToKeep(4)
* .build())
* .enabled(true)
* .hourlySchedule(HourlyScheduleArgs.builder()
* .minute(50)
* .snapshotsToKeep(2)
* .build())
* .location("eastus")
* .monthlySchedule(MonthlyScheduleArgs.builder()
* .daysOfMonth("10,11,12")
* .hour(14)
* .minute(15)
* .snapshotsToKeep(5)
* .build())
* .resourceGroupName("myRG")
* .snapshotPolicyName("snapshotPolicyName")
* .weeklySchedule(WeeklyScheduleArgs.builder()
* .day("Wednesday")
* .hour(14)
* .minute(45)
* .snapshotsToKeep(3)
* .build())
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:netapp:SnapshotPolicy account1/snapshotPolicy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}
* ```
* @property accountName The name of the NetApp account
* @property dailySchedule Schedule for daily snapshots
* @property enabled The property to decide policy is enabled or not
* @property hourlySchedule Schedule for hourly snapshots
* @property location The geo-location where the resource lives
* @property monthlySchedule Schedule for monthly snapshots
* @property resourceGroupName The name of the resource group. The name is case insensitive.
* @property snapshotPolicyName The name of the snapshot policy
* @property tags Resource tags.
* @property weeklySchedule Schedule for weekly snapshots
*/
public data class SnapshotPolicyArgs(
public val accountName: Output? = null,
public val dailySchedule: Output? = null,
public val enabled: Output? = null,
public val hourlySchedule: Output? = null,
public val location: Output? = null,
public val monthlySchedule: Output? = null,
public val resourceGroupName: Output? = null,
public val snapshotPolicyName: Output? = null,
public val tags: Output>? = null,
public val weeklySchedule: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.netapp.SnapshotPolicyArgs =
com.pulumi.azurenative.netapp.SnapshotPolicyArgs.builder()
.accountName(accountName?.applyValue({ args0 -> args0 }))
.dailySchedule(dailySchedule?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.enabled(enabled?.applyValue({ args0 -> args0 }))
.hourlySchedule(hourlySchedule?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.location(location?.applyValue({ args0 -> args0 }))
.monthlySchedule(monthlySchedule?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.snapshotPolicyName(snapshotPolicyName?.applyValue({ args0 -> args0 }))
.tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.weeklySchedule(
weeklySchedule?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
).build()
}
/**
* Builder for [SnapshotPolicyArgs].
*/
@PulumiTagMarker
public class SnapshotPolicyArgsBuilder internal constructor() {
private var accountName: Output? = null
private var dailySchedule: Output? = null
private var enabled: Output? = null
private var hourlySchedule: Output? = null
private var location: Output? = null
private var monthlySchedule: Output? = null
private var resourceGroupName: Output? = null
private var snapshotPolicyName: Output? = null
private var tags: Output>? = null
private var weeklySchedule: Output? = null
/**
* @param value The name of the NetApp account
*/
@JvmName("gdqfodwyfgsyhjou")
public suspend fun accountName(`value`: Output) {
this.accountName = value
}
/**
* @param value Schedule for daily snapshots
*/
@JvmName("keuyofyuaklantma")
public suspend fun dailySchedule(`value`: Output) {
this.dailySchedule = value
}
/**
* @param value The property to decide policy is enabled or not
*/
@JvmName("ftpqfnstdsduafbi")
public suspend fun enabled(`value`: Output) {
this.enabled = value
}
/**
* @param value Schedule for hourly snapshots
*/
@JvmName("jjomahivdanpbhpb")
public suspend fun hourlySchedule(`value`: Output) {
this.hourlySchedule = value
}
/**
* @param value The geo-location where the resource lives
*/
@JvmName("dcmwrsawlhevghbd")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value Schedule for monthly snapshots
*/
@JvmName("lyrobckckffmsefn")
public suspend fun monthlySchedule(`value`: Output) {
this.monthlySchedule = value
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("ybrdvppfjacjbpqt")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value The name of the snapshot policy
*/
@JvmName("iptnhlpdxmboreje")
public suspend fun snapshotPolicyName(`value`: Output) {
this.snapshotPolicyName = value
}
/**
* @param value Resource tags.
*/
@JvmName("uhhqubswommbuklg")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
/**
* @param value Schedule for weekly snapshots
*/
@JvmName("bvfgvdvxsmxaosql")
public suspend fun weeklySchedule(`value`: Output) {
this.weeklySchedule = value
}
/**
* @param value The name of the NetApp account
*/
@JvmName("bjmxjsoyvnqwpbku")
public suspend fun accountName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.accountName = mapped
}
/**
* @param value Schedule for daily snapshots
*/
@JvmName("umqssvyeiedbdkab")
public suspend fun dailySchedule(`value`: DailyScheduleArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.dailySchedule = mapped
}
/**
* @param argument Schedule for daily snapshots
*/
@JvmName("qtqjvixsffmajyfg")
public suspend fun dailySchedule(argument: suspend DailyScheduleArgsBuilder.() -> Unit) {
val toBeMapped = DailyScheduleArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.dailySchedule = mapped
}
/**
* @param value The property to decide policy is enabled or not
*/
@JvmName("fknsgdwxckfunquf")
public suspend fun enabled(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.enabled = mapped
}
/**
* @param value Schedule for hourly snapshots
*/
@JvmName("iuxmysqhngduevrl")
public suspend fun hourlySchedule(`value`: HourlyScheduleArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.hourlySchedule = mapped
}
/**
* @param argument Schedule for hourly snapshots
*/
@JvmName("vxleiitiqbpbnhxb")
public suspend fun hourlySchedule(argument: suspend HourlyScheduleArgsBuilder.() -> Unit) {
val toBeMapped = HourlyScheduleArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.hourlySchedule = mapped
}
/**
* @param value The geo-location where the resource lives
*/
@JvmName("exfvjcylmswmkjlv")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value Schedule for monthly snapshots
*/
@JvmName("rhkdvptfhcifrfwc")
public suspend fun monthlySchedule(`value`: MonthlyScheduleArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.monthlySchedule = mapped
}
/**
* @param argument Schedule for monthly snapshots
*/
@JvmName("yscjxbynwddvkrjn")
public suspend fun monthlySchedule(argument: suspend MonthlyScheduleArgsBuilder.() -> Unit) {
val toBeMapped = MonthlyScheduleArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.monthlySchedule = mapped
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("edcmdqurpdphimxq")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value The name of the snapshot policy
*/
@JvmName("hthxgkdcjymicdse")
public suspend fun snapshotPolicyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.snapshotPolicyName = mapped
}
/**
* @param value Resource tags.
*/
@JvmName("hcxaevguyjyqlisn")
public suspend fun tags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param values Resource tags.
*/
@JvmName("nelpfvlapftrddfi")
public fun tags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param value Schedule for weekly snapshots
*/
@JvmName("ykmxyibeibtqbpxk")
public suspend fun weeklySchedule(`value`: WeeklyScheduleArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.weeklySchedule = mapped
}
/**
* @param argument Schedule for weekly snapshots
*/
@JvmName("efghocpvkcejsjvj")
public suspend fun weeklySchedule(argument: suspend WeeklyScheduleArgsBuilder.() -> Unit) {
val toBeMapped = WeeklyScheduleArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.weeklySchedule = mapped
}
internal fun build(): SnapshotPolicyArgs = SnapshotPolicyArgs(
accountName = accountName,
dailySchedule = dailySchedule,
enabled = enabled,
hourlySchedule = hourlySchedule,
location = location,
monthlySchedule = monthlySchedule,
resourceGroupName = resourceGroupName,
snapshotPolicyName = snapshotPolicyName,
tags = tags,
weeklySchedule = weeklySchedule,
)
}