Skip to content

delete_chap_credentials async

delete_chap_credentials(
    target_arn: TargetARN,
    initiator_name: IqnName,
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
) -> DeleteChapCredentialsOutput

Deletes Challenge-Handshake Authentication Protocol (CHAP) credentials for a specified iSCSI target and initiator pair. This operation is supported in volume and tape gateway types.

Parameters:

  • target_arn (TargetARN) –

    The Amazon Resource Name (ARN) of the iSCSI volume target. Use the DescribeStorediSCSIVolumes operation to return to retrieve the TargetARN for specified VolumeARN.

  • initiator_name (IqnName) –

    The iSCSI initiator that connects to the target.

Raises:

  • InternalServerError –

    An internal server error has occurred during the request. For more information, see the error and message fields.

  • InvalidGatewayRequestException –

    An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

  • UnknownServiceError –

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

Examples:

To delete CHAP credentials Deletes Challenge-Handshake Authentication Protocol (CHAP) credentials for a specified iSCSI target and initiator pair.

>>> await client.delete_chap_credentials(target_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume', initiator_name='iqn.1991-05.com.microsoft:computername.domain.example.com')
Source code in docs_src/capo_storage_gateway/_services/async_storage_gateway.py
async def delete_chap_credentials(
    self,
    target_arn: "capo_storage_gateway.types.target_arn.TargetARN",
    initiator_name: "capo_storage_gateway.types.iqn_name.IqnName",
    *,
    config_overrides: Optional[AsyncStorageGatewayClientConfig] = None,
) -> "capo_storage_gateway.types.delete_chap_credentials_output.DeleteChapCredentialsOutput":
    """<p>Deletes Challenge-Handshake Authentication Protocol (CHAP) credentials for a specified iSCSI target and initiator pair. This operation is supported in volume and tape gateway types.</p>

    Args:
        target_arn: <p>The Amazon Resource Name (ARN) of the iSCSI volume target. Use the <a>DescribeStorediSCSIVolumes</a> operation to return to retrieve the TargetARN for specified VolumeARN.</p>
        initiator_name: <p>The iSCSI initiator that connects to the target.</p>

    Raises:
        capo_storage_gateway.errors.internal_server_error.InternalServerError: <p>An internal server error has occurred during the request. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.invalid_gateway_request_exception.InvalidGatewayRequestException: <p>An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.</p>
        capo_storage_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To delete CHAP credentials
        Deletes Challenge-Handshake Authentication Protocol (CHAP) credentials for a specified iSCSI target and initiator pair.

        >>> await client.delete_chap_credentials(target_arn='arn:aws:storagegateway:us-east-1:111122223333:gateway/sgw-12A3456B/target/iqn.1997-05.com.amazon:myvolume', initiator_name='iqn.1991-05.com.microsoft:computername.domain.example.com')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_storage_gateway.types.delete_chap_credentials_input.DeleteChapCredentialsInput]",
    ) -> AsyncOperationResponse[
        "capo_storage_gateway.types.delete_chap_credentials_output.DeleteChapCredentialsOutput"
    ]:
        import capo_storage_gateway._operations.storage_gateway_20130630.delete_chap_credentials

        (
            output,
            http_response,
        ) = await capo_storage_gateway._operations.storage_gateway_20130630.delete_chap_credentials.async_delete_chap_credentials(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteChapCredentials")
    )
    input_: capo_storage_gateway.types.delete_chap_credentials_input.DeleteChapCredentialsInput = {
        "target_arn": target_arn,
        "initiator_name": initiator_name,
    }

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