get Server Snapshots
This data source provides the Simple Application Server Snapshots of the current Alibaba Cloud user.
NOTE: Available in v1.143.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.simpleapplicationserver.SimpleapplicationserverFunctions;
import com.pulumi.alicloud.simpleapplicationserver.inputs.GetServerSnapshotsArgs;
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 = SimpleapplicationserverFunctions.getServerSnapshots(GetServerSnapshotsArgs.builder()
.ids("example_id")
.build());
ctx.export("simpleApplicationServerSnapshotId1", ids.applyValue(getServerSnapshotsResult -> getServerSnapshotsResult.snapshots()[0].id()));
final var nameRegex = SimpleapplicationserverFunctions.getServerSnapshots(GetServerSnapshotsArgs.builder()
.nameRegex("^my-Snapshot")
.build());
ctx.export("simpleApplicationServerSnapshotId2", nameRegex.applyValue(getServerSnapshotsResult -> getServerSnapshotsResult.snapshots()[0].id()));
final var diskIdConf = SimpleapplicationserverFunctions.getServerSnapshots(GetServerSnapshotsArgs.builder()
.ids("example_id")
.diskId("example_value")
.build());
ctx.export("simpleApplicationServerSnapshotId3", diskIdConf.applyValue(getServerSnapshotsResult -> getServerSnapshotsResult.snapshots()[0].id()));
final var instanceIdConf = SimpleapplicationserverFunctions.getServerSnapshots(GetServerSnapshotsArgs.builder()
.ids("example_id")
.instanceId("example_value")
.build());
ctx.export("simpleApplicationServerSnapshotId4", instanceIdConf.applyValue(getServerSnapshotsResult -> getServerSnapshotsResult.snapshots()[0].id()));
}
}
Content copied to clipboard
Return
A collection of values returned by getServerSnapshots.
Parameters
argument
A collection of arguments for invoking getServerSnapshots.
suspend fun getServerSnapshots(diskId: String? = null, ids: List<String>? = null, instanceId: String? = null, nameRegex: String? = null, outputFile: String? = null, status: String? = null): GetServerSnapshotsResult
Return
A collection of values returned by getServerSnapshots.
See also
Parameters
disk Id
The ID of the source disk. This parameter has a value even after the source disk is released.
ids
A list of Snapshot IDs.
instance Id
The ID of the simple application server.
name Regex
A regex string to filter results by Snapshot name.
output File
status
The status of the snapshots. Valid values: Progressing
, Accomplished
and Failed
.
suspend fun getServerSnapshots(argument: suspend GetServerSnapshotsPlainArgsBuilder.() -> Unit): GetServerSnapshotsResult
Return
A collection of values returned by getServerSnapshots.
See also
Parameters
argument
Builder for com.pulumi.alicloud.simpleapplicationserver.kotlin.inputs.GetServerSnapshotsPlainArgs.