/
getDatabase.go
161 lines (139 loc) · 5.62 KB
/
getDatabase.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
// 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 kusto
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about an existing Kusto Database
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/kusto"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := kusto.LookupDatabase(ctx, &kusto.LookupDatabaseArgs{
// Name: "my-kusto-database",
// ResourceGroupName: "test_resource_group",
// ClusterName: "test_cluster",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupDatabase(ctx *pulumi.Context, args *LookupDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupDatabaseResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupDatabaseResult
err := ctx.Invoke("azure:kusto/getDatabase:getDatabase", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDatabase.
type LookupDatabaseArgs struct {
// The name of the Kusto Cluster this database is added to.
ClusterName string `pulumi:"clusterName"`
// The name of the Kusto Database.
Name string `pulumi:"name"`
// The Resource Group where the Kusto Database exists.
ResourceGroupName string `pulumi:"resourceGroupName"`
}
// A collection of values returned by getDatabase.
type LookupDatabaseResult struct {
ClusterName string `pulumi:"clusterName"`
// The time the data that should be kept in cache for fast queries as ISO 8601 timespan.
HotCachePeriod string `pulumi:"hotCachePeriod"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The Azure Region in which the managed Kusto Database exists.
Location string `pulumi:"location"`
Name string `pulumi:"name"`
ResourceGroupName string `pulumi:"resourceGroupName"`
// The size of the database in bytes.
Size float64 `pulumi:"size"`
// The time the data should be kept before it stops being accessible to queries as ISO 8601 timespan.
SoftDeletePeriod string `pulumi:"softDeletePeriod"`
}
func LookupDatabaseOutput(ctx *pulumi.Context, args LookupDatabaseOutputArgs, opts ...pulumi.InvokeOption) LookupDatabaseResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupDatabaseResult, error) {
args := v.(LookupDatabaseArgs)
r, err := LookupDatabase(ctx, &args, opts...)
var s LookupDatabaseResult
if r != nil {
s = *r
}
return s, err
}).(LookupDatabaseResultOutput)
}
// A collection of arguments for invoking getDatabase.
type LookupDatabaseOutputArgs struct {
// The name of the Kusto Cluster this database is added to.
ClusterName pulumi.StringInput `pulumi:"clusterName"`
// The name of the Kusto Database.
Name pulumi.StringInput `pulumi:"name"`
// The Resource Group where the Kusto Database exists.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
}
func (LookupDatabaseOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDatabaseArgs)(nil)).Elem()
}
// A collection of values returned by getDatabase.
type LookupDatabaseResultOutput struct{ *pulumi.OutputState }
func (LookupDatabaseResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDatabaseResult)(nil)).Elem()
}
func (o LookupDatabaseResultOutput) ToLookupDatabaseResultOutput() LookupDatabaseResultOutput {
return o
}
func (o LookupDatabaseResultOutput) ToLookupDatabaseResultOutputWithContext(ctx context.Context) LookupDatabaseResultOutput {
return o
}
func (o LookupDatabaseResultOutput) ClusterName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.ClusterName }).(pulumi.StringOutput)
}
// The time the data that should be kept in cache for fast queries as ISO 8601 timespan.
func (o LookupDatabaseResultOutput) HotCachePeriod() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.HotCachePeriod }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupDatabaseResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.Id }).(pulumi.StringOutput)
}
// The Azure Region in which the managed Kusto Database exists.
func (o LookupDatabaseResultOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.Location }).(pulumi.StringOutput)
}
func (o LookupDatabaseResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.Name }).(pulumi.StringOutput)
}
func (o LookupDatabaseResultOutput) ResourceGroupName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.ResourceGroupName }).(pulumi.StringOutput)
}
// The size of the database in bytes.
func (o LookupDatabaseResultOutput) Size() pulumi.Float64Output {
return o.ApplyT(func(v LookupDatabaseResult) float64 { return v.Size }).(pulumi.Float64Output)
}
// The time the data should be kept before it stops being accessible to queries as ISO 8601 timespan.
func (o LookupDatabaseResultOutput) SoftDeletePeriod() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.SoftDeletePeriod }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDatabaseResultOutput{})
}