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.
Parameters:
Raises:
Examples:
To describe a policy associated with a load balancer
This example describes the specified policy associated with the specified load balancer.
>>> client.describe_load_balancer_policies(load_balancer_name='my-load-balancer', policy_names=['my-authentication-policy'])
Source code in docs_src/capo_elastic_load_balancing/_services/elastic_load_balancing.py
| def describe_load_balancer_policies(
self,
*,
config_overrides: Optional[ElasticLoadBalancingClientConfig] = None,
load_balancer_name: Optional[
"capo_elastic_load_balancing.types.access_point_name.AccessPointName"
] = None,
policy_names: Optional[
"capo_elastic_load_balancing.types.policy_names.PolicyNames"
] = None,
) -> "capo_elastic_load_balancing.types.describe_load_balancer_policies_output.DescribeLoadBalancerPoliciesOutput":
"""<p>Describes the specified policies.</p> <p>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 <code>ELBSample-</code> prefix.</p>
Args:
load_balancer_name: <p>The name of the load balancer.</p>
policy_names: <p>The names of the policies.</p>
Raises:
capo_elastic_load_balancing.errors.access_point_not_found_exception.AccessPointNotFoundException: <p>The specified load balancer does not exist.</p>
capo_elastic_load_balancing.errors.policy_not_found_exception.PolicyNotFoundException: <p>One or more of the specified policies do not exist.</p>
capo_elastic_load_balancing.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
To describe a policy associated with a load balancer
This example describes the specified policy associated with the specified load balancer.
>>> client.describe_load_balancer_policies(load_balancer_name='my-load-balancer', policy_names=['my-authentication-policy'])
"""
def _handler(
req: "OperationRequest[capo_elastic_load_balancing.types.describe_load_balancer_policies_input.DescribeLoadBalancerPoliciesInput]",
) -> OperationResponse[
"capo_elastic_load_balancing.types.describe_load_balancer_policies_output.DescribeLoadBalancerPoliciesOutput"
]:
import capo_elastic_load_balancing._operations.elastic_load_balancing_v7.describe_load_balancer_policies
output, http_response = (
capo_elastic_load_balancing._operations.elastic_load_balancing_v7.describe_load_balancer_policies.describe_load_balancer_policies(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeLoadBalancerPolicies")
)
input_: capo_elastic_load_balancing.types.describe_load_balancer_policies_input.DescribeLoadBalancerPoliciesInput = {}
if load_balancer_name is not None:
input_["load_balancer_name"] = load_balancer_name
if policy_names is not None:
input_["policy_names"] = policy_names
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|