Skip to content

list_attachment_nat_configurations

list_attachment_nat_configurations(
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    core_network_id: Optional[CoreNetworkId] = None,
    attachment_id: Optional[AttachmentId] = None,
    filters: Optional[FilterMap] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListAttachmentNatConfigurationsResponse

Returns the NAT configurations of core network attachments. You must specify either a core network ID or an attachment ID. Only the core network owner can list NAT configurations.

Parameters:

  • core_network_id (Optional[CoreNetworkId], default: None ) –

    The ID of a core network. Returns the NAT configurations of attachments in the core network that support NAT.

  • attachment_id (Optional[AttachmentId], default: None ) –

    The ID of an attachment. Returns the NAT configuration of the specified attachment. If you specify both an attachment ID and a core network ID, the attachment ID is used.

  • filters (Optional[FilterMap], default: None ) –

    The filters to apply to the results. Values for the same filter are joined with OR, and different filters are joined with AND. You can specify up to 10 filter values in total. The following filters are supported:

    • nat-gateway-support: The state of NAT gateway support on the attachment, for example ENABLED.

    • nat-system-route-support: Whether system routes are installed for the attachment, true or false.

    • rule-number: The rule number of a NAT rule.

    • match-source-cidr: The source CIDR block of a NAT rule. The value must exactly match the CIDR block of the rule.

    • nat-cidr: The NAT CIDR block of a NAT rule. The value must exactly match the CIDR block of the rule.

    • nat-rule-state: The state of a NAT rule, for example ACTIVATED.

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

    The maximum number of results to return.

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

    The token for the next page of results.

Raises:

Source code in docs_src/capo_networkmanager/_services/network_manager.py
def list_attachment_nat_configurations(
    self,
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    core_network_id: Optional[
        "capo_networkmanager.types.core_network_id.CoreNetworkId"
    ] = None,
    attachment_id: Optional[
        "capo_networkmanager.types.attachment_id.AttachmentId"
    ] = None,
    filters: Optional["capo_networkmanager.types.filter_map.FilterMap"] = None,
    max_results: Optional[
        "capo_networkmanager.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_networkmanager.types.next_token.NextToken"] = None,
) -> "capo_networkmanager.types.list_attachment_nat_configurations_response.ListAttachmentNatConfigurationsResponse":
    """<p>Returns the NAT configurations of core network attachments. You must specify either a core network ID or an attachment ID. Only the core network owner can list NAT configurations.</p>

    Args:
        core_network_id: <p>The ID of a core network. Returns the NAT configurations of attachments in the core network that support NAT.</p>
        attachment_id: <p>The ID of an attachment. Returns the NAT configuration of the specified attachment. If you specify both an attachment ID and a core network ID, the attachment ID is used.</p>
        filters: <p>The filters to apply to the results. Values for the same filter are joined with OR, and different filters are joined with AND. You can specify up to 10 filter values in total. The following filters are supported:</p> <ul> <li> <p> <code>nat-gateway-support</code>: The state of NAT gateway support on the attachment, for example <code>ENABLED</code>.</p> </li> <li> <p> <code>nat-system-route-support</code>: Whether system routes are installed for the attachment, <code>true</code> or <code>false</code>.</p> </li> <li> <p> <code>rule-number</code>: The rule number of a NAT rule.</p> </li> <li> <p> <code>match-source-cidr</code>: The source CIDR block of a NAT rule. The value must exactly match the CIDR block of the rule.</p> </li> <li> <p> <code>nat-cidr</code>: The NAT CIDR block of a NAT rule. The value must exactly match the CIDR block of the rule.</p> </li> <li> <p> <code>nat-rule-state</code>: The state of a NAT rule, for example <code>ACTIVATED</code>.</p> </li> </ul>
        max_results: <p>The maximum number of results to return.</p>
        next_token: <p>The token for the next page of results.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_networkmanager.types.list_attachment_nat_configurations_request.ListAttachmentNatConfigurationsRequest]",
    ) -> OperationResponse[
        "capo_networkmanager.types.list_attachment_nat_configurations_response.ListAttachmentNatConfigurationsResponse"
    ]:
        import capo_networkmanager._operations.network_manager.list_attachment_nat_configurations

        output, http_response = (
            capo_networkmanager._operations.network_manager.list_attachment_nat_configurations.list_attachment_nat_configurations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListAttachmentNatConfigurations")
    )
    input_: capo_networkmanager.types.list_attachment_nat_configurations_request.ListAttachmentNatConfigurationsRequest = {}
    if core_network_id is not None:
        input_["core_network_id"] = core_network_id
    if attachment_id is not None:
        input_["attachment_id"] = attachment_id
    if filters is not None:
        input_["filters"] = filters
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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