:doc:`DataZone <../../datazone>` / Client / create_asset

************
create_asset
************



.. py:method:: DataZone.Client.create_asset(**kwargs)

  

  Creates an asset in Amazon DataZone catalog.

   

  Before creating assets, make sure that the following requirements are met:

   

  
  * ``--domain-identifier`` must refer to an existing domain.
   
  * ``--owning-project-identifier`` must be a valid project within the domain.
   
  * Asset type must be created beforehand using ``create-asset-type``, or be a supported system-defined type. For more information, see `create-asset-type <https://docs.aws.amazon.com/cli/latest/reference/datazone/create-asset-type.html>`__.
   
  * ``--type-revision`` (if used) must match a valid revision of the asset type.
   
  * ``formsInput`` is required when it is associated as required in the ``asset-type``. For more information, see `create-form-type <https://docs.aws.amazon.com/cli/latest/reference/datazone/create-form-type.html>`__.
   
  * Form content must include all required fields as per the form schema (e.g., ``bucketArn``).
  

   

  You must invoke the following pre-requisite commands before invoking this API:

   

  
  * `CreateFormType <https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateFormType.html>`__
   
  * `CreateAssetType <https://docs.aws.amazon.com/datazone/latest/APIReference/API_CreateAssetType.html>`__
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datazone-2018-05-10/CreateAsset>`_  


  **Request Syntax**
  ::

    response = client.create_asset(
        name='string',
        domainIdentifier='string',
        externalIdentifier='string',
        typeIdentifier='string',
        typeRevision='string',
        description='string',
        glossaryTerms=[
            'string',
        ],
        formsInput=[
            {
                'formName': 'string',
                'typeIdentifier': 'string',
                'typeRevision': 'string',
                'content': 'string'
            },
        ],
        owningProjectIdentifier='string',
        predictionConfiguration={
            'businessNameGeneration': {
                'enabled': True|False
            }
        },
        clientToken='string'
    )
    
  :type name: string
  :param name: **[REQUIRED]** 

    Asset name.

    

  
  :type domainIdentifier: string
  :param domainIdentifier: **[REQUIRED]** 

    Amazon DataZone domain where the asset is created.

    

  
  :type externalIdentifier: string
  :param externalIdentifier: 

    The external identifier of the asset.

     

    If the value for the ``externalIdentifier`` parameter is specified, it must be a unique value.

    

  
  :type typeIdentifier: string
  :param typeIdentifier: **[REQUIRED]** 

    The unique identifier of this asset's type.

    

  
  :type typeRevision: string
  :param typeRevision: 

    The revision of this asset's type.

    

  
  :type description: string
  :param description: 

    Asset description.

    

  
  :type glossaryTerms: list
  :param glossaryTerms: 

    Glossary terms attached to the asset.

    

  
    - *(string) --* 

    

  :type formsInput: list
  :param formsInput: 

    Metadata forms attached to the asset.

    

  
    - *(dict) --* 

      The details of a metadata form.

      

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

        The name of the metadata form.

        

      
      - **typeIdentifier** *(string) --* 

        The ID of the metadata form type.

        

      
      - **typeRevision** *(string) --* 

        The revision of the metadata form type.

        

      
      - **content** *(string) --* 

        The content of the metadata form.

        

      
    

  :type owningProjectIdentifier: string
  :param owningProjectIdentifier: **[REQUIRED]** 

    The unique identifier of the project that owns this asset.

    

  
  :type predictionConfiguration: dict
  :param predictionConfiguration: 

    The configuration of the automatically generated business-friendly metadata for the asset.

    

  
    - **businessNameGeneration** *(dict) --* 

      The business name generation mechanism.

      

    
      - **enabled** *(boolean) --* 

        Specifies whether the business name generation is enabled.

        

      
    
  
  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.

    This field is autopopulated if not provided.

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

    
    ::

      {
          'id': 'string',
          'name': 'string',
          'typeIdentifier': 'string',
          'typeRevision': 'string',
          'externalIdentifier': 'string',
          'revision': 'string',
          'description': 'string',
          'createdAt': datetime(2015, 1, 1),
          'createdBy': 'string',
          'firstRevisionCreatedAt': datetime(2015, 1, 1),
          'firstRevisionCreatedBy': 'string',
          'glossaryTerms': [
              'string',
          ],
          'governedGlossaryTerms': [
              'string',
          ],
          'owningProjectId': 'string',
          'domainId': 'string',
          'listing': {
              'listingId': 'string',
              'listingStatus': 'CREATING'|'ACTIVE'|'INACTIVE'
          },
          'formsOutput': [
              {
                  'formName': 'string',
                  'typeName': 'string',
                  'typeRevision': 'string',
                  'content': 'string'
              },
          ],
          'readOnlyFormsOutput': [
              {
                  'formName': 'string',
                  'typeName': 'string',
                  'typeRevision': 'string',
                  'content': 'string'
              },
          ],
          'latestTimeSeriesDataPointFormsOutput': [
              {
                  'formName': 'string',
                  'typeIdentifier': 'string',
                  'typeRevision': 'string',
                  'timestamp': datetime(2015, 1, 1),
                  'contentSummary': 'string',
                  'id': 'string'
              },
          ],
          'predictionConfiguration': {
              'businessNameGeneration': {
                  'enabled': True|False
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The unique identifier of the created asset.

        
      

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

        The name of the created asset.

        
      

      - **typeIdentifier** *(string) --* 

        The identifier of the created asset type.

        
      

      - **typeRevision** *(string) --* 

        The revision type of the asset.

        
      

      - **externalIdentifier** *(string) --* 

        The external identifier of the asset.

        
      

      - **revision** *(string) --* 

        The revision of the asset.

        
      

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

        The description of the created asset.

        
      

      - **createdAt** *(datetime) --* 

        The timestamp of when the asset was created.

        
      

      - **createdBy** *(string) --* 

        The Amazon DataZone user that created this asset in the catalog.

        
      

      - **firstRevisionCreatedAt** *(datetime) --* 

        The timestamp of when the first revision of the asset took place.

        
      

      - **firstRevisionCreatedBy** *(string) --* 

        The Amazon DataZone user that made the first revision of the asset.

        
      

      - **glossaryTerms** *(list) --* 

        The glossary terms that are attached to the created asset.

        
        

        - *(string) --* 
    
      

      - **governedGlossaryTerms** *(list) --* 

        The glossary terms in a restricted glossary.

        
        

        - *(string) --* 
    
      

      - **owningProjectId** *(string) --* 

        The ID of the Amazon DataZone project that owns the created asset.

        
      

      - **domainId** *(string) --* 

        The ID of the Amazon DataZone domain in which the asset was created.

        
      

      - **listing** *(dict) --* 

        The details of an asset published in an Amazon DataZone catalog.

        
        

        - **listingId** *(string) --* 

          The identifier of an asset published in an Amazon DataZone catalog.

          
        

        - **listingStatus** *(string) --* 

          The status of an asset published in an Amazon DataZone catalog.

          
    
      

      - **formsOutput** *(list) --* 

        The metadata forms that are attached to the created asset.

        
        

        - *(dict) --* 

          The details of a metadata form.

          
          

          - **formName** *(string) --* 

            The name of the metadata form.

            
          

          - **typeName** *(string) --* 

            The name of the metadata form type.

            
          

          - **typeRevision** *(string) --* 

            The revision of the metadata form type.

            
          

          - **content** *(string) --* 

            The content of the metadata form.

            
      
    
      

      - **readOnlyFormsOutput** *(list) --* 

        The read-only metadata forms that are attached to the created asset.

        
        

        - *(dict) --* 

          The details of a metadata form.

          
          

          - **formName** *(string) --* 

            The name of the metadata form.

            
          

          - **typeName** *(string) --* 

            The name of the metadata form type.

            
          

          - **typeRevision** *(string) --* 

            The revision of the metadata form type.

            
          

          - **content** *(string) --* 

            The content of the metadata form.

            
      
    
      

      - **latestTimeSeriesDataPointFormsOutput** *(list) --* 

        The latest data point that was imported into the time series form for the asset.

        
        

        - *(dict) --* 

          The summary of the time series data points form.

          
          

          - **formName** *(string) --* 

            The name of the time series data points summary form.

            
          

          - **typeIdentifier** *(string) --* 

            The type ID of the time series data points summary form.

            
          

          - **typeRevision** *(string) --* 

            The type revision of the time series data points summary form.

            
          

          - **timestamp** *(datetime) --* 

            The timestamp of the time series data points summary form.

            
          

          - **contentSummary** *(string) --* 

            The content of the summary of the time series data points form.

            
          

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

            The ID of the time series data points summary form.

            
      
    
      

      - **predictionConfiguration** *(dict) --* 

        The configuration of the automatically generated business-friendly metadata for the asset.

        
        

        - **businessNameGeneration** *(dict) --* 

          The business name generation mechanism.

          
          

          - **enabled** *(boolean) --* 

            Specifies whether the business name generation is enabled.

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

  
  *   :py:class:`DataZone.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`DataZone.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`DataZone.Client.exceptions.ThrottlingException`

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

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

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

  
  *   :py:class:`DataZone.Client.exceptions.UnauthorizedException`

  