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

******************
create_domain_unit
******************



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

  

  Creates a domain unit in Amazon DataZone.

  

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


  **Request Syntax**
  ::

    response = client.create_domain_unit(
        domainIdentifier='string',
        name='string',
        parentDomainUnitIdentifier='string',
        description='string',
        clientToken='string'
    )
    
  :type domainIdentifier: string
  :param domainIdentifier: **[REQUIRED]** 

    The ID of the domain where you want to crate a domain unit.

    

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

    The name of the domain unit.

    

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

    The ID of the parent domain unit.

    

  
  :type description: string
  :param description: 

    The description of the domain unit.

    

  
  :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',
          'domainId': 'string',
          'name': 'string',
          'parentDomainUnitId': 'string',
          'description': 'string',
          'owners': [
              {
                  'user': {
                      'userId': 'string'
                  },
                  'group': {
                      'groupId': 'string'
                  }
              },
          ],
          'ancestorDomainUnitIds': [
              'string',
          ],
          'createdAt': datetime(2015, 1, 1),
          'createdBy': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The ID of the domain unit.

        
      

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

        The ID of the domain where the domain unit was created.

        
      

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

        The name of the domain unit.

        
      

      - **parentDomainUnitId** *(string) --* 

        The ID of the parent domain unit.

        
      

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

        The description of the domain unit.

        
      

      - **owners** *(list) --* 

        The owners of the domain unit.

        
        

        - *(dict) --* 

          The properties of the domain unit owner.

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``user``, ``group``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                    'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


        
          

          - **user** *(dict) --* 

            Indicates that the domain unit owner is a user.

            
            

            - **userId** *(string) --* 

              The ID of teh domain unit user.

              
        
          

          - **group** *(dict) --* 

            Indicates that the domain unit owner is a group.

            
            

            - **groupId** *(string) --* 

              The ID of the domain unit group.

              
        
      
    
      

      - **ancestorDomainUnitIds** *(list) --* 

        The IDs of the ancestor domain units.

        
        

        - *(string) --* 
    
      

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

        The timestamp at which the domain unit was created.

        
      

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

        The user who created the domain unit.

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

  
  *   :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`

  