deleteChapCredentials method
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.
May throw InvalidGatewayRequestException. May throw InternalServerError.
Parameter initiatorName
:
The iSCSI initiator that connects to the target.
Parameter targetARN
:
The Amazon Resource Name (ARN) of the iSCSI volume target. Use the
DescribeStorediSCSIVolumes operation to return to retrieve the
TargetARN for specified VolumeARN.
Implementation
Future<DeleteChapCredentialsOutput> deleteChapCredentials({
required String initiatorName,
required String targetARN,
}) async {
ArgumentError.checkNotNull(initiatorName, 'initiatorName');
_s.validateStringLength(
'initiatorName',
initiatorName,
1,
255,
isRequired: true,
);
ArgumentError.checkNotNull(targetARN, 'targetARN');
_s.validateStringLength(
'targetARN',
targetARN,
50,
800,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StorageGateway_20130630.DeleteChapCredentials'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'InitiatorName': initiatorName,
'TargetARN': targetARN,
},
);
return DeleteChapCredentialsOutput.fromJson(jsonResponse.body);
}