Skip to content

modify_instance_network_performance_options async

modify_instance_network_performance_options(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    instance_id: Optional[InstanceId] = None,
    bandwidth_weighting: Optional[InstanceBandwidthWeighting] = None,
    dry_run: Optional[Boolean] = None,
) -> ModifyInstanceNetworkPerformanceResult

Change the configuration of the network performance options for an existing instance.

Parameters:

  • instance_id (Optional[InstanceId], default: None ) –

    The ID of the instance to update.

  • bandwidth_weighting (Optional[InstanceBandwidthWeighting], default: None ) –

    Specify the bandwidth weighting option to boost the associated type of baseline bandwidth, as follows:

    default

    This option uses the standard bandwidth configuration for your instance type.

    vpc-1

    This option boosts your networking baseline bandwidth and reduces your EBS baseline bandwidth.

    ebs-1

    This option boosts your EBS baseline bandwidth and reduces your networking baseline bandwidth.

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

    Checks whether you have the required permissions for the operation, 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.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def modify_instance_network_performance_options(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    instance_id: Optional["capo_ec2.types.instance_id.InstanceId"] = None,
    bandwidth_weighting: Optional[
        "capo_ec2.types.instance_bandwidth_weighting.InstanceBandwidthWeighting"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.modify_instance_network_performance_result.ModifyInstanceNetworkPerformanceResult":
    """<p>Change the configuration of the network performance options for an existing instance.</p>

    Args:
        instance_id: <p>The ID of the instance to update.</p>
        bandwidth_weighting: <p>Specify the bandwidth weighting option to boost the associated type of baseline bandwidth, as follows:</p> <dl> <dt>default</dt> <dd> <p>This option uses the standard bandwidth configuration for your instance type.</p> </dd> <dt>vpc-1</dt> <dd> <p>This option boosts your networking baseline bandwidth and reduces your EBS baseline bandwidth.</p> </dd> <dt>ebs-1</dt> <dd> <p>This option boosts your EBS baseline bandwidth and reduces your networking baseline bandwidth.</p> </dd> </dl>
        dry_run: <p>Checks whether you have the required permissions for the operation, 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>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.modify_instance_network_performance_request.ModifyInstanceNetworkPerformanceRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.modify_instance_network_performance_result.ModifyInstanceNetworkPerformanceResult"
    ]:
        import capo_ec2._operations.amazon_ec2.modify_instance_network_performance_options

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

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ModifyInstanceNetworkPerformanceOptions"),
    )
    input_: capo_ec2.types.modify_instance_network_performance_request.ModifyInstanceNetworkPerformanceRequest = {}
    if instance_id is not None:
        input_["instance_id"] = instance_id
    if bandwidth_weighting is not None:
        input_["bandwidth_weighting"] = bandwidth_weighting
    if dry_run is not None:
        input_["dry_run"] = dry_run

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