Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.nas.getSnapshots
Explore with Pulumi AI
This data source provides the Nas Snapshots of the current Alibaba Cloud user.
NOTE: Available in v1.152.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.nas.getSnapshots({});
export const nasSnapshotId1 = ids.then(ids => ids.snapshots?.[0]?.id);
const nameRegex = alicloud.nas.getSnapshots({
    nameRegex: "^my-Snapshot",
});
export const nasSnapshotId2 = nameRegex.then(nameRegex => nameRegex.snapshots?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.nas.get_snapshots()
pulumi.export("nasSnapshotId1", ids.snapshots[0].id)
name_regex = alicloud.nas.get_snapshots(name_regex="^my-Snapshot")
pulumi.export("nasSnapshotId2", name_regex.snapshots[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.GetSnapshots(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("nasSnapshotId1", ids.Snapshots[0].Id)
		nameRegex, err := nas.GetSnapshots(ctx, &nas.GetSnapshotsArgs{
			NameRegex: pulumi.StringRef("^my-Snapshot"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("nasSnapshotId2", nameRegex.Snapshots[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.GetSnapshots.Invoke();
    var nameRegex = AliCloud.Nas.GetSnapshots.Invoke(new()
    {
        NameRegex = "^my-Snapshot",
    });
    return new Dictionary<string, object?>
    {
        ["nasSnapshotId1"] = ids.Apply(getSnapshotsResult => getSnapshotsResult.Snapshots[0]?.Id),
        ["nasSnapshotId2"] = nameRegex.Apply(getSnapshotsResult => getSnapshotsResult.Snapshots[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.GetSnapshotsArgs;
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.getSnapshots();
        ctx.export("nasSnapshotId1", ids.applyValue(getSnapshotsResult -> getSnapshotsResult.snapshots()[0].id()));
        final var nameRegex = NasFunctions.getSnapshots(GetSnapshotsArgs.builder()
            .nameRegex("^my-Snapshot")
            .build());
        ctx.export("nasSnapshotId2", nameRegex.applyValue(getSnapshotsResult -> getSnapshotsResult.snapshots()[0].id()));
    }
}
variables:
  ids:
    fn::invoke:
      Function: alicloud:nas:getSnapshots
      Arguments: {}
  nameRegex:
    fn::invoke:
      Function: alicloud:nas:getSnapshots
      Arguments:
        nameRegex: ^my-Snapshot
outputs:
  nasSnapshotId1: ${ids.snapshots[0].id}
  nasSnapshotId2: ${nameRegex.snapshots[0].id}
Using getSnapshots
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 getSnapshots(args: GetSnapshotsArgs, opts?: InvokeOptions): Promise<GetSnapshotsResult>
function getSnapshotsOutput(args: GetSnapshotsOutputArgs, opts?: InvokeOptions): Output<GetSnapshotsResult>def get_snapshots(file_system_id: Optional[str] = None,
                  ids: Optional[Sequence[str]] = None,
                  name_regex: Optional[str] = None,
                  output_file: Optional[str] = None,
                  snapshot_name: Optional[str] = None,
                  status: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetSnapshotsResult
def get_snapshots_output(file_system_id: Optional[pulumi.Input[str]] = None,
                  ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                  name_regex: Optional[pulumi.Input[str]] = None,
                  output_file: Optional[pulumi.Input[str]] = None,
                  snapshot_name: Optional[pulumi.Input[str]] = None,
                  status: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotsResult]func GetSnapshots(ctx *Context, args *GetSnapshotsArgs, opts ...InvokeOption) (*GetSnapshotsResult, error)
func GetSnapshotsOutput(ctx *Context, args *GetSnapshotsOutputArgs, opts ...InvokeOption) GetSnapshotsResultOutput> Note: This function is named GetSnapshots in the Go SDK.
public static class GetSnapshots 
{
    public static Task<GetSnapshotsResult> InvokeAsync(GetSnapshotsArgs args, InvokeOptions? opts = null)
    public static Output<GetSnapshotsResult> Invoke(GetSnapshotsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetSnapshotsResult> getSnapshots(GetSnapshotsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:nas/getSnapshots:getSnapshots
  arguments:
    # arguments dictionaryThe following arguments are supported:
- File
System stringId  - The ID of the file system.
 - Ids List<string>
 - A list of Snapshot IDs.
 - Name
Regex string - A regex string to filter results by Snapshot name.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). - Snapshot
Name string - The name of the snapshot.
 - Status string
 - Status. Valid values: 
accomplished,failed,progressing. 
- File
System stringId  - The ID of the file system.
 - Ids []string
 - A list of Snapshot IDs.
 - Name
Regex string - A regex string to filter results by Snapshot name.
 - Output
File string - File name where to save data source results (after running 
pulumi preview). - Snapshot
Name string - The name of the snapshot.
 - Status string
 - Status. Valid values: 
accomplished,failed,progressing. 
- file
System StringId  - The ID of the file system.
 - ids List<String>
 - A list of Snapshot IDs.
 - name
Regex String - A regex string to filter results by Snapshot name.
 - output
File String - File name where to save data source results (after running 
pulumi preview). - snapshot
Name String - The name of the snapshot.
 - status String
 - Status. Valid values: 
accomplished,failed,progressing. 
- file
System stringId  - The ID of the file system.
 - ids string[]
 - A list of Snapshot IDs.
 - name
Regex string - A regex string to filter results by Snapshot name.
 - output
File string - File name where to save data source results (after running 
pulumi preview). - snapshot
Name string - The name of the snapshot.
 - status string
 - Status. Valid values: 
accomplished,failed,progressing. 
- file_
system_ strid  - The ID of the file system.
 - ids Sequence[str]
 - A list of Snapshot IDs.
 - name_
regex str - A regex string to filter results by Snapshot name.
 - output_
file str - File name where to save data source results (after running 
pulumi preview). - snapshot_
name str - The name of the snapshot.
 - status str
 - Status. Valid values: 
accomplished,failed,progressing. 
- file
System StringId  - The ID of the file system.
 - ids List<String>
 - A list of Snapshot IDs.
 - name
Regex String - A regex string to filter results by Snapshot name.
 - output
File String - File name where to save data source results (after running 
pulumi preview). - snapshot
Name String - The name of the snapshot.
 - status String
 - Status. Valid values: 
accomplished,failed,progressing. 
getSnapshots Result
The following output properties are available:
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Ids List<string>
 - Names List<string>
 - Snapshots
List<Pulumi.
Ali Cloud. Nas. Outputs. Get Snapshots Snapshot>  - File
System stringId  - Name
Regex string - Output
File string - Snapshot
Name string - Status string
 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Ids []string
 - Names []string
 - Snapshots
[]Get
Snapshots Snapshot  - File
System stringId  - Name
Regex string - Output
File string - Snapshot
Name string - Status string
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - ids List<String>
 - names List<String>
 - snapshots
List<Get
Snapshots Snapshot>  - file
System StringId  - name
Regex String - output
File String - snapshot
Name String - status String
 
- id string
 - The provider-assigned unique ID for this managed resource.
 - ids string[]
 - names string[]
 - snapshots
Get
Snapshots Snapshot[]  - file
System stringId  - name
Regex string - output
File string - snapshot
Name string - status string
 
- id str
 - The provider-assigned unique ID for this managed resource.
 - ids Sequence[str]
 - names Sequence[str]
 - snapshots
Sequence[Get
Snapshots Snapshot]  - file_
system_ strid  - name_
regex str - output_
file str - snapshot_
name str - status str
 
- id String
 - The provider-assigned unique ID for this managed resource.
 - ids List<String>
 - names List<String>
 - snapshots List<Property Map>
 - file
System StringId  - name
Regex String - output
File String - snapshot
Name String - status String
 
Supporting Types
GetSnapshotsSnapshot  
- Create
Time string - The creation time of the resource.
 - Description string
 - The description of the snapshot.
 - Encrypt
Type int - The type of the encryption.
 - Id string
 - The ID of the Snapshot.
 - Progress string
 - The progress of the snapshot creation. The value of this parameter is expressed as a percentage.
 - Remain
Time int - The remaining time that is required to create the snapshot. Unit: seconds.
 - Retention
Days int - The retention period of the automatic snapshot. Unit: days.
 - Snapshot
Id string - The ID of the resource.
 - Snapshot
Name string - The name of the snapshot.
 - Source
File stringSystem Id  - The ID of the source file system.
 - Source
File stringSystem Size  - The capacity of the source file system. Unit: GiB.
 - Source
File stringSystem Version  - The version of the source file system.
 - Status string
 - The status of the snapshot.
 
- Create
Time string - The creation time of the resource.
 - Description string
 - The description of the snapshot.
 - Encrypt
Type int - The type of the encryption.
 - Id string
 - The ID of the Snapshot.
 - Progress string
 - The progress of the snapshot creation. The value of this parameter is expressed as a percentage.
 - Remain
Time int - The remaining time that is required to create the snapshot. Unit: seconds.
 - Retention
Days int - The retention period of the automatic snapshot. Unit: days.
 - Snapshot
Id string - The ID of the resource.
 - Snapshot
Name string - The name of the snapshot.
 - Source
File stringSystem Id  - The ID of the source file system.
 - Source
File stringSystem Size  - The capacity of the source file system. Unit: GiB.
 - Source
File stringSystem Version  - The version of the source file system.
 - Status string
 - The status of the snapshot.
 
- create
Time String - The creation time of the resource.
 - description String
 - The description of the snapshot.
 - encrypt
Type Integer - The type of the encryption.
 - id String
 - The ID of the Snapshot.
 - progress String
 - The progress of the snapshot creation. The value of this parameter is expressed as a percentage.
 - remain
Time Integer - The remaining time that is required to create the snapshot. Unit: seconds.
 - retention
Days Integer - The retention period of the automatic snapshot. Unit: days.
 - snapshot
Id String - The ID of the resource.
 - snapshot
Name String - The name of the snapshot.
 - source
File StringSystem Id  - The ID of the source file system.
 - source
File StringSystem Size  - The capacity of the source file system. Unit: GiB.
 - source
File StringSystem Version  - The version of the source file system.
 - status String
 - The status of the snapshot.
 
- create
Time string - The creation time of the resource.
 - description string
 - The description of the snapshot.
 - encrypt
Type number - The type of the encryption.
 - id string
 - The ID of the Snapshot.
 - progress string
 - The progress of the snapshot creation. The value of this parameter is expressed as a percentage.
 - remain
Time number - The remaining time that is required to create the snapshot. Unit: seconds.
 - retention
Days number - The retention period of the automatic snapshot. Unit: days.
 - snapshot
Id string - The ID of the resource.
 - snapshot
Name string - The name of the snapshot.
 - source
File stringSystem Id  - The ID of the source file system.
 - source
File stringSystem Size  - The capacity of the source file system. Unit: GiB.
 - source
File stringSystem Version  - The version of the source file system.
 - status string
 - The status of the snapshot.
 
- create_
time str - The creation time of the resource.
 - description str
 - The description of the snapshot.
 - encrypt_
type int - The type of the encryption.
 - id str
 - The ID of the Snapshot.
 - progress str
 - The progress of the snapshot creation. The value of this parameter is expressed as a percentage.
 - remain_
time int - The remaining time that is required to create the snapshot. Unit: seconds.
 - retention_
days int - The retention period of the automatic snapshot. Unit: days.
 - snapshot_
id str - The ID of the resource.
 - snapshot_
name str - The name of the snapshot.
 - source_
file_ strsystem_ id  - The ID of the source file system.
 - source_
file_ strsystem_ size  - The capacity of the source file system. Unit: GiB.
 - source_
file_ strsystem_ version  - The version of the source file system.
 - status str
 - The status of the snapshot.
 
- create
Time String - The creation time of the resource.
 - description String
 - The description of the snapshot.
 - encrypt
Type Number - The type of the encryption.
 - id String
 - The ID of the Snapshot.
 - progress String
 - The progress of the snapshot creation. The value of this parameter is expressed as a percentage.
 - remain
Time Number - The remaining time that is required to create the snapshot. Unit: seconds.
 - retention
Days Number - The retention period of the automatic snapshot. Unit: days.
 - snapshot
Id String - The ID of the resource.
 - snapshot
Name String - The name of the snapshot.
 - source
File StringSystem Id  - The ID of the source file system.
 - source
File StringSystem Size  - The capacity of the source file system. Unit: GiB.
 - source
File StringSystem Version  - The version of the source file system.
 - status String
 - The status of the snapshot.
 
Package Details
- Repository
 - Alibaba Cloud pulumi/pulumi-alicloud
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
alicloudTerraform Provider.