Skip to content

Commit b8c68ed

Browse files
authored
docs: add some descriptions (#23)
1 parent 2e7d3a3 commit b8c68ed

23 files changed

+227
-74
lines changed

provider/cmd/pulumi-resource-pinecone/schema.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
}
6666
},
6767
"pinecone:index:lookupPineconeIndex": {
68-
"description": "The result of a get operation on a Pinecone index.",
6968
"inputs": {
7069
"properties": {
7170
"name": {
@@ -79,13 +78,13 @@
7978
"type": "object"
8079
},
8180
"outputs": {
82-
"description": "The result of a get operation on a Pinecone index.",
8381
"properties": {
8482
"dimension": {
8583
"description": "The dimensions of the vectors in the index. Defaults to 1536.",
8684
"type": "integer"
8785
},
8886
"host": {
87+
"description": "The host of the index.",
8988
"type": "string"
9089
},
9190
"metric": {
@@ -101,6 +100,7 @@
101100
"description": "Describe how the index should be deployed."
102101
},
103102
"status": {
103+
"description": "The status of the index.",
104104
"type": "boolean"
105105
}
106106
},
@@ -243,6 +243,7 @@
243243
"type": "integer"
244244
},
245245
"host": {
246+
"description": "The URL address where the index is hosted.",
246247
"type": "string"
247248
},
248249
"metric": {
@@ -331,9 +332,11 @@
331332
"pinecone:index:PineconeServerlessSpec": {
332333
"properties": {
333334
"cloud": {
334-
"$ref": "#/types/pinecone:index:ServerlessSpecCloud"
335+
"$ref": "#/types/pinecone:index:ServerlessSpecCloud",
336+
"description": "he public cloud where you would like your index hosted"
335337
},
336338
"region": {
339+
"description": "The region where you would like your index to be created. Different cloud providers have different regions available.",
337340
"type": "string"
338341
}
339342
},
@@ -346,10 +349,12 @@
346349
"pinecone:index:PineconeSpec": {
347350
"properties": {
348351
"pod": {
349-
"$ref": "#/types/pinecone:index:PineconePodSpec"
352+
"$ref": "#/types/pinecone:index:PineconePodSpec",
353+
"description": "Configuration needed to deploy a pod index."
350354
},
351355
"serverless": {
352-
"$ref": "#/types/pinecone:index:PineconeServerlessSpec"
356+
"$ref": "#/types/pinecone:index:PineconeServerlessSpec",
357+
"description": "Configuration needed to deploy a serverless index."
353358
}
354359
},
355360
"type": "object"

provider/pkg/pinecone/index/collection.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package index
22

33
import (
44
"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"
5+
"net/http"
6+
87
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/client"
98
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/config"
109
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/utils"
11-
"net/http"
10+
p "github.com/pulumi/pulumi-go-provider"
11+
"github.com/pulumi/pulumi-go-provider/infer"
12+
"github.com/pulumi/pulumi/sdk/v3/go/common/diag"
1213
)
1314

1415
type PineconeCollection struct{}

provider/pkg/pinecone/index/getCollection.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package index
22

33
import (
44
"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"
5+
"net/http"
6+
87
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/client"
98
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/config"
109
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/utils"
11-
"net/http"
10+
p "github.com/pulumi/pulumi-go-provider"
11+
"github.com/pulumi/pulumi-go-provider/infer"
12+
"github.com/pulumi/pulumi/sdk/v3/go/common/diag"
1213
)
1314

1415
type LookupPineconeCollection struct{}

provider/pkg/pinecone/index/getIndex.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@ package index
22

33
import (
44
"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"
85
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/client"
96
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/config"
107
"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"
1111
"net/http"
1212
)
1313

1414
type LookupPineconeIndex struct{}
1515

16-
func (g *LookupPineconeIndex) Annotate(a infer.Annotator) {
17-
a.Describe(&g, "The result of a get operation on a Pinecone index.")
18-
}
19-
2016
func (*LookupPineconeIndex) Call(ctx p.Context, args LookupPineconeIndexArgs) (LookupPineconeIndexResult, error) {
2117
pineconeConfig := infer.GetConfig[config.PineconeProviderConfig](ctx)
2218
httpClient := &http.Client{
@@ -70,5 +66,7 @@ type LookupPineconeIndexResult struct {
7066
}
7167

7268
func (g *LookupPineconeIndexResult) Annotate(a infer.Annotator) {
73-
a.Describe(&g, "The result of a get operation on a Pinecone index.")
69+
a.Describe(&g.IndexSpec, "Describe how the index should be deployed.")
70+
a.Describe(&g.IndexHost, "The host of the index.")
71+
a.Describe(&g.IndextStatus, "The status of the index.")
7472
}

provider/pkg/pinecone/index/index.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,26 @@ type PineconeIndexState struct {
9898
IndexHost string `pulumi:"host,omitempty"`
9999
}
100100

101-
func (pia *PineconeIndexArgs) Annotate(a infer.Annotator) {
102-
a.Describe(&pia.IndexName, "The name of the Pinecone index.")
103-
a.Describe(&pia.IndexDimension, "The dimensions of the vectors in the index. Defaults to 1536.")
104-
a.Describe(&pia.IndexMetric, "The metric used to compute the distance between vectors.")
105-
a.Describe(&pia.IndexSpec, "Describe how the index should be deployed.")
101+
func (pip *PineconeIndexState) Annotate(a infer.Annotator) {
102+
a.Describe(&pip.IndexHost, "The URL address where the index is hosted.")
103+
}
104+
105+
func (pip *PineconeIndexArgs) Annotate(a infer.Annotator) {
106+
a.Describe(&pip.IndexName, "The name of the Pinecone index.")
107+
a.Describe(&pip.IndexDimension, "The dimensions of the vectors in the index. Defaults to 1536.")
108+
a.Describe(&pip.IndexMetric, "The metric used to compute the distance between vectors.")
109+
a.Describe(&pip.IndexSpec, "Describe how the index should be deployed.")
110+
}
111+
112+
func (pip *PineconeServerlessSpec) Annotate(a infer.Annotator) {
113+
a.Describe(&pip.Cloud, "he public cloud where you would like your index hosted")
114+
a.Describe(&pip.Region, "The region where you would like your index to be created. Different cloud "+
115+
"providers have different regions available.")
116+
}
117+
118+
func (pip *PineconeSpec) Annotate(a infer.Annotator) {
119+
a.Describe(&pip.Serverless, "Configuration needed to deploy a serverless index.")
120+
a.Describe(&pip.Pod, "Configuration needed to deploy a pod index.")
106121
}
107122

108123
func (*PineconeIndex) Create(ctx p.Context, name string, args PineconeIndexArgs, preview bool) (string, PineconeIndexState, error) {

provider/pkg/pinecone/pod/index.go

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package pod
22

33
import (
44
"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"
85
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/client"
96
"github.com/pinecone-io/pulumi-pinecone/provider/pkg/pinecone/config"
107
"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"
1111
"net/http"
1212
)
1313

@@ -19,16 +19,18 @@ type PodSpecReplicas = int32
1919

2020
type PodSpecShards = int32
2121

22+
type MetaDataConfig struct {
23+
Indexed *[]string `pulumi:"indexed"`
24+
}
25+
2226
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"`
3234
}
3335

3436
type PineconeSpec struct {
@@ -42,13 +44,32 @@ type PineconePodIndexArgs struct {
4244
IndexSpec PineconeSpec `pulumi:"spec"`
4345
}
4446

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+
4552
func (pia *PineconePodIndexArgs) Annotate(a infer.Annotator) {
4653
a.Describe(&pia.IndexName, "The name of the Pinecone index.")
4754
a.Describe(&pia.IndexDimension, "The dimensions of the vectors in the index.")
4855
a.Describe(&pia.IndexMetric, "The metric used to compute the distance between vectors.")
4956
a.Describe(&pia.IndexSpec, "Describe how the index should be deployed.")
5057
}
5158

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+
5273
func (*PineconePodIndex) Create(ctx p.Context, name string, args PineconePodIndexArgs, preview bool) (string, PineconePodIndexState, error) {
5374
pineconeConfig := infer.GetConfig[config.PineconeProviderConfig](ctx)
5475
if err := utils.ValidateIndexName(args.IndexName); err != nil {

sdk/dotnet/Inputs/PineconeServerlessSpecArgs.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ namespace PineconeDatabase.Pinecone.Inputs
1313

1414
public sealed class PineconeServerlessSpecArgs : global::Pulumi.ResourceArgs
1515
{
16+
/// <summary>
17+
/// he public cloud where you would like your index hosted
18+
/// </summary>
1619
[Input("cloud", required: true)]
1720
public Input<PineconeDatabase.Pinecone.ServerlessSpecCloud> Cloud { get; set; } = null!;
1821

22+
/// <summary>
23+
/// The region where you would like your index to be created. Different cloud providers have different regions available.
24+
/// </summary>
1925
[Input("region", required: true)]
2026
public Input<string> Region { get; set; } = null!;
2127

sdk/dotnet/Inputs/PineconeSpecArgs.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ namespace PineconeDatabase.Pinecone.Inputs
1313

1414
public sealed class PineconeSpecArgs : global::Pulumi.ResourceArgs
1515
{
16+
/// <summary>
17+
/// Configuration needed to deploy a pod index.
18+
/// </summary>
1619
[Input("pod")]
1720
public Input<Inputs.PineconePodSpecArgs>? Pod { get; set; }
1821

22+
/// <summary>
23+
/// Configuration needed to deploy a serverless index.
24+
/// </summary>
1925
[Input("serverless")]
2026
public Input<Inputs.PineconeServerlessSpecArgs>? Serverless { get; set; }
2127

sdk/dotnet/LookupPineconeIndex.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ namespace PineconeDatabase.Pinecone
1212
{
1313
public static class LookupPineconeIndex
1414
{
15-
/// <summary>
16-
/// The result of a get operation on a Pinecone index.
17-
/// </summary>
1815
public static Task<LookupPineconeIndexResult> InvokeAsync(LookupPineconeIndexArgs args, InvokeOptions? options = null)
1916
=> global::Pulumi.Deployment.Instance.InvokeAsync<LookupPineconeIndexResult>("pinecone:index:lookupPineconeIndex", args ?? new LookupPineconeIndexArgs(), options.WithDefaults());
2017

21-
/// <summary>
22-
/// The result of a get operation on a Pinecone index.
23-
/// </summary>
2418
public static Output<LookupPineconeIndexResult> Invoke(LookupPineconeIndexInvokeArgs args, InvokeOptions? options = null)
2519
=> global::Pulumi.Deployment.Instance.Invoke<LookupPineconeIndexResult>("pinecone:index:lookupPineconeIndex", args ?? new LookupPineconeIndexInvokeArgs(), options.WithDefaults());
2620
}
@@ -62,6 +56,9 @@ public sealed class LookupPineconeIndexResult
6256
/// The dimensions of the vectors in the index. Defaults to 1536.
6357
/// </summary>
6458
public readonly int? Dimension;
59+
/// <summary>
60+
/// The host of the index.
61+
/// </summary>
6562
public readonly string Host;
6663
/// <summary>
6764
/// The metric used to compute the distance between vectors.
@@ -75,6 +72,9 @@ public sealed class LookupPineconeIndexResult
7572
/// Describe how the index should be deployed.
7673
/// </summary>
7774
public readonly Outputs.PineconeSpec Spec;
75+
/// <summary>
76+
/// The status of the index.
77+
/// </summary>
7878
public readonly bool Status;
7979

8080
[OutputConstructor]

sdk/dotnet/Outputs/PineconeServerlessSpec.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ namespace PineconeDatabase.Pinecone.Outputs
1414
[OutputType]
1515
public sealed class PineconeServerlessSpec
1616
{
17+
/// <summary>
18+
/// he public cloud where you would like your index hosted
19+
/// </summary>
1720
public readonly PineconeDatabase.Pinecone.ServerlessSpecCloud Cloud;
21+
/// <summary>
22+
/// The region where you would like your index to be created. Different cloud providers have different regions available.
23+
/// </summary>
1824
public readonly string Region;
1925

2026
[OutputConstructor]

0 commit comments

Comments
 (0)