/
federation.go
238 lines (200 loc) · 14 KB
/
federation.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
// 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 v1beta
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a metastore federation in a project and location.
type Federation struct {
pulumi.CustomResourceState
// A map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number.
BackendMetastores pulumi.StringMapOutput `pulumi:"backendMetastores"`
// The time when the metastore federation was created.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// The federation endpoint.
EndpointUri pulumi.StringOutput `pulumi:"endpointUri"`
// Required. The ID of the metastore federation, which is used as the final component of the metastore federation's name.This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
FederationId pulumi.StringOutput `pulumi:"federationId"`
// User-defined labels for the metastore federation.
Labels pulumi.StringMapOutput `pulumi:"labels"`
Location pulumi.StringOutput `pulumi:"location"`
// Immutable. The relative resource name of the federation, of the form: projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
Name pulumi.StringOutput `pulumi:"name"`
Project pulumi.StringOutput `pulumi:"project"`
// Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
RequestId pulumi.StringPtrOutput `pulumi:"requestId"`
// The current state of the federation.
State pulumi.StringOutput `pulumi:"state"`
// Additional information about the current state of the metastore federation, if available.
StateMessage pulumi.StringOutput `pulumi:"stateMessage"`
// The globally unique resource identifier of the metastore federation.
Uid pulumi.StringOutput `pulumi:"uid"`
// The time when the metastore federation was last updated.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
// Immutable. The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version.
Version pulumi.StringOutput `pulumi:"version"`
}
// NewFederation registers a new resource with the given unique name, arguments, and options.
func NewFederation(ctx *pulumi.Context,
name string, args *FederationArgs, opts ...pulumi.ResourceOption) (*Federation, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.FederationId == nil {
return nil, errors.New("invalid value for required argument 'FederationId'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"federationId",
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Federation
err := ctx.RegisterResource("google-native:metastore/v1beta:Federation", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetFederation gets an existing Federation resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetFederation(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *FederationState, opts ...pulumi.ResourceOption) (*Federation, error) {
var resource Federation
err := ctx.ReadResource("google-native:metastore/v1beta:Federation", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Federation resources.
type federationState struct {
}
type FederationState struct {
}
func (FederationState) ElementType() reflect.Type {
return reflect.TypeOf((*federationState)(nil)).Elem()
}
type federationArgs struct {
// A map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number.
BackendMetastores map[string]string `pulumi:"backendMetastores"`
// Required. The ID of the metastore federation, which is used as the final component of the metastore federation's name.This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
FederationId string `pulumi:"federationId"`
// User-defined labels for the metastore federation.
Labels map[string]string `pulumi:"labels"`
Location *string `pulumi:"location"`
// Immutable. The relative resource name of the federation, of the form: projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
Name *string `pulumi:"name"`
Project *string `pulumi:"project"`
// Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
RequestId *string `pulumi:"requestId"`
// Immutable. The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version.
Version *string `pulumi:"version"`
}
// The set of arguments for constructing a Federation resource.
type FederationArgs struct {
// A map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number.
BackendMetastores pulumi.StringMapInput
// Required. The ID of the metastore federation, which is used as the final component of the metastore federation's name.This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
FederationId pulumi.StringInput
// User-defined labels for the metastore federation.
Labels pulumi.StringMapInput
Location pulumi.StringPtrInput
// Immutable. The relative resource name of the federation, of the form: projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
Name pulumi.StringPtrInput
Project pulumi.StringPtrInput
// Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
RequestId pulumi.StringPtrInput
// Immutable. The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version.
Version pulumi.StringPtrInput
}
func (FederationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*federationArgs)(nil)).Elem()
}
type FederationInput interface {
pulumi.Input
ToFederationOutput() FederationOutput
ToFederationOutputWithContext(ctx context.Context) FederationOutput
}
func (*Federation) ElementType() reflect.Type {
return reflect.TypeOf((**Federation)(nil)).Elem()
}
func (i *Federation) ToFederationOutput() FederationOutput {
return i.ToFederationOutputWithContext(context.Background())
}
func (i *Federation) ToFederationOutputWithContext(ctx context.Context) FederationOutput {
return pulumi.ToOutputWithContext(ctx, i).(FederationOutput)
}
type FederationOutput struct{ *pulumi.OutputState }
func (FederationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Federation)(nil)).Elem()
}
func (o FederationOutput) ToFederationOutput() FederationOutput {
return o
}
func (o FederationOutput) ToFederationOutputWithContext(ctx context.Context) FederationOutput {
return o
}
// A map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number.
func (o FederationOutput) BackendMetastores() pulumi.StringMapOutput {
return o.ApplyT(func(v *Federation) pulumi.StringMapOutput { return v.BackendMetastores }).(pulumi.StringMapOutput)
}
// The time when the metastore federation was created.
func (o FederationOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// The federation endpoint.
func (o FederationOutput) EndpointUri() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.EndpointUri }).(pulumi.StringOutput)
}
// Required. The ID of the metastore federation, which is used as the final component of the metastore federation's name.This value must be between 2 and 63 characters long inclusive, begin with a letter, end with a letter or number, and consist of alpha-numeric ASCII characters or hyphens.
func (o FederationOutput) FederationId() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.FederationId }).(pulumi.StringOutput)
}
// User-defined labels for the metastore federation.
func (o FederationOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *Federation) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
func (o FederationOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Immutable. The relative resource name of the federation, of the form: projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
func (o FederationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o FederationOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Optional. A request ID. Specify a unique request ID to allow the server to ignore the request if it has completed. The server will ignore subsequent requests that provide a duplicate request ID for at least 60 minutes after the first request.For example, if an initial request times out, followed by another request with the same request ID, the server ignores the second request to prevent the creation of duplicate commitments.The request ID must be a valid UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier#Format) A zero UUID (00000000-0000-0000-0000-000000000000) is not supported.
func (o FederationOutput) RequestId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Federation) pulumi.StringPtrOutput { return v.RequestId }).(pulumi.StringPtrOutput)
}
// The current state of the federation.
func (o FederationOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Additional information about the current state of the metastore federation, if available.
func (o FederationOutput) StateMessage() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.StateMessage }).(pulumi.StringOutput)
}
// The globally unique resource identifier of the metastore federation.
func (o FederationOutput) Uid() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.Uid }).(pulumi.StringOutput)
}
// The time when the metastore federation was last updated.
func (o FederationOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
// Immutable. The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version.
func (o FederationOutput) Version() pulumi.StringOutput {
return o.ApplyT(func(v *Federation) pulumi.StringOutput { return v.Version }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*FederationInput)(nil)).Elem(), &Federation{})
pulumi.RegisterOutputType(FederationOutput{})
}