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

*****************
get_access_policy
*****************



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

  

  Returns an OpenSearch Serverless access policy. For more information, see `Data access control for Amazon OpenSearch Serverless <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-data-access.html>`__.

  

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


  **Request Syntax**
  ::

    response = client.get_access_policy(
        type='data',
        name='string'
    )
    
  :type type: string
  :param type: **[REQUIRED]** 

    Tye type of policy. Currently, the only supported value is ``data``.

    

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

    The name of the access policy.

    

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

    
    ::

      {
          'accessPolicyDetail': {
              'type': 'data',
              'name': 'string',
              'policyVersion': 'string',
              'description': 'string',
              'policy': {...}|[...]|123|123.4|'string'|True|None,
              'createdDate': 123,
              'lastModifiedDate': 123
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **accessPolicyDetail** *(dict) --* 

        Details about the requested access policy.

        
        

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

          The type of access policy.

          
        

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

          The name of the policy.

          
        

        - **policyVersion** *(string) --* 

          The version of the policy.

          
        

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

          The description of the policy.

          
        

        - **policy** (:ref:`document<document>`) -- 

          The JSON policy document without any whitespaces.

          
        

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

          The date the policy was created.

          
        

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

          The timestamp of when the policy was last modified.

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

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

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

  