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

com.pulumi.azure.netapp.SnapshotPolicy Maven / Gradle / Ivy

// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.netapp;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.netapp.SnapshotPolicyArgs;
import com.pulumi.azure.netapp.inputs.SnapshotPolicyState;
import com.pulumi.azure.netapp.outputs.SnapshotPolicyDailySchedule;
import com.pulumi.azure.netapp.outputs.SnapshotPolicyHourlySchedule;
import com.pulumi.azure.netapp.outputs.SnapshotPolicyMonthlySchedule;
import com.pulumi.azure.netapp.outputs.SnapshotPolicyWeeklySchedule;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a NetApp Snapshot Policy.
 * 
 * ## NetApp Snapshot Policy Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.netapp.Account;
 * import com.pulumi.azure.netapp.AccountArgs;
 * import com.pulumi.azure.netapp.SnapshotPolicy;
 * import com.pulumi.azure.netapp.SnapshotPolicyArgs;
 * import com.pulumi.azure.netapp.inputs.SnapshotPolicyHourlyScheduleArgs;
 * import com.pulumi.azure.netapp.inputs.SnapshotPolicyDailyScheduleArgs;
 * import com.pulumi.azure.netapp.inputs.SnapshotPolicyWeeklyScheduleArgs;
 * import com.pulumi.azure.netapp.inputs.SnapshotPolicyMonthlyScheduleArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("resource-group-01")
 *             .location("East US")
 *             .build());
 * 
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("netappaccount-01")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 * 
 *         var exampleSnapshotPolicy = new SnapshotPolicy("exampleSnapshotPolicy", SnapshotPolicyArgs.builder()
 *             .name("snapshotpolicy-01")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .accountName(exampleAccount.name())
 *             .enabled(true)
 *             .hourlySchedule(SnapshotPolicyHourlyScheduleArgs.builder()
 *                 .snapshotsToKeep(4)
 *                 .minute(15)
 *                 .build())
 *             .dailySchedule(SnapshotPolicyDailyScheduleArgs.builder()
 *                 .snapshotsToKeep(2)
 *                 .hour(20)
 *                 .minute(15)
 *                 .build())
 *             .weeklySchedule(SnapshotPolicyWeeklyScheduleArgs.builder()
 *                 .snapshotsToKeep(1)
 *                 .daysOfWeeks(                
 *                     "Monday",
 *                     "Friday")
 *                 .hour(23)
 *                 .minute(0)
 *                 .build())
 *             .monthlySchedule(SnapshotPolicyMonthlyScheduleArgs.builder()
 *                 .snapshotsToKeep(1)
 *                 .daysOfMonths(                
 *                     1,
 *                     15,
 *                     20,
 *                     30)
 *                 .hour(5)
 *                 .minute(45)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * NetApp Snapshot Policy can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:netapp/snapshotPolicy:SnapshotPolicy example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.NetApp/netAppAccounts/account1/snapshotPolicies/snapshotpolicy1 * ``` * */ @ResourceType(type="azure:netapp/snapshotPolicy:SnapshotPolicy") public class SnapshotPolicy extends com.pulumi.resources.CustomResource { /** * The name of the NetApp Account in which the NetApp Snapshot Policy should be created. Changing this forces a new resource to be created. * */ @Export(name="accountName", refs={String.class}, tree="[0]") private Output accountName; /** * @return The name of the NetApp Account in which the NetApp Snapshot Policy should be created. Changing this forces a new resource to be created. * */ public Output accountName() { return this.accountName; } /** * Sets a daily snapshot schedule. A `daily_schedule` block as defined below. * */ @Export(name="dailySchedule", refs={SnapshotPolicyDailySchedule.class}, tree="[0]") private Output dailySchedule; /** * @return Sets a daily snapshot schedule. A `daily_schedule` block as defined below. * */ public Output> dailySchedule() { return Codegen.optional(this.dailySchedule); } /** * Defines that the NetApp Snapshot Policy is enabled or not. * */ @Export(name="enabled", refs={Boolean.class}, tree="[0]") private Output enabled; /** * @return Defines that the NetApp Snapshot Policy is enabled or not. * */ public Output enabled() { return this.enabled; } /** * Sets an hourly snapshot schedule. A `hourly_schedule` block as defined below. * */ @Export(name="hourlySchedule", refs={SnapshotPolicyHourlySchedule.class}, tree="[0]") private Output hourlySchedule; /** * @return Sets an hourly snapshot schedule. A `hourly_schedule` block as defined below. * */ public Output> hourlySchedule() { return Codegen.optional(this.hourlySchedule); } /** * Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. * */ public Output location() { return this.location; } /** * Sets a monthly snapshot schedule. A `monthly_schedule` block as defined below. * */ @Export(name="monthlySchedule", refs={SnapshotPolicyMonthlySchedule.class}, tree="[0]") private Output monthlySchedule; /** * @return Sets a monthly snapshot schedule. A `monthly_schedule` block as defined below. * */ public Output> monthlySchedule() { return Codegen.optional(this.monthlySchedule); } /** * The name of the NetApp Snapshot Policy. Changing this forces a new resource to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the NetApp Snapshot Policy. Changing this forces a new resource to be created. * */ public Output name() { return this.name; } /** * The name of the resource group where the NetApp Snapshot Policy should be created. Changing this forces a new resource to be created. * */ @Export(name="resourceGroupName", refs={String.class}, tree="[0]") private Output resourceGroupName; /** * @return The name of the resource group where the NetApp Snapshot Policy should be created. Changing this forces a new resource to be created. * */ public Output resourceGroupName() { return this.resourceGroupName; } /** * A mapping of tags to assign to the resource. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags to assign to the resource. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Sets a weekly snapshot schedule. A `weekly_schedule` block as defined below. * */ @Export(name="weeklySchedule", refs={SnapshotPolicyWeeklySchedule.class}, tree="[0]") private Output weeklySchedule; /** * @return Sets a weekly snapshot schedule. A `weekly_schedule` block as defined below. * */ public Output> weeklySchedule() { return Codegen.optional(this.weeklySchedule); } /** * * @param name The _unique_ name of the resulting resource. */ public SnapshotPolicy(java.lang.String name) { this(name, SnapshotPolicyArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public SnapshotPolicy(java.lang.String name, SnapshotPolicyArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public SnapshotPolicy(java.lang.String name, SnapshotPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:netapp/snapshotPolicy:SnapshotPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private SnapshotPolicy(java.lang.String name, Output id, @Nullable SnapshotPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:netapp/snapshotPolicy:SnapshotPolicy", name, state, makeResourceOptions(options, id), false); } private static SnapshotPolicyArgs makeArgs(SnapshotPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? SnapshotPolicyArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static SnapshotPolicy get(java.lang.String name, Output id, @Nullable SnapshotPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new SnapshotPolicy(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy