ElasticLoadBalancing / Client / describe_load_balancer_policies

describe_load_balancer_policies#

ElasticLoadBalancing.Client.describe_load_balancer_policies(**kwargs)#

Describes the specified policies.

If you specify a load balancer name, the action returns the descriptions of all policies created for the load balancer. If you specify a policy name associated with your load balancer, the action returns the description of that policy. If you don’t specify a load balancer name, the action returns descriptions of the specified sample policies, or descriptions of all sample policies. The names of the sample policies have the ELBSample- prefix.

See also: AWS API Documentation

Request Syntax

response = client.describe_load_balancer_policies(
    LoadBalancerName='string',
    PolicyNames=[
        'string',
    ]
)
Parameters:
  • LoadBalancerName (string) – The name of the load balancer.

  • PolicyNames (list) –

    The names of the policies.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'PolicyDescriptions': [
        {
            'PolicyName': 'string',
            'PolicyTypeName': 'string',
            'PolicyAttributeDescriptions': [
                {
                    'AttributeName': 'string',
                    'AttributeValue': 'string'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) –

    Contains the output of DescribeLoadBalancerPolicies.

    • PolicyDescriptions (list) –

      Information about the policies.

      • (dict) –

        Information about a policy.

        • PolicyName (string) –

          The name of the policy.

        • PolicyTypeName (string) –

          The name of the policy type.

        • PolicyAttributeDescriptions (list) –

          The policy attributes.

          • (dict) –

            Information about a policy attribute.

            • AttributeName (string) –

              The name of the attribute.

            • AttributeValue (string) –

              The value of the attribute.

Exceptions

Examples

This example describes the specified policy associated with the specified load balancer.

response = client.describe_load_balancer_policies(
    LoadBalancerName='my-load-balancer',
    PolicyNames=[
        'my-authentication-policy',
    ],
)

print(response)

Expected Output:

{
    'PolicyDescriptions': [
        {
            'PolicyAttributeDescriptions': [
                {
                    'AttributeName': 'PublicKeyPolicyName',
                    'AttributeValue': 'my-PublicKey-policy',
                },
            ],
            'PolicyName': 'my-authentication-policy',
            'PolicyTypeName': 'BackendServerAuthenticationPolicyType',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}