Skip to content

describe_network_interface_attribute async

describe_network_interface_attribute(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    network_interface_id: Optional[NetworkInterfaceId] = None,
    attribute: Optional[NetworkInterfaceAttribute] = None,
) -> DescribeNetworkInterfaceAttributeResult

Describes a network interface attribute. You can specify only one attribute at a time.

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.

  • network_interface_id (Optional[NetworkInterfaceId], default: None ) –

    The ID of the network interface.

  • attribute (Optional[NetworkInterfaceAttribute], default: None ) –

    The attribute of the network interface. This parameter is required.

Raises:

Examples:

To describe the attachment attribute of a network interface This example describes the attachment attribute of the specified network interface.

>>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='attachment')
To describe the description attribute of a network interface
This example describes the description attribute of the specified network interface.
>>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='description')
To describe the groupSet attribute of a network interface
This example describes the groupSet attribute of the specified network interface.
>>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='groupSet')
To describe the sourceDestCheck attribute of a network interface
This example describes the sourceDestCheck attribute of the specified network interface.
>>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='sourceDestCheck')
Source code in docs_src/capo_ec2/_services/async_ec2.py
async def describe_network_interface_attribute(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    network_interface_id: Optional[
        "capo_ec2.types.network_interface_id.NetworkInterfaceId"
    ] = None,
    attribute: Optional[
        "capo_ec2.types.network_interface_attribute.NetworkInterfaceAttribute"
    ] = None,
) -> "capo_ec2.types.describe_network_interface_attribute_result.DescribeNetworkInterfaceAttributeResult":
    """<p>Describes a network interface attribute. You can specify only one attribute at a time.</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>
        network_interface_id: <p>The ID of the network interface.</p>
        attribute: <p>The attribute of the network interface. This parameter is required.</p>

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

    Examples:
        To describe the attachment attribute of a network interface
        This example describes the attachment attribute of the specified network interface.

        >>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='attachment')
        To describe the description attribute of a network interface
        This example describes the description attribute of the specified network interface.

        >>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='description')
        To describe the groupSet attribute of a network interface
        This example describes the groupSet attribute of the specified network interface.

        >>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='groupSet')
        To describe the sourceDestCheck attribute of a network interface
        This example describes the sourceDestCheck attribute of the specified network interface.

        >>> await client.describe_network_interface_attribute(network_interface_id='eni-686ea200', attribute='sourceDestCheck')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.describe_network_interface_attribute_request.DescribeNetworkInterfaceAttributeRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.describe_network_interface_attribute_result.DescribeNetworkInterfaceAttributeResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_network_interface_attribute

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.describe_network_interface_attribute.async_describe_network_interface_attribute(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeNetworkInterfaceAttribute")
    )
    input_: capo_ec2.types.describe_network_interface_attribute_request.DescribeNetworkInterfaceAttributeRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if network_interface_id is not None:
        input_["network_interface_id"] = network_interface_id
    if attribute is not None:
        input_["attribute"] = attribute

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output