/
getSearchIndex.go
259 lines (229 loc) · 12.3 KB
/
getSearchIndex.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
250
251
252
253
254
255
256
257
258
259
// 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 mongodbatlas
import (
"context"
"reflect"
"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// `SearchIndex` describe a single search indexes. This represents a single search index that have been created.
//
// > **NOTE:** Groups and projects are synonymous terms. You may find `groupId` in the official documentation.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := mongodbatlas.LookupSearchIndex(ctx, &mongodbatlas.LookupSearchIndexArgs{
// ClusterName: "<CLUSTER_NAME>",
// IndexId: "<INDEX_ID",
// ProjectId: "<PROJECT_ID>",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func LookupSearchIndex(ctx *pulumi.Context, args *LookupSearchIndexArgs, opts ...pulumi.InvokeOption) (*LookupSearchIndexResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupSearchIndexResult
err := ctx.Invoke("mongodbatlas:index/getSearchIndex:getSearchIndex", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSearchIndex.
type LookupSearchIndexArgs struct {
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when creating the index.
Analyzer *string `pulumi:"analyzer"`
// [Custom analyzers](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/custom/#std-label-custom-analyzers) to use in this index (this is an array of objects).
Analyzers *string `pulumi:"analyzers"`
// The name of the cluster containing the collection with one or more Atlas Search indexes.
ClusterName string `pulumi:"clusterName"`
// Name of the collection the index is on.
CollectionName *string `pulumi:"collectionName"`
// Name of the database the collection is in.
Database *string `pulumi:"database"`
Fields *string `pulumi:"fields"`
// The unique identifier of the Atlas Search index. Use the `getSearchIndexes`datasource to find the IDs of all Atlas Search indexes.
IndexId string `pulumi:"indexId"`
// Flag indicating whether the index uses dynamic or static mappings.
MappingsDynamic *bool `pulumi:"mappingsDynamic"`
// Object containing one or more field specifications.
MappingsFields *string `pulumi:"mappingsFields"`
// Name of the index.
Name *string `pulumi:"name"`
// The unique identifier for the [project](https://docs.atlas.mongodb.com/organizations-projects/#std-label-projects) that contains the specified cluster.
ProjectId string `pulumi:"projectId"`
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when searching the index.
SearchAnalyzer *string `pulumi:"searchAnalyzer"`
Type *string `pulumi:"type"`
}
// A collection of values returned by getSearchIndex.
type LookupSearchIndexResult struct {
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when creating the index.
Analyzer *string `pulumi:"analyzer"`
// [Custom analyzers](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/custom/#std-label-custom-analyzers) to use in this index (this is an array of objects).
Analyzers *string `pulumi:"analyzers"`
ClusterName string `pulumi:"clusterName"`
// Name of the collection the index is on.
CollectionName *string `pulumi:"collectionName"`
// Name of the database the collection is in.
Database *string `pulumi:"database"`
Fields *string `pulumi:"fields"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
IndexId string `pulumi:"indexId"`
// Flag indicating whether the index uses dynamic or static mappings.
MappingsDynamic *bool `pulumi:"mappingsDynamic"`
// Object containing one or more field specifications.
MappingsFields *string `pulumi:"mappingsFields"`
// Name of the index.
Name *string `pulumi:"name"`
ProjectId string `pulumi:"projectId"`
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when searching the index.
SearchAnalyzer *string `pulumi:"searchAnalyzer"`
// Current status of the index.
Status string `pulumi:"status"`
// Synonyms mapping definition to use in this index.
// * `synonyms.#.name` - Name of the [synonym mapping definition](https://docs.atlas.mongodb.com/reference/atlas-search/synonyms/#std-label-synonyms-ref).
// * `synonyms.#.source_collection` - Name of the source MongoDB collection for the synonyms.
// * `synonyms.#.analyzer` - Name of the [analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use with this synonym mapping.
Synonyms []GetSearchIndexSynonym `pulumi:"synonyms"`
Type *string `pulumi:"type"`
}
func LookupSearchIndexOutput(ctx *pulumi.Context, args LookupSearchIndexOutputArgs, opts ...pulumi.InvokeOption) LookupSearchIndexResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupSearchIndexResult, error) {
args := v.(LookupSearchIndexArgs)
r, err := LookupSearchIndex(ctx, &args, opts...)
var s LookupSearchIndexResult
if r != nil {
s = *r
}
return s, err
}).(LookupSearchIndexResultOutput)
}
// A collection of arguments for invoking getSearchIndex.
type LookupSearchIndexOutputArgs struct {
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when creating the index.
Analyzer pulumi.StringPtrInput `pulumi:"analyzer"`
// [Custom analyzers](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/custom/#std-label-custom-analyzers) to use in this index (this is an array of objects).
Analyzers pulumi.StringPtrInput `pulumi:"analyzers"`
// The name of the cluster containing the collection with one or more Atlas Search indexes.
ClusterName pulumi.StringInput `pulumi:"clusterName"`
// Name of the collection the index is on.
CollectionName pulumi.StringPtrInput `pulumi:"collectionName"`
// Name of the database the collection is in.
Database pulumi.StringPtrInput `pulumi:"database"`
Fields pulumi.StringPtrInput `pulumi:"fields"`
// The unique identifier of the Atlas Search index. Use the `getSearchIndexes`datasource to find the IDs of all Atlas Search indexes.
IndexId pulumi.StringInput `pulumi:"indexId"`
// Flag indicating whether the index uses dynamic or static mappings.
MappingsDynamic pulumi.BoolPtrInput `pulumi:"mappingsDynamic"`
// Object containing one or more field specifications.
MappingsFields pulumi.StringPtrInput `pulumi:"mappingsFields"`
// Name of the index.
Name pulumi.StringPtrInput `pulumi:"name"`
// The unique identifier for the [project](https://docs.atlas.mongodb.com/organizations-projects/#std-label-projects) that contains the specified cluster.
ProjectId pulumi.StringInput `pulumi:"projectId"`
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when searching the index.
SearchAnalyzer pulumi.StringPtrInput `pulumi:"searchAnalyzer"`
Type pulumi.StringPtrInput `pulumi:"type"`
}
func (LookupSearchIndexOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSearchIndexArgs)(nil)).Elem()
}
// A collection of values returned by getSearchIndex.
type LookupSearchIndexResultOutput struct{ *pulumi.OutputState }
func (LookupSearchIndexResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupSearchIndexResult)(nil)).Elem()
}
func (o LookupSearchIndexResultOutput) ToLookupSearchIndexResultOutput() LookupSearchIndexResultOutput {
return o
}
func (o LookupSearchIndexResultOutput) ToLookupSearchIndexResultOutputWithContext(ctx context.Context) LookupSearchIndexResultOutput {
return o
}
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when creating the index.
func (o LookupSearchIndexResultOutput) Analyzer() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.Analyzer }).(pulumi.StringPtrOutput)
}
// [Custom analyzers](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/custom/#std-label-custom-analyzers) to use in this index (this is an array of objects).
func (o LookupSearchIndexResultOutput) Analyzers() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.Analyzers }).(pulumi.StringPtrOutput)
}
func (o LookupSearchIndexResultOutput) ClusterName() pulumi.StringOutput {
return o.ApplyT(func(v LookupSearchIndexResult) string { return v.ClusterName }).(pulumi.StringOutput)
}
// Name of the collection the index is on.
func (o LookupSearchIndexResultOutput) CollectionName() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.CollectionName }).(pulumi.StringPtrOutput)
}
// Name of the database the collection is in.
func (o LookupSearchIndexResultOutput) Database() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.Database }).(pulumi.StringPtrOutput)
}
func (o LookupSearchIndexResultOutput) Fields() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.Fields }).(pulumi.StringPtrOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o LookupSearchIndexResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupSearchIndexResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o LookupSearchIndexResultOutput) IndexId() pulumi.StringOutput {
return o.ApplyT(func(v LookupSearchIndexResult) string { return v.IndexId }).(pulumi.StringOutput)
}
// Flag indicating whether the index uses dynamic or static mappings.
func (o LookupSearchIndexResultOutput) MappingsDynamic() pulumi.BoolPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *bool { return v.MappingsDynamic }).(pulumi.BoolPtrOutput)
}
// Object containing one or more field specifications.
func (o LookupSearchIndexResultOutput) MappingsFields() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.MappingsFields }).(pulumi.StringPtrOutput)
}
// Name of the index.
func (o LookupSearchIndexResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
func (o LookupSearchIndexResultOutput) ProjectId() pulumi.StringOutput {
return o.ApplyT(func(v LookupSearchIndexResult) string { return v.ProjectId }).(pulumi.StringOutput)
}
// [Analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use when searching the index.
func (o LookupSearchIndexResultOutput) SearchAnalyzer() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.SearchAnalyzer }).(pulumi.StringPtrOutput)
}
// Current status of the index.
func (o LookupSearchIndexResultOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v LookupSearchIndexResult) string { return v.Status }).(pulumi.StringOutput)
}
// Synonyms mapping definition to use in this index.
// * `synonyms.#.name` - Name of the [synonym mapping definition](https://docs.atlas.mongodb.com/reference/atlas-search/synonyms/#std-label-synonyms-ref).
// * `synonyms.#.source_collection` - Name of the source MongoDB collection for the synonyms.
// * `synonyms.#.analyzer` - Name of the [analyzer](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/#std-label-analyzers-ref) to use with this synonym mapping.
func (o LookupSearchIndexResultOutput) Synonyms() GetSearchIndexSynonymArrayOutput {
return o.ApplyT(func(v LookupSearchIndexResult) []GetSearchIndexSynonym { return v.Synonyms }).(GetSearchIndexSynonymArrayOutput)
}
func (o LookupSearchIndexResultOutput) Type() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupSearchIndexResult) *string { return v.Type }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(LookupSearchIndexResultOutput{})
}