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

*************************
create_subscription_grant
*************************



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

  

  Creates a subsscription grant in Amazon DataZone.

  

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


  **Request Syntax**
  ::

    response = client.create_subscription_grant(
        domainIdentifier='string',
        environmentIdentifier='string',
        subscriptionTargetIdentifier='string',
        grantedEntity={
            'listing': {
                'identifier': 'string',
                'revision': 'string'
            }
        },
        assetTargetNames=[
            {
                'assetId': 'string',
                'targetName': 'string'
            },
        ],
        clientToken='string'
    )
    
  :type domainIdentifier: string
  :param domainIdentifier: **[REQUIRED]** 

    The ID of the Amazon DataZone domain in which the subscription grant is created.

    

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

    The ID of the environment in which the subscription grant is created.

    

  
  :type subscriptionTargetIdentifier: string
  :param subscriptionTargetIdentifier: 

    The ID of the subscription target for which the subscription grant is created.

    

  
  :type grantedEntity: dict
  :param grantedEntity: **[REQUIRED]** 

    The entity to which the subscription is to be granted.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``listing``. 

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

      The listing for which a subscription is to be granted.

      

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

        An identifier of revision to be made to an asset published in a Amazon DataZone catalog.

        

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

        The details of a revision to be made to an asset published in a Amazon DataZone catalog.

        

      
    
  
  :type assetTargetNames: list
  :param assetTargetNames: 

    The names of the assets for which the subscription grant is created.

    

  
    - *(dict) --* 

      The name map for assets.

      

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

        The identifier of the inventory asset.

        

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

        The target name in the asset target name map.

        

      
    

  :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',
          'createdBy': 'string',
          'updatedBy': 'string',
          'domainId': 'string',
          'createdAt': datetime(2015, 1, 1),
          'updatedAt': datetime(2015, 1, 1),
          'environmentId': 'string',
          'subscriptionTargetId': 'string',
          'grantedEntity': {
              'listing': {
                  'id': 'string',
                  'revision': 'string'
              }
          },
          'status': 'PENDING'|'IN_PROGRESS'|'GRANT_FAILED'|'REVOKE_FAILED'|'GRANT_AND_REVOKE_FAILED'|'COMPLETED'|'INACCESSIBLE',
          'assets': [
              {
                  'assetId': 'string',
                  'assetRevision': 'string',
                  'status': 'GRANT_PENDING'|'REVOKE_PENDING'|'GRANT_IN_PROGRESS'|'REVOKE_IN_PROGRESS'|'GRANTED'|'REVOKED'|'GRANT_FAILED'|'REVOKE_FAILED',
                  'targetName': 'string',
                  'failureCause': {
                      'message': 'string'
                  },
                  'grantedTimestamp': datetime(2015, 1, 1),
                  'failureTimestamp': datetime(2015, 1, 1),
                  'assetScope': {
                      'assetId': 'string',
                      'filterIds': [
                          'string',
                      ],
                      'status': 'string',
                      'errorMessage': 'string'
                  },
                  'permissions': {
                      's3': [
                          'READ'|'WRITE',
                      ]
                  }
              },
          ],
          'subscriptionId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The ID of the subscription grant.

        
      

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

        The Amazon DataZone user who created the subscription grant.

        
      

      - **updatedBy** *(string) --* 

        The Amazon DataZone user who updated the subscription grant.

        
      

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

        The ID of the Amazon DataZone domain in which the subscription grant is created.

        
      

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

        A timestamp of when the subscription grant is created.

        
      

      - **updatedAt** *(datetime) --* 

        A timestamp of when the subscription grant was updated.

        
      

      - **environmentId** *(string) --* 

        The environment ID for which subscription grant is created.

        
      

      - **subscriptionTargetId** *(string) --* 

        The ID of the subscription target for which the subscription grant is created.

        
      

      - **grantedEntity** *(dict) --* 

        The entity to which the subscription is granted.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``listing``.     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'}


      
        

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

          The listing for which a subscription is granted.

          
          

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

            An identifier of a revision of an asset published in a Amazon DataZone catalog.

            
          

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

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

            
      
    
      

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

        The status of the subscription grant.

        
      

      - **assets** *(list) --* 

        The assets for which the subscription grant is created.

        
        

        - *(dict) --* 

          The details of the asset for which the subscription grant is created.

          
          

          - **assetId** *(string) --* 

            The identifier of the asset for which the subscription grant is created.

            
          

          - **assetRevision** *(string) --* 

            The revision of the asset for which the subscription grant is created.

            
          

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

            The status of the asset for which the subscription grant is created.

            
          

          - **targetName** *(string) --* 

            The target name of the asset for which the subscription grant is created.

            
          

          - **failureCause** *(dict) --* 

            The failure cause included in the details of the asset for which the subscription grant is created.

            
            

            - **message** *(string) --* 

              The description of the error message.

              
        
          

          - **grantedTimestamp** *(datetime) --* 

            The timestamp of when the subscription grant to the asset is created.

            
          

          - **failureTimestamp** *(datetime) --* 

            The failure timestamp included in the details of the asset for which the subscription grant is created.

            
          

          - **assetScope** *(dict) --* 

            The asset scope of the subscribed asset.

            
            

            - **assetId** *(string) --* 

              The asset ID of the asset scope.

              
            

            - **filterIds** *(list) --* 

              The filter IDs of the asset scope.

              
              

              - *(string) --* 
          
            

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

              The status of the asset scope.

              
            

            - **errorMessage** *(string) --* 

              The error message of the asset scope.

              
        
          

          - **permissions** *(dict) --* 

            The asset permissions.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``s3``.     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'}


          
            

            - **s3** *(list) --* 

              The S3 details of the asset permissions.

              
              

              - *(string) --* 
          
        
      
    
      

      - **subscriptionId** *(string) --* 

        The identifier of the subscription grant.

        
  
  **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.ConflictException`

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

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

  