IoT / Client / get_policy

get_policy#

IoT.Client.get_policy(**kwargs)#

Gets information about the specified policy with the policy document of the default version.

Requires permission to access the GetPolicy action.

See also: AWS API Documentation

Request Syntax

response = client.get_policy(
    policyName='string'
)
Parameters:

policyName (string) –

[REQUIRED]

The name of the policy.

Return type:

dict

Returns:

Response Syntax

{
    'policyName': 'string',
    'policyArn': 'string',
    'policyDocument': 'string',
    'defaultVersionId': 'string',
    'creationDate': datetime(2015, 1, 1),
    'lastModifiedDate': datetime(2015, 1, 1),
    'generationId': 'string'
}

Response Structure

  • (dict) –

    The output from the GetPolicy operation.

    • policyName (string) –

      The policy name.

    • policyArn (string) –

      The policy ARN.

    • policyDocument (string) –

      The JSON document that describes the policy.

    • defaultVersionId (string) –

      The default policy version ID.

    • creationDate (datetime) –

      The date the policy was created.

    • lastModifiedDate (datetime) –

      The date the policy was last modified.

    • generationId (string) –

      The generation ID of the policy.

Exceptions