Skip to content

describe_secondary_networks

describe_secondary_networks(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    filters: Optional[FilterList] = None,
    max_results: Optional[DescribeSecondaryNetworksMaxResults] = None,
    next_token: Optional[String] = None,
    secondary_network_ids: Optional[SecondaryNetworkIdList] = None,
) -> DescribeSecondaryNetworksResult

Describes one or more secondary networks.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

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

    The filters. The following are the possible values:

    • ipv4-cidr-block-association.association-id - The association ID for an IPv4 CIDR block associated with the secondary network.

    • ipv4-cidr-block-association.cidr-block - An IPv4 CIDR block associated with the secondary network.

    • ipv4-cidr-block-association.state - The state of an IPv4 CIDR block associated with the secondary network.

    • owner-id - The ID of the Amazon Web Services account that owns the secondary network.

    • secondary-network-id - The ID of the secondary network.

    • secondary-network-arn - The ARN of the secondary network.

    • state - The state of the secondary network (create-in-progress | create-complete | create-failed | delete-in-progress | delete-complete | delete-failed).

    • tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    • type - The type of the secondary network (rdma).

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

    The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

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

    The token for the next page of results.

  • secondary_network_ids (Optional[SecondaryNetworkIdList], default: None ) –

    The IDs of the secondary networks.

Raises:

Examples:

To describe specified secondary networks This example describes the specified secondary networks.

>>> client.describe_secondary_networks(secondary_network_ids=['sn-0123456789abcdef0', 'sn-0987654321fedcba0'])
To describe secondary networks using filters
This example uses filters to describe any secondary network you own that has a tag with the key Environment and the value Production and whose state is create-complete.
>>> client.describe_secondary_networks(filters=[{'Name': 'tag:Environment', 'Values': ['Production']}, {'Name': 'state', 'Values': ['create-complete']}], max_results=5)
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_secondary_networks(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_secondary_networks_max_results.DescribeSecondaryNetworksMaxResults"
    ] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    secondary_network_ids: Optional[
        "capo_ec2.types.secondary_network_id_list.SecondaryNetworkIdList"
    ] = None,
) -> "capo_ec2.types.describe_secondary_networks_result.DescribeSecondaryNetworksResult":
    """<p>Describes one or more secondary networks.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        filters: <p>The filters. The following are the possible values:</p> <ul> <li> <p> <code>ipv4-cidr-block-association.association-id</code> - The association ID for an IPv4 CIDR block associated with the secondary network.</p> </li> <li> <p> <code>ipv4-cidr-block-association.cidr-block</code> - An IPv4 CIDR block associated with the secondary network.</p> </li> <li> <p> <code>ipv4-cidr-block-association.state</code> - The state of an IPv4 CIDR block associated with the secondary network.</p> </li> <li> <p> <code>owner-id</code> - The ID of the Amazon Web Services account that owns the secondary network.</p> </li> <li> <p> <code>secondary-network-id</code> - The ID of the secondary network.</p> </li> <li> <p> <code>secondary-network-arn</code> - The ARN of the secondary network.</p> </li> <li> <p> <code>state</code> - The state of the secondary network (<code>create-in-progress</code> | <code>create-complete</code> | <code>create-failed</code> | <code>delete-in-progress</code> | <code>delete-complete</code> | <code>delete-failed</code>).</p> </li> <li> <p> <code>tag</code>:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p> </li> <li> <p> <code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p> </li> <li> <p> <code>type</code> - The type of the secondary network (<code>rdma</code>).</p> </li> </ul>
        max_results: <p>The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned <code>nextToken</code> value.</p>
        next_token: <p>The token for the next page of results.</p>
        secondary_network_ids: <p>The IDs of the secondary networks.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe specified secondary networks
        This example describes the specified secondary networks.

        >>> client.describe_secondary_networks(secondary_network_ids=['sn-0123456789abcdef0', 'sn-0987654321fedcba0'])
        To describe secondary networks using filters
        This example uses filters to describe any secondary network you own that has a tag with the key Environment and the value Production and whose state is create-complete.

        >>> client.describe_secondary_networks(filters=[{'Name': 'tag:Environment', 'Values': ['Production']}, {'Name': 'state', 'Values': ['create-complete']}], max_results=5)
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_secondary_networks_request.DescribeSecondaryNetworksRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_secondary_networks_result.DescribeSecondaryNetworksResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_secondary_networks

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_secondary_networks.describe_secondary_networks(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeSecondaryNetworks")
    )
    input_: capo_ec2.types.describe_secondary_networks_request.DescribeSecondaryNetworksRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    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
    if secondary_network_ids is not None:
        input_["secondary_network_ids"] = secondary_network_ids

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