1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. simpleapplicationserver
  5. getServerSnapshots
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.simpleapplicationserver.getServerSnapshots

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    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}
    

    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>
    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]
    func GetServerSnapshots(ctx *Context, args *GetServerSnapshotsArgs, opts ...InvokeOption) (*GetServerSnapshotsResult, error)
    func GetServerSnapshotsOutput(ctx *Context, args *GetServerSnapshotsOutputArgs, opts ...InvokeOption) GetServerSnapshotsResultOutput

    > 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)
    }
    public static CompletableFuture<GetServerSnapshotsResult> getServerSnapshots(GetServerSnapshotsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:simpleapplicationserver/getServerSnapshots:getServerSnapshots
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DiskId string
    The ID of the source disk. This parameter has a value even after the source disk is released.
    Ids List<string>
    A list of Snapshot IDs.
    InstanceId string
    The ID of the simple application server.
    NameRegex 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 string
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    DiskId string
    The ID of the source disk. This parameter has a value even after the source disk is released.
    Ids []string
    A list of Snapshot IDs.
    InstanceId string
    The ID of the simple application server.
    NameRegex 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 string
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    diskId String
    The ID of the source disk. This parameter has a value even after the source disk is released.
    ids List<String>
    A list of Snapshot IDs.
    instanceId String
    The ID of the simple application server.
    nameRegex 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 String
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    diskId string
    The ID of the source disk. This parameter has a value even after the source disk is released.
    ids string[]
    A list of Snapshot IDs.
    instanceId string
    The ID of the simple application server.
    nameRegex 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 string
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    disk_id str
    The ID of the source disk. This parameter has a value even after the source disk is released.
    ids Sequence[str]
    A list of Snapshot IDs.
    instance_id str
    The ID of the simple application server.
    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).
    status str
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    diskId String
    The ID of the source disk. This parameter has a value even after the source disk is released.
    ids List<String>
    A list of Snapshot IDs.
    instanceId String
    The ID of the simple application server.
    nameRegex 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 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 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 string
    The ID of the source disk. This parameter has a value even after the source disk is released.
    Id string
    The ID of the Snapshot.
    Progress string
    The progress of snapshot creation.
    Remark string
    The remarks of the snapshot.
    SnapshotId string
    The ID of the snapshot.
    SnapshotName string
    The name of the snapshot.
    SourceDiskType string
    A snapshot of the source of a disk type. Possible values: System, Data.
    Status string
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    CreateTime 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 string
    The ID of the source disk. This parameter has a value even after the source disk is released.
    Id string
    The ID of the Snapshot.
    Progress string
    The progress of snapshot creation.
    Remark string
    The remarks of the snapshot.
    SnapshotId string
    The ID of the snapshot.
    SnapshotName string
    The name of the snapshot.
    SourceDiskType string
    A snapshot of the source of a disk type. Possible values: System, Data.
    Status string
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    createTime 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 String
    The ID of the source disk. This parameter has a value even after the source disk is released.
    id String
    The ID of the Snapshot.
    progress String
    The progress of snapshot creation.
    remark String
    The remarks of the snapshot.
    snapshotId String
    The ID of the snapshot.
    snapshotName String
    The name of the snapshot.
    sourceDiskType String
    A snapshot of the source of a disk type. Possible values: System, Data.
    status String
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    createTime 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 string
    The ID of the source disk. This parameter has a value even after the source disk is released.
    id string
    The ID of the Snapshot.
    progress string
    The progress of snapshot creation.
    remark string
    The remarks of the snapshot.
    snapshotId string
    The ID of the snapshot.
    snapshotName string
    The name of the snapshot.
    sourceDiskType string
    A snapshot of the source of a disk type. Possible values: System, Data.
    status string
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    create_time 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 str
    The ID of the source disk. This parameter has a value even after the source disk is released.
    id str
    The ID of the Snapshot.
    progress str
    The progress of snapshot creation.
    remark str
    The remarks of the snapshot.
    snapshot_id str
    The ID of the snapshot.
    snapshot_name str
    The name of the snapshot.
    source_disk_type str
    A snapshot of the source of a disk type. Possible values: System, Data.
    status str
    The status of the snapshots. Valid values: Progressing, Accomplished and Failed.
    createTime 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 String
    The ID of the source disk. This parameter has a value even after the source disk is released.
    id String
    The ID of the Snapshot.
    progress String
    The progress of snapshot creation.
    remark String
    The remarks of the snapshot.
    snapshotId String
    The ID of the snapshot.
    snapshotName String
    The name of the snapshot.
    sourceDiskType String
    A snapshot of the source of a disk type. Possible values: System, Data.
    status 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.
    alicloud logo
    Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi