1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. nas
  5. getAutoSnapshotPolicies
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.nas.getAutoSnapshotPolicies

Explore with Pulumi AI

This data source provides Auto Snapshot Policies available to the user.

NOTE: Available in v1.153.0+.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.nas.getAutoSnapshotPolicies({
    ids: ["example_value"],
});
export const nasAutoSnapshotPoliciesId1 = ids.then(ids => ids.policies?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.nas.get_auto_snapshot_policies(ids=["example_value"])
pulumi.export("nasAutoSnapshotPoliciesId1", ids.policies[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := nas.GetAutoSnapshotPolicies(ctx, &nas.GetAutoSnapshotPoliciesArgs{
			Ids: []string{
				"example_value",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("nasAutoSnapshotPoliciesId1", ids.Policies[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.Nas.GetAutoSnapshotPolicies.Invoke(new()
    {
        Ids = new[]
        {
            "example_value",
        },
    });

    return new Dictionary<string, object?>
    {
        ["nasAutoSnapshotPoliciesId1"] = ids.Apply(getAutoSnapshotPoliciesResult => getAutoSnapshotPoliciesResult.Policies[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.nas.NasFunctions;
import com.pulumi.alicloud.nas.inputs.GetAutoSnapshotPoliciesArgs;
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 ids = NasFunctions.getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs.builder()
            .ids("example_value")
            .build());

        ctx.export("nasAutoSnapshotPoliciesId1", ids.applyValue(getAutoSnapshotPoliciesResult -> getAutoSnapshotPoliciesResult.policies()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:nas:getAutoSnapshotPolicies
      arguments:
        ids:
          - example_value
outputs:
  nasAutoSnapshotPoliciesId1: ${ids.policies[0].id}
Copy

Using getAutoSnapshotPolicies

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 getAutoSnapshotPolicies(args: GetAutoSnapshotPoliciesArgs, opts?: InvokeOptions): Promise<GetAutoSnapshotPoliciesResult>
function getAutoSnapshotPoliciesOutput(args: GetAutoSnapshotPoliciesOutputArgs, opts?: InvokeOptions): Output<GetAutoSnapshotPoliciesResult>
Copy
def get_auto_snapshot_policies(ids: Optional[Sequence[str]] = None,
                               name_regex: Optional[str] = None,
                               output_file: Optional[str] = None,
                               status: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetAutoSnapshotPoliciesResult
def get_auto_snapshot_policies_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               name_regex: Optional[pulumi.Input[str]] = None,
                               output_file: Optional[pulumi.Input[str]] = None,
                               status: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetAutoSnapshotPoliciesResult]
Copy
func GetAutoSnapshotPolicies(ctx *Context, args *GetAutoSnapshotPoliciesArgs, opts ...InvokeOption) (*GetAutoSnapshotPoliciesResult, error)
func GetAutoSnapshotPoliciesOutput(ctx *Context, args *GetAutoSnapshotPoliciesOutputArgs, opts ...InvokeOption) GetAutoSnapshotPoliciesResultOutput
Copy

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

public static class GetAutoSnapshotPolicies 
{
    public static Task<GetAutoSnapshotPoliciesResult> InvokeAsync(GetAutoSnapshotPoliciesArgs args, InvokeOptions? opts = null)
    public static Output<GetAutoSnapshotPoliciesResult> Invoke(GetAutoSnapshotPoliciesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAutoSnapshotPoliciesResult> getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs args, InvokeOptions options)
public static Output<GetAutoSnapshotPoliciesResult> getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:nas/getAutoSnapshotPolicies:getAutoSnapshotPolicies
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Auto Snapshot Policies IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Auto Snapshot Policy name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the automatic snapshot policy. Valid values: Creating, Available.
Ids Changes to this property will trigger replacement. []string
A list of Auto Snapshot Policies IDs.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Auto Snapshot Policy name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the automatic snapshot policy. Valid values: Creating, Available.
ids Changes to this property will trigger replacement. List<String>
A list of Auto Snapshot Policies IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Auto Snapshot Policy name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the automatic snapshot policy. Valid values: Creating, Available.
ids Changes to this property will trigger replacement. string[]
A list of Auto Snapshot Policies IDs.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Auto Snapshot Policy name.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
The status of the automatic snapshot policy. Valid values: Creating, Available.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Auto Snapshot Policies IDs.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Auto Snapshot Policy name.
output_file str
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. str
The status of the automatic snapshot policy. Valid values: Creating, Available.
ids Changes to this property will trigger replacement. List<String>
A list of Auto Snapshot Policies IDs.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Auto Snapshot Policy name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the automatic snapshot policy. Valid values: Creating, Available.

getAutoSnapshotPolicies Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Names List<string>
A list of Auto Snapshot Policy names.
Policies List<Pulumi.AliCloud.Nas.Outputs.GetAutoSnapshotPoliciesPolicy>
A list of Auto Snapshot Policies. Each element contains the following attributes:
NameRegex string
OutputFile string
Status string
The status of the automatic snapshot policy.
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
A list of Auto Snapshot Policy names.
Policies []GetAutoSnapshotPoliciesPolicy
A list of Auto Snapshot Policies. Each element contains the following attributes:
NameRegex string
OutputFile string
Status string
The status of the automatic snapshot policy.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
A list of Auto Snapshot Policy names.
policies List<GetAutoSnapshotPoliciesPolicy>
A list of Auto Snapshot Policies. Each element contains the following attributes:
nameRegex String
outputFile String
status String
The status of the automatic snapshot policy.
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
A list of Auto Snapshot Policy names.
policies GetAutoSnapshotPoliciesPolicy[]
A list of Auto Snapshot Policies. Each element contains the following attributes:
nameRegex string
outputFile string
status string
The status of the automatic snapshot policy.
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
A list of Auto Snapshot Policy names.
policies Sequence[GetAutoSnapshotPoliciesPolicy]
A list of Auto Snapshot Policies. Each element contains the following attributes:
name_regex str
output_file str
status str
The status of the automatic snapshot policy.
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
A list of Auto Snapshot Policy names.
policies List<Property Map>
A list of Auto Snapshot Policies. Each element contains the following attributes:
nameRegex String
outputFile String
status String
The status of the automatic snapshot policy.

Supporting Types

GetAutoSnapshotPoliciesPolicy

AutoSnapshotPolicyId This property is required. string
The ID of the automatic snapshot policy.
AutoSnapshotPolicyName This property is required. string
The name of the automatic snapshot policy.
CreateTime This property is required. string
The time when the automatic snapshot policy was created.
FileSystemNums This property is required. int
The number of file systems to which the automatic snapshot policy applies.
Id This property is required. string
ID of the Auto Snapshot Policy.
RepeatWeekdays This property is required. List<string>
The day on which an auto snapshot was created.
RetentionDays This property is required. int
The number of days for which you want to retain auto snapshots.
Status This property is required. string
The status of the automatic snapshot policy. Valid values: Creating, Available.
TimePoints This property is required. List<string>
The point in time at which an auto snapshot was created. Unit: hours.
AutoSnapshotPolicyId This property is required. string
The ID of the automatic snapshot policy.
AutoSnapshotPolicyName This property is required. string
The name of the automatic snapshot policy.
CreateTime This property is required. string
The time when the automatic snapshot policy was created.
FileSystemNums This property is required. int
The number of file systems to which the automatic snapshot policy applies.
Id This property is required. string
ID of the Auto Snapshot Policy.
RepeatWeekdays This property is required. []string
The day on which an auto snapshot was created.
RetentionDays This property is required. int
The number of days for which you want to retain auto snapshots.
Status This property is required. string
The status of the automatic snapshot policy. Valid values: Creating, Available.
TimePoints This property is required. []string
The point in time at which an auto snapshot was created. Unit: hours.
autoSnapshotPolicyId This property is required. String
The ID of the automatic snapshot policy.
autoSnapshotPolicyName This property is required. String
The name of the automatic snapshot policy.
createTime This property is required. String
The time when the automatic snapshot policy was created.
fileSystemNums This property is required. Integer
The number of file systems to which the automatic snapshot policy applies.
id This property is required. String
ID of the Auto Snapshot Policy.
repeatWeekdays This property is required. List<String>
The day on which an auto snapshot was created.
retentionDays This property is required. Integer
The number of days for which you want to retain auto snapshots.
status This property is required. String
The status of the automatic snapshot policy. Valid values: Creating, Available.
timePoints This property is required. List<String>
The point in time at which an auto snapshot was created. Unit: hours.
autoSnapshotPolicyId This property is required. string
The ID of the automatic snapshot policy.
autoSnapshotPolicyName This property is required. string
The name of the automatic snapshot policy.
createTime This property is required. string
The time when the automatic snapshot policy was created.
fileSystemNums This property is required. number
The number of file systems to which the automatic snapshot policy applies.
id This property is required. string
ID of the Auto Snapshot Policy.
repeatWeekdays This property is required. string[]
The day on which an auto snapshot was created.
retentionDays This property is required. number
The number of days for which you want to retain auto snapshots.
status This property is required. string
The status of the automatic snapshot policy. Valid values: Creating, Available.
timePoints This property is required. string[]
The point in time at which an auto snapshot was created. Unit: hours.
auto_snapshot_policy_id This property is required. str
The ID of the automatic snapshot policy.
auto_snapshot_policy_name This property is required. str
The name of the automatic snapshot policy.
create_time This property is required. str
The time when the automatic snapshot policy was created.
file_system_nums This property is required. int
The number of file systems to which the automatic snapshot policy applies.
id This property is required. str
ID of the Auto Snapshot Policy.
repeat_weekdays This property is required. Sequence[str]
The day on which an auto snapshot was created.
retention_days This property is required. int
The number of days for which you want to retain auto snapshots.
status This property is required. str
The status of the automatic snapshot policy. Valid values: Creating, Available.
time_points This property is required. Sequence[str]
The point in time at which an auto snapshot was created. Unit: hours.
autoSnapshotPolicyId This property is required. String
The ID of the automatic snapshot policy.
autoSnapshotPolicyName This property is required. String
The name of the automatic snapshot policy.
createTime This property is required. String
The time when the automatic snapshot policy was created.
fileSystemNums This property is required. Number
The number of file systems to which the automatic snapshot policy applies.
id This property is required. String
ID of the Auto Snapshot Policy.
repeatWeekdays This property is required. List<String>
The day on which an auto snapshot was created.
retentionDays This property is required. Number
The number of days for which you want to retain auto snapshots.
status This property is required. String
The status of the automatic snapshot policy. Valid values: Creating, Available.
timePoints This property is required. List<String>
The point in time at which an auto snapshot was created. Unit: hours.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.