Skip to content

Commit bc43a56

Browse files
authored
Merge pull request #25 from pinecone-io/revert-24-revert-23-ch11268
Revert "Revert "Add pods and pod_type to create_index""
2 parents 0c2b280 + de0b4b5 commit bc43a56

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pinecone/manage.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class IndexDescription(NamedTuple):
2727
replicas: int
2828
dimension: int
2929
shards: int
30+
pods: int
31+
pod_type: str
3032
index_config: None
3133
status: None
3234

@@ -62,6 +64,8 @@ def create_index(
6264
metric: str = "cosine",
6365
replicas: int = 1,
6466
shards: int = 1,
67+
pods: int = 1,
68+
pod_type: str = 'p1',
6569
index_config: dict = None
6670
):
6771
"""Creates a Pinecone index.
@@ -86,6 +90,10 @@ def create_index(
8690
:param shards: the number of shards per index, defaults to 1.
8791
Use 1 shard per 1GB of vectors
8892
:type shards: int,optional
93+
:param pods: Total number of pods to be used by the index. pods = shard*replicas
94+
:type pods: int,optional
95+
:param pod_type: the pod type to be used for the index. can be one of p1 or s1.
96+
:type pod_type: str,optional
8997
:param index_config: Advanced configuration options for the index
9098
:type timeout: int, optional
9199
:param timeout: Timeout for wait until index gets ready. If None, wait indefinitely; if >=0, time out after this many seconds; if -1, return immediately and do not wait. Default: None
@@ -99,6 +107,8 @@ def create_index(
99107
metric=metric,
100108
replicas=replicas,
101109
shards=shards,
110+
pods=pods,
111+
pod_type=pod_type,
102112
index_config=index_config or {}
103113
))
104114

@@ -173,7 +183,7 @@ def describe_index(name: str):
173183
db = response['database']
174184
ready = response['status']['ready']
175185
return IndexDescription(name=db['name'], index_type=db['index_type'], metric=db['metric'],
176-
replicas=db['replicas'], dimension=db['dimension'], shards=db['shards'],
186+
replicas=db['replicas'], dimension=db['dimension'], shards=db['shards'], pods=db['pods'], pod_type=db['pod_type'],
177187
index_config=db['index_config'], status={'ready': ready})
178188

179189

0 commit comments

Comments
 (0)