pinecone.core.client.api.index_operations_api

Pinecone index operations API

# noqa: E501

Contact: support@pinecone.io

  1"""
  2    Pinecone index operations API
  3
  4      # noqa: E501
  5
  6    Contact: support@pinecone.io
  7"""
  8
  9
 10import re  # noqa: F401
 11import sys  # noqa: F401
 12
 13from pinecone.core.client.api_client import ApiClient, Endpoint as _Endpoint
 14from pinecone.core.client.model_utils import (  # noqa: F401
 15    check_allowed_values,
 16    check_validations,
 17    date,
 18    datetime,
 19    file_type,
 20    none_type,
 21    validate_and_convert_types,
 22)
 23from pinecone.core.client.model.collection_meta import CollectionMeta
 24from pinecone.core.client.model.create_collection_request import CreateCollectionRequest
 25from pinecone.core.client.model.create_request import CreateRequest
 26from pinecone.core.client.model.index_meta import IndexMeta
 27from pinecone.core.client.model.patch_request import PatchRequest
 28
 29
 30class IndexOperationsApi(object):
 31    """NOTE: This class is auto generated by OpenAPI Generator
 32    Ref: https://openapi-generator.tech
 33
 34    Do not edit the class manually.
 35    """
 36
 37    def __init__(self, api_client=None):
 38        if api_client is None:
 39            api_client = ApiClient()
 40        self.api_client = api_client
 41
 42        def __configure_index(self, index_name, **kwargs):
 43            """configure_index  # noqa: E501
 44
 45            This operation specifies the pod type and number of replicas for an index.  # noqa: E501
 46            This method makes a synchronous HTTP request by default. To make an
 47            asynchronous HTTP request, please pass async_req=True
 48
 49            >>> thread = api.configure_index(index_name, async_req=True)
 50            >>> result = thread.get()
 51
 52            Args:
 53                index_name (str): The name of the index
 54
 55            Keyword Args:
 56                patch_request (PatchRequest): The desired pod type and replica configuration for the index.. [optional]
 57                _return_http_data_only (bool): response data without head status
 58                    code and headers. Default is True.
 59                _preload_content (bool): if False, the urllib3.HTTPResponse object
 60                    will be returned without reading/decoding response data.
 61                    Default is True.
 62                _request_timeout (int/float/tuple): timeout setting for this request. If
 63                    one number provided, it will be total request timeout. It can also
 64                    be a pair (tuple) of (connection, read) timeouts.
 65                    Default is None.
 66                _check_input_type (bool): specifies if type checking
 67                    should be done one the data sent to the server.
 68                    Default is True.
 69                _check_return_type (bool): specifies if type checking
 70                    should be done one the data received from the server.
 71                    Default is True.
 72                _host_index (int/None): specifies the index of the server
 73                    that we want to use.
 74                    Default is read from the configuration.
 75                async_req (bool): execute request asynchronously
 76
 77            Returns:
 78                str
 79                    If the method is called asynchronously, returns the request
 80                    thread.
 81            """
 82            kwargs["async_req"] = kwargs.get("async_req", False)
 83            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
 84            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
 85            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
 86            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
 87            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
 88            kwargs["_host_index"] = kwargs.get("_host_index")
 89            kwargs["index_name"] = index_name
 90            return self.call_with_http_info(**kwargs)
 91
 92        self.configure_index = _Endpoint(
 93            settings={
 94                "response_type": (str,),
 95                "auth": ["ApiKeyAuth"],
 96                "endpoint_path": "/databases/{indexName}",
 97                "operation_id": "configure_index",
 98                "http_method": "PATCH",
 99                "servers": [
100                    {
101                        "url": "https://controller.{environment}.pinecone.io",
102                        "description": "No description provided",
103                        "variables": {
104                            "environment": {
105                                "description": "No description provided",
106                                "default_value": "unknown",
107                            }
108                        },
109                    },
110                ],
111            },
112            params_map={
113                "all": [
114                    "index_name",
115                    "patch_request",
116                ],
117                "required": [
118                    "index_name",
119                ],
120                "nullable": [],
121                "enum": [],
122                "validation": [],
123            },
124            root_map={
125                "validations": {},
126                "allowed_values": {},
127                "openapi_types": {
128                    "index_name": (str,),
129                    "patch_request": (PatchRequest,),
130                },
131                "attribute_map": {
132                    "index_name": "indexName",
133                },
134                "location_map": {
135                    "index_name": "path",
136                    "patch_request": "body",
137                },
138                "collection_format_map": {},
139            },
140            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
141            api_client=api_client,
142            callable=__configure_index,
143        )
144
145        def __create_collection(self, **kwargs):
146            """create_collection  # noqa: E501
147
148            This operation creates a Pinecone collection from an existing index.  # noqa: E501
149            This method makes a synchronous HTTP request by default. To make an
150            asynchronous HTTP request, please pass async_req=True
151
152            >>> thread = api.create_collection(async_req=True)
153            >>> result = thread.get()
154
155
156            Keyword Args:
157                create_collection_request (CreateCollectionRequest): [optional]
158                _return_http_data_only (bool): response data without head status
159                    code and headers. Default is True.
160                _preload_content (bool): if False, the urllib3.HTTPResponse object
161                    will be returned without reading/decoding response data.
162                    Default is True.
163                _request_timeout (int/float/tuple): timeout setting for this request. If
164                    one number provided, it will be total request timeout. It can also
165                    be a pair (tuple) of (connection, read) timeouts.
166                    Default is None.
167                _check_input_type (bool): specifies if type checking
168                    should be done one the data sent to the server.
169                    Default is True.
170                _check_return_type (bool): specifies if type checking
171                    should be done one the data received from the server.
172                    Default is True.
173                _host_index (int/None): specifies the index of the server
174                    that we want to use.
175                    Default is read from the configuration.
176                async_req (bool): execute request asynchronously
177
178            Returns:
179                str
180                    If the method is called asynchronously, returns the request
181                    thread.
182            """
183            kwargs["async_req"] = kwargs.get("async_req", False)
184            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
185            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
186            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
187            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
188            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
189            kwargs["_host_index"] = kwargs.get("_host_index")
190            return self.call_with_http_info(**kwargs)
191
192        self.create_collection = _Endpoint(
193            settings={
194                "response_type": (str,),
195                "auth": ["ApiKeyAuth"],
196                "endpoint_path": "/collections",
197                "operation_id": "create_collection",
198                "http_method": "POST",
199                "servers": [
200                    {
201                        "url": "https://controller.{environment}.pinecone.io",
202                        "description": "No description provided",
203                        "variables": {
204                            "environment": {
205                                "description": "No description provided",
206                                "default_value": "unknown",
207                            }
208                        },
209                    },
210                ],
211            },
212            params_map={
213                "all": [
214                    "create_collection_request",
215                ],
216                "required": [],
217                "nullable": [],
218                "enum": [],
219                "validation": [],
220            },
221            root_map={
222                "validations": {},
223                "allowed_values": {},
224                "openapi_types": {
225                    "create_collection_request": (CreateCollectionRequest,),
226                },
227                "attribute_map": {},
228                "location_map": {
229                    "create_collection_request": "body",
230                },
231                "collection_format_map": {},
232            },
233            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
234            api_client=api_client,
235            callable=__create_collection,
236        )
237
238        def __create_index(self, **kwargs):
239            """create_index  # noqa: E501
240
241            This operation creates a Pinecone index. Specify the distance metric, the dimension of vectors to be stored in the index, the numbers replicas to use, and the collection from which to create the index, if applicable.  # noqa: E501
242            This method makes a synchronous HTTP request by default. To make an
243            asynchronous HTTP request, please pass async_req=True
244
245            >>> thread = api.create_index(async_req=True)
246            >>> result = thread.get()
247
248
249            Keyword Args:
250                create_request (CreateRequest): [optional]
251                _return_http_data_only (bool): response data without head status
252                    code and headers. Default is True.
253                _preload_content (bool): if False, the urllib3.HTTPResponse object
254                    will be returned without reading/decoding response data.
255                    Default is True.
256                _request_timeout (int/float/tuple): timeout setting for this request. If
257                    one number provided, it will be total request timeout. It can also
258                    be a pair (tuple) of (connection, read) timeouts.
259                    Default is None.
260                _check_input_type (bool): specifies if type checking
261                    should be done one the data sent to the server.
262                    Default is True.
263                _check_return_type (bool): specifies if type checking
264                    should be done one the data received from the server.
265                    Default is True.
266                _host_index (int/None): specifies the index of the server
267                    that we want to use.
268                    Default is read from the configuration.
269                async_req (bool): execute request asynchronously
270
271            Returns:
272                str
273                    If the method is called asynchronously, returns the request
274                    thread.
275            """
276            kwargs["async_req"] = kwargs.get("async_req", False)
277            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
278            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
279            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
280            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
281            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
282            kwargs["_host_index"] = kwargs.get("_host_index")
283            return self.call_with_http_info(**kwargs)
284
285        self.create_index = _Endpoint(
286            settings={
287                "response_type": (str,),
288                "auth": ["ApiKeyAuth"],
289                "endpoint_path": "/databases",
290                "operation_id": "create_index",
291                "http_method": "POST",
292                "servers": [
293                    {
294                        "url": "https://controller.{environment}.pinecone.io",
295                        "description": "No description provided",
296                        "variables": {
297                            "environment": {
298                                "description": "No description provided",
299                                "default_value": "unknown",
300                            }
301                        },
302                    },
303                ],
304            },
305            params_map={
306                "all": [
307                    "create_request",
308                ],
309                "required": [],
310                "nullable": [],
311                "enum": [],
312                "validation": [],
313            },
314            root_map={
315                "validations": {},
316                "allowed_values": {},
317                "openapi_types": {
318                    "create_request": (CreateRequest,),
319                },
320                "attribute_map": {},
321                "location_map": {
322                    "create_request": "body",
323                },
324                "collection_format_map": {},
325            },
326            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
327            api_client=api_client,
328            callable=__create_index,
329        )
330
331        def __delete_collection(self, collection_name, **kwargs):
332            """delete_collection  # noqa: E501
333
334            This operation deletes an existing collection.  # noqa: E501
335            This method makes a synchronous HTTP request by default. To make an
336            asynchronous HTTP request, please pass async_req=True
337
338            >>> thread = api.delete_collection(collection_name, async_req=True)
339            >>> result = thread.get()
340
341            Args:
342                collection_name (str): The name of the collection
343
344            Keyword Args:
345                _return_http_data_only (bool): response data without head status
346                    code and headers. Default is True.
347                _preload_content (bool): if False, the urllib3.HTTPResponse object
348                    will be returned without reading/decoding response data.
349                    Default is True.
350                _request_timeout (int/float/tuple): timeout setting for this request. If
351                    one number provided, it will be total request timeout. It can also
352                    be a pair (tuple) of (connection, read) timeouts.
353                    Default is None.
354                _check_input_type (bool): specifies if type checking
355                    should be done one the data sent to the server.
356                    Default is True.
357                _check_return_type (bool): specifies if type checking
358                    should be done one the data received from the server.
359                    Default is True.
360                _host_index (int/None): specifies the index of the server
361                    that we want to use.
362                    Default is read from the configuration.
363                async_req (bool): execute request asynchronously
364
365            Returns:
366                str
367                    If the method is called asynchronously, returns the request
368                    thread.
369            """
370            kwargs["async_req"] = kwargs.get("async_req", False)
371            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
372            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
373            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
374            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
375            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
376            kwargs["_host_index"] = kwargs.get("_host_index")
377            kwargs["collection_name"] = collection_name
378            return self.call_with_http_info(**kwargs)
379
380        self.delete_collection = _Endpoint(
381            settings={
382                "response_type": (str,),
383                "auth": ["ApiKeyAuth"],
384                "endpoint_path": "/collections/{collectionName}",
385                "operation_id": "delete_collection",
386                "http_method": "DELETE",
387                "servers": [
388                    {
389                        "url": "https://controller.{environment}.pinecone.io",
390                        "description": "No description provided",
391                        "variables": {
392                            "environment": {
393                                "description": "No description provided",
394                                "default_value": "unknown",
395                            }
396                        },
397                    },
398                ],
399            },
400            params_map={
401                "all": [
402                    "collection_name",
403                ],
404                "required": [
405                    "collection_name",
406                ],
407                "nullable": [],
408                "enum": [],
409                "validation": [],
410            },
411            root_map={
412                "validations": {},
413                "allowed_values": {},
414                "openapi_types": {
415                    "collection_name": (str,),
416                },
417                "attribute_map": {
418                    "collection_name": "collectionName",
419                },
420                "location_map": {
421                    "collection_name": "path",
422                },
423                "collection_format_map": {},
424            },
425            headers_map={
426                "accept": ["text/plain"],
427                "content_type": [],
428            },
429            api_client=api_client,
430            callable=__delete_collection,
431        )
432
433        def __delete_index(self, index_name, **kwargs):
434            """delete_index  # noqa: E501
435
436            This operation deletes an existing index.  # noqa: E501
437            This method makes a synchronous HTTP request by default. To make an
438            asynchronous HTTP request, please pass async_req=True
439
440            >>> thread = api.delete_index(index_name, async_req=True)
441            >>> result = thread.get()
442
443            Args:
444                index_name (str): The name of the index
445
446            Keyword Args:
447                _return_http_data_only (bool): response data without head status
448                    code and headers. Default is True.
449                _preload_content (bool): if False, the urllib3.HTTPResponse object
450                    will be returned without reading/decoding response data.
451                    Default is True.
452                _request_timeout (int/float/tuple): timeout setting for this request. If
453                    one number provided, it will be total request timeout. It can also
454                    be a pair (tuple) of (connection, read) timeouts.
455                    Default is None.
456                _check_input_type (bool): specifies if type checking
457                    should be done one the data sent to the server.
458                    Default is True.
459                _check_return_type (bool): specifies if type checking
460                    should be done one the data received from the server.
461                    Default is True.
462                _host_index (int/None): specifies the index of the server
463                    that we want to use.
464                    Default is read from the configuration.
465                async_req (bool): execute request asynchronously
466
467            Returns:
468                str
469                    If the method is called asynchronously, returns the request
470                    thread.
471            """
472            kwargs["async_req"] = kwargs.get("async_req", False)
473            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
474            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
475            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
476            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
477            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
478            kwargs["_host_index"] = kwargs.get("_host_index")
479            kwargs["index_name"] = index_name
480            return self.call_with_http_info(**kwargs)
481
482        self.delete_index = _Endpoint(
483            settings={
484                "response_type": (str,),
485                "auth": ["ApiKeyAuth"],
486                "endpoint_path": "/databases/{indexName}",
487                "operation_id": "delete_index",
488                "http_method": "DELETE",
489                "servers": [
490                    {
491                        "url": "https://controller.{environment}.pinecone.io",
492                        "description": "No description provided",
493                        "variables": {
494                            "environment": {
495                                "description": "No description provided",
496                                "default_value": "unknown",
497                            }
498                        },
499                    },
500                ],
501            },
502            params_map={
503                "all": [
504                    "index_name",
505                ],
506                "required": [
507                    "index_name",
508                ],
509                "nullable": [],
510                "enum": [],
511                "validation": [],
512            },
513            root_map={
514                "validations": {},
515                "allowed_values": {},
516                "openapi_types": {
517                    "index_name": (str,),
518                },
519                "attribute_map": {
520                    "index_name": "indexName",
521                },
522                "location_map": {
523                    "index_name": "path",
524                },
525                "collection_format_map": {},
526            },
527            headers_map={
528                "accept": ["text/plain"],
529                "content_type": [],
530            },
531            api_client=api_client,
532            callable=__delete_index,
533        )
534
535        def __describe_collection(self, collection_name, **kwargs):
536            """describe_collection  # noqa: E501
537
538            Get a description of a collection, including the name, size, and status.  # noqa: E501
539            This method makes a synchronous HTTP request by default. To make an
540            asynchronous HTTP request, please pass async_req=True
541
542            >>> thread = api.describe_collection(collection_name, async_req=True)
543            >>> result = thread.get()
544
545            Args:
546                collection_name (str): The name of the collection
547
548            Keyword Args:
549                _return_http_data_only (bool): response data without head status
550                    code and headers. Default is True.
551                _preload_content (bool): if False, the urllib3.HTTPResponse object
552                    will be returned without reading/decoding response data.
553                    Default is True.
554                _request_timeout (int/float/tuple): timeout setting for this request. If
555                    one number provided, it will be total request timeout. It can also
556                    be a pair (tuple) of (connection, read) timeouts.
557                    Default is None.
558                _check_input_type (bool): specifies if type checking
559                    should be done one the data sent to the server.
560                    Default is True.
561                _check_return_type (bool): specifies if type checking
562                    should be done one the data received from the server.
563                    Default is True.
564                _host_index (int/None): specifies the index of the server
565                    that we want to use.
566                    Default is read from the configuration.
567                async_req (bool): execute request asynchronously
568
569            Returns:
570                CollectionMeta
571                    If the method is called asynchronously, returns the request
572                    thread.
573            """
574            kwargs["async_req"] = kwargs.get("async_req", False)
575            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
576            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
577            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
578            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
579            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
580            kwargs["_host_index"] = kwargs.get("_host_index")
581            kwargs["collection_name"] = collection_name
582            return self.call_with_http_info(**kwargs)
583
584        self.describe_collection = _Endpoint(
585            settings={
586                "response_type": (CollectionMeta,),
587                "auth": ["ApiKeyAuth"],
588                "endpoint_path": "/collections/{collectionName}",
589                "operation_id": "describe_collection",
590                "http_method": "GET",
591                "servers": [
592                    {
593                        "url": "https://controller.{environment}.pinecone.io",
594                        "description": "No description provided",
595                        "variables": {
596                            "environment": {
597                                "description": "No description provided",
598                                "default_value": "unknown",
599                            }
600                        },
601                    },
602                ],
603            },
604            params_map={
605                "all": [
606                    "collection_name",
607                ],
608                "required": [
609                    "collection_name",
610                ],
611                "nullable": [],
612                "enum": [],
613                "validation": [],
614            },
615            root_map={
616                "validations": {},
617                "allowed_values": {},
618                "openapi_types": {
619                    "collection_name": (str,),
620                },
621                "attribute_map": {
622                    "collection_name": "collectionName",
623                },
624                "location_map": {
625                    "collection_name": "path",
626                },
627                "collection_format_map": {},
628            },
629            headers_map={
630                "accept": ["application/json"],
631                "content_type": [],
632            },
633            api_client=api_client,
634            callable=__describe_collection,
635        )
636
637        def __describe_index(self, index_name, **kwargs):
638            """describe_index  # noqa: E501
639
640            Get a description of an index, including dimension, distance metric, number of replicas, and more.  # noqa: E501
641            This method makes a synchronous HTTP request by default. To make an
642            asynchronous HTTP request, please pass async_req=True
643
644            >>> thread = api.describe_index(index_name, async_req=True)
645            >>> result = thread.get()
646
647            Args:
648                index_name (str): The name of the index
649
650            Keyword Args:
651                _return_http_data_only (bool): response data without head status
652                    code and headers. Default is True.
653                _preload_content (bool): if False, the urllib3.HTTPResponse object
654                    will be returned without reading/decoding response data.
655                    Default is True.
656                _request_timeout (int/float/tuple): timeout setting for this request. If
657                    one number provided, it will be total request timeout. It can also
658                    be a pair (tuple) of (connection, read) timeouts.
659                    Default is None.
660                _check_input_type (bool): specifies if type checking
661                    should be done one the data sent to the server.
662                    Default is True.
663                _check_return_type (bool): specifies if type checking
664                    should be done one the data received from the server.
665                    Default is True.
666                _host_index (int/None): specifies the index of the server
667                    that we want to use.
668                    Default is read from the configuration.
669                async_req (bool): execute request asynchronously
670
671            Returns:
672                IndexMeta
673                    If the method is called asynchronously, returns the request
674                    thread.
675            """
676            kwargs["async_req"] = kwargs.get("async_req", False)
677            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
678            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
679            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
680            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
681            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
682            kwargs["_host_index"] = kwargs.get("_host_index")
683            kwargs["index_name"] = index_name
684            return self.call_with_http_info(**kwargs)
685
686        self.describe_index = _Endpoint(
687            settings={
688                "response_type": (IndexMeta,),
689                "auth": ["ApiKeyAuth"],
690                "endpoint_path": "/databases/{indexName}",
691                "operation_id": "describe_index",
692                "http_method": "GET",
693                "servers": [
694                    {
695                        "url": "https://controller.{environment}.pinecone.io",
696                        "description": "No description provided",
697                        "variables": {
698                            "environment": {
699                                "description": "No description provided",
700                                "default_value": "unknown",
701                            }
702                        },
703                    },
704                ],
705            },
706            params_map={
707                "all": [
708                    "index_name",
709                ],
710                "required": [
711                    "index_name",
712                ],
713                "nullable": [],
714                "enum": [],
715                "validation": [],
716            },
717            root_map={
718                "validations": {},
719                "allowed_values": {},
720                "openapi_types": {
721                    "index_name": (str,),
722                },
723                "attribute_map": {
724                    "index_name": "indexName",
725                },
726                "location_map": {
727                    "index_name": "path",
728                },
729                "collection_format_map": {},
730            },
731            headers_map={
732                "accept": ["application/json"],
733                "content_type": [],
734            },
735            api_client=api_client,
736            callable=__describe_index,
737        )
738
739        def __list_collections(self, **kwargs):
740            """list_collections  # noqa: E501
741
742            This operation returns a list of your Pinecone collections.  # noqa: E501
743            This method makes a synchronous HTTP request by default. To make an
744            asynchronous HTTP request, please pass async_req=True
745
746            >>> thread = api.list_collections(async_req=True)
747            >>> result = thread.get()
748
749
750            Keyword Args:
751                _return_http_data_only (bool): response data without head status
752                    code and headers. Default is True.
753                _preload_content (bool): if False, the urllib3.HTTPResponse object
754                    will be returned without reading/decoding response data.
755                    Default is True.
756                _request_timeout (int/float/tuple): timeout setting for this request. If
757                    one number provided, it will be total request timeout. It can also
758                    be a pair (tuple) of (connection, read) timeouts.
759                    Default is None.
760                _check_input_type (bool): specifies if type checking
761                    should be done one the data sent to the server.
762                    Default is True.
763                _check_return_type (bool): specifies if type checking
764                    should be done one the data received from the server.
765                    Default is True.
766                _host_index (int/None): specifies the index of the server
767                    that we want to use.
768                    Default is read from the configuration.
769                async_req (bool): execute request asynchronously
770
771            Returns:
772                [str]
773                    If the method is called asynchronously, returns the request
774                    thread.
775            """
776            kwargs["async_req"] = kwargs.get("async_req", False)
777            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
778            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
779            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
780            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
781            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
782            kwargs["_host_index"] = kwargs.get("_host_index")
783            return self.call_with_http_info(**kwargs)
784
785        self.list_collections = _Endpoint(
786            settings={
787                "response_type": ([str],),
788                "auth": ["ApiKeyAuth"],
789                "endpoint_path": "/collections",
790                "operation_id": "list_collections",
791                "http_method": "GET",
792                "servers": [
793                    {
794                        "url": "https://controller.{environment}.pinecone.io",
795                        "description": "No description provided",
796                        "variables": {
797                            "environment": {
798                                "description": "No description provided",
799                                "default_value": "unknown",
800                            }
801                        },
802                    },
803                ],
804            },
805            params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
806            root_map={
807                "validations": {},
808                "allowed_values": {},
809                "openapi_types": {},
810                "attribute_map": {},
811                "location_map": {},
812                "collection_format_map": {},
813            },
814            headers_map={
815                "accept": ["application/json; charset=utf-8"],
816                "content_type": [],
817            },
818            api_client=api_client,
819            callable=__list_collections,
820        )
821
822        def __list_indexes(self, **kwargs):
823            """list_indexes  # noqa: E501
824
825            This operation returns a list of the indexes in the current project.  # noqa: E501
826            This method makes a synchronous HTTP request by default. To make an
827            asynchronous HTTP request, please pass async_req=True
828
829            >>> thread = api.list_indexes(async_req=True)
830            >>> result = thread.get()
831
832
833            Keyword Args:
834                _return_http_data_only (bool): response data without head status
835                    code and headers. Default is True.
836                _preload_content (bool): if False, the urllib3.HTTPResponse object
837                    will be returned without reading/decoding response data.
838                    Default is True.
839                _request_timeout (int/float/tuple): timeout setting for this request. If
840                    one number provided, it will be total request timeout. It can also
841                    be a pair (tuple) of (connection, read) timeouts.
842                    Default is None.
843                _check_input_type (bool): specifies if type checking
844                    should be done one the data sent to the server.
845                    Default is True.
846                _check_return_type (bool): specifies if type checking
847                    should be done one the data received from the server.
848                    Default is True.
849                _host_index (int/None): specifies the index of the server
850                    that we want to use.
851                    Default is read from the configuration.
852                async_req (bool): execute request asynchronously
853
854            Returns:
855                [str]
856                    If the method is called asynchronously, returns the request
857                    thread.
858            """
859            kwargs["async_req"] = kwargs.get("async_req", False)
860            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
861            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
862            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
863            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
864            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
865            kwargs["_host_index"] = kwargs.get("_host_index")
866            return self.call_with_http_info(**kwargs)
867
868        self.list_indexes = _Endpoint(
869            settings={
870                "response_type": ([str],),
871                "auth": ["ApiKeyAuth"],
872                "endpoint_path": "/databases",
873                "operation_id": "list_indexes",
874                "http_method": "GET",
875                "servers": [
876                    {
877                        "url": "https://controller.{environment}.pinecone.io",
878                        "description": "No description provided",
879                        "variables": {
880                            "environment": {
881                                "description": "No description provided",
882                                "default_value": "unknown",
883                            }
884                        },
885                    },
886                ],
887            },
888            params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
889            root_map={
890                "validations": {},
891                "allowed_values": {},
892                "openapi_types": {},
893                "attribute_map": {},
894                "location_map": {},
895                "collection_format_map": {},
896            },
897            headers_map={
898                "accept": ["application/json; charset=utf-8"],
899                "content_type": [],
900            },
901            api_client=api_client,
902            callable=__list_indexes,
903        )
class IndexOperationsApi:
 31class IndexOperationsApi(object):
 32    """NOTE: This class is auto generated by OpenAPI Generator
 33    Ref: https://openapi-generator.tech
 34
 35    Do not edit the class manually.
 36    """
 37
 38    def __init__(self, api_client=None):
 39        if api_client is None:
 40            api_client = ApiClient()
 41        self.api_client = api_client
 42
 43        def __configure_index(self, index_name, **kwargs):
 44            """configure_index  # noqa: E501
 45
 46            This operation specifies the pod type and number of replicas for an index.  # noqa: E501
 47            This method makes a synchronous HTTP request by default. To make an
 48            asynchronous HTTP request, please pass async_req=True
 49
 50            >>> thread = api.configure_index(index_name, async_req=True)
 51            >>> result = thread.get()
 52
 53            Args:
 54                index_name (str): The name of the index
 55
 56            Keyword Args:
 57                patch_request (PatchRequest): The desired pod type and replica configuration for the index.. [optional]
 58                _return_http_data_only (bool): response data without head status
 59                    code and headers. Default is True.
 60                _preload_content (bool): if False, the urllib3.HTTPResponse object
 61                    will be returned without reading/decoding response data.
 62                    Default is True.
 63                _request_timeout (int/float/tuple): timeout setting for this request. If
 64                    one number provided, it will be total request timeout. It can also
 65                    be a pair (tuple) of (connection, read) timeouts.
 66                    Default is None.
 67                _check_input_type (bool): specifies if type checking
 68                    should be done one the data sent to the server.
 69                    Default is True.
 70                _check_return_type (bool): specifies if type checking
 71                    should be done one the data received from the server.
 72                    Default is True.
 73                _host_index (int/None): specifies the index of the server
 74                    that we want to use.
 75                    Default is read from the configuration.
 76                async_req (bool): execute request asynchronously
 77
 78            Returns:
 79                str
 80                    If the method is called asynchronously, returns the request
 81                    thread.
 82            """
 83            kwargs["async_req"] = kwargs.get("async_req", False)
 84            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
 85            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
 86            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
 87            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
 88            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
 89            kwargs["_host_index"] = kwargs.get("_host_index")
 90            kwargs["index_name"] = index_name
 91            return self.call_with_http_info(**kwargs)
 92
 93        self.configure_index = _Endpoint(
 94            settings={
 95                "response_type": (str,),
 96                "auth": ["ApiKeyAuth"],
 97                "endpoint_path": "/databases/{indexName}",
 98                "operation_id": "configure_index",
 99                "http_method": "PATCH",
100                "servers": [
101                    {
102                        "url": "https://controller.{environment}.pinecone.io",
103                        "description": "No description provided",
104                        "variables": {
105                            "environment": {
106                                "description": "No description provided",
107                                "default_value": "unknown",
108                            }
109                        },
110                    },
111                ],
112            },
113            params_map={
114                "all": [
115                    "index_name",
116                    "patch_request",
117                ],
118                "required": [
119                    "index_name",
120                ],
121                "nullable": [],
122                "enum": [],
123                "validation": [],
124            },
125            root_map={
126                "validations": {},
127                "allowed_values": {},
128                "openapi_types": {
129                    "index_name": (str,),
130                    "patch_request": (PatchRequest,),
131                },
132                "attribute_map": {
133                    "index_name": "indexName",
134                },
135                "location_map": {
136                    "index_name": "path",
137                    "patch_request": "body",
138                },
139                "collection_format_map": {},
140            },
141            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
142            api_client=api_client,
143            callable=__configure_index,
144        )
145
146        def __create_collection(self, **kwargs):
147            """create_collection  # noqa: E501
148
149            This operation creates a Pinecone collection from an existing index.  # noqa: E501
150            This method makes a synchronous HTTP request by default. To make an
151            asynchronous HTTP request, please pass async_req=True
152
153            >>> thread = api.create_collection(async_req=True)
154            >>> result = thread.get()
155
156
157            Keyword Args:
158                create_collection_request (CreateCollectionRequest): [optional]
159                _return_http_data_only (bool): response data without head status
160                    code and headers. Default is True.
161                _preload_content (bool): if False, the urllib3.HTTPResponse object
162                    will be returned without reading/decoding response data.
163                    Default is True.
164                _request_timeout (int/float/tuple): timeout setting for this request. If
165                    one number provided, it will be total request timeout. It can also
166                    be a pair (tuple) of (connection, read) timeouts.
167                    Default is None.
168                _check_input_type (bool): specifies if type checking
169                    should be done one the data sent to the server.
170                    Default is True.
171                _check_return_type (bool): specifies if type checking
172                    should be done one the data received from the server.
173                    Default is True.
174                _host_index (int/None): specifies the index of the server
175                    that we want to use.
176                    Default is read from the configuration.
177                async_req (bool): execute request asynchronously
178
179            Returns:
180                str
181                    If the method is called asynchronously, returns the request
182                    thread.
183            """
184            kwargs["async_req"] = kwargs.get("async_req", False)
185            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
186            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
187            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
188            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
189            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
190            kwargs["_host_index"] = kwargs.get("_host_index")
191            return self.call_with_http_info(**kwargs)
192
193        self.create_collection = _Endpoint(
194            settings={
195                "response_type": (str,),
196                "auth": ["ApiKeyAuth"],
197                "endpoint_path": "/collections",
198                "operation_id": "create_collection",
199                "http_method": "POST",
200                "servers": [
201                    {
202                        "url": "https://controller.{environment}.pinecone.io",
203                        "description": "No description provided",
204                        "variables": {
205                            "environment": {
206                                "description": "No description provided",
207                                "default_value": "unknown",
208                            }
209                        },
210                    },
211                ],
212            },
213            params_map={
214                "all": [
215                    "create_collection_request",
216                ],
217                "required": [],
218                "nullable": [],
219                "enum": [],
220                "validation": [],
221            },
222            root_map={
223                "validations": {},
224                "allowed_values": {},
225                "openapi_types": {
226                    "create_collection_request": (CreateCollectionRequest,),
227                },
228                "attribute_map": {},
229                "location_map": {
230                    "create_collection_request": "body",
231                },
232                "collection_format_map": {},
233            },
234            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
235            api_client=api_client,
236            callable=__create_collection,
237        )
238
239        def __create_index(self, **kwargs):
240            """create_index  # noqa: E501
241
242            This operation creates a Pinecone index. Specify the distance metric, the dimension of vectors to be stored in the index, the numbers replicas to use, and the collection from which to create the index, if applicable.  # noqa: E501
243            This method makes a synchronous HTTP request by default. To make an
244            asynchronous HTTP request, please pass async_req=True
245
246            >>> thread = api.create_index(async_req=True)
247            >>> result = thread.get()
248
249
250            Keyword Args:
251                create_request (CreateRequest): [optional]
252                _return_http_data_only (bool): response data without head status
253                    code and headers. Default is True.
254                _preload_content (bool): if False, the urllib3.HTTPResponse object
255                    will be returned without reading/decoding response data.
256                    Default is True.
257                _request_timeout (int/float/tuple): timeout setting for this request. If
258                    one number provided, it will be total request timeout. It can also
259                    be a pair (tuple) of (connection, read) timeouts.
260                    Default is None.
261                _check_input_type (bool): specifies if type checking
262                    should be done one the data sent to the server.
263                    Default is True.
264                _check_return_type (bool): specifies if type checking
265                    should be done one the data received from the server.
266                    Default is True.
267                _host_index (int/None): specifies the index of the server
268                    that we want to use.
269                    Default is read from the configuration.
270                async_req (bool): execute request asynchronously
271
272            Returns:
273                str
274                    If the method is called asynchronously, returns the request
275                    thread.
276            """
277            kwargs["async_req"] = kwargs.get("async_req", False)
278            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
279            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
280            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
281            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
282            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
283            kwargs["_host_index"] = kwargs.get("_host_index")
284            return self.call_with_http_info(**kwargs)
285
286        self.create_index = _Endpoint(
287            settings={
288                "response_type": (str,),
289                "auth": ["ApiKeyAuth"],
290                "endpoint_path": "/databases",
291                "operation_id": "create_index",
292                "http_method": "POST",
293                "servers": [
294                    {
295                        "url": "https://controller.{environment}.pinecone.io",
296                        "description": "No description provided",
297                        "variables": {
298                            "environment": {
299                                "description": "No description provided",
300                                "default_value": "unknown",
301                            }
302                        },
303                    },
304                ],
305            },
306            params_map={
307                "all": [
308                    "create_request",
309                ],
310                "required": [],
311                "nullable": [],
312                "enum": [],
313                "validation": [],
314            },
315            root_map={
316                "validations": {},
317                "allowed_values": {},
318                "openapi_types": {
319                    "create_request": (CreateRequest,),
320                },
321                "attribute_map": {},
322                "location_map": {
323                    "create_request": "body",
324                },
325                "collection_format_map": {},
326            },
327            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
328            api_client=api_client,
329            callable=__create_index,
330        )
331
332        def __delete_collection(self, collection_name, **kwargs):
333            """delete_collection  # noqa: E501
334
335            This operation deletes an existing collection.  # noqa: E501
336            This method makes a synchronous HTTP request by default. To make an
337            asynchronous HTTP request, please pass async_req=True
338
339            >>> thread = api.delete_collection(collection_name, async_req=True)
340            >>> result = thread.get()
341
342            Args:
343                collection_name (str): The name of the collection
344
345            Keyword Args:
346                _return_http_data_only (bool): response data without head status
347                    code and headers. Default is True.
348                _preload_content (bool): if False, the urllib3.HTTPResponse object
349                    will be returned without reading/decoding response data.
350                    Default is True.
351                _request_timeout (int/float/tuple): timeout setting for this request. If
352                    one number provided, it will be total request timeout. It can also
353                    be a pair (tuple) of (connection, read) timeouts.
354                    Default is None.
355                _check_input_type (bool): specifies if type checking
356                    should be done one the data sent to the server.
357                    Default is True.
358                _check_return_type (bool): specifies if type checking
359                    should be done one the data received from the server.
360                    Default is True.
361                _host_index (int/None): specifies the index of the server
362                    that we want to use.
363                    Default is read from the configuration.
364                async_req (bool): execute request asynchronously
365
366            Returns:
367                str
368                    If the method is called asynchronously, returns the request
369                    thread.
370            """
371            kwargs["async_req"] = kwargs.get("async_req", False)
372            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
373            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
374            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
375            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
376            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
377            kwargs["_host_index"] = kwargs.get("_host_index")
378            kwargs["collection_name"] = collection_name
379            return self.call_with_http_info(**kwargs)
380
381        self.delete_collection = _Endpoint(
382            settings={
383                "response_type": (str,),
384                "auth": ["ApiKeyAuth"],
385                "endpoint_path": "/collections/{collectionName}",
386                "operation_id": "delete_collection",
387                "http_method": "DELETE",
388                "servers": [
389                    {
390                        "url": "https://controller.{environment}.pinecone.io",
391                        "description": "No description provided",
392                        "variables": {
393                            "environment": {
394                                "description": "No description provided",
395                                "default_value": "unknown",
396                            }
397                        },
398                    },
399                ],
400            },
401            params_map={
402                "all": [
403                    "collection_name",
404                ],
405                "required": [
406                    "collection_name",
407                ],
408                "nullable": [],
409                "enum": [],
410                "validation": [],
411            },
412            root_map={
413                "validations": {},
414                "allowed_values": {},
415                "openapi_types": {
416                    "collection_name": (str,),
417                },
418                "attribute_map": {
419                    "collection_name": "collectionName",
420                },
421                "location_map": {
422                    "collection_name": "path",
423                },
424                "collection_format_map": {},
425            },
426            headers_map={
427                "accept": ["text/plain"],
428                "content_type": [],
429            },
430            api_client=api_client,
431            callable=__delete_collection,
432        )
433
434        def __delete_index(self, index_name, **kwargs):
435            """delete_index  # noqa: E501
436
437            This operation deletes an existing index.  # noqa: E501
438            This method makes a synchronous HTTP request by default. To make an
439            asynchronous HTTP request, please pass async_req=True
440
441            >>> thread = api.delete_index(index_name, async_req=True)
442            >>> result = thread.get()
443
444            Args:
445                index_name (str): The name of the index
446
447            Keyword Args:
448                _return_http_data_only (bool): response data without head status
449                    code and headers. Default is True.
450                _preload_content (bool): if False, the urllib3.HTTPResponse object
451                    will be returned without reading/decoding response data.
452                    Default is True.
453                _request_timeout (int/float/tuple): timeout setting for this request. If
454                    one number provided, it will be total request timeout. It can also
455                    be a pair (tuple) of (connection, read) timeouts.
456                    Default is None.
457                _check_input_type (bool): specifies if type checking
458                    should be done one the data sent to the server.
459                    Default is True.
460                _check_return_type (bool): specifies if type checking
461                    should be done one the data received from the server.
462                    Default is True.
463                _host_index (int/None): specifies the index of the server
464                    that we want to use.
465                    Default is read from the configuration.
466                async_req (bool): execute request asynchronously
467
468            Returns:
469                str
470                    If the method is called asynchronously, returns the request
471                    thread.
472            """
473            kwargs["async_req"] = kwargs.get("async_req", False)
474            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
475            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
476            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
477            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
478            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
479            kwargs["_host_index"] = kwargs.get("_host_index")
480            kwargs["index_name"] = index_name
481            return self.call_with_http_info(**kwargs)
482
483        self.delete_index = _Endpoint(
484            settings={
485                "response_type": (str,),
486                "auth": ["ApiKeyAuth"],
487                "endpoint_path": "/databases/{indexName}",
488                "operation_id": "delete_index",
489                "http_method": "DELETE",
490                "servers": [
491                    {
492                        "url": "https://controller.{environment}.pinecone.io",
493                        "description": "No description provided",
494                        "variables": {
495                            "environment": {
496                                "description": "No description provided",
497                                "default_value": "unknown",
498                            }
499                        },
500                    },
501                ],
502            },
503            params_map={
504                "all": [
505                    "index_name",
506                ],
507                "required": [
508                    "index_name",
509                ],
510                "nullable": [],
511                "enum": [],
512                "validation": [],
513            },
514            root_map={
515                "validations": {},
516                "allowed_values": {},
517                "openapi_types": {
518                    "index_name": (str,),
519                },
520                "attribute_map": {
521                    "index_name": "indexName",
522                },
523                "location_map": {
524                    "index_name": "path",
525                },
526                "collection_format_map": {},
527            },
528            headers_map={
529                "accept": ["text/plain"],
530                "content_type": [],
531            },
532            api_client=api_client,
533            callable=__delete_index,
534        )
535
536        def __describe_collection(self, collection_name, **kwargs):
537            """describe_collection  # noqa: E501
538
539            Get a description of a collection, including the name, size, and status.  # noqa: E501
540            This method makes a synchronous HTTP request by default. To make an
541            asynchronous HTTP request, please pass async_req=True
542
543            >>> thread = api.describe_collection(collection_name, async_req=True)
544            >>> result = thread.get()
545
546            Args:
547                collection_name (str): The name of the collection
548
549            Keyword Args:
550                _return_http_data_only (bool): response data without head status
551                    code and headers. Default is True.
552                _preload_content (bool): if False, the urllib3.HTTPResponse object
553                    will be returned without reading/decoding response data.
554                    Default is True.
555                _request_timeout (int/float/tuple): timeout setting for this request. If
556                    one number provided, it will be total request timeout. It can also
557                    be a pair (tuple) of (connection, read) timeouts.
558                    Default is None.
559                _check_input_type (bool): specifies if type checking
560                    should be done one the data sent to the server.
561                    Default is True.
562                _check_return_type (bool): specifies if type checking
563                    should be done one the data received from the server.
564                    Default is True.
565                _host_index (int/None): specifies the index of the server
566                    that we want to use.
567                    Default is read from the configuration.
568                async_req (bool): execute request asynchronously
569
570            Returns:
571                CollectionMeta
572                    If the method is called asynchronously, returns the request
573                    thread.
574            """
575            kwargs["async_req"] = kwargs.get("async_req", False)
576            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
577            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
578            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
579            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
580            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
581            kwargs["_host_index"] = kwargs.get("_host_index")
582            kwargs["collection_name"] = collection_name
583            return self.call_with_http_info(**kwargs)
584
585        self.describe_collection = _Endpoint(
586            settings={
587                "response_type": (CollectionMeta,),
588                "auth": ["ApiKeyAuth"],
589                "endpoint_path": "/collections/{collectionName}",
590                "operation_id": "describe_collection",
591                "http_method": "GET",
592                "servers": [
593                    {
594                        "url": "https://controller.{environment}.pinecone.io",
595                        "description": "No description provided",
596                        "variables": {
597                            "environment": {
598                                "description": "No description provided",
599                                "default_value": "unknown",
600                            }
601                        },
602                    },
603                ],
604            },
605            params_map={
606                "all": [
607                    "collection_name",
608                ],
609                "required": [
610                    "collection_name",
611                ],
612                "nullable": [],
613                "enum": [],
614                "validation": [],
615            },
616            root_map={
617                "validations": {},
618                "allowed_values": {},
619                "openapi_types": {
620                    "collection_name": (str,),
621                },
622                "attribute_map": {
623                    "collection_name": "collectionName",
624                },
625                "location_map": {
626                    "collection_name": "path",
627                },
628                "collection_format_map": {},
629            },
630            headers_map={
631                "accept": ["application/json"],
632                "content_type": [],
633            },
634            api_client=api_client,
635            callable=__describe_collection,
636        )
637
638        def __describe_index(self, index_name, **kwargs):
639            """describe_index  # noqa: E501
640
641            Get a description of an index, including dimension, distance metric, number of replicas, and more.  # noqa: E501
642            This method makes a synchronous HTTP request by default. To make an
643            asynchronous HTTP request, please pass async_req=True
644
645            >>> thread = api.describe_index(index_name, async_req=True)
646            >>> result = thread.get()
647
648            Args:
649                index_name (str): The name of the index
650
651            Keyword Args:
652                _return_http_data_only (bool): response data without head status
653                    code and headers. Default is True.
654                _preload_content (bool): if False, the urllib3.HTTPResponse object
655                    will be returned without reading/decoding response data.
656                    Default is True.
657                _request_timeout (int/float/tuple): timeout setting for this request. If
658                    one number provided, it will be total request timeout. It can also
659                    be a pair (tuple) of (connection, read) timeouts.
660                    Default is None.
661                _check_input_type (bool): specifies if type checking
662                    should be done one the data sent to the server.
663                    Default is True.
664                _check_return_type (bool): specifies if type checking
665                    should be done one the data received from the server.
666                    Default is True.
667                _host_index (int/None): specifies the index of the server
668                    that we want to use.
669                    Default is read from the configuration.
670                async_req (bool): execute request asynchronously
671
672            Returns:
673                IndexMeta
674                    If the method is called asynchronously, returns the request
675                    thread.
676            """
677            kwargs["async_req"] = kwargs.get("async_req", False)
678            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
679            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
680            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
681            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
682            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
683            kwargs["_host_index"] = kwargs.get("_host_index")
684            kwargs["index_name"] = index_name
685            return self.call_with_http_info(**kwargs)
686
687        self.describe_index = _Endpoint(
688            settings={
689                "response_type": (IndexMeta,),
690                "auth": ["ApiKeyAuth"],
691                "endpoint_path": "/databases/{indexName}",
692                "operation_id": "describe_index",
693                "http_method": "GET",
694                "servers": [
695                    {
696                        "url": "https://controller.{environment}.pinecone.io",
697                        "description": "No description provided",
698                        "variables": {
699                            "environment": {
700                                "description": "No description provided",
701                                "default_value": "unknown",
702                            }
703                        },
704                    },
705                ],
706            },
707            params_map={
708                "all": [
709                    "index_name",
710                ],
711                "required": [
712                    "index_name",
713                ],
714                "nullable": [],
715                "enum": [],
716                "validation": [],
717            },
718            root_map={
719                "validations": {},
720                "allowed_values": {},
721                "openapi_types": {
722                    "index_name": (str,),
723                },
724                "attribute_map": {
725                    "index_name": "indexName",
726                },
727                "location_map": {
728                    "index_name": "path",
729                },
730                "collection_format_map": {},
731            },
732            headers_map={
733                "accept": ["application/json"],
734                "content_type": [],
735            },
736            api_client=api_client,
737            callable=__describe_index,
738        )
739
740        def __list_collections(self, **kwargs):
741            """list_collections  # noqa: E501
742
743            This operation returns a list of your Pinecone collections.  # noqa: E501
744            This method makes a synchronous HTTP request by default. To make an
745            asynchronous HTTP request, please pass async_req=True
746
747            >>> thread = api.list_collections(async_req=True)
748            >>> result = thread.get()
749
750
751            Keyword Args:
752                _return_http_data_only (bool): response data without head status
753                    code and headers. Default is True.
754                _preload_content (bool): if False, the urllib3.HTTPResponse object
755                    will be returned without reading/decoding response data.
756                    Default is True.
757                _request_timeout (int/float/tuple): timeout setting for this request. If
758                    one number provided, it will be total request timeout. It can also
759                    be a pair (tuple) of (connection, read) timeouts.
760                    Default is None.
761                _check_input_type (bool): specifies if type checking
762                    should be done one the data sent to the server.
763                    Default is True.
764                _check_return_type (bool): specifies if type checking
765                    should be done one the data received from the server.
766                    Default is True.
767                _host_index (int/None): specifies the index of the server
768                    that we want to use.
769                    Default is read from the configuration.
770                async_req (bool): execute request asynchronously
771
772            Returns:
773                [str]
774                    If the method is called asynchronously, returns the request
775                    thread.
776            """
777            kwargs["async_req"] = kwargs.get("async_req", False)
778            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
779            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
780            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
781            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
782            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
783            kwargs["_host_index"] = kwargs.get("_host_index")
784            return self.call_with_http_info(**kwargs)
785
786        self.list_collections = _Endpoint(
787            settings={
788                "response_type": ([str],),
789                "auth": ["ApiKeyAuth"],
790                "endpoint_path": "/collections",
791                "operation_id": "list_collections",
792                "http_method": "GET",
793                "servers": [
794                    {
795                        "url": "https://controller.{environment}.pinecone.io",
796                        "description": "No description provided",
797                        "variables": {
798                            "environment": {
799                                "description": "No description provided",
800                                "default_value": "unknown",
801                            }
802                        },
803                    },
804                ],
805            },
806            params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
807            root_map={
808                "validations": {},
809                "allowed_values": {},
810                "openapi_types": {},
811                "attribute_map": {},
812                "location_map": {},
813                "collection_format_map": {},
814            },
815            headers_map={
816                "accept": ["application/json; charset=utf-8"],
817                "content_type": [],
818            },
819            api_client=api_client,
820            callable=__list_collections,
821        )
822
823        def __list_indexes(self, **kwargs):
824            """list_indexes  # noqa: E501
825
826            This operation returns a list of the indexes in the current project.  # noqa: E501
827            This method makes a synchronous HTTP request by default. To make an
828            asynchronous HTTP request, please pass async_req=True
829
830            >>> thread = api.list_indexes(async_req=True)
831            >>> result = thread.get()
832
833
834            Keyword Args:
835                _return_http_data_only (bool): response data without head status
836                    code and headers. Default is True.
837                _preload_content (bool): if False, the urllib3.HTTPResponse object
838                    will be returned without reading/decoding response data.
839                    Default is True.
840                _request_timeout (int/float/tuple): timeout setting for this request. If
841                    one number provided, it will be total request timeout. It can also
842                    be a pair (tuple) of (connection, read) timeouts.
843                    Default is None.
844                _check_input_type (bool): specifies if type checking
845                    should be done one the data sent to the server.
846                    Default is True.
847                _check_return_type (bool): specifies if type checking
848                    should be done one the data received from the server.
849                    Default is True.
850                _host_index (int/None): specifies the index of the server
851                    that we want to use.
852                    Default is read from the configuration.
853                async_req (bool): execute request asynchronously
854
855            Returns:
856                [str]
857                    If the method is called asynchronously, returns the request
858                    thread.
859            """
860            kwargs["async_req"] = kwargs.get("async_req", False)
861            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
862            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
863            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
864            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
865            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
866            kwargs["_host_index"] = kwargs.get("_host_index")
867            return self.call_with_http_info(**kwargs)
868
869        self.list_indexes = _Endpoint(
870            settings={
871                "response_type": ([str],),
872                "auth": ["ApiKeyAuth"],
873                "endpoint_path": "/databases",
874                "operation_id": "list_indexes",
875                "http_method": "GET",
876                "servers": [
877                    {
878                        "url": "https://controller.{environment}.pinecone.io",
879                        "description": "No description provided",
880                        "variables": {
881                            "environment": {
882                                "description": "No description provided",
883                                "default_value": "unknown",
884                            }
885                        },
886                    },
887                ],
888            },
889            params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
890            root_map={
891                "validations": {},
892                "allowed_values": {},
893                "openapi_types": {},
894                "attribute_map": {},
895                "location_map": {},
896                "collection_format_map": {},
897            },
898            headers_map={
899                "accept": ["application/json; charset=utf-8"],
900                "content_type": [],
901            },
902            api_client=api_client,
903            callable=__list_indexes,
904        )

NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech

Do not edit the class manually.

IndexOperationsApi(api_client=None)
 38    def __init__(self, api_client=None):
 39        if api_client is None:
 40            api_client = ApiClient()
 41        self.api_client = api_client
 42
 43        def __configure_index(self, index_name, **kwargs):
 44            """configure_index  # noqa: E501
 45
 46            This operation specifies the pod type and number of replicas for an index.  # noqa: E501
 47            This method makes a synchronous HTTP request by default. To make an
 48            asynchronous HTTP request, please pass async_req=True
 49
 50            >>> thread = api.configure_index(index_name, async_req=True)
 51            >>> result = thread.get()
 52
 53            Args:
 54                index_name (str): The name of the index
 55
 56            Keyword Args:
 57                patch_request (PatchRequest): The desired pod type and replica configuration for the index.. [optional]
 58                _return_http_data_only (bool): response data without head status
 59                    code and headers. Default is True.
 60                _preload_content (bool): if False, the urllib3.HTTPResponse object
 61                    will be returned without reading/decoding response data.
 62                    Default is True.
 63                _request_timeout (int/float/tuple): timeout setting for this request. If
 64                    one number provided, it will be total request timeout. It can also
 65                    be a pair (tuple) of (connection, read) timeouts.
 66                    Default is None.
 67                _check_input_type (bool): specifies if type checking
 68                    should be done one the data sent to the server.
 69                    Default is True.
 70                _check_return_type (bool): specifies if type checking
 71                    should be done one the data received from the server.
 72                    Default is True.
 73                _host_index (int/None): specifies the index of the server
 74                    that we want to use.
 75                    Default is read from the configuration.
 76                async_req (bool): execute request asynchronously
 77
 78            Returns:
 79                str
 80                    If the method is called asynchronously, returns the request
 81                    thread.
 82            """
 83            kwargs["async_req"] = kwargs.get("async_req", False)
 84            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
 85            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
 86            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
 87            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
 88            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
 89            kwargs["_host_index"] = kwargs.get("_host_index")
 90            kwargs["index_name"] = index_name
 91            return self.call_with_http_info(**kwargs)
 92
 93        self.configure_index = _Endpoint(
 94            settings={
 95                "response_type": (str,),
 96                "auth": ["ApiKeyAuth"],
 97                "endpoint_path": "/databases/{indexName}",
 98                "operation_id": "configure_index",
 99                "http_method": "PATCH",
100                "servers": [
101                    {
102                        "url": "https://controller.{environment}.pinecone.io",
103                        "description": "No description provided",
104                        "variables": {
105                            "environment": {
106                                "description": "No description provided",
107                                "default_value": "unknown",
108                            }
109                        },
110                    },
111                ],
112            },
113            params_map={
114                "all": [
115                    "index_name",
116                    "patch_request",
117                ],
118                "required": [
119                    "index_name",
120                ],
121                "nullable": [],
122                "enum": [],
123                "validation": [],
124            },
125            root_map={
126                "validations": {},
127                "allowed_values": {},
128                "openapi_types": {
129                    "index_name": (str,),
130                    "patch_request": (PatchRequest,),
131                },
132                "attribute_map": {
133                    "index_name": "indexName",
134                },
135                "location_map": {
136                    "index_name": "path",
137                    "patch_request": "body",
138                },
139                "collection_format_map": {},
140            },
141            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
142            api_client=api_client,
143            callable=__configure_index,
144        )
145
146        def __create_collection(self, **kwargs):
147            """create_collection  # noqa: E501
148
149            This operation creates a Pinecone collection from an existing index.  # noqa: E501
150            This method makes a synchronous HTTP request by default. To make an
151            asynchronous HTTP request, please pass async_req=True
152
153            >>> thread = api.create_collection(async_req=True)
154            >>> result = thread.get()
155
156
157            Keyword Args:
158                create_collection_request (CreateCollectionRequest): [optional]
159                _return_http_data_only (bool): response data without head status
160                    code and headers. Default is True.
161                _preload_content (bool): if False, the urllib3.HTTPResponse object
162                    will be returned without reading/decoding response data.
163                    Default is True.
164                _request_timeout (int/float/tuple): timeout setting for this request. If
165                    one number provided, it will be total request timeout. It can also
166                    be a pair (tuple) of (connection, read) timeouts.
167                    Default is None.
168                _check_input_type (bool): specifies if type checking
169                    should be done one the data sent to the server.
170                    Default is True.
171                _check_return_type (bool): specifies if type checking
172                    should be done one the data received from the server.
173                    Default is True.
174                _host_index (int/None): specifies the index of the server
175                    that we want to use.
176                    Default is read from the configuration.
177                async_req (bool): execute request asynchronously
178
179            Returns:
180                str
181                    If the method is called asynchronously, returns the request
182                    thread.
183            """
184            kwargs["async_req"] = kwargs.get("async_req", False)
185            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
186            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
187            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
188            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
189            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
190            kwargs["_host_index"] = kwargs.get("_host_index")
191            return self.call_with_http_info(**kwargs)
192
193        self.create_collection = _Endpoint(
194            settings={
195                "response_type": (str,),
196                "auth": ["ApiKeyAuth"],
197                "endpoint_path": "/collections",
198                "operation_id": "create_collection",
199                "http_method": "POST",
200                "servers": [
201                    {
202                        "url": "https://controller.{environment}.pinecone.io",
203                        "description": "No description provided",
204                        "variables": {
205                            "environment": {
206                                "description": "No description provided",
207                                "default_value": "unknown",
208                            }
209                        },
210                    },
211                ],
212            },
213            params_map={
214                "all": [
215                    "create_collection_request",
216                ],
217                "required": [],
218                "nullable": [],
219                "enum": [],
220                "validation": [],
221            },
222            root_map={
223                "validations": {},
224                "allowed_values": {},
225                "openapi_types": {
226                    "create_collection_request": (CreateCollectionRequest,),
227                },
228                "attribute_map": {},
229                "location_map": {
230                    "create_collection_request": "body",
231                },
232                "collection_format_map": {},
233            },
234            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
235            api_client=api_client,
236            callable=__create_collection,
237        )
238
239        def __create_index(self, **kwargs):
240            """create_index  # noqa: E501
241
242            This operation creates a Pinecone index. Specify the distance metric, the dimension of vectors to be stored in the index, the numbers replicas to use, and the collection from which to create the index, if applicable.  # noqa: E501
243            This method makes a synchronous HTTP request by default. To make an
244            asynchronous HTTP request, please pass async_req=True
245
246            >>> thread = api.create_index(async_req=True)
247            >>> result = thread.get()
248
249
250            Keyword Args:
251                create_request (CreateRequest): [optional]
252                _return_http_data_only (bool): response data without head status
253                    code and headers. Default is True.
254                _preload_content (bool): if False, the urllib3.HTTPResponse object
255                    will be returned without reading/decoding response data.
256                    Default is True.
257                _request_timeout (int/float/tuple): timeout setting for this request. If
258                    one number provided, it will be total request timeout. It can also
259                    be a pair (tuple) of (connection, read) timeouts.
260                    Default is None.
261                _check_input_type (bool): specifies if type checking
262                    should be done one the data sent to the server.
263                    Default is True.
264                _check_return_type (bool): specifies if type checking
265                    should be done one the data received from the server.
266                    Default is True.
267                _host_index (int/None): specifies the index of the server
268                    that we want to use.
269                    Default is read from the configuration.
270                async_req (bool): execute request asynchronously
271
272            Returns:
273                str
274                    If the method is called asynchronously, returns the request
275                    thread.
276            """
277            kwargs["async_req"] = kwargs.get("async_req", False)
278            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
279            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
280            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
281            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
282            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
283            kwargs["_host_index"] = kwargs.get("_host_index")
284            return self.call_with_http_info(**kwargs)
285
286        self.create_index = _Endpoint(
287            settings={
288                "response_type": (str,),
289                "auth": ["ApiKeyAuth"],
290                "endpoint_path": "/databases",
291                "operation_id": "create_index",
292                "http_method": "POST",
293                "servers": [
294                    {
295                        "url": "https://controller.{environment}.pinecone.io",
296                        "description": "No description provided",
297                        "variables": {
298                            "environment": {
299                                "description": "No description provided",
300                                "default_value": "unknown",
301                            }
302                        },
303                    },
304                ],
305            },
306            params_map={
307                "all": [
308                    "create_request",
309                ],
310                "required": [],
311                "nullable": [],
312                "enum": [],
313                "validation": [],
314            },
315            root_map={
316                "validations": {},
317                "allowed_values": {},
318                "openapi_types": {
319                    "create_request": (CreateRequest,),
320                },
321                "attribute_map": {},
322                "location_map": {
323                    "create_request": "body",
324                },
325                "collection_format_map": {},
326            },
327            headers_map={"accept": ["text/plain"], "content_type": ["application/json"]},
328            api_client=api_client,
329            callable=__create_index,
330        )
331
332        def __delete_collection(self, collection_name, **kwargs):
333            """delete_collection  # noqa: E501
334
335            This operation deletes an existing collection.  # noqa: E501
336            This method makes a synchronous HTTP request by default. To make an
337            asynchronous HTTP request, please pass async_req=True
338
339            >>> thread = api.delete_collection(collection_name, async_req=True)
340            >>> result = thread.get()
341
342            Args:
343                collection_name (str): The name of the collection
344
345            Keyword Args:
346                _return_http_data_only (bool): response data without head status
347                    code and headers. Default is True.
348                _preload_content (bool): if False, the urllib3.HTTPResponse object
349                    will be returned without reading/decoding response data.
350                    Default is True.
351                _request_timeout (int/float/tuple): timeout setting for this request. If
352                    one number provided, it will be total request timeout. It can also
353                    be a pair (tuple) of (connection, read) timeouts.
354                    Default is None.
355                _check_input_type (bool): specifies if type checking
356                    should be done one the data sent to the server.
357                    Default is True.
358                _check_return_type (bool): specifies if type checking
359                    should be done one the data received from the server.
360                    Default is True.
361                _host_index (int/None): specifies the index of the server
362                    that we want to use.
363                    Default is read from the configuration.
364                async_req (bool): execute request asynchronously
365
366            Returns:
367                str
368                    If the method is called asynchronously, returns the request
369                    thread.
370            """
371            kwargs["async_req"] = kwargs.get("async_req", False)
372            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
373            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
374            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
375            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
376            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
377            kwargs["_host_index"] = kwargs.get("_host_index")
378            kwargs["collection_name"] = collection_name
379            return self.call_with_http_info(**kwargs)
380
381        self.delete_collection = _Endpoint(
382            settings={
383                "response_type": (str,),
384                "auth": ["ApiKeyAuth"],
385                "endpoint_path": "/collections/{collectionName}",
386                "operation_id": "delete_collection",
387                "http_method": "DELETE",
388                "servers": [
389                    {
390                        "url": "https://controller.{environment}.pinecone.io",
391                        "description": "No description provided",
392                        "variables": {
393                            "environment": {
394                                "description": "No description provided",
395                                "default_value": "unknown",
396                            }
397                        },
398                    },
399                ],
400            },
401            params_map={
402                "all": [
403                    "collection_name",
404                ],
405                "required": [
406                    "collection_name",
407                ],
408                "nullable": [],
409                "enum": [],
410                "validation": [],
411            },
412            root_map={
413                "validations": {},
414                "allowed_values": {},
415                "openapi_types": {
416                    "collection_name": (str,),
417                },
418                "attribute_map": {
419                    "collection_name": "collectionName",
420                },
421                "location_map": {
422                    "collection_name": "path",
423                },
424                "collection_format_map": {},
425            },
426            headers_map={
427                "accept": ["text/plain"],
428                "content_type": [],
429            },
430            api_client=api_client,
431            callable=__delete_collection,
432        )
433
434        def __delete_index(self, index_name, **kwargs):
435            """delete_index  # noqa: E501
436
437            This operation deletes an existing index.  # noqa: E501
438            This method makes a synchronous HTTP request by default. To make an
439            asynchronous HTTP request, please pass async_req=True
440
441            >>> thread = api.delete_index(index_name, async_req=True)
442            >>> result = thread.get()
443
444            Args:
445                index_name (str): The name of the index
446
447            Keyword Args:
448                _return_http_data_only (bool): response data without head status
449                    code and headers. Default is True.
450                _preload_content (bool): if False, the urllib3.HTTPResponse object
451                    will be returned without reading/decoding response data.
452                    Default is True.
453                _request_timeout (int/float/tuple): timeout setting for this request. If
454                    one number provided, it will be total request timeout. It can also
455                    be a pair (tuple) of (connection, read) timeouts.
456                    Default is None.
457                _check_input_type (bool): specifies if type checking
458                    should be done one the data sent to the server.
459                    Default is True.
460                _check_return_type (bool): specifies if type checking
461                    should be done one the data received from the server.
462                    Default is True.
463                _host_index (int/None): specifies the index of the server
464                    that we want to use.
465                    Default is read from the configuration.
466                async_req (bool): execute request asynchronously
467
468            Returns:
469                str
470                    If the method is called asynchronously, returns the request
471                    thread.
472            """
473            kwargs["async_req"] = kwargs.get("async_req", False)
474            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
475            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
476            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
477            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
478            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
479            kwargs["_host_index"] = kwargs.get("_host_index")
480            kwargs["index_name"] = index_name
481            return self.call_with_http_info(**kwargs)
482
483        self.delete_index = _Endpoint(
484            settings={
485                "response_type": (str,),
486                "auth": ["ApiKeyAuth"],
487                "endpoint_path": "/databases/{indexName}",
488                "operation_id": "delete_index",
489                "http_method": "DELETE",
490                "servers": [
491                    {
492                        "url": "https://controller.{environment}.pinecone.io",
493                        "description": "No description provided",
494                        "variables": {
495                            "environment": {
496                                "description": "No description provided",
497                                "default_value": "unknown",
498                            }
499                        },
500                    },
501                ],
502            },
503            params_map={
504                "all": [
505                    "index_name",
506                ],
507                "required": [
508                    "index_name",
509                ],
510                "nullable": [],
511                "enum": [],
512                "validation": [],
513            },
514            root_map={
515                "validations": {},
516                "allowed_values": {},
517                "openapi_types": {
518                    "index_name": (str,),
519                },
520                "attribute_map": {
521                    "index_name": "indexName",
522                },
523                "location_map": {
524                    "index_name": "path",
525                },
526                "collection_format_map": {},
527            },
528            headers_map={
529                "accept": ["text/plain"],
530                "content_type": [],
531            },
532            api_client=api_client,
533            callable=__delete_index,
534        )
535
536        def __describe_collection(self, collection_name, **kwargs):
537            """describe_collection  # noqa: E501
538
539            Get a description of a collection, including the name, size, and status.  # noqa: E501
540            This method makes a synchronous HTTP request by default. To make an
541            asynchronous HTTP request, please pass async_req=True
542
543            >>> thread = api.describe_collection(collection_name, async_req=True)
544            >>> result = thread.get()
545
546            Args:
547                collection_name (str): The name of the collection
548
549            Keyword Args:
550                _return_http_data_only (bool): response data without head status
551                    code and headers. Default is True.
552                _preload_content (bool): if False, the urllib3.HTTPResponse object
553                    will be returned without reading/decoding response data.
554                    Default is True.
555                _request_timeout (int/float/tuple): timeout setting for this request. If
556                    one number provided, it will be total request timeout. It can also
557                    be a pair (tuple) of (connection, read) timeouts.
558                    Default is None.
559                _check_input_type (bool): specifies if type checking
560                    should be done one the data sent to the server.
561                    Default is True.
562                _check_return_type (bool): specifies if type checking
563                    should be done one the data received from the server.
564                    Default is True.
565                _host_index (int/None): specifies the index of the server
566                    that we want to use.
567                    Default is read from the configuration.
568                async_req (bool): execute request asynchronously
569
570            Returns:
571                CollectionMeta
572                    If the method is called asynchronously, returns the request
573                    thread.
574            """
575            kwargs["async_req"] = kwargs.get("async_req", False)
576            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
577            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
578            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
579            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
580            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
581            kwargs["_host_index"] = kwargs.get("_host_index")
582            kwargs["collection_name"] = collection_name
583            return self.call_with_http_info(**kwargs)
584
585        self.describe_collection = _Endpoint(
586            settings={
587                "response_type": (CollectionMeta,),
588                "auth": ["ApiKeyAuth"],
589                "endpoint_path": "/collections/{collectionName}",
590                "operation_id": "describe_collection",
591                "http_method": "GET",
592                "servers": [
593                    {
594                        "url": "https://controller.{environment}.pinecone.io",
595                        "description": "No description provided",
596                        "variables": {
597                            "environment": {
598                                "description": "No description provided",
599                                "default_value": "unknown",
600                            }
601                        },
602                    },
603                ],
604            },
605            params_map={
606                "all": [
607                    "collection_name",
608                ],
609                "required": [
610                    "collection_name",
611                ],
612                "nullable": [],
613                "enum": [],
614                "validation": [],
615            },
616            root_map={
617                "validations": {},
618                "allowed_values": {},
619                "openapi_types": {
620                    "collection_name": (str,),
621                },
622                "attribute_map": {
623                    "collection_name": "collectionName",
624                },
625                "location_map": {
626                    "collection_name": "path",
627                },
628                "collection_format_map": {},
629            },
630            headers_map={
631                "accept": ["application/json"],
632                "content_type": [],
633            },
634            api_client=api_client,
635            callable=__describe_collection,
636        )
637
638        def __describe_index(self, index_name, **kwargs):
639            """describe_index  # noqa: E501
640
641            Get a description of an index, including dimension, distance metric, number of replicas, and more.  # noqa: E501
642            This method makes a synchronous HTTP request by default. To make an
643            asynchronous HTTP request, please pass async_req=True
644
645            >>> thread = api.describe_index(index_name, async_req=True)
646            >>> result = thread.get()
647
648            Args:
649                index_name (str): The name of the index
650
651            Keyword Args:
652                _return_http_data_only (bool): response data without head status
653                    code and headers. Default is True.
654                _preload_content (bool): if False, the urllib3.HTTPResponse object
655                    will be returned without reading/decoding response data.
656                    Default is True.
657                _request_timeout (int/float/tuple): timeout setting for this request. If
658                    one number provided, it will be total request timeout. It can also
659                    be a pair (tuple) of (connection, read) timeouts.
660                    Default is None.
661                _check_input_type (bool): specifies if type checking
662                    should be done one the data sent to the server.
663                    Default is True.
664                _check_return_type (bool): specifies if type checking
665                    should be done one the data received from the server.
666                    Default is True.
667                _host_index (int/None): specifies the index of the server
668                    that we want to use.
669                    Default is read from the configuration.
670                async_req (bool): execute request asynchronously
671
672            Returns:
673                IndexMeta
674                    If the method is called asynchronously, returns the request
675                    thread.
676            """
677            kwargs["async_req"] = kwargs.get("async_req", False)
678            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
679            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
680            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
681            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
682            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
683            kwargs["_host_index"] = kwargs.get("_host_index")
684            kwargs["index_name"] = index_name
685            return self.call_with_http_info(**kwargs)
686
687        self.describe_index = _Endpoint(
688            settings={
689                "response_type": (IndexMeta,),
690                "auth": ["ApiKeyAuth"],
691                "endpoint_path": "/databases/{indexName}",
692                "operation_id": "describe_index",
693                "http_method": "GET",
694                "servers": [
695                    {
696                        "url": "https://controller.{environment}.pinecone.io",
697                        "description": "No description provided",
698                        "variables": {
699                            "environment": {
700                                "description": "No description provided",
701                                "default_value": "unknown",
702                            }
703                        },
704                    },
705                ],
706            },
707            params_map={
708                "all": [
709                    "index_name",
710                ],
711                "required": [
712                    "index_name",
713                ],
714                "nullable": [],
715                "enum": [],
716                "validation": [],
717            },
718            root_map={
719                "validations": {},
720                "allowed_values": {},
721                "openapi_types": {
722                    "index_name": (str,),
723                },
724                "attribute_map": {
725                    "index_name": "indexName",
726                },
727                "location_map": {
728                    "index_name": "path",
729                },
730                "collection_format_map": {},
731            },
732            headers_map={
733                "accept": ["application/json"],
734                "content_type": [],
735            },
736            api_client=api_client,
737            callable=__describe_index,
738        )
739
740        def __list_collections(self, **kwargs):
741            """list_collections  # noqa: E501
742
743            This operation returns a list of your Pinecone collections.  # noqa: E501
744            This method makes a synchronous HTTP request by default. To make an
745            asynchronous HTTP request, please pass async_req=True
746
747            >>> thread = api.list_collections(async_req=True)
748            >>> result = thread.get()
749
750
751            Keyword Args:
752                _return_http_data_only (bool): response data without head status
753                    code and headers. Default is True.
754                _preload_content (bool): if False, the urllib3.HTTPResponse object
755                    will be returned without reading/decoding response data.
756                    Default is True.
757                _request_timeout (int/float/tuple): timeout setting for this request. If
758                    one number provided, it will be total request timeout. It can also
759                    be a pair (tuple) of (connection, read) timeouts.
760                    Default is None.
761                _check_input_type (bool): specifies if type checking
762                    should be done one the data sent to the server.
763                    Default is True.
764                _check_return_type (bool): specifies if type checking
765                    should be done one the data received from the server.
766                    Default is True.
767                _host_index (int/None): specifies the index of the server
768                    that we want to use.
769                    Default is read from the configuration.
770                async_req (bool): execute request asynchronously
771
772            Returns:
773                [str]
774                    If the method is called asynchronously, returns the request
775                    thread.
776            """
777            kwargs["async_req"] = kwargs.get("async_req", False)
778            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
779            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
780            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
781            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
782            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
783            kwargs["_host_index"] = kwargs.get("_host_index")
784            return self.call_with_http_info(**kwargs)
785
786        self.list_collections = _Endpoint(
787            settings={
788                "response_type": ([str],),
789                "auth": ["ApiKeyAuth"],
790                "endpoint_path": "/collections",
791                "operation_id": "list_collections",
792                "http_method": "GET",
793                "servers": [
794                    {
795                        "url": "https://controller.{environment}.pinecone.io",
796                        "description": "No description provided",
797                        "variables": {
798                            "environment": {
799                                "description": "No description provided",
800                                "default_value": "unknown",
801                            }
802                        },
803                    },
804                ],
805            },
806            params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
807            root_map={
808                "validations": {},
809                "allowed_values": {},
810                "openapi_types": {},
811                "attribute_map": {},
812                "location_map": {},
813                "collection_format_map": {},
814            },
815            headers_map={
816                "accept": ["application/json; charset=utf-8"],
817                "content_type": [],
818            },
819            api_client=api_client,
820            callable=__list_collections,
821        )
822
823        def __list_indexes(self, **kwargs):
824            """list_indexes  # noqa: E501
825
826            This operation returns a list of the indexes in the current project.  # noqa: E501
827            This method makes a synchronous HTTP request by default. To make an
828            asynchronous HTTP request, please pass async_req=True
829
830            >>> thread = api.list_indexes(async_req=True)
831            >>> result = thread.get()
832
833
834            Keyword Args:
835                _return_http_data_only (bool): response data without head status
836                    code and headers. Default is True.
837                _preload_content (bool): if False, the urllib3.HTTPResponse object
838                    will be returned without reading/decoding response data.
839                    Default is True.
840                _request_timeout (int/float/tuple): timeout setting for this request. If
841                    one number provided, it will be total request timeout. It can also
842                    be a pair (tuple) of (connection, read) timeouts.
843                    Default is None.
844                _check_input_type (bool): specifies if type checking
845                    should be done one the data sent to the server.
846                    Default is True.
847                _check_return_type (bool): specifies if type checking
848                    should be done one the data received from the server.
849                    Default is True.
850                _host_index (int/None): specifies the index of the server
851                    that we want to use.
852                    Default is read from the configuration.
853                async_req (bool): execute request asynchronously
854
855            Returns:
856                [str]
857                    If the method is called asynchronously, returns the request
858                    thread.
859            """
860            kwargs["async_req"] = kwargs.get("async_req", False)
861            kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
862            kwargs["_preload_content"] = kwargs.get("_preload_content", True)
863            kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
864            kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
865            kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
866            kwargs["_host_index"] = kwargs.get("_host_index")
867            return self.call_with_http_info(**kwargs)
868
869        self.list_indexes = _Endpoint(
870            settings={
871                "response_type": ([str],),
872                "auth": ["ApiKeyAuth"],
873                "endpoint_path": "/databases",
874                "operation_id": "list_indexes",
875                "http_method": "GET",
876                "servers": [
877                    {
878                        "url": "https://controller.{environment}.pinecone.io",
879                        "description": "No description provided",
880                        "variables": {
881                            "environment": {
882                                "description": "No description provided",
883                                "default_value": "unknown",
884                            }
885                        },
886                    },
887                ],
888            },
889            params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
890            root_map={
891                "validations": {},
892                "allowed_values": {},
893                "openapi_types": {},
894                "attribute_map": {},
895                "location_map": {},
896                "collection_format_map": {},
897            },
898            headers_map={
899                "accept": ["application/json; charset=utf-8"],
900                "content_type": [],
901            },
902            api_client=api_client,
903            callable=__list_indexes,
904        )
api_client
configure_index
create_collection
create_index
delete_collection
delete_index
describe_collection
describe_index
list_collections
list_indexes