generated from pulumi/pulumi-tf-provider-boilerplate
/
getFilesystemSnapshotPolicies.go
174 lines (153 loc) · 8.66 KB
/
getFilesystemSnapshotPolicies.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package filestorage
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the list of Filesystem Snapshot Policies in Oracle Cloud Infrastructure File Storage service.
//
// Lists file system snapshot policies in the specified compartment.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/FileStorage"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := FileStorage.GetFilesystemSnapshotPolicies(ctx, &filestorage.GetFilesystemSnapshotPoliciesArgs{
// AvailabilityDomain: filesystemSnapshotPolicyAvailabilityDomain,
// CompartmentId: compartmentId,
// DisplayName: pulumi.StringRef(filesystemSnapshotPolicyDisplayName),
// Id: pulumi.StringRef(filesystemSnapshotPolicyId),
// State: pulumi.StringRef(filesystemSnapshotPolicyState),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetFilesystemSnapshotPolicies(ctx *pulumi.Context, args *GetFilesystemSnapshotPoliciesArgs, opts ...pulumi.InvokeOption) (*GetFilesystemSnapshotPoliciesResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetFilesystemSnapshotPoliciesResult
err := ctx.Invoke("oci:FileStorage/getFilesystemSnapshotPolicies:getFilesystemSnapshotPolicies", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getFilesystemSnapshotPolicies.
type GetFilesystemSnapshotPoliciesArgs struct {
// The name of the availability domain. Example: `Uocm:PHX-AD-1`
AvailabilityDomain string `pulumi:"availabilityDomain"`
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
CompartmentId string `pulumi:"compartmentId"`
// A user-friendly name. It does not have to be unique, and it is changeable. Example: `My resource`
DisplayName *string `pulumi:"displayName"`
Filters []GetFilesystemSnapshotPoliciesFilter `pulumi:"filters"`
// Filter results by [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resouce type.
Id *string `pulumi:"id"`
// Filter results by the specified lifecycle state. Must be a valid state for the resource type.
State *string `pulumi:"state"`
}
// A collection of values returned by getFilesystemSnapshotPolicies.
type GetFilesystemSnapshotPoliciesResult struct {
// The availability domain that the file system snapshot policy is in. May be unset using a blank or NULL value. Example: `Uocm:PHX-AD-2`
AvailabilityDomain string `pulumi:"availabilityDomain"`
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the file system snapshot policy.
CompartmentId string `pulumi:"compartmentId"`
// A user-friendly name. It does not have to be unique, and it is changeable. Avoid entering confidential information. Example: `My Filesystem Snapshot Policy`
DisplayName *string `pulumi:"displayName"`
// The list of filesystem_snapshot_policies.
FilesystemSnapshotPolicies []GetFilesystemSnapshotPoliciesFilesystemSnapshotPolicy `pulumi:"filesystemSnapshotPolicies"`
Filters []GetFilesystemSnapshotPoliciesFilter `pulumi:"filters"`
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the file system snapshot policy.
Id *string `pulumi:"id"`
// The current state of this file system snapshot policy.
State *string `pulumi:"state"`
}
func GetFilesystemSnapshotPoliciesOutput(ctx *pulumi.Context, args GetFilesystemSnapshotPoliciesOutputArgs, opts ...pulumi.InvokeOption) GetFilesystemSnapshotPoliciesResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetFilesystemSnapshotPoliciesResult, error) {
args := v.(GetFilesystemSnapshotPoliciesArgs)
r, err := GetFilesystemSnapshotPolicies(ctx, &args, opts...)
var s GetFilesystemSnapshotPoliciesResult
if r != nil {
s = *r
}
return s, err
}).(GetFilesystemSnapshotPoliciesResultOutput)
}
// A collection of arguments for invoking getFilesystemSnapshotPolicies.
type GetFilesystemSnapshotPoliciesOutputArgs struct {
// The name of the availability domain. Example: `Uocm:PHX-AD-1`
AvailabilityDomain pulumi.StringInput `pulumi:"availabilityDomain"`
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
CompartmentId pulumi.StringInput `pulumi:"compartmentId"`
// A user-friendly name. It does not have to be unique, and it is changeable. Example: `My resource`
DisplayName pulumi.StringPtrInput `pulumi:"displayName"`
Filters GetFilesystemSnapshotPoliciesFilterArrayInput `pulumi:"filters"`
// Filter results by [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resouce type.
Id pulumi.StringPtrInput `pulumi:"id"`
// Filter results by the specified lifecycle state. Must be a valid state for the resource type.
State pulumi.StringPtrInput `pulumi:"state"`
}
func (GetFilesystemSnapshotPoliciesOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetFilesystemSnapshotPoliciesArgs)(nil)).Elem()
}
// A collection of values returned by getFilesystemSnapshotPolicies.
type GetFilesystemSnapshotPoliciesResultOutput struct{ *pulumi.OutputState }
func (GetFilesystemSnapshotPoliciesResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetFilesystemSnapshotPoliciesResult)(nil)).Elem()
}
func (o GetFilesystemSnapshotPoliciesResultOutput) ToGetFilesystemSnapshotPoliciesResultOutput() GetFilesystemSnapshotPoliciesResultOutput {
return o
}
func (o GetFilesystemSnapshotPoliciesResultOutput) ToGetFilesystemSnapshotPoliciesResultOutputWithContext(ctx context.Context) GetFilesystemSnapshotPoliciesResultOutput {
return o
}
// The availability domain that the file system snapshot policy is in. May be unset using a blank or NULL value. Example: `Uocm:PHX-AD-2`
func (o GetFilesystemSnapshotPoliciesResultOutput) AvailabilityDomain() pulumi.StringOutput {
return o.ApplyT(func(v GetFilesystemSnapshotPoliciesResult) string { return v.AvailabilityDomain }).(pulumi.StringOutput)
}
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the file system snapshot policy.
func (o GetFilesystemSnapshotPoliciesResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetFilesystemSnapshotPoliciesResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
// A user-friendly name. It does not have to be unique, and it is changeable. Avoid entering confidential information. Example: `My Filesystem Snapshot Policy`
func (o GetFilesystemSnapshotPoliciesResultOutput) DisplayName() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetFilesystemSnapshotPoliciesResult) *string { return v.DisplayName }).(pulumi.StringPtrOutput)
}
// The list of filesystem_snapshot_policies.
func (o GetFilesystemSnapshotPoliciesResultOutput) FilesystemSnapshotPolicies() GetFilesystemSnapshotPoliciesFilesystemSnapshotPolicyArrayOutput {
return o.ApplyT(func(v GetFilesystemSnapshotPoliciesResult) []GetFilesystemSnapshotPoliciesFilesystemSnapshotPolicy {
return v.FilesystemSnapshotPolicies
}).(GetFilesystemSnapshotPoliciesFilesystemSnapshotPolicyArrayOutput)
}
func (o GetFilesystemSnapshotPoliciesResultOutput) Filters() GetFilesystemSnapshotPoliciesFilterArrayOutput {
return o.ApplyT(func(v GetFilesystemSnapshotPoliciesResult) []GetFilesystemSnapshotPoliciesFilter { return v.Filters }).(GetFilesystemSnapshotPoliciesFilterArrayOutput)
}
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the file system snapshot policy.
func (o GetFilesystemSnapshotPoliciesResultOutput) Id() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetFilesystemSnapshotPoliciesResult) *string { return v.Id }).(pulumi.StringPtrOutput)
}
// The current state of this file system snapshot policy.
func (o GetFilesystemSnapshotPoliciesResultOutput) State() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetFilesystemSnapshotPoliciesResult) *string { return v.State }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetFilesystemSnapshotPoliciesResultOutput{})
}