@@ -2,12 +2,12 @@ package pod
2
2
3
3
import (
4
4
"fmt"
5
- p "github.com/pulumi/pulumi-go-provider"
6
- "github.com/pulumi/pulumi-go-provider/infer"
7
- "github.com/pulumi/pulumi/sdk/v3/go/common/diag"
8
5
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/client"
9
6
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/config"
10
7
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/utils"
8
+ p "github.com/pulumi/pulumi-go-provider"
9
+ "github.com/pulumi/pulumi-go-provider/infer"
10
+ "github.com/pulumi/pulumi/sdk/v3/go/common/diag"
11
11
"net/http"
12
12
)
13
13
@@ -19,16 +19,18 @@ type PodSpecReplicas = int32
19
19
20
20
type PodSpecShards = int32
21
21
22
+ type MetaDataConfig struct {
23
+ Indexed * []string `pulumi:"indexed"`
24
+ }
25
+
22
26
type PineconePodSpec struct {
23
- Environment string `pulumi:"environment"`
24
- Replicas PodSpecReplicas `pulumi:"replicas"`
25
- Shards PodSpecShards `pulumi:"shards"`
26
- PodType PodSpecPodType `pulumi:"podType"`
27
- Pods int `pulumi:"pods"`
28
- MetaDataConfig struct {
29
- Indexed * []string `pulumi:"indexed"`
30
- } `pulumi:"metaDataConfig"`
31
- SourceCollection * string `pulumi:"sourceCollection"`
27
+ Environment string `pulumi:"environment"`
28
+ Replicas PodSpecReplicas `pulumi:"replicas"`
29
+ Shards PodSpecShards `pulumi:"shards"`
30
+ PodType PodSpecPodType `pulumi:"podType"`
31
+ Pods int `pulumi:"pods"`
32
+ MetaDataConfig MetaDataConfig `pulumi:"metaDataConfig"`
33
+ SourceCollection * string `pulumi:"sourceCollection"`
32
34
}
33
35
34
36
type PineconeSpec struct {
@@ -42,13 +44,32 @@ type PineconePodIndexArgs struct {
42
44
IndexSpec PineconeSpec `pulumi:"spec"`
43
45
}
44
46
47
+ func (pim * MetaDataConfig ) Annotate (a infer.Annotator ) {
48
+ a .Describe (& pim .Indexed , " Indexed By default, all metadata is indexed; to change this behavior, use this" +
49
+ " property to specify an array of metadata fields which should be indexed." )
50
+ }
51
+
45
52
func (pia * PineconePodIndexArgs ) Annotate (a infer.Annotator ) {
46
53
a .Describe (& pia .IndexName , "The name of the Pinecone index." )
47
54
a .Describe (& pia .IndexDimension , "The dimensions of the vectors in the index." )
48
55
a .Describe (& pia .IndexMetric , "The metric used to compute the distance between vectors." )
49
56
a .Describe (& pia .IndexSpec , "Describe how the index should be deployed." )
50
57
}
51
58
59
+ func (pip * PineconePodSpec ) Annotate (a infer.Annotator ) {
60
+ a .Describe (& pip .Environment , "The environment where the index is hosted." )
61
+ a .Describe (& pip .Replicas , "The number of replicas. Replicas duplicate your index. They provide higher" +
62
+ " availability and throughput. Replicas can be scaled up or down as your needs change." )
63
+ a .Describe (& pip .Shards , "The number of shards. Shards split your data across multiple pods so you can" +
64
+ " fit more data into an index." )
65
+ a .Describe (& pip .PodType , "The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one" +
66
+ " of `x1`, `x2`, `x4`, or `x8`." )
67
+ a .Describe (& pip .Pods , "The number of pods to be used in the index. This should be equal to " +
68
+ "`shards` x `replicas`." )
69
+ a .Describe (& pip .MetaDataConfig , "Configuration for the behavior of Pinecone's internal metadata index." )
70
+ a .Describe (& pip .SourceCollection , "The name of the collection to be used as the source for the index." )
71
+ }
72
+
52
73
func (* PineconePodIndex ) Create (ctx p.Context , name string , args PineconePodIndexArgs , preview bool ) (string , PineconePodIndexState , error ) {
53
74
pineconeConfig := infer.GetConfig [config.PineconeProviderConfig ](ctx )
54
75
if err := utils .ValidateIndexName (args .IndexName ); err != nil {
0 commit comments