/
getEcsSnapshots.go
108 lines (103 loc) · 3.73 KB
/
getEcsSnapshots.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package ecs
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// This data source provides the Ecs Snapshots of the current Alibaba Cloud user.
//
// > **NOTE:** Available in v1.120.0+.
//
// ## Example Usage
//
// Basic Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-alicloud/sdk/v2/go/alicloud/ecs"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// opt0 := "tf-test"
// example, err := ecs.GetEcsSnapshots(ctx, &ecs.GetEcsSnapshotsArgs{
// Ids: []string{
// "s-bp1fvuxxxxxxxx",
// },
// NameRegex: &opt0,
// }, nil)
// if err != nil {
// return err
// }
// ctx.Export("firstEcsSnapshotId", example.Snapshots[0].Id)
// return nil
// })
// }
// ```
func GetEcsSnapshots(ctx *pulumi.Context, args *GetEcsSnapshotsArgs, opts ...pulumi.InvokeOption) (*GetEcsSnapshotsResult, error) {
var rv GetEcsSnapshotsResult
err := ctx.Invoke("alicloud:ecs/getEcsSnapshots:getEcsSnapshots", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getEcsSnapshots.
type GetEcsSnapshotsArgs struct {
// The category of the snapshot.
Category *string `pulumi:"category"`
// Specifies whether to check the validity of the request without actually making the request.
DryRun *bool `pulumi:"dryRun"`
// Whether the snapshot is encrypted.
Encrypted *bool `pulumi:"encrypted"`
// A list of Snapshot IDs.
Ids []string `pulumi:"ids"`
// The kms key id.
KmsKeyId *string `pulumi:"kmsKeyId"`
// A regex string to filter results by Snapshot name.
NameRegex *string `pulumi:"nameRegex"`
OutputFile *string `pulumi:"outputFile"`
// The resource group id.
ResourceGroupId *string `pulumi:"resourceGroupId"`
// The snapshot link id.
SnapshotLinkId *string `pulumi:"snapshotLinkId"`
// Snapshot Display Name.
SnapshotName *string `pulumi:"snapshotName"`
// Snapshot creation type.
SnapshotType *string `pulumi:"snapshotType"`
// Source disk attributes.
SourceDiskType *string `pulumi:"sourceDiskType"`
// The status of the snapshot.
Status *string `pulumi:"status"`
// The tags.
Tags map[string]interface{} `pulumi:"tags"`
Type *string `pulumi:"type"`
// A resource type that has a reference relationship.
Usage *string `pulumi:"usage"`
}
// A collection of values returned by getEcsSnapshots.
type GetEcsSnapshotsResult struct {
Category *string `pulumi:"category"`
DryRun *bool `pulumi:"dryRun"`
Encrypted *bool `pulumi:"encrypted"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Ids []string `pulumi:"ids"`
KmsKeyId *string `pulumi:"kmsKeyId"`
NameRegex *string `pulumi:"nameRegex"`
Names []string `pulumi:"names"`
OutputFile *string `pulumi:"outputFile"`
ResourceGroupId *string `pulumi:"resourceGroupId"`
SnapshotLinkId *string `pulumi:"snapshotLinkId"`
SnapshotName *string `pulumi:"snapshotName"`
SnapshotType *string `pulumi:"snapshotType"`
Snapshots []GetEcsSnapshotsSnapshot `pulumi:"snapshots"`
SourceDiskType *string `pulumi:"sourceDiskType"`
Status *string `pulumi:"status"`
Tags map[string]interface{} `pulumi:"tags"`
Type *string `pulumi:"type"`
Usage *string `pulumi:"usage"`
}