1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. simpleapplicationserver
  5. getServerSnapshots
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.simpleapplicationserver.getServerSnapshots

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.simpleapplicationserver.getServerSnapshots({
    ids: ["example_id"],
});
export const simpleApplicationServerSnapshotId1 = ids.then(ids => ids.snapshots?.[0]?.id);
const nameRegex = alicloud.simpleapplicationserver.getServerSnapshots({
    nameRegex: "^my-Snapshot",
});
export const simpleApplicationServerSnapshotId2 = nameRegex.then(nameRegex => nameRegex.snapshots?.[0]?.id);
const diskIdConf = alicloud.simpleapplicationserver.getServerSnapshots({
    ids: ["example_id"],
    diskId: "example_value",
});
export const simpleApplicationServerSnapshotId3 = diskIdConf.then(diskIdConf => diskIdConf.snapshots?.[0]?.id);
const instanceIdConf = alicloud.simpleapplicationserver.getServerSnapshots({
    ids: ["example_id"],
    instanceId: "example_value",
});
export const simpleApplicationServerSnapshotId4 = instanceIdConf.then(instanceIdConf => instanceIdConf.snapshots?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.simpleapplicationserver.get_server_snapshots(ids=["example_id"])
pulumi.export("simpleApplicationServerSnapshotId1", ids.snapshots[0].id)
name_regex = alicloud.simpleapplicationserver.get_server_snapshots(name_regex="^my-Snapshot")
pulumi.export("simpleApplicationServerSnapshotId2", name_regex.snapshots[0].id)
disk_id_conf = alicloud.simpleapplicationserver.get_server_snapshots(ids=["example_id"],
    disk_id="example_value")
pulumi.export("simpleApplicationServerSnapshotId3", disk_id_conf.snapshots[0].id)
instance_id_conf = alicloud.simpleapplicationserver.get_server_snapshots(ids=["example_id"],
    instance_id="example_value")
pulumi.export("simpleApplicationServerSnapshotId4", instance_id_conf.snapshots[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/simpleapplicationserver"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := simpleapplicationserver.GetServerSnapshots(ctx, &simpleapplicationserver.GetServerSnapshotsArgs{
			Ids: []string{
				"example_id",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerSnapshotId1", ids.Snapshots[0].Id)
		nameRegex, err := simpleapplicationserver.GetServerSnapshots(ctx, &simpleapplicationserver.GetServerSnapshotsArgs{
			NameRegex: pulumi.StringRef("^my-Snapshot"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerSnapshotId2", nameRegex.Snapshots[0].Id)
		diskIdConf, err := simpleapplicationserver.GetServerSnapshots(ctx, &simpleapplicationserver.GetServerSnapshotsArgs{
			Ids: []string{
				"example_id",
			},
			DiskId: pulumi.StringRef("example_value"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerSnapshotId3", diskIdConf.Snapshots[0].Id)
		instanceIdConf, err := simpleapplicationserver.GetServerSnapshots(ctx, &simpleapplicationserver.GetServerSnapshotsArgs{
			Ids: []string{
				"example_id",
			},
			InstanceId: pulumi.StringRef("example_value"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("simpleApplicationServerSnapshotId4", instanceIdConf.Snapshots[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.SimpleApplicationServer.GetServerSnapshots.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
    });

    var nameRegex = AliCloud.SimpleApplicationServer.GetServerSnapshots.Invoke(new()
    {
        NameRegex = "^my-Snapshot",
    });

    var diskIdConf = AliCloud.SimpleApplicationServer.GetServerSnapshots.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
        DiskId = "example_value",
    });

    var instanceIdConf = AliCloud.SimpleApplicationServer.GetServerSnapshots.Invoke(new()
    {
        Ids = new[]
        {
            "example_id",
        },
        InstanceId = "example_value",
    });

    return new Dictionary<string, object?>
    {
        ["simpleApplicationServerSnapshotId1"] = ids.Apply(getServerSnapshotsResult => getServerSnapshotsResult.Snapshots[0]?.Id),
        ["simpleApplicationServerSnapshotId2"] = nameRegex.Apply(getServerSnapshotsResult => getServerSnapshotsResult.Snapshots[0]?.Id),
        ["simpleApplicationServerSnapshotId3"] = diskIdConf.Apply(getServerSnapshotsResult => getServerSnapshotsResult.Snapshots[0]?.Id),
        ["simpleApplicationServerSnapshotId4"] = instanceIdConf.Apply(getServerSnapshotsResult => getServerSnapshotsResult.Snapshots[0]?.Id),
    };
});
Copy
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()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerSnapshots
      arguments:
        ids:
          - example_id
  nameRegex:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerSnapshots
      arguments:
        nameRegex: ^my-Snapshot
  diskIdConf:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerSnapshots
      arguments:
        ids:
          - example_id
        diskId: example_value
  instanceIdConf:
    fn::invoke:
      function: alicloud:simpleapplicationserver:getServerSnapshots
      arguments:
        ids:
          - example_id
        instanceId: example_value
outputs:
  simpleApplicationServerSnapshotId1: ${ids.snapshots[0].id}
  simpleApplicationServerSnapshotId2: ${nameRegex.snapshots[0].id}
  simpleApplicationServerSnapshotId3: ${diskIdConf.snapshots[0].id}
  simpleApplicationServerSnapshotId4: ${instanceIdConf.snapshots[0].id}
Copy

Using getServerSnapshots

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 getServerSnapshots(args: GetServerSnapshotsArgs, opts?: InvokeOptions): Promise<GetServerSnapshotsResult>
function getServerSnapshotsOutput(args: GetServerSnapshotsOutputArgs, opts?: InvokeOptions): Output<GetServerSnapshotsResult>
Copy
def get_server_snapshots(disk_id: Optional[str] = None,
                         ids: Optional[Sequence[str]] = None,
                         instance_id: Optional[str] = None,
                         name_regex: Optional[str] = None,
                         output_file: Optional[str] = None,
                         status: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetServerSnapshotsResult
def get_server_snapshots_output(disk_id: Optional[pulumi.Input[str]] = None,
                         ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                         instance_id: Optional[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[GetServerSnapshotsResult]
Copy
func GetServerSnapshots(ctx *Context, args *GetServerSnapshotsArgs, opts ...InvokeOption) (*GetServerSnapshotsResult, error)
func GetServerSnapshotsOutput(ctx *Context, args *GetServerSnapshotsOutputArgs, opts ...InvokeOption) GetServerSnapshotsResultOutput
Copy

> Note: This function is named GetServerSnapshots in the Go SDK.

public static class GetServerSnapshots 
{
    public static Task<GetServerSnapshotsResult> InvokeAsync(GetServerSnapshotsArgs args, InvokeOptions? opts = null)
    public static Output<GetServerSnapshotsResult> Invoke(GetServerSnapshotsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServerSnapshotsResult> getServerSnapshots(GetServerSnapshotsArgs args, InvokeOptions options)
public static Output<GetServerSnapshotsResult> getServerSnapshots(GetServerSnapshotsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:simpleapplicationserver/getServerSnapshots:getServerSnapshots
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DiskId Changes to this property will trigger replacement. string
The ID of the disk.
Ids Changes to this property will trigger replacement. List<string>
A list of Snapshot IDs.
InstanceId Changes to this property will trigger replacement. string
The ID of the simple application server.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Snapshot name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
DiskId Changes to this property will trigger replacement. string
The ID of the disk.
Ids Changes to this property will trigger replacement. []string
A list of Snapshot IDs.
InstanceId Changes to this property will trigger replacement. string
The ID of the simple application server.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Snapshot name.
OutputFile string
File name where to save data source results (after running pulumi preview).
Status Changes to this property will trigger replacement. string
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
diskId Changes to this property will trigger replacement. String
The ID of the disk.
ids Changes to this property will trigger replacement. List<String>
A list of Snapshot IDs.
instanceId Changes to this property will trigger replacement. String
The ID of the simple application server.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Snapshot name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
diskId Changes to this property will trigger replacement. string
The ID of the disk.
ids Changes to this property will trigger replacement. string[]
A list of Snapshot IDs.
instanceId Changes to this property will trigger replacement. string
The ID of the simple application server.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Snapshot name.
outputFile string
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. string
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
disk_id Changes to this property will trigger replacement. str
The ID of the disk.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Snapshot IDs.
instance_id Changes to this property will trigger replacement. str
The ID of the simple application server.
name_regex Changes to this property will trigger replacement. 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).
status Changes to this property will trigger replacement. str
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
diskId Changes to this property will trigger replacement. String
The ID of the disk.
ids Changes to this property will trigger replacement. List<String>
A list of Snapshot IDs.
instanceId Changes to this property will trigger replacement. String
The ID of the simple application server.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Snapshot name.
outputFile String
File name where to save data source results (after running pulumi preview).
status Changes to this property will trigger replacement. String
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.

getServerSnapshots 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.AliCloud.SimpleApplicationServer.Outputs.GetServerSnapshotsSnapshot>
DiskId string
InstanceId string
NameRegex string
OutputFile string
Status string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Names []string
Snapshots []GetServerSnapshotsSnapshot
DiskId string
InstanceId string
NameRegex string
OutputFile string
Status string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
snapshots List<GetServerSnapshotsSnapshot>
diskId String
instanceId String
nameRegex String
outputFile String
status String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
names string[]
snapshots GetServerSnapshotsSnapshot[]
diskId string
instanceId string
nameRegex string
outputFile string
status string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
names Sequence[str]
snapshots Sequence[GetServerSnapshotsSnapshot]
disk_id str
instance_id str
name_regex str
output_file str
status str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
names List<String>
snapshots List<Property Map>
diskId String
instanceId String
nameRegex String
outputFile String
status String

Supporting Types

GetServerSnapshotsSnapshot

CreateTime This property is required. string
The time when the snapshot was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
DiskId This property is required. string
The ID of the source disk. This parameter has a value even after the source disk is released.
Id This property is required. string
The ID of the Snapshot.
Progress This property is required. string
The progress of snapshot creation.
Remark This property is required. string
The remarks of the snapshot.
SnapshotId This property is required. string
The ID of the snapshot.
SnapshotName This property is required. string
The name of the snapshot.
SourceDiskType This property is required. string
A snapshot of the source of a disk type. Possible values: System, Data.
Status This property is required. string
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
CreateTime This property is required. string
The time when the snapshot was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
DiskId This property is required. string
The ID of the source disk. This parameter has a value even after the source disk is released.
Id This property is required. string
The ID of the Snapshot.
Progress This property is required. string
The progress of snapshot creation.
Remark This property is required. string
The remarks of the snapshot.
SnapshotId This property is required. string
The ID of the snapshot.
SnapshotName This property is required. string
The name of the snapshot.
SourceDiskType This property is required. string
A snapshot of the source of a disk type. Possible values: System, Data.
Status This property is required. string
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
createTime This property is required. String
The time when the snapshot was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
diskId This property is required. String
The ID of the source disk. This parameter has a value even after the source disk is released.
id This property is required. String
The ID of the Snapshot.
progress This property is required. String
The progress of snapshot creation.
remark This property is required. String
The remarks of the snapshot.
snapshotId This property is required. String
The ID of the snapshot.
snapshotName This property is required. String
The name of the snapshot.
sourceDiskType This property is required. String
A snapshot of the source of a disk type. Possible values: System, Data.
status This property is required. String
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
createTime This property is required. string
The time when the snapshot was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
diskId This property is required. string
The ID of the source disk. This parameter has a value even after the source disk is released.
id This property is required. string
The ID of the Snapshot.
progress This property is required. string
The progress of snapshot creation.
remark This property is required. string
The remarks of the snapshot.
snapshotId This property is required. string
The ID of the snapshot.
snapshotName This property is required. string
The name of the snapshot.
sourceDiskType This property is required. string
A snapshot of the source of a disk type. Possible values: System, Data.
status This property is required. string
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
create_time This property is required. str
The time when the snapshot was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
disk_id This property is required. str
The ID of the source disk. This parameter has a value even after the source disk is released.
id This property is required. str
The ID of the Snapshot.
progress This property is required. str
The progress of snapshot creation.
remark This property is required. str
The remarks of the snapshot.
snapshot_id This property is required. str
The ID of the snapshot.
snapshot_name This property is required. str
The name of the snapshot.
source_disk_type This property is required. str
A snapshot of the source of a disk type. Possible values: System, Data.
status This property is required. str
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
createTime This property is required. String
The time when the snapshot was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
diskId This property is required. String
The ID of the source disk. This parameter has a value even after the source disk is released.
id This property is required. String
The ID of the Snapshot.
progress This property is required. String
The progress of snapshot creation.
remark This property is required. String
The remarks of the snapshot.
snapshotId This property is required. String
The ID of the snapshot.
snapshotName This property is required. String
The name of the snapshot.
sourceDiskType This property is required. String
A snapshot of the source of a disk type. Possible values: System, Data.
status This property is required. String
The status of the snapshots. Valid values: Progressing, Accomplished and Failed.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi