Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.simpleapplicationserver.getServerSnapshots
Explore with Pulumi AI
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:
- Disk
Id string - The ID of the disk.
- Ids List<string>
- A list of Snapshot IDs.
- Instance
Id string - The ID of the simple application server.
- Name
Regex string - A regex string to filter results by Snapshot name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- Disk
Id string - The ID of the disk.
- Ids []string
- A list of Snapshot IDs.
- Instance
Id string - The ID of the simple application server.
- Name
Regex string - A regex string to filter results by Snapshot name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- disk
Id String - The ID of the disk.
- ids List<String>
- A list of Snapshot IDs.
- instance
Id String - The ID of the simple application server.
- name
Regex String - A regex string to filter results by Snapshot name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- disk
Id string - The ID of the disk.
- ids string[]
- A list of Snapshot IDs.
- instance
Id string - The ID of the simple application server.
- name
Regex string - A regex string to filter results by Snapshot name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - status string
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- disk_
id str - The ID of the disk.
- 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
andFailed
.
- disk
Id String - The ID of the disk.
- ids List<String>
- A list of Snapshot IDs.
- instance
Id String - The ID of the simple application server.
- name
Regex String - A regex string to filter results by Snapshot name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
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.
Ali Cloud. Simple Application Server. Outputs. Get Server Snapshots Snapshot> - Disk
Id string - Instance
Id string - Name
Regex string - Output
File string - Status string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Snapshots
[]Get
Server Snapshots Snapshot - Disk
Id string - Instance
Id string - Name
Regex string - Output
File string - Status string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- snapshots
List<Get
Server Snapshots Snapshot> - disk
Id String - instance
Id String - name
Regex String - output
File String - status String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- snapshots
Get
Server Snapshots Snapshot[] - disk
Id string - instance
Id string - name
Regex string - output
File string - status string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- snapshots
Sequence[Get
Server Snapshots Snapshot] - 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>
- disk
Id String - instance
Id String - name
Regex String - output
File String - status String
Supporting Types
GetServerSnapshotsSnapshot
- Create
Time 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. - Disk
Id 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.
- Snapshot
Id string - The ID of the snapshot.
- Snapshot
Name string - The name of the snapshot.
- Source
Disk stringType - A snapshot of the source of a disk type. Possible values:
System
,Data
. - Status string
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- Create
Time 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. - Disk
Id 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.
- Snapshot
Id string - The ID of the snapshot.
- Snapshot
Name string - The name of the snapshot.
- Source
Disk stringType - A snapshot of the source of a disk type. Possible values:
System
,Data
. - Status string
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- create
Time 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. - disk
Id 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.
- snapshot
Id String - The ID of the snapshot.
- snapshot
Name String - The name of the snapshot.
- source
Disk StringType - A snapshot of the source of a disk type. Possible values:
System
,Data
. - status String
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- create
Time 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. - disk
Id 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.
- snapshot
Id string - The ID of the snapshot.
- snapshot
Name string - The name of the snapshot.
- source
Disk stringType - A snapshot of the source of a disk type. Possible values:
System
,Data
. - status string
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- 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_ strtype - A snapshot of the source of a disk type. Possible values:
System
,Data
. - status str
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
- create
Time 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. - disk
Id 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.
- snapshot
Id String - The ID of the snapshot.
- snapshot
Name String - The name of the snapshot.
- source
Disk StringType - A snapshot of the source of a disk type. Possible values:
System
,Data
. - status String
- The status of the snapshots. Valid values:
Progressing
,Accomplished
andFailed
.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.