:doc:`OpenSearchServiceServerless <../../opensearchserverless>` / Client / create_collection

*****************
create_collection
*****************



.. py:method:: OpenSearchServiceServerless.Client.create_collection(**kwargs)

  

  Creates a new OpenSearch Serverless collection. For more information, see `Creating and managing Amazon OpenSearch Serverless collections <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-manage.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/opensearchserverless-2021-11-01/CreateCollection>`_  


  **Request Syntax**
  ::

    response = client.create_collection(
        name='string',
        type='SEARCH'|'TIMESERIES'|'VECTORSEARCH',
        description='string',
        tags=[
            {
                'key': 'string',
                'value': 'string'
            },
        ],
        standbyReplicas='ENABLED'|'DISABLED',
        vectorOptions={
            'ServerlessVectorAcceleration': 'ENABLED'|'DISABLED'|'ALLOWED'
        },
        collectionGroupName='string',
        encryptionConfig={
            'aWSOwnedKey': True|False,
            'kmsKeyArn': 'string'
        },
        clientToken='string'
    )
    
  :type name: string
  :param name: **[REQUIRED]** 

    Name of the collection.

    

  
  :type type: string
  :param type: 

    The type of collection.

    

  
  :type description: string
  :param description: 

    Description of the collection.

    

  
  :type tags: list
  :param tags: 

    An arbitrary set of tags (key–value pairs) to associate with the OpenSearch Serverless collection.

    

  
    - *(dict) --* 

      A map of key-value pairs associated to an OpenSearch Serverless resource.

      

    
      - **key** *(string) --* **[REQUIRED]** 

        The key to use in the tag.

        

      
      - **value** *(string) --* **[REQUIRED]** 

        The value of the tag.

        

      
    

  :type standbyReplicas: string
  :param standbyReplicas: 

    Indicates whether standby replicas should be used for a collection.

    

  
  :type vectorOptions: dict
  :param vectorOptions: 

    Configuration options for vector search capabilities in the collection.

    

  
    - **ServerlessVectorAcceleration** *(string) --* **[REQUIRED]** 

      Specifies whether serverless vector acceleration is enabled for the collection.

      

    
  
  :type collectionGroupName: string
  :param collectionGroupName: 

    The name of the collection group to associate with the collection.

    

  
  :type encryptionConfig: dict
  :param encryptionConfig: 

    Encryption settings for the collection.

    

  
    - **aWSOwnedKey** *(boolean) --* 

      Indicates whether to use an Amazon Web Services-owned key for encryption.

      

    
    - **kmsKeyArn** *(string) --* 

      The ARN of the Amazon Web Services Key Management Service key used to encrypt the collection.

      

    
  
  :type clientToken: string
  :param clientToken: 

    Unique, case-sensitive identifier to ensure idempotency of the request.

    This field is autopopulated if not provided.

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'createCollectionDetail': {
              'id': 'string',
              'name': 'string',
              'status': 'CREATING'|'DELETING'|'ACTIVE'|'FAILED',
              'type': 'SEARCH'|'TIMESERIES'|'VECTORSEARCH',
              'description': 'string',
              'arn': 'string',
              'kmsKeyArn': 'string',
              'standbyReplicas': 'ENABLED'|'DISABLED',
              'vectorOptions': {
                  'ServerlessVectorAcceleration': 'ENABLED'|'DISABLED'|'ALLOWED'
              },
              'createdDate': 123,
              'lastModifiedDate': 123,
              'collectionGroupName': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **createCollectionDetail** *(dict) --* 

        Details about the collection.

        
        

        - **id** *(string) --* 

          The unique identifier of the collection.

          
        

        - **name** *(string) --* 

          The name of the collection.

          
        

        - **status** *(string) --* 

          The current status of the collection.

          
        

        - **type** *(string) --* 

          The type of collection.

          
        

        - **description** *(string) --* 

          A description of the collection.

          
        

        - **arn** *(string) --* 

          The Amazon Resource Name (ARN) of the collection.

          
        

        - **kmsKeyArn** *(string) --* 

          The Amazon Resource Name (ARN) of the KMS key with which to encrypt the collection.

          
        

        - **standbyReplicas** *(string) --* 

          Creates details about an OpenSearch Serverless collection.

          
        

        - **vectorOptions** *(dict) --* 

          Configuration options for vector search capabilities in the collection.

          
          

          - **ServerlessVectorAcceleration** *(string) --* 

            Specifies whether serverless vector acceleration is enabled for the collection.

            
      
        

        - **createdDate** *(integer) --* 

          The Epoch time when the collection was created.

          
        

        - **lastModifiedDate** *(integer) --* 

          The date and time when the collection was last modified.

          
        

        - **collectionGroupName** *(string) --* 

          The name of the collection group that contains this collection.

          
    
  
  **Exceptions**
  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.InternalServerException`

  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.OcuLimitExceededException`

  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.ConflictException`

  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.ValidationException`

  
  *   :py:class:`OpenSearchServiceServerless.Client.exceptions.ServiceQuotaExceededException`

  