generated from pulumi/pulumi-tf-provider-boilerplate
/
getDataAsset.go
233 lines (201 loc) · 10.4 KB
/
getDataAsset.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
// 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 datacatalog
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides details about a specific Data Asset resource in Oracle Cloud Infrastructure Data Catalog service.
//
// Gets a specific data asset for the given key within a data catalog.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/DataCatalog"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := DataCatalog.GetDataAsset(ctx, &datacatalog.GetDataAssetArgs{
// CatalogId: testCatalog.Id,
// DataAssetKey: dataAssetDataAssetKey,
// Fields: dataAssetFields,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupDataAsset(ctx *pulumi.Context, args *LookupDataAssetArgs, opts ...pulumi.InvokeOption) (*LookupDataAssetResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupDataAssetResult
err := ctx.Invoke("oci:DataCatalog/getDataAsset:getDataAsset", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDataAsset.
type LookupDataAssetArgs struct {
// Unique catalog identifier.
CatalogId string `pulumi:"catalogId"`
// Unique data asset key.
DataAssetKey string `pulumi:"dataAssetKey"`
// Specifies the fields to return in a data asset response.
Fields []string `pulumi:"fields"`
}
// A collection of values returned by getDataAsset.
type LookupDataAssetResult struct {
// The data catalog's OCID.
CatalogId string `pulumi:"catalogId"`
// OCID of the user who created the data asset.
CreatedById string `pulumi:"createdById"`
DataAssetKey string `pulumi:"dataAssetKey"`
// Detailed description of the data asset.
Description string `pulumi:"description"`
// A user-friendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
DisplayName string `pulumi:"displayName"`
// External URI that can be used to reference the object. Format will differ based on the type of object.
ExternalKey string `pulumi:"externalKey"`
Fields []string `pulumi:"fields"`
Id string `pulumi:"id"`
// Unique data asset key that is immutable.
Key string `pulumi:"key"`
// A message describing the current state in more detail. An object not in ACTIVE state may have functional limitations, see service documentation for details.
LifecycleDetails string `pulumi:"lifecycleDetails"`
// A map of maps that contains the properties which are specific to the asset type. Each data asset type definition defines it's set of required and optional properties. The map keys are category names and the values are maps of property name to property value. Every property is contained inside of a category. Most data assets have required properties within the "default" category. Example: `{"properties": { "default": { "host": "host1", "port": "1521", "database": "orcl"}}}`
Properties map[string]interface{} `pulumi:"properties"`
// The current state of the data asset.
State string `pulumi:"state"`
// The date and time the data asset was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2019-03-25T21:10:29.600Z`
TimeCreated string `pulumi:"timeCreated"`
// The last time that a harvest was performed on the data asset. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string.
TimeHarvested string `pulumi:"timeHarvested"`
// The last time that any change was made to the data asset. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string.
TimeUpdated string `pulumi:"timeUpdated"`
// The key of the object type. Type key's can be found via the '/types' endpoint.
TypeKey string `pulumi:"typeKey"`
// OCID of the user who last modified the data asset.
UpdatedById string `pulumi:"updatedById"`
// URI to the data asset instance in the API.
Uri string `pulumi:"uri"`
}
func LookupDataAssetOutput(ctx *pulumi.Context, args LookupDataAssetOutputArgs, opts ...pulumi.InvokeOption) LookupDataAssetResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupDataAssetResult, error) {
args := v.(LookupDataAssetArgs)
r, err := LookupDataAsset(ctx, &args, opts...)
var s LookupDataAssetResult
if r != nil {
s = *r
}
return s, err
}).(LookupDataAssetResultOutput)
}
// A collection of arguments for invoking getDataAsset.
type LookupDataAssetOutputArgs struct {
// Unique catalog identifier.
CatalogId pulumi.StringInput `pulumi:"catalogId"`
// Unique data asset key.
DataAssetKey pulumi.StringInput `pulumi:"dataAssetKey"`
// Specifies the fields to return in a data asset response.
Fields pulumi.StringArrayInput `pulumi:"fields"`
}
func (LookupDataAssetOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDataAssetArgs)(nil)).Elem()
}
// A collection of values returned by getDataAsset.
type LookupDataAssetResultOutput struct{ *pulumi.OutputState }
func (LookupDataAssetResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDataAssetResult)(nil)).Elem()
}
func (o LookupDataAssetResultOutput) ToLookupDataAssetResultOutput() LookupDataAssetResultOutput {
return o
}
func (o LookupDataAssetResultOutput) ToLookupDataAssetResultOutputWithContext(ctx context.Context) LookupDataAssetResultOutput {
return o
}
// The data catalog's OCID.
func (o LookupDataAssetResultOutput) CatalogId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.CatalogId }).(pulumi.StringOutput)
}
// OCID of the user who created the data asset.
func (o LookupDataAssetResultOutput) CreatedById() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.CreatedById }).(pulumi.StringOutput)
}
func (o LookupDataAssetResultOutput) DataAssetKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.DataAssetKey }).(pulumi.StringOutput)
}
// Detailed description of the data asset.
func (o LookupDataAssetResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.Description }).(pulumi.StringOutput)
}
// A user-friendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
func (o LookupDataAssetResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// External URI that can be used to reference the object. Format will differ based on the type of object.
func (o LookupDataAssetResultOutput) ExternalKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.ExternalKey }).(pulumi.StringOutput)
}
func (o LookupDataAssetResultOutput) Fields() pulumi.StringArrayOutput {
return o.ApplyT(func(v LookupDataAssetResult) []string { return v.Fields }).(pulumi.StringArrayOutput)
}
func (o LookupDataAssetResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.Id }).(pulumi.StringOutput)
}
// Unique data asset key that is immutable.
func (o LookupDataAssetResultOutput) Key() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.Key }).(pulumi.StringOutput)
}
// A message describing the current state in more detail. An object not in ACTIVE state may have functional limitations, see service documentation for details.
func (o LookupDataAssetResultOutput) LifecycleDetails() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.LifecycleDetails }).(pulumi.StringOutput)
}
// A map of maps that contains the properties which are specific to the asset type. Each data asset type definition defines it's set of required and optional properties. The map keys are category names and the values are maps of property name to property value. Every property is contained inside of a category. Most data assets have required properties within the "default" category. Example: `{"properties": { "default": { "host": "host1", "port": "1521", "database": "orcl"}}}`
func (o LookupDataAssetResultOutput) Properties() pulumi.MapOutput {
return o.ApplyT(func(v LookupDataAssetResult) map[string]interface{} { return v.Properties }).(pulumi.MapOutput)
}
// The current state of the data asset.
func (o LookupDataAssetResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.State }).(pulumi.StringOutput)
}
// The date and time the data asset was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2019-03-25T21:10:29.600Z`
func (o LookupDataAssetResultOutput) TimeCreated() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.TimeCreated }).(pulumi.StringOutput)
}
// The last time that a harvest was performed on the data asset. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string.
func (o LookupDataAssetResultOutput) TimeHarvested() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.TimeHarvested }).(pulumi.StringOutput)
}
// The last time that any change was made to the data asset. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string.
func (o LookupDataAssetResultOutput) TimeUpdated() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.TimeUpdated }).(pulumi.StringOutput)
}
// The key of the object type. Type key's can be found via the '/types' endpoint.
func (o LookupDataAssetResultOutput) TypeKey() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.TypeKey }).(pulumi.StringOutput)
}
// OCID of the user who last modified the data asset.
func (o LookupDataAssetResultOutput) UpdatedById() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.UpdatedById }).(pulumi.StringOutput)
}
// URI to the data asset instance in the API.
func (o LookupDataAssetResultOutput) Uri() pulumi.StringOutput {
return o.ApplyT(func(v LookupDataAssetResult) string { return v.Uri }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDataAssetResultOutput{})
}