getSnapshots

This data source provides the Nas Snapshots of the current Alibaba Cloud user.

NOTE: Available in v1.152.0+.

Example Usage

Basic Usage

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

Return

A collection of values returned by getSnapshots.

Parameters

argument

A collection of arguments for invoking getSnapshots.


suspend fun getSnapshots(fileSystemId: String? = null, ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, snapshotName: String? = null, status: String? = null): GetSnapshotsResult

Return

A collection of values returned by getSnapshots.

See also

Parameters

fileSystemId

The ID of the file system.

ids

A list of Snapshot IDs.

nameRegex

A regex string to filter results by Snapshot name.

outputFile
snapshotName

The name of the snapshot.

status

The status of the snapshot.


Return

A collection of values returned by getSnapshots.

See also

Parameters

argument

Builder for com.pulumi.alicloud.nas.kotlin.inputs.GetSnapshotsPlainArgs.