deleteAutoSnapshot method

Future<DeleteAutoSnapshotResult> deleteAutoSnapshot({
  1. required String date,
  2. required String resourceName,
})

Deletes an automatic snapshot of an instance or disk. For more information, see the Lightsail Dev Guide.

May throw ServiceException. May throw InvalidInputException. May throw NotFoundException. May throw OperationFailureException. May throw AccessDeniedException. May throw UnauthenticatedException.

Parameter date : The date of the automatic snapshot to delete in YYYY-MM-DD format. Use the get auto snapshots operation to get the available automatic snapshots for a resource.

Parameter resourceName : The name of the source instance or disk from which to delete the automatic snapshot.

Implementation

Future<DeleteAutoSnapshotResult> deleteAutoSnapshot({
  required String date,
  required String resourceName,
}) async {
  ArgumentError.checkNotNull(date, 'date');
  ArgumentError.checkNotNull(resourceName, 'resourceName');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Lightsail_20161128.DeleteAutoSnapshot'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'date': date,
      'resourceName': resourceName,
    },
  );

  return DeleteAutoSnapshotResult.fromJson(jsonResponse.body);
}