:doc:`Glue <../../glue>` / Client / get_schema_by_definition

************************
get_schema_by_definition
************************



.. py:method:: Glue.Client.get_schema_by_definition(**kwargs)

  

  Retrieves a schema by the ``SchemaDefinition``. The schema definition is sent to the Schema Registry, canonicalized, and hashed. If the hash is matched within the scope of the ``SchemaName`` or ARN (or the default registry, if none is supplied), that schema’s metadata is returned. Otherwise, a 404 or NotFound error is returned. Schema versions in ``Deleted`` statuses will not be included in the results.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSchemaByDefinition>`_  


  **Request Syntax**
  ::

    response = client.get_schema_by_definition(
        SchemaId={
            'SchemaArn': 'string',
            'SchemaName': 'string',
            'RegistryName': 'string'
        },
        SchemaDefinition='string'
    )
    
  :type SchemaId: dict
  :param SchemaId: **[REQUIRED]** 

    This is a wrapper structure to contain schema identity fields. The structure contains:

     

    
    * SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of ``SchemaArn`` or ``SchemaName`` has to be provided.
     
    * SchemaId$SchemaName: The name of the schema. One of ``SchemaArn`` or ``SchemaName`` has to be provided.
    

    

  
    - **SchemaArn** *(string) --* 

      The Amazon Resource Name (ARN) of the schema. One of ``SchemaArn`` or ``SchemaName`` has to be provided.

      

    
    - **SchemaName** *(string) --* 

      The name of the schema. One of ``SchemaArn`` or ``SchemaName`` has to be provided.

      

    
    - **RegistryName** *(string) --* 

      The name of the schema registry that contains the schema.

      

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

    The definition of the schema for which schema details are required.

    

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

    
    ::

      {
          'SchemaVersionId': 'string',
          'SchemaArn': 'string',
          'DataFormat': 'AVRO'|'JSON'|'PROTOBUF',
          'Status': 'AVAILABLE'|'PENDING'|'FAILURE'|'DELETING',
          'CreatedTime': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **SchemaVersionId** *(string) --* 

        The schema ID of the schema version.

        
      

      - **SchemaArn** *(string) --* 

        The Amazon Resource Name (ARN) of the schema.

        
      

      - **DataFormat** *(string) --* 

        The data format of the schema definition. Currently ``AVRO``, ``JSON`` and ``PROTOBUF`` are supported.

        
      

      - **Status** *(string) --* 

        The status of the schema version.

        
      

      - **CreatedTime** *(string) --* 

        The date and time the schema was created.

        
  
  **Exceptions**
  
  *   :py:class:`Glue.Client.exceptions.InvalidInputException`

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

  
  *   :py:class:`Glue.Client.exceptions.EntityNotFoundException`

  
  *   :py:class:`Glue.Client.exceptions.InternalServiceException`

  