getSnapshotPolicy

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)
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 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
})
}
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}

Return

A collection of values returned by getSnapshotPolicy.

Parameters

argument

A collection of arguments for invoking getSnapshotPolicy.


suspend fun getSnapshotPolicy(accountName: String, name: String, resourceGroupName: String): GetSnapshotPolicyResult

Return

A collection of values returned by getSnapshotPolicy.

Parameters

accountName

The name of the NetApp account where the NetApp Snapshot Policy exists.

name

The name of the NetApp Snapshot Policy.

resourceGroupName

The Name of the Resource Group where the NetApp Snapshot Policy exists.

See also


Return

A collection of values returned by getSnapshotPolicy.

Parameters

argument

Builder for com.pulumi.azure.netapp.kotlin.inputs.GetSnapshotPolicyPlainArgs.

See also