1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. nas
  5. getAutoSnapshotPolicies
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.nas.getAutoSnapshotPolicies

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    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);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.nas.get_auto_snapshot_policies(ids=["example_value"])
    pulumi.export("nasAutoSnapshotPoliciesId1", ids.policies[0].id)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:nas:getAutoSnapshotPolicies
          Arguments:
            ids:
              - example_value
    outputs:
      nasAutoSnapshotPoliciesId1: ${ids.policies[0].id}
    

    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>
    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]
    func GetAutoSnapshotPolicies(ctx *Context, args *GetAutoSnapshotPoliciesArgs, opts ...InvokeOption) (*GetAutoSnapshotPoliciesResult, error)
    func GetAutoSnapshotPoliciesOutput(ctx *Context, args *GetAutoSnapshotPoliciesOutputArgs, opts ...InvokeOption) GetAutoSnapshotPoliciesResultOutput

    > 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)
    }
    public static CompletableFuture<GetAutoSnapshotPoliciesResult> getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:nas/getAutoSnapshotPolicies:getAutoSnapshotPolicies
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Auto Snapshot Policies IDs.
    NameRegex 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 string
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    Ids []string
    A list of Auto Snapshot Policies IDs.
    NameRegex 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 string
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    ids List<String>
    A list of Auto Snapshot Policies IDs.
    nameRegex 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 String
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    ids string[]
    A list of Auto Snapshot Policies IDs.
    nameRegex 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 string
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    ids Sequence[str]
    A list of Auto Snapshot Policies IDs.
    name_regex 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 str
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    ids List<String>
    A list of Auto Snapshot Policies IDs.
    nameRegex 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 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 string
    The ID of the automatic snapshot policy.
    AutoSnapshotPolicyName string
    The name of the automatic snapshot policy.
    CreateTime string
    The time when the automatic snapshot policy was created.
    FileSystemNums int
    The number of file systems to which the automatic snapshot policy applies.
    Id string
    ID of the Auto Snapshot Policy.
    RepeatWeekdays List<string>
    The day on which an auto snapshot was created.
    RetentionDays int
    The number of days for which you want to retain auto snapshots.
    Status string
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    TimePoints List<string>
    The point in time at which an auto snapshot was created. Unit: hours.
    AutoSnapshotPolicyId string
    The ID of the automatic snapshot policy.
    AutoSnapshotPolicyName string
    The name of the automatic snapshot policy.
    CreateTime string
    The time when the automatic snapshot policy was created.
    FileSystemNums int
    The number of file systems to which the automatic snapshot policy applies.
    Id string
    ID of the Auto Snapshot Policy.
    RepeatWeekdays []string
    The day on which an auto snapshot was created.
    RetentionDays int
    The number of days for which you want to retain auto snapshots.
    Status string
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    TimePoints []string
    The point in time at which an auto snapshot was created. Unit: hours.
    autoSnapshotPolicyId String
    The ID of the automatic snapshot policy.
    autoSnapshotPolicyName String
    The name of the automatic snapshot policy.
    createTime String
    The time when the automatic snapshot policy was created.
    fileSystemNums Integer
    The number of file systems to which the automatic snapshot policy applies.
    id String
    ID of the Auto Snapshot Policy.
    repeatWeekdays List<String>
    The day on which an auto snapshot was created.
    retentionDays Integer
    The number of days for which you want to retain auto snapshots.
    status String
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    timePoints List<String>
    The point in time at which an auto snapshot was created. Unit: hours.
    autoSnapshotPolicyId string
    The ID of the automatic snapshot policy.
    autoSnapshotPolicyName string
    The name of the automatic snapshot policy.
    createTime string
    The time when the automatic snapshot policy was created.
    fileSystemNums number
    The number of file systems to which the automatic snapshot policy applies.
    id string
    ID of the Auto Snapshot Policy.
    repeatWeekdays string[]
    The day on which an auto snapshot was created.
    retentionDays number
    The number of days for which you want to retain auto snapshots.
    status string
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    timePoints string[]
    The point in time at which an auto snapshot was created. Unit: hours.
    auto_snapshot_policy_id str
    The ID of the automatic snapshot policy.
    auto_snapshot_policy_name str
    The name of the automatic snapshot policy.
    create_time str
    The time when the automatic snapshot policy was created.
    file_system_nums int
    The number of file systems to which the automatic snapshot policy applies.
    id str
    ID of the Auto Snapshot Policy.
    repeat_weekdays Sequence[str]
    The day on which an auto snapshot was created.
    retention_days int
    The number of days for which you want to retain auto snapshots.
    status str
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    time_points Sequence[str]
    The point in time at which an auto snapshot was created. Unit: hours.
    autoSnapshotPolicyId String
    The ID of the automatic snapshot policy.
    autoSnapshotPolicyName String
    The name of the automatic snapshot policy.
    createTime String
    The time when the automatic snapshot policy was created.
    fileSystemNums Number
    The number of file systems to which the automatic snapshot policy applies.
    id String
    ID of the Auto Snapshot Policy.
    repeatWeekdays List<String>
    The day on which an auto snapshot was created.
    retentionDays Number
    The number of days for which you want to retain auto snapshots.
    status String
    The status of the automatic snapshot policy. Valid values: Creating, Available.
    timePoints 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.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi