get Snapshots
This data source provides the Dbfs Snapshots of the current Alibaba Cloud user.
NOTE: Available in v1.156.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.databasefilesystem.DatabasefilesystemFunctions;
import com.pulumi.alicloud.databasefilesystem.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 = DatabasefilesystemFunctions.getSnapshots(GetSnapshotsArgs.builder()
.ids("example_id")
.build());
ctx.export("dbfsSnapshotId1", ids.applyValue(getSnapshotsResult -> getSnapshotsResult.snapshots()[0].id()));
final var nameRegex = DatabasefilesystemFunctions.getSnapshots(GetSnapshotsArgs.builder()
.nameRegex("^my-Snapshot")
.build());
ctx.export("dbfsSnapshotId2", nameRegex.applyValue(getSnapshotsResult -> getSnapshotsResult.snapshots()[0].id()));
final var status = DatabasefilesystemFunctions.getSnapshots(GetSnapshotsArgs.builder()
.status("accomplished")
.build());
ctx.export("dbfsSnapshotId3", status.applyValue(getSnapshotsResult -> getSnapshotsResult.snapshots()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getSnapshots.
Parameters
argument
A collection of arguments for invoking getSnapshots.
suspend fun getSnapshots(ids: List<String>? = null, nameRegex: String? = null, outputFile: String? = null, status: String? = null): GetSnapshotsResult
Return
A collection of values returned by getSnapshots.
See also
Parameters
ids
A list of Snapshot IDs.
name Regex
A regex string to filter results by Snapshot name.
output File
File name where to save data source results (after running pulumi preview
).
status
The status of the snapshot. Possible values: progressing
, accomplished
, failed
.
suspend fun getSnapshots(argument: suspend GetSnapshotsPlainArgsBuilder.() -> Unit): GetSnapshotsResult
Return
A collection of values returned by getSnapshots.
See also
Parameters
argument
Builder for com.pulumi.alicloud.databasefilesystem.kotlin.inputs.GetSnapshotsPlainArgs.