Snapshot Policy Args
data class SnapshotPolicyArgs(val accountName: Output<String>? = null, val dailySchedule: Output<DailyScheduleArgs>? = null, val enabled: Output<Boolean>? = null, val hourlySchedule: Output<HourlyScheduleArgs>? = null, val location: Output<String>? = null, val monthlySchedule: Output<MonthlyScheduleArgs>? = null, val resourceGroupName: Output<String>? = null, val snapshotPolicyName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val weeklySchedule: Output<WeeklyScheduleArgs>? = null) : ConvertibleToJava<SnapshotPolicyArgs>
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.
Example Usage
SnapshotPolicies_Create
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,
},
});
});
Content copied to clipboard
package main
import (
"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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:netapp:SnapshotPolicy account1/snapshotPolicy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/snapshotPolicies/{snapshotPolicyName}
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(accountName: Output<String>? = null, dailySchedule: Output<DailyScheduleArgs>? = null, enabled: Output<Boolean>? = null, hourlySchedule: Output<HourlyScheduleArgs>? = null, location: Output<String>? = null, monthlySchedule: Output<MonthlyScheduleArgs>? = null, resourceGroupName: Output<String>? = null, snapshotPolicyName: Output<String>? = null, tags: Output<Map<String, String>>? = null, weeklySchedule: Output<WeeklyScheduleArgs>? = null)
Properties
Link copied to clipboard
The name of the NetApp account
Link copied to clipboard
Schedule for daily snapshots
Link copied to clipboard
Schedule for hourly snapshots
Link copied to clipboard
Schedule for monthly snapshots
Link copied to clipboard
The name of the resource group. The name is case insensitive.
Link copied to clipboard
The name of the snapshot policy
Link copied to clipboard
Schedule for weekly snapshots