1. Packages
  2. Azure Classic
  3. API Docs
  4. netapp
  5. getSnapshotPolicy

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

azure.netapp.getSnapshotPolicy

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

    Uses this data source to access information about an existing NetApp Snapshot Policy.

    NetApp Snapshot Policy Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.netapp.getSnapshotPolicy({
        resourceGroupName: "acctestRG",
        accountName: "acctestnetappaccount",
        name: "example-snapshot-policy",
    });
    export const id = example.then(example => example.id);
    export const name = example.then(example => example.name);
    export const enabled = example.then(example => example.enabled);
    export const hourlySchedule = example.then(example => example.hourlySchedules);
    export const dailySchedule = example.then(example => example.dailySchedules);
    export const weeklySchedule = example.then(example => example.weeklySchedules);
    export const monthlySchedule = example.then(example => example.monthlySchedules);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.netapp.get_snapshot_policy(resource_group_name="acctestRG",
        account_name="acctestnetappaccount",
        name="example-snapshot-policy")
    pulumi.export("id", example.id)
    pulumi.export("name", example.name)
    pulumi.export("enabled", example.enabled)
    pulumi.export("hourlySchedule", example.hourly_schedules)
    pulumi.export("dailySchedule", example.daily_schedules)
    pulumi.export("weeklySchedule", example.weekly_schedules)
    pulumi.export("monthlySchedule", example.monthly_schedules)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/netapp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := netapp.LookupSnapshotPolicy(ctx, &netapp.LookupSnapshotPolicyArgs{
    			ResourceGroupName: "acctestRG",
    			AccountName:       "acctestnetappaccount",
    			Name:              "example-snapshot-policy",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", example.Id)
    		ctx.Export("name", example.Name)
    		ctx.Export("enabled", example.Enabled)
    		ctx.Export("hourlySchedule", example.HourlySchedules)
    		ctx.Export("dailySchedule", example.DailySchedules)
    		ctx.Export("weeklySchedule", example.WeeklySchedules)
    		ctx.Export("monthlySchedule", example.MonthlySchedules)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Azure.NetApp.GetSnapshotPolicy.Invoke(new()
        {
            ResourceGroupName = "acctestRG",
            AccountName = "acctestnetappaccount",
            Name = "example-snapshot-policy",
        });
    
        return new Dictionary<string, object?>
        {
            ["id"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Id),
            ["name"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Name),
            ["enabled"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.Enabled),
            ["hourlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.HourlySchedules),
            ["dailySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.DailySchedules),
            ["weeklySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.WeeklySchedules),
            ["monthlySchedule"] = example.Apply(getSnapshotPolicyResult => getSnapshotPolicyResult.MonthlySchedules),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.netapp.NetappFunctions;
    import com.pulumi.azure.netapp.inputs.GetSnapshotPolicyArgs;
    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 example = NetappFunctions.getSnapshotPolicy(GetSnapshotPolicyArgs.builder()
                .resourceGroupName("acctestRG")
                .accountName("acctestnetappaccount")
                .name("example-snapshot-policy")
                .build());
    
            ctx.export("id", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.id()));
            ctx.export("name", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.name()));
            ctx.export("enabled", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.enabled()));
            ctx.export("hourlySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.hourlySchedules()));
            ctx.export("dailySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.dailySchedules()));
            ctx.export("weeklySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.weeklySchedules()));
            ctx.export("monthlySchedule", example.applyValue(getSnapshotPolicyResult -> getSnapshotPolicyResult.monthlySchedules()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:netapp:getSnapshotPolicy
          Arguments:
            resourceGroupName: acctestRG
            accountName: acctestnetappaccount
            name: example-snapshot-policy
    outputs:
      id: ${example.id}
      name: ${example.name}
      enabled: ${example.enabled}
      hourlySchedule: ${example.hourlySchedules}
      dailySchedule: ${example.dailySchedules}
      weeklySchedule: ${example.weeklySchedules}
      monthlySchedule: ${example.monthlySchedules}
    

    Using getSnapshotPolicy

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getSnapshotPolicy(args: GetSnapshotPolicyArgs, opts?: InvokeOptions): Promise<GetSnapshotPolicyResult>
    function getSnapshotPolicyOutput(args: GetSnapshotPolicyOutputArgs, opts?: InvokeOptions): Output<GetSnapshotPolicyResult>
    def get_snapshot_policy(account_name: Optional[str] = None,
                            name: Optional[str] = None,
                            resource_group_name: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetSnapshotPolicyResult
    def get_snapshot_policy_output(account_name: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            resource_group_name: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotPolicyResult]
    func LookupSnapshotPolicy(ctx *Context, args *LookupSnapshotPolicyArgs, opts ...InvokeOption) (*LookupSnapshotPolicyResult, error)
    func LookupSnapshotPolicyOutput(ctx *Context, args *LookupSnapshotPolicyOutputArgs, opts ...InvokeOption) LookupSnapshotPolicyResultOutput

    > Note: This function is named LookupSnapshotPolicy in the Go SDK.

    public static class GetSnapshotPolicy 
    {
        public static Task<GetSnapshotPolicyResult> InvokeAsync(GetSnapshotPolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetSnapshotPolicyResult> Invoke(GetSnapshotPolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSnapshotPolicyResult> getSnapshotPolicy(GetSnapshotPolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:netapp/getSnapshotPolicy:getSnapshotPolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountName string
    The name of the NetApp account where the NetApp Snapshot Policy exists.
    Name string
    The name of the NetApp Snapshot Policy.
    ResourceGroupName string
    The Name of the Resource Group where the NetApp Snapshot Policy exists.
    AccountName string
    The name of the NetApp account where the NetApp Snapshot Policy exists.
    Name string
    The name of the NetApp Snapshot Policy.
    ResourceGroupName string
    The Name of the Resource Group where the NetApp Snapshot Policy exists.
    accountName String
    The name of the NetApp account where the NetApp Snapshot Policy exists.
    name String
    The name of the NetApp Snapshot Policy.
    resourceGroupName String
    The Name of the Resource Group where the NetApp Snapshot Policy exists.
    accountName string
    The name of the NetApp account where the NetApp Snapshot Policy exists.
    name string
    The name of the NetApp Snapshot Policy.
    resourceGroupName string
    The Name of the Resource Group where the NetApp Snapshot Policy exists.
    account_name str
    The name of the NetApp account where the NetApp Snapshot Policy exists.
    name str
    The name of the NetApp Snapshot Policy.
    resource_group_name str
    The Name of the Resource Group where the NetApp Snapshot Policy exists.
    accountName String
    The name of the NetApp account where the NetApp Snapshot Policy exists.
    name String
    The name of the NetApp Snapshot Policy.
    resourceGroupName String
    The Name of the Resource Group where the NetApp Snapshot Policy exists.

    getSnapshotPolicy Result

    The following output properties are available:

    AccountName string
    The name of the NetApp Account in which the NetApp Snapshot Policy was created.
    DailySchedules List<GetSnapshotPolicyDailySchedule>
    Daily snapshot schedule.
    Enabled bool
    Defines that the NetApp Snapshot Policy is enabled or not.
    HourlySchedules List<GetSnapshotPolicyHourlySchedule>
    Hourly snapshot schedule.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Specifies the supported Azure location where the resource exists.
    MonthlySchedules List<GetSnapshotPolicyMonthlySchedule>
    List of the days of the month when the snapshots will be created.
    Name string
    The name of the NetApp Snapshot Policy.
    ResourceGroupName string
    The name of the resource group where the NetApp Snapshot Policy should be created.
    Tags Dictionary<string, string>
    WeeklySchedules List<GetSnapshotPolicyWeeklySchedule>
    Weekly snapshot schedule.
    AccountName string
    The name of the NetApp Account in which the NetApp Snapshot Policy was created.
    DailySchedules []GetSnapshotPolicyDailySchedule
    Daily snapshot schedule.
    Enabled bool
    Defines that the NetApp Snapshot Policy is enabled or not.
    HourlySchedules []GetSnapshotPolicyHourlySchedule
    Hourly snapshot schedule.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    Specifies the supported Azure location where the resource exists.
    MonthlySchedules []GetSnapshotPolicyMonthlySchedule
    List of the days of the month when the snapshots will be created.
    Name string
    The name of the NetApp Snapshot Policy.
    ResourceGroupName string
    The name of the resource group where the NetApp Snapshot Policy should be created.
    Tags map[string]string
    WeeklySchedules []GetSnapshotPolicyWeeklySchedule
    Weekly snapshot schedule.
    accountName String
    The name of the NetApp Account in which the NetApp Snapshot Policy was created.
    dailySchedules List<GetSnapshotPolicyDailySchedule>
    Daily snapshot schedule.
    enabled Boolean
    Defines that the NetApp Snapshot Policy is enabled or not.
    hourlySchedules List<GetSnapshotPolicyHourlySchedule>
    Hourly snapshot schedule.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    Specifies the supported Azure location where the resource exists.
    monthlySchedules List<GetSnapshotPolicyMonthlySchedule>
    List of the days of the month when the snapshots will be created.
    name String
    The name of the NetApp Snapshot Policy.
    resourceGroupName String
    The name of the resource group where the NetApp Snapshot Policy should be created.
    tags Map<String,String>
    weeklySchedules List<GetSnapshotPolicyWeeklySchedule>
    Weekly snapshot schedule.
    accountName string
    The name of the NetApp Account in which the NetApp Snapshot Policy was created.
    dailySchedules GetSnapshotPolicyDailySchedule[]
    Daily snapshot schedule.
    enabled boolean
    Defines that the NetApp Snapshot Policy is enabled or not.
    hourlySchedules GetSnapshotPolicyHourlySchedule[]
    Hourly snapshot schedule.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    Specifies the supported Azure location where the resource exists.
    monthlySchedules GetSnapshotPolicyMonthlySchedule[]
    List of the days of the month when the snapshots will be created.
    name string
    The name of the NetApp Snapshot Policy.
    resourceGroupName string
    The name of the resource group where the NetApp Snapshot Policy should be created.
    tags {[key: string]: string}
    weeklySchedules GetSnapshotPolicyWeeklySchedule[]
    Weekly snapshot schedule.
    account_name str
    The name of the NetApp Account in which the NetApp Snapshot Policy was created.
    daily_schedules Sequence[GetSnapshotPolicyDailySchedule]
    Daily snapshot schedule.
    enabled bool
    Defines that the NetApp Snapshot Policy is enabled or not.
    hourly_schedules Sequence[GetSnapshotPolicyHourlySchedule]
    Hourly snapshot schedule.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    Specifies the supported Azure location where the resource exists.
    monthly_schedules Sequence[GetSnapshotPolicyMonthlySchedule]
    List of the days of the month when the snapshots will be created.
    name str
    The name of the NetApp Snapshot Policy.
    resource_group_name str
    The name of the resource group where the NetApp Snapshot Policy should be created.
    tags Mapping[str, str]
    weekly_schedules Sequence[GetSnapshotPolicyWeeklySchedule]
    Weekly snapshot schedule.
    accountName String
    The name of the NetApp Account in which the NetApp Snapshot Policy was created.
    dailySchedules List<Property Map>
    Daily snapshot schedule.
    enabled Boolean
    Defines that the NetApp Snapshot Policy is enabled or not.
    hourlySchedules List<Property Map>
    Hourly snapshot schedule.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    Specifies the supported Azure location where the resource exists.
    monthlySchedules List<Property Map>
    List of the days of the month when the snapshots will be created.
    name String
    The name of the NetApp Snapshot Policy.
    resourceGroupName String
    The name of the resource group where the NetApp Snapshot Policy should be created.
    tags Map<String>
    weeklySchedules List<Property Map>
    Weekly snapshot schedule.

    Supporting Types

    GetSnapshotPolicyDailySchedule

    Hour int
    Hour of the day that the snapshots will be created.
    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    Hour int
    Hour of the day that the snapshots will be created.
    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    hour Integer
    Hour of the day that the snapshots will be created.
    minute Integer
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Integer
    How many hourly snapshots to keep.
    hour number
    Hour of the day that the snapshots will be created.
    minute number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep number
    How many hourly snapshots to keep.
    hour int
    Hour of the day that the snapshots will be created.
    minute int
    Minute of the hour that the snapshots will be created.
    snapshots_to_keep int
    How many hourly snapshots to keep.
    hour Number
    Hour of the day that the snapshots will be created.
    minute Number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Number
    How many hourly snapshots to keep.

    GetSnapshotPolicyHourlySchedule

    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    minute Integer
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Integer
    How many hourly snapshots to keep.
    minute number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep number
    How many hourly snapshots to keep.
    minute int
    Minute of the hour that the snapshots will be created.
    snapshots_to_keep int
    How many hourly snapshots to keep.
    minute Number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Number
    How many hourly snapshots to keep.

    GetSnapshotPolicyMonthlySchedule

    DaysOfMonths List<int>
    Hour int
    Hour of the day that the snapshots will be created.
    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    DaysOfMonths []int
    Hour int
    Hour of the day that the snapshots will be created.
    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    daysOfMonths List<Integer>
    hour Integer
    Hour of the day that the snapshots will be created.
    minute Integer
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Integer
    How many hourly snapshots to keep.
    daysOfMonths number[]
    hour number
    Hour of the day that the snapshots will be created.
    minute number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep number
    How many hourly snapshots to keep.
    days_of_months Sequence[int]
    hour int
    Hour of the day that the snapshots will be created.
    minute int
    Minute of the hour that the snapshots will be created.
    snapshots_to_keep int
    How many hourly snapshots to keep.
    daysOfMonths List<Number>
    hour Number
    Hour of the day that the snapshots will be created.
    minute Number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Number
    How many hourly snapshots to keep.

    GetSnapshotPolicyWeeklySchedule

    DaysOfWeeks List<string>
    List of the week days using English names when the snapshots will be created.
    Hour int
    Hour of the day that the snapshots will be created.
    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    DaysOfWeeks []string
    List of the week days using English names when the snapshots will be created.
    Hour int
    Hour of the day that the snapshots will be created.
    Minute int
    Minute of the hour that the snapshots will be created.
    SnapshotsToKeep int
    How many hourly snapshots to keep.
    daysOfWeeks List<String>
    List of the week days using English names when the snapshots will be created.
    hour Integer
    Hour of the day that the snapshots will be created.
    minute Integer
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Integer
    How many hourly snapshots to keep.
    daysOfWeeks string[]
    List of the week days using English names when the snapshots will be created.
    hour number
    Hour of the day that the snapshots will be created.
    minute number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep number
    How many hourly snapshots to keep.
    days_of_weeks Sequence[str]
    List of the week days using English names when the snapshots will be created.
    hour int
    Hour of the day that the snapshots will be created.
    minute int
    Minute of the hour that the snapshots will be created.
    snapshots_to_keep int
    How many hourly snapshots to keep.
    daysOfWeeks List<String>
    List of the week days using English names when the snapshots will be created.
    hour Number
    Hour of the day that the snapshots will be created.
    minute Number
    Minute of the hour that the snapshots will be created.
    snapshotsToKeep Number
    How many hourly snapshots to keep.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi