Skip to content

list_firewalls

list_firewalls(
    *,
    config_overrides: Optional[NetworkFirewallClientConfig] = None,
    next_token: Optional[PaginationToken] = None,
    vpc_ids: Optional[VpcIds] = None,
    max_results: Optional[PaginationMaxResults] = None,
) -> ListFirewallsResponse

Retrieves the metadata for the firewalls that you have defined. If you provide VPC identifiers in your request, this returns only the firewalls for those VPCs.

Depending on your setting for max results and the number of firewalls, a single call might not return the full list.

Parameters:

  • next_token (Optional[PaginationToken], default: None ) –

    When you request a list of objects with a MaxResults setting, if the number of objects that are still available for retrieval exceeds the maximum you requested, Network Firewall returns a NextToken value in the response. To retrieve the next batch of objects, use the token returned from the prior request in your next request.

  • vpc_ids (Optional[VpcIds], default: None ) –

    The unique identifiers of the VPCs that you want Network Firewall to retrieve the firewalls for. Leave this blank to retrieve all firewalls that you have defined.

  • max_results (Optional[PaginationMaxResults], default: None ) –

    The maximum number of objects that you want Network Firewall to return for this request. If more objects are available, in the response, Network Firewall provides a NextToken value that you can use in a subsequent call to get the next batch of objects.

Raises:

  • InternalServerError –

    Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request.

  • InvalidRequestException –

    The operation failed because of a problem with your request. Examples include:

    • You specified an unsupported parameter name or value.

    • You tried to update a property with a value that isn't among the available types.

    • Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.

  • ThrottlingException –

    Unable to process the request due to throttling limitations.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_network_firewall/_services/network_firewall.py
def list_firewalls(
    self,
    *,
    config_overrides: Optional[NetworkFirewallClientConfig] = None,
    next_token: Optional[
        "capo_network_firewall.types.pagination_token.PaginationToken"
    ] = None,
    vpc_ids: Optional["capo_network_firewall.types.vpc_ids.VpcIds"] = None,
    max_results: Optional[
        "capo_network_firewall.types.pagination_max_results.PaginationMaxResults"
    ] = None,
) -> "capo_network_firewall.types.list_firewalls_response.ListFirewallsResponse":
    """<p>Retrieves the metadata for the firewalls that you have defined. If you provide VPC identifiers in your request, this returns only the firewalls for those VPCs.</p> <p>Depending on your setting for max results and the number of firewalls, a single call might not return the full list. </p>

    Args:
        next_token: <p>When you request a list of objects with a <code>MaxResults</code> setting, if the number of objects that are still available for retrieval exceeds the maximum you requested, Network Firewall returns a <code>NextToken</code> value in the response. To retrieve the next batch of objects, use the token returned from the prior request in your next request.</p>
        vpc_ids: <p>The unique identifiers of the VPCs that you want Network Firewall to retrieve the firewalls for. Leave this blank to retrieve all firewalls that you have defined.</p>
        max_results: <p>The maximum number of objects that you want Network Firewall to return for this request. If more objects are available, in the response, Network Firewall provides a <code>NextToken</code> value that you can use in a subsequent call to get the next batch of objects.</p>

    Raises:
        capo_network_firewall.errors.internal_server_error.InternalServerError: <p>Your request is valid, but Network Firewall couldn't perform the operation because of a system problem. Retry your request. </p>
        capo_network_firewall.errors.invalid_request_exception.InvalidRequestException: <p>The operation failed because of a problem with your request. Examples include: </p> <ul> <li> <p>You specified an unsupported parameter name or value.</p> </li> <li> <p>You tried to update a property with a value that isn't among the available types.</p> </li> <li> <p>Your request references an ARN that is malformed, or corresponds to a resource that isn't valid in the context of the request.</p> </li> </ul>
        capo_network_firewall.errors.throttling_exception.ThrottlingException: <p>Unable to process the request due to throttling limitations.</p>
        capo_network_firewall.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_network_firewall.types.list_firewalls_request.ListFirewallsRequest]",
    ) -> OperationResponse[
        "capo_network_firewall.types.list_firewalls_response.ListFirewallsResponse"
    ]:
        import capo_network_firewall._operations.network_firewall_20201112.list_firewalls

        output, http_response = (
            capo_network_firewall._operations.network_firewall_20201112.list_firewalls.list_firewalls(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListFirewalls")
    )
    input_: capo_network_firewall.types.list_firewalls_request.ListFirewallsRequest = {}
    if next_token is not None:
        input_["next_token"] = next_token
    if vpc_ids is not None:
        input_["vpc_ids"] = vpc_ids
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output