generated from pulumi/pulumi-tf-provider-boilerplate
/
getStorageProfile.go
249 lines (220 loc) · 9.82 KB
/
getStorageProfile.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
// 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 storageprofile
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
// ### S
// This is an example of how to create a storage profile data source.
//
// **Storage profile data source by its id:**
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-vra/sdk/go/vra/storageprofile"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-vra/sdk/go/vra/storageprofile"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := storageprofile.LookupStorageProfile(ctx, &storageprofile.LookupStorageProfileArgs{
// Id: pulumi.StringRef(vra_storage_profile.This.Id),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// **Vra storage profile data source filter by external region id:**
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-vra/sdk/go/vra/storageprofile"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumiverse/pulumi-vra/sdk/go/vra/storageprofile"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := storageprofile.LookupStorageProfile(ctx, &storageprofile.LookupStorageProfileArgs{
// Filter: pulumi.StringRef("externalRegionId eq 'foobar'"),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// A storage profile data source supports the following arguments:
func LookupStorageProfile(ctx *pulumi.Context, args *LookupStorageProfileArgs, opts ...pulumi.InvokeOption) (*LookupStorageProfileResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv LookupStorageProfileResult
err := ctx.Invoke("vra:storageprofile/getStorageProfile:getStorageProfile", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getStorageProfile.
type LookupStorageProfileArgs struct {
// A human-friendly description.
Description *string `pulumi:"description"`
// Map of storage properties that are to be applied on disk while provisioning.
DiskProperties map[string]interface{} `pulumi:"diskProperties"`
// Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
Filter *string `pulumi:"filter"`
// The id of the image profile instance.
Id *string `pulumi:"id"`
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags []GetStorageProfileTag `pulumi:"tags"`
}
// A collection of values returned by getStorageProfile.
type LookupStorageProfileResult struct {
// Id of the cloud account this storage profile belongs to.
CloudAccountId string `pulumi:"cloudAccountId"`
// Date when the entity was created. The date is in ISO 6801 and UTC.
CreatedAt string `pulumi:"createdAt"`
// Indicates if this storage profile is a default profile.
DefaultItem bool `pulumi:"defaultItem"`
Description *string `pulumi:"description"`
DiskProperties map[string]interface{} `pulumi:"diskProperties"`
// The id of the region as seen in the cloud provider for which this profile is defined.
ExternalRegionId string `pulumi:"externalRegionId"`
Filter *string `pulumi:"filter"`
Id string `pulumi:"id"`
// HATEOAS of the entity
Links []GetStorageProfileLink `pulumi:"links"`
// A human-friendly name used as an identifier in APIs that support this option.
Name string `pulumi:"name"`
// The id of the organization this entity belongs to.
OrgId string `pulumi:"orgId"`
// Email of the user that owns the entity.
Owner string `pulumi:"owner"`
// Indicates whether this storage profile supports encryption or not.
SupportsEncryption bool `pulumi:"supportsEncryption"`
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags []GetStorageProfileTag `pulumi:"tags"`
// Date when the entity was last updated. The date is ISO 8601 and UTC.
UpdatedAt string `pulumi:"updatedAt"`
}
func LookupStorageProfileOutput(ctx *pulumi.Context, args LookupStorageProfileOutputArgs, opts ...pulumi.InvokeOption) LookupStorageProfileResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupStorageProfileResult, error) {
args := v.(LookupStorageProfileArgs)
r, err := LookupStorageProfile(ctx, &args, opts...)
var s LookupStorageProfileResult
if r != nil {
s = *r
}
return s, err
}).(LookupStorageProfileResultOutput)
}
// A collection of arguments for invoking getStorageProfile.
type LookupStorageProfileOutputArgs struct {
// A human-friendly description.
Description pulumi.StringPtrInput `pulumi:"description"`
// Map of storage properties that are to be applied on disk while provisioning.
DiskProperties pulumi.MapInput `pulumi:"diskProperties"`
// Filter query string that is supported by vRA multi-cloud IaaS API. Example: regionId eq '<regionId>' and cloudAccountId eq '<cloudAccountId>'.
Filter pulumi.StringPtrInput `pulumi:"filter"`
// The id of the image profile instance.
Id pulumi.StringPtrInput `pulumi:"id"`
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
Tags GetStorageProfileTagArrayInput `pulumi:"tags"`
}
func (LookupStorageProfileOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupStorageProfileArgs)(nil)).Elem()
}
// A collection of values returned by getStorageProfile.
type LookupStorageProfileResultOutput struct{ *pulumi.OutputState }
func (LookupStorageProfileResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupStorageProfileResult)(nil)).Elem()
}
func (o LookupStorageProfileResultOutput) ToLookupStorageProfileResultOutput() LookupStorageProfileResultOutput {
return o
}
func (o LookupStorageProfileResultOutput) ToLookupStorageProfileResultOutputWithContext(ctx context.Context) LookupStorageProfileResultOutput {
return o
}
// Id of the cloud account this storage profile belongs to.
func (o LookupStorageProfileResultOutput) CloudAccountId() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.CloudAccountId }).(pulumi.StringOutput)
}
// Date when the entity was created. The date is in ISO 6801 and UTC.
func (o LookupStorageProfileResultOutput) CreatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.CreatedAt }).(pulumi.StringOutput)
}
// Indicates if this storage profile is a default profile.
func (o LookupStorageProfileResultOutput) DefaultItem() pulumi.BoolOutput {
return o.ApplyT(func(v LookupStorageProfileResult) bool { return v.DefaultItem }).(pulumi.BoolOutput)
}
func (o LookupStorageProfileResultOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupStorageProfileResult) *string { return v.Description }).(pulumi.StringPtrOutput)
}
func (o LookupStorageProfileResultOutput) DiskProperties() pulumi.MapOutput {
return o.ApplyT(func(v LookupStorageProfileResult) map[string]interface{} { return v.DiskProperties }).(pulumi.MapOutput)
}
// The id of the region as seen in the cloud provider for which this profile is defined.
func (o LookupStorageProfileResultOutput) ExternalRegionId() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.ExternalRegionId }).(pulumi.StringOutput)
}
func (o LookupStorageProfileResultOutput) Filter() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupStorageProfileResult) *string { return v.Filter }).(pulumi.StringPtrOutput)
}
func (o LookupStorageProfileResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.Id }).(pulumi.StringOutput)
}
// HATEOAS of the entity
func (o LookupStorageProfileResultOutput) Links() GetStorageProfileLinkArrayOutput {
return o.ApplyT(func(v LookupStorageProfileResult) []GetStorageProfileLink { return v.Links }).(GetStorageProfileLinkArrayOutput)
}
// A human-friendly name used as an identifier in APIs that support this option.
func (o LookupStorageProfileResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.Name }).(pulumi.StringOutput)
}
// The id of the organization this entity belongs to.
func (o LookupStorageProfileResultOutput) OrgId() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.OrgId }).(pulumi.StringOutput)
}
// Email of the user that owns the entity.
func (o LookupStorageProfileResultOutput) Owner() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.Owner }).(pulumi.StringOutput)
}
// Indicates whether this storage profile supports encryption or not.
func (o LookupStorageProfileResultOutput) SupportsEncryption() pulumi.BoolOutput {
return o.ApplyT(func(v LookupStorageProfileResult) bool { return v.SupportsEncryption }).(pulumi.BoolOutput)
}
// A set of tag keys and optional values that were set on this Network Profile.
// example:[ { "key" : "ownedBy", "value": "Rainpole" } ]
func (o LookupStorageProfileResultOutput) Tags() GetStorageProfileTagArrayOutput {
return o.ApplyT(func(v LookupStorageProfileResult) []GetStorageProfileTag { return v.Tags }).(GetStorageProfileTagArrayOutput)
}
// Date when the entity was last updated. The date is ISO 8601 and UTC.
func (o LookupStorageProfileResultOutput) UpdatedAt() pulumi.StringOutput {
return o.ApplyT(func(v LookupStorageProfileResult) string { return v.UpdatedAt }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupStorageProfileResultOutput{})
}