forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getDatabase.go
119 lines (100 loc) · 4.29 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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package dbformariadb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets information about a database.
// Azure REST API version: 2018-06-01.
//
// Other available API versions: 2018-06-01-preview.
func LookupDatabase(ctx *pulumi.Context, args *LookupDatabaseArgs, opts ...pulumi.InvokeOption) (*LookupDatabaseResult, error) {
opts = utilities.PkgInvokeDefaultOpts(opts)
var rv LookupDatabaseResult
err := ctx.Invoke("azure-native:dbformariadb:getDatabase", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupDatabaseArgs struct {
// The name of the database.
DatabaseName string `pulumi:"databaseName"`
// The name of the resource group. The name is case insensitive.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The name of the server.
ServerName string `pulumi:"serverName"`
}
// Represents a Database.
type LookupDatabaseResult struct {
// The charset of the database.
Charset *string `pulumi:"charset"`
// The collation of the database.
Collation *string `pulumi:"collation"`
// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
Id string `pulumi:"id"`
// The name of the resource
Name string `pulumi:"name"`
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
Type string `pulumi:"type"`
}
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)
}
type LookupDatabaseOutputArgs struct {
// The name of the database.
DatabaseName pulumi.StringInput `pulumi:"databaseName"`
// The name of the resource group. The name is case insensitive.
ResourceGroupName pulumi.StringInput `pulumi:"resourceGroupName"`
// The name of the server.
ServerName pulumi.StringInput `pulumi:"serverName"`
}
func (LookupDatabaseOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDatabaseArgs)(nil)).Elem()
}
// Represents a Database.
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
}
// The charset of the database.
func (o LookupDatabaseResultOutput) Charset() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDatabaseResult) *string { return v.Charset }).(pulumi.StringPtrOutput)
}
// The collation of the database.
func (o LookupDatabaseResultOutput) Collation() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupDatabaseResult) *string { return v.Collation }).(pulumi.StringPtrOutput)
}
// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
func (o LookupDatabaseResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.Id }).(pulumi.StringOutput)
}
// The name of the resource
func (o LookupDatabaseResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.Name }).(pulumi.StringOutput)
}
// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
func (o LookupDatabaseResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupDatabaseResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDatabaseResultOutput{})
}