We recommend using Azure Native.
Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi
azure.netapp.getSnapshotPolicy
Explore with Pulumi AI
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:
- Account
Name string - The name of the NetApp account where the NetApp Snapshot Policy exists.
- Name string
- The name of the NetApp Snapshot Policy.
- Resource
Group stringName - The Name of the Resource Group where the NetApp Snapshot Policy exists.
- Account
Name string - The name of the NetApp account where the NetApp Snapshot Policy exists.
- Name string
- The name of the NetApp Snapshot Policy.
- Resource
Group stringName - The Name of the Resource Group where the NetApp Snapshot Policy exists.
- account
Name String - The name of the NetApp account where the NetApp Snapshot Policy exists.
- name String
- The name of the NetApp Snapshot Policy.
- resource
Group StringName - The Name of the Resource Group where the NetApp Snapshot Policy exists.
- account
Name string - The name of the NetApp account where the NetApp Snapshot Policy exists.
- name string
- The name of the NetApp Snapshot Policy.
- resource
Group stringName - 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_ strname - The Name of the Resource Group where the NetApp Snapshot Policy exists.
- account
Name String - The name of the NetApp account where the NetApp Snapshot Policy exists.
- name String
- The name of the NetApp Snapshot Policy.
- resource
Group StringName - The Name of the Resource Group where the NetApp Snapshot Policy exists.
getSnapshotPolicy Result
The following output properties are available:
- Account
Name string - The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- Daily
Schedules List<GetSnapshot Policy Daily Schedule> - Daily snapshot schedule.
- Enabled bool
- Defines that the NetApp Snapshot Policy is enabled or not.
- Hourly
Schedules List<GetSnapshot Policy Hourly Schedule> - 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.
- Monthly
Schedules List<GetSnapshot Policy Monthly Schedule> - List of the days of the month when the snapshots will be created.
- Name string
- The name of the NetApp Snapshot Policy.
- Resource
Group stringName - The name of the resource group where the NetApp Snapshot Policy should be created.
- Dictionary<string, string>
- Weekly
Schedules List<GetSnapshot Policy Weekly Schedule> - Weekly snapshot schedule.
- Account
Name string - The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- Daily
Schedules []GetSnapshot Policy Daily Schedule - Daily snapshot schedule.
- Enabled bool
- Defines that the NetApp Snapshot Policy is enabled or not.
- Hourly
Schedules []GetSnapshot Policy Hourly Schedule - 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.
- Monthly
Schedules []GetSnapshot Policy Monthly Schedule - List of the days of the month when the snapshots will be created.
- Name string
- The name of the NetApp Snapshot Policy.
- Resource
Group stringName - The name of the resource group where the NetApp Snapshot Policy should be created.
- map[string]string
- Weekly
Schedules []GetSnapshot Policy Weekly Schedule - Weekly snapshot schedule.
- account
Name String - The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- daily
Schedules List<GetSnapshot Policy Daily Schedule> - Daily snapshot schedule.
- enabled Boolean
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourly
Schedules List<GetSnapshot Policy Hourly Schedule> - 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.
- monthly
Schedules List<GetSnapshot Policy Monthly Schedule> - List of the days of the month when the snapshots will be created.
- name String
- The name of the NetApp Snapshot Policy.
- resource
Group StringName - The name of the resource group where the NetApp Snapshot Policy should be created.
- Map<String,String>
- weekly
Schedules List<GetSnapshot Policy Weekly Schedule> - Weekly snapshot schedule.
- account
Name string - The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- daily
Schedules GetSnapshot Policy Daily Schedule[] - Daily snapshot schedule.
- enabled boolean
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourly
Schedules GetSnapshot Policy Hourly Schedule[] - 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.
- monthly
Schedules GetSnapshot Policy Monthly Schedule[] - List of the days of the month when the snapshots will be created.
- name string
- The name of the NetApp Snapshot Policy.
- resource
Group stringName - The name of the resource group where the NetApp Snapshot Policy should be created.
- {[key: string]: string}
- weekly
Schedules GetSnapshot Policy Weekly Schedule[] - Weekly snapshot schedule.
- account_
name str - The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- daily_
schedules Sequence[GetSnapshot Policy Daily Schedule] - Daily snapshot schedule.
- enabled bool
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourly_
schedules Sequence[GetSnapshot Policy Hourly Schedule] - 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[GetSnapshot Policy Monthly Schedule] - List of the days of the month when the snapshots will be created.
- name str
- The name of the NetApp Snapshot Policy.
- resource_
group_ strname - The name of the resource group where the NetApp Snapshot Policy should be created.
- Mapping[str, str]
- weekly_
schedules Sequence[GetSnapshot Policy Weekly Schedule] - Weekly snapshot schedule.
- account
Name String - The name of the NetApp Account in which the NetApp Snapshot Policy was created.
- daily
Schedules List<Property Map> - Daily snapshot schedule.
- enabled Boolean
- Defines that the NetApp Snapshot Policy is enabled or not.
- hourly
Schedules 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.
- monthly
Schedules 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.
- resource
Group StringName - The name of the resource group where the NetApp Snapshot Policy should be created.
- Map<String>
- weekly
Schedules 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.
- Snapshots
To intKeep - 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 intKeep - 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.
- snapshots
To IntegerKeep - 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.
- snapshots
To numberKeep - 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_ intkeep - 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.
- snapshots
To NumberKeep - How many hourly snapshots to keep.
GetSnapshotPolicyHourlySchedule
- Minute int
- Minute of the hour that the snapshots will be created.
- Snapshots
To intKeep - How many hourly snapshots to keep.
- Minute int
- Minute of the hour that the snapshots will be created.
- Snapshots
To intKeep - How many hourly snapshots to keep.
- minute Integer
- Minute of the hour that the snapshots will be created.
- snapshots
To IntegerKeep - How many hourly snapshots to keep.
- minute number
- Minute of the hour that the snapshots will be created.
- snapshots
To numberKeep - How many hourly snapshots to keep.
- minute int
- Minute of the hour that the snapshots will be created.
- snapshots_
to_ intkeep - How many hourly snapshots to keep.
- minute Number
- Minute of the hour that the snapshots will be created.
- snapshots
To NumberKeep - How many hourly snapshots to keep.
GetSnapshotPolicyMonthlySchedule
- Days
Of List<int>Months - 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 intKeep - How many hourly snapshots to keep.
- Days
Of []intMonths - 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 intKeep - How many hourly snapshots to keep.
- days
Of List<Integer>Months - hour Integer
- Hour of the day that the snapshots will be created.
- minute Integer
- Minute of the hour that the snapshots will be created.
- snapshots
To IntegerKeep - How many hourly snapshots to keep.
- days
Of number[]Months - hour number
- Hour of the day that the snapshots will be created.
- minute number
- Minute of the hour that the snapshots will be created.
- snapshots
To numberKeep - How many hourly snapshots to keep.
- days_
of_ Sequence[int]months - 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_ intkeep - How many hourly snapshots to keep.
- days
Of List<Number>Months - hour Number
- Hour of the day that the snapshots will be created.
- minute Number
- Minute of the hour that the snapshots will be created.
- snapshots
To NumberKeep - How many hourly snapshots to keep.
GetSnapshotPolicyWeeklySchedule
- Days
Of List<string>Weeks - 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 intKeep - How many hourly snapshots to keep.
- Days
Of []stringWeeks - 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 intKeep - How many hourly snapshots to keep.
- days
Of List<String>Weeks - 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.
- snapshots
To IntegerKeep - How many hourly snapshots to keep.
- days
Of string[]Weeks - 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.
- snapshots
To numberKeep - How many hourly snapshots to keep.
- days_
of_ Sequence[str]weeks - 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_ intkeep - How many hourly snapshots to keep.
- days
Of List<String>Weeks - 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.
- snapshots
To NumberKeep - 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.