deleteBackup method

Future<void> deleteBackup({
  1. required String backupId,
})

Deletes a backup. You can delete both manual and automated backups. This operation is asynchronous.

An InvalidStateException is thrown when a backup deletion is already in progress. A ResourceNotFoundException is thrown when the backup does not exist. A ValidationException is thrown when parameters of the request are not valid.

May throw InvalidStateException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter backupId : The ID of the backup to delete. Run the DescribeBackups command to get a list of backup IDs. Backup IDs are in the format ServerName-yyyyMMddHHmmssSSS.

Implementation

Future<void> deleteBackup({
  required String backupId,
}) async {
  ArgumentError.checkNotNull(backupId, 'backupId');
  _s.validateStringLength(
    'backupId',
    backupId,
    0,
    79,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'OpsWorksCM_V2016_11_01.DeleteBackup'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'BackupId': backupId,
    },
  );
}